I'd like to send all my "INPUT" data to EMONCMS.ORG and via MQTT.
My problem is the reverse than here: http://openenergymonitor.org/emon/node/11937
** I am able to send MQTT received data, but not HTTP received data.
I have 3 different nodes (5, 10, 11) in my Emonhub's INPUT. Each node from a different device. Node 5 comes via Serial (MQTT), and nodes 10/11 from HTTP access.
LOG EMONCMS:
Received mqtt message: emonhub/rx/5/values 165,6,35,103,125,33
MAIN INFO input() received time=1452698657, value=-1
MAIN INFO input() received time=1452698657, value=40
MAIN INFO input() received time=1452698657, value=108
MAIN INFO input() received time=1452698657, value=124
MAIN INFO input() received time=1452698657, value=33
Received MQTT data for Node 5 is send via MQTT:
LOG EMONHUB:
SerialDirect Publishing: emonhub/rx/5/values 159,6,29,100,123,33
Configuration as following:
[[MQTT]]
Type = EmonHubMqttInterfacer
[[[init_settings]]]
mqtt_host = localhost
mqtt_port = 1883
[[[runtimesettings]]]
pubchannels = ToRFM12,
subchannels = ToEmonCMS,
basetopic = emonhub/[[SerialDirect]]
Type = EmonHubSerialInterfacer
[[[init_settings]]]
com_port = /dev/ttyACM0 #USB
com_baud = 9600
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
subchannels = ToRFM12
calibration = 110V #(UK/EU: 230V, US: 110V)
baseid = 5 #(emonPi default:5)
quiet = false #(default:true)
And Node 5 data is send to LOCALHOST and EMONCMS.ORG:
** (Is there any fail? Is not data being duplicated many times?)
LOG EMONHUB:
S-LOCAL sending: http://localhost/emoncms/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[[1452698904,5,161,5,34,109,124,33],[1452698907,5,159,7,44,99,124,33],[1452698909,5,157,5,45,102,124,33],[1452698912,5,157,3,44,105,123,33],[1452698915,5,160,5,44,104,124,33],[1452698918,5,161,6,36,105,124,33],[1452698921,5,162,4,35,107,124,33],[1452698923,5,159,6,35,103,124,33],[1452698926,5,161,-2,38,112,124,33],[1452698929,5,160,5,38,102,124,33]]&sentat=1452698930S-REMOTO sending: http://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[[1452698904,5,161,5,34,109,124,33],[1452698907,5,159,7,44,99,124,33],[1452698909,5,157,5,45,102,124,33],[1452698912,5,157,3,44,105,123,33],[1452698915,5,160,5,44,104,124,33],[1452698918,5,161,6,36,105,124,33],[1452698921,5,162,4,35,107,124,33],[1452698923,5,159,6,35,103,124,33],[1452698926,5,161,-2,38,112,124,33],[1452698929,5,160,5,38,102,124,33]]&sentat=1452698931
Configuration as following:
[[S-REMOTO]]
Type = EmonHubEmoncmsHTTPInterfacer
[[[init_settings]]]
[[[runtimesettings]]]
pubchannels = ToRFM12,
subchannels = ToEmonCMS,
url = http://emoncms.org
apikey = xxxxx
senddata = 1
sendstatus = 1[[S-LOCAL]]
Type = EmonHubEmoncmsHTTPInterfacer
[[[init_settings]]]
[[[runtimesettings]]]
pubchannels = ToRFM12,
subchannels = ToEmonCMS,
url = http://localhost/emoncms
apikey = xxxxx
node = 10
senddata = 1
sendstatus = 1
It works fine... NO PROBLEM.
But I am not able to do the same for nodes 10 and 11. How could I configure Emonhub to send all nodes data to EMONCMS.ORG and via MQTT?
pi@emonpi /var/log $ ps aux | grep phpmqtt
pi 8891 0.0 0.4 3548 1796 pts/2 S+ 14:10 0:00 grep --color=auto phpmqtt
root 24763 0.0 0.5 4592 2620 pts/2 S 12:48 0:00 sudo php /var/www/emoncms/scripts/phpmqtt_input.php
root 24766 10.1 3.3 37840 14724 pts/2 R 12:48 8:19 php /var/www/emoncms/scripts/phpmqtt_input.php
Thanx...
Re: Publish to MQTT and Emoncms.org from a HTTP feed input [SOLVED]
What version of Emoncms are you running ?
My version (9 RC2) has a 'Publish to MQTT' process available from the process list which is what I use although this doesn't work on MQTT received data without the changes mentioned in the other thread you quoted
Re: Publish to MQTT and Emoncms.org from a HTTP feed input [SOLVED]
Thanx Bra1n! I found it...
I did added "emoncms/rx/11/values", but it appears only a "0":
Emonhub configuration file:
Re: Publish to MQTT and Emoncms.org from a HTTP feed input [SOLVED]
If I recall correctly from looking at the code you can only publish down one level so something like emoncms/11 would work but not emoncms/rx/11 etc
Re: Publish to MQTT and Emoncms.org from a HTTP feed input [SOLVED]
It still changing to 0... "emonhub/11", "emonhub", anything else numbers. If I put "11" it works.
Also... items for each "topic" are not together?
...
emonhub/rx/5/rssi 0
11 149
11 285
11 0
emonhub/rx/5/values 288,102,67,110,125,33
...
Re: Publish to MQTT and Emoncms.org from a HTTP feed input [SOLVED]
To solve what I want, I did a "hacked" EmonHubMqttInterfacer...
Now I have Arduino's OpenEnergy Shield connected to my Raspberry's Emoncms via SERIAL only (USB cable), than I can also power up Arduino.
Power data (from Arduino) is received into NODES, than sent to INPUT using EmonHubEmoncmsHTTPInterfacer and to Mqtt-broker (to use also in another Raspberry and Openhab) using hacked EmonHubMqttInterfacer.
And hacked EmonHubMqttInterfacer also get all other Mqtt-broker data (from others equipments) and send them to INPUT.