[Moved from Newly created inputs not appearing in emonCMS via MQTT]
Yesterday morning I had one emonTH on node 18 logging tempertaure, humidity, battery level to my emonbase and emoncms.org
Having given up on getting an old emonTH running using 433, I bought another in the openenergymonitor shop sale.
The new emonTH_V1 arrived yesterday morning, configured for RF nodeid 23 according to the paperwork. I put in some batteries, and the leds lit up steadily for a few seconds and then went out.
Since then I have had the first and second emonTH units side by side. The first thing I noticed was that although the leds on the first one flash regularly (although more like every minute rather than every 10 seconds), the second one doesnât flash at all after the initial power up.
At this point the emonTH entries in my local configuration file look like this:
#[[18]]
# nodename = emonth0
# [[[rx]]]
# names = temperature, humidity, spare1, spare2, battery
# datacode = L,L,L,L,L
# scales = 0.01,0.01,1,1,0.1
# units = C,%,C,C,V
[[19]]
nodename = emonth1
[[[rx]]]
names = temperature, external temperature, humidity, battery
datacode = h
scales = 0.1,0.1,0.1,0.1
units = C,C,%,V
[[23]]
nodename = emonth5
[[[rx]]]
names = temperature, external temperature, humidity, battery, pulsecount
datacodes = h,h,h,h,L
scales = 0.1,0.1,0.1,0.1,1
units = C,C,%,V,p
At this time the first emonTH had been logging for over a month with the node 18 entry for emonhub.conf commented out.
Initially the second emonTH was transmitting virtually nothing recognisable.
I stopped emonhub and checked the data being received
#minicom -D /dev/ttyAMA0 -b9600
This showed regular, 11 bytes of data from node 18 interleaved with 13 bytes of data on node 23, corresponding to that shown in the NEW FRAME data in the log below.
I quit (rather than exited) from the minicom session.
I then restarted the emonhub service. (#sudo systemctl start emonhub)
When I checked later, things had settled down, and the emonhub.log had entries like this:
2017-02-11 14:29:16,091 DEBUG RFM2Pi 2507 NEW FRAME : 18 18 7 126 14 0 0 0 0 26 0
2017-02-11 14:29:16,095 DEBUG RFM2Pi 2507 Timestamp : 1486823356.09
2017-02-11 14:29:16,097 DEBUG RFM2Pi 2507 From Node : 18
2017-02-11 14:29:16,100 DEBUG RFM2Pi 2507 Values : [1810, 3710, 0, 0, 26]
2017-02-11 14:29:16,103 DEBUG RFM2Pi 2507 Sent to channel(start)' : ToEmonCMS
2017-02-11 14:29:16,106 INFO RFM2Pi Publishing: emon/18/1 1810
2017-02-11 14:29:16,112 INFO RFM2Pi Publishing: emon/18/2 3710
2017-02-11 14:29:16,118 INFO RFM2Pi Publishing: emon/18/3 0
2017-02-11 14:29:16,123 INFO RFM2Pi Publishing: emon/18/4 0
2017-02-11 14:29:16,128 INFO RFM2Pi Publishing: emon/18/5 26
2017-02-11 14:29:16,143 INFO RFM2Pi Publishing: emon/18/rssi 0
2017-02-11 14:29:16,159 INFO RFM2Pi Publishing: emonhub/rx/18/values 1810,3710,0,0,26
2017-02-11 14:29:16,170 INFO RFM2Pi Publishing: emonhub/rx/18/rssi 0
2017-02-11 14:29:16,198 DEBUG RFM2Pi 2507 adding frame to buffer => [1486823356.090841, 18, 1810, 3710, 0, 0, 26]
2017-02-11 14:29:16,201 DEBUG RFM2Pi 2507 Sent to channel(end)' : ToEmonCMS
2017-02-11 14:29:28,551 DEBUG emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2017-02-11 14:29:28,554 INFO emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2017-02-11 14:29:31,638 DEBUG RFM2Pi 2508 NEW FRAME : 23 184 0 0 0 10 0 31 0 1 0 0 0
2017-02-11 14:29:31,645 DEBUG RFM2Pi 2508 Timestamp : 1486823371.64
2017-02-11 14:29:31,648 DEBUG RFM2Pi 2508 From Node : 23
2017-02-11 14:29:31,651 DEBUG RFM2Pi 2508 Values : [18.400000000000002, 0, 1, 3.1, 1]
2017-02-11 14:29:31,653 DEBUG RFM2Pi 2508 Sent to channel(start)' : ToEmonCMS
2017-02-11 14:29:31,656 INFO RFM2Pi Publishing: emon/emonth5/temperature 18.4
2017-02-11 14:29:31,665 INFO RFM2Pi Publishing: emon/emonth5/external temperature 0
2017-02-11 14:29:31,670 INFO RFM2Pi Publishing: emon/emonth5/humidity 1
2017-02-11 14:29:31,675 INFO RFM2Pi Publishing: emon/emonth5/battery 3.1
2017-02-11 14:29:31,681 INFO RFM2Pi Publishing: emon/emonth5/pulsecount 1
2017-02-11 14:29:31,686 INFO RFM2Pi Publishing: emon/emonth5/rssi 0
2017-02-11 14:29:31,691 INFO RFM2Pi Publishing: emonhub/rx/23/values 18.4,0,1,3.1,1
2017-02-11 14:29:31,697 INFO RFM2Pi Publishing: emonhub/rx/23/rssi 0
2017-02-11 14:29:31,703 DEBUG RFM2Pi 2508 adding frame to buffer => [1486823371.637282, 23, 18.400000000000002, 0, 1, 3.1, 1]
2017-02-11 14:29:31,706 DEBUG RFM2Pi 2508 Sent to channel(end)' : ToEmonCMS
2017-02-11 14:29:35,060 INFO emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[[1486823371.637282,23,18.400000000000002,0,1,3.1,1]]&sentat=1486823375
2017-02-11 14:29:35,294 DEBUG emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2017-02-11 14:29:35,298 INFO emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2017-02-11 14:30:05,073 INFO emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[]&sentat=1486823405
2017-02-11 14:30:12,545 DEBUG emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2017-02-11 14:30:12,548 INFO emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
So although the leds werenât flashing regularly, I was still receiving data.
I am supposedly logging to both my local emoncms and emoncms.org, but all I was seeing at this point was inputs on node 19 and rssi on node 23 locally. I canât remember what I saw on emoncms.org.
At some point I swapped the batteries between the emonTHs. Things started going wrong after that. On emoncms.org, inputs from first emonTH moved from node 18 to node 19. Locally, there was nothing. I managed to get some kind of data showing on a graphat emoncms.org yesterday evening, but by this morning there was nothing logged locally, and only very limited data showing on emoncms.org.
This morning I uncommented the node 18 entries in emonhub.conf, and restarted the emonhub service. That didnât seem to help, so I rebooted the pi this morning, and now I seem to have lost all my inputs!
from the period of the most recent emonhub service restart, emonhub.log contains:
2017-02-12 11:48:54,235 DEBUG emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2017-02-12 11:48:54,238 INFO emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2017-02-12 11:49:00,755 INFO emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[]&sentat=1486900140
2017-02-12 11:49:00,990 DEBUG emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2017-02-12 11:49:00,994 INFO emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2017-02-12 11:49:30,819 INFO emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[]&sentat=1486900170
2017-02-12 11:49:48,394 DEBUG MainThread SIGINT received.
2017-02-12 11:49:48,396 INFO MainThread Exiting hub...
2017-02-12 11:49:54,459 DEBUG emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2017-02-12 11:49:54,463 INFO emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2017-02-12 11:49:54,818 INFO MainThread Exit completed
2017-02-12 12:03:17,391 INFO MainThread EmonHub emonHub 'emon-pi' variant v1.2
2017-02-12 12:03:17,394 INFO MainThread Opening hub...
2017-02-12 12:03:17,397 INFO MainThread Logging level set to DEBUG
2017-02-12 12:03:17,400 INFO MainThread Creating EmonHubJeeInterfacer 'RFM2Pi'
2017-02-12 12:03:17,408 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 9600 bits/s
2017-02-12 12:03:19,412 WARNING MainThread Device communication error - check settings
2017-02-12 12:03:19,415 INFO MainThread Setting RFM2Pi frequency: 433 (4b)
2017-02-12 12:03:20,419 INFO MainThread Setting RFM2Pi group: 210 (210g)
2017-02-12 12:03:21,424 INFO MainThread Setting RFM2Pi quiet: 0 (0q)
2017-02-12 12:03:22,428 INFO MainThread Setting RFM2Pi baseid: 5 (5i)
2017-02-12 12:03:23,432 INFO MainThread Setting RFM2Pi calibration: 230V (1p)
2017-02-12 12:03:24,436 DEBUG MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2017-02-12 12:03:24,440 DEBUG MainThread Interfacer: Subscribed to channel' : ToRFM12
2017-02-12 12:03:24,442 DEBUG MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2017-02-12 12:03:24,445 DEBUG MainThread Interfacer: Subscribed to channel' : ToRFM12
2017-02-12 12:03:24,451 INFO MainThread Creating EmonHubMqttInterfacer 'MQTT'
2017-02-12 12:03:24,455 INFO MainThread MQTT Init mqtt_host=127.0.0.1 mqtt_port=1883 mqtt_user=emonpi
2017-02-12 12:03:24,465 DEBUG MainThread MQTT Subscribed to channel' : ToEmonCMS
2017-02-12 12:03:24,469 INFO MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2017-02-12 12:03:24,475 DEBUG MainThread emoncmsorg Subscribed to channel' : ToEmonCMS
2017-02-12 12:03:24,593 INFO MQTT Connecting to MQTT Server
2017-02-12 12:03:24,621 INFO MQTT connection status: Connection successful
2017-02-12 12:03:24,630 DEBUG MQTT CONACK => Return code: 0
2017-02-12 12:03:24,744 INFO MQTT on_subscribe
2017-02-12 12:03:54,599 INFO emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[]&sentat=1486901034
2017-02-12 12:04:00,402 DEBUG emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2017-02-12 12:04:00,405 INFO emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2017-02-12 12:04:24,579 INFO emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[]&sentat=1486901064
2017-02-12 12:04:30,396 DEBUG emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2017-02-12 12:04:30,399 INFO emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2017-02-12 12:04:54,581 INFO emoncmsorg sending: https://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[]&sentat=1486901094
2017-02-12 12:04:59,852 DEBUG emoncmsorg acknowledged receipt with 'ok' from https://emoncms.org
2017-02-12 12:04:59,857 INFO emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
So it looks as if Iâve messed up /dev/ttyAMA0!
Help!