Device communication error - check settings

Hi,

after a reboot of emonhub I am no more receiving data from sensors.

I tried soft and hard reboot but no way.

I found following error in emonhub logs:

2018-01-09 20:27:57,551 DEBUG MainThread SIGINT received.
2018-01-09 20:27:57,553 INFO MainThread Exiting hub…
2018-01-09 20:27:57,608 INFO MainThread Exit completed
2018-01-09 20:28:00,858 INFO MainThread EmonHub emonHub emon-pi variant v2.0.0
2018-01-09 20:28:00,860 INFO MainThread Opening hub…
2018-01-09 20:28:00,863 INFO MainThread Logging level set to DEBUG
2018-01-09 20:28:00,866 INFO MainThread Creating EmonHubJeeInterfacer ‘RFM2Pi’
2018-01-09 20:28:00,875 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 9600 bits/s
2018-01-09 20:28:02,881 WARNING MainThread Device communication error - check settings
2018-01-09 20:28:02,884 INFO MainThread Setting RFM2Pi frequency: 868 (8b)
2018-01-09 20:28:03,888 INFO MainThread Setting RFM2Pi group: 210 (210g)
2018-01-09 20:28:04,892 INFO MainThread Setting RFM2Pi quiet: 0 (0q)
2018-01-09 20:28:05,896 INFO MainThread Setting RFM2Pi baseid: 15 (15i)
2018-01-09 20:28:06,900 INFO MainThread Setting RFM2Pi calibration: 230V (1p)
2018-01-09 20:28:07,904 DEBUG MainThread Setting RFM2Pi subchannels: [‘ToRFM12’]
2018-01-09 20:28:07,907 DEBUG MainThread Setting RFM2Pi pubchannels: [‘ToEmonCMS’]
2018-01-09 20:28:07,911 INFO MainThread Creating EmonHubMqttInterfacer ‘MQTT’
2018-01-09 20:28:07,915 INFO MainThread MQTT Init mqtt_host=127.0.0.1 mqtt_port=1883 mqtt_user=emonpi
2018-01-09 20:28:07,925 INFO MainThread Creating EmonHubEmoncmsHTTPInterfacer ‘emoncmsorg’
2018-01-09 20:28:08,031 INFO MQTT Connecting to MQTT Server
2018-01-09 20:28:08,043 INFO MQTT connection status: Connection successful
2018-01-09 20:28:08,047 DEBUG MQTT CONACK => Return code: 0
2018-01-09 20:28:08,152 INFO MQTT on_subscribe
2018-01-09 20:28:22,941 INFO emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2018-01-09 20:28:37,980 INFO emoncmsorg sending: https://emoncms.org/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y

Any guess ?

Probably I tried an upgrade (unaware of what I was doing …) see attachment with inconsistent versions.

2018-01-09 20:28:00,875 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 9600 bits/s
2018-01-09 20:28:02,881 WARNING  MainThread Device communication error - check settings
2018-01-09 20:28:02,884 INFO     MainThread Setting RFM2Pi frequency: 868 (8b)

The previous and the next lines suggest this is an older rfm12b based RFM2Pi rather than a newer rfm69cw based device. The “Device communication error” may be a result of using the correct update button from the emoncms admin screen. For older rfm12b based devices, using the “Update emonBase” button will overwrite the existing rfm12b firmware with rfm69cw firmware causing the firmware to stall at start up.

See the Update EmonPi Button or Update EmonBase Button? - #2 by pb66 thread for more info on this.

If this is the case, you will need to manually reinstall the rfm12b based firmware and remember to only use the “Update emonPi” button in future so the FW upload fails and doesn’t overwrite your existing FW.

To reinstall the correct FW try

rpi-rw
git -C /home/pi/RFM2Pi pull
sudo service emonhub stop
sudo avrdude -v -p atmega328p -c arduino -P /dev/ttyAMA0 -b 38400 -U flash:w:/home/pi/RFM2Pi/firmware/RFM69CW_RF_Demo_ATmega328/RFM12_Demo_ATmega328.cpp.hex:i
sudo service emonhub start

[edit - corrected pull command]

Hi Paul, really thanks for your prompt answer. I did really a mess !!!

I am following your instructions but I receive this error:

[email protected](rw):~$ git pull -C /home/pi/RFM2Pi
fatal: Not a git repository (or any of the parent directories): .git
[email protected](rw):~$

Ooops! I think maybe that 2nd line should have been the other way round

git -C /home/pi/RFM2Pi pull

[edit - I have now corrected the original post]

I did it !!!

THANKS PAUL ! You are my angel