RF radio (?) problem after EmonBase update

(Mads Lykke) #1

I did a long overdue update of my EmonBase yesterday, and now I can not get it up running again.

After the update, I do not get inputs from any of my RF nodes, neither in the local EmonCMS nor in I can get it to post PV data collected by the Bluetooth connection to, but no local input.

When I look in the EmonHub - log, the only suspect thing I see is this:

2017-12-02 16:09:17,200 INFO MainThread Creating EmonHubJeeInterfacer 'RFM2Pi’
2017-12-02 16:09:17,251 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 9600 bits/s
2017-12-02 16:09:19,296 WARNING MainThread Device communication error - check settings

Seems the RF radio is not starting, any ideas? I’m no linux wizard, so please be gentle :slight_smile:

(Elias - RExometer) #2

If I remember correctly the baudrate was changed in the rfm2pi firmware some time ago. Try to set the baudrate to 38400.

(Mads Lykke) #3

Unfortunately, that did not do it - same warning. If it had worked, I would probably also have had to update the EmonTX’s to 38400 to get communication going.

(Robert Wall) #4

No - we’re referring to the serial comms between the RFM12Pi and the Pi, not the radio channel itself.
Try 57600 (that is what my old RFM12Pi wants).
Failing that, try all the baud rates in turn until it talks.

(Mads Lykke) #5

Did a fresh SD install (v. 10/2017) w. stock config file. Tried 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, and 115200 - no luck unfortunately. Maybe I should download an older version and see if that works.

(Robert Wall) #6

What exactly is your hardware: An RFM2PI, and RFM12Pi or RFM69Pi, and which radio module, RFM12B or RFM69CW?

(Mine is an RFM12Pi with an RFM69CW - just to confuse everyone.)

The firmware is probably compiled for the RFM69, if you have an RFM12B, if definitely won’t work and you’ll need to change #define RF69_COMPAT 1 to #define RF69_COMPAT 0 and recompile & reload the RFM??Pi.

(Mads Lykke) #7

Ah, think you are on to something here. It’s a RFM12Pi and a RFM12B module!

(Paul) #8

How did you update?

The fact emonhub tried starting the serial connection at 9600 baud tells us the RFM2Pi you had was an rfm12b based device (assuming it worked previously and hadn’t changed that setting in emonhub.conf).

If you used the “Update emonBase” button from the emonCMS admin page you will have written the rfm69cw firmware to the RFM2Pi (see the Update EmonPi Button or Update EmonBase Button? thread for more detail) and as Robert says

There is already a compiled RFM2Pi FW for the rfm12b based devices, there just isn’t a update routine for it, try…

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

(Mads Lykke) #9

Bingo! That worked a treat - seems everything is up running again. Thank you Paul and Robert for all your patience and competent debugging.

First I just pushed the update button, but when my problems persisted, I resorted to downloading a fresh image. It seemed to work fine except for the radio issues. Anyhow, now I’m warned that my HW is “outdated” and that I need to be careful before updating in the future.

(Paul) #10

All you need to do is make a habit of using the “Update emonPi” button NOT the “update emonBase”, the difference in upload baud between the 8MHz RFM2Pi’s and the 16MHz emonPi board will cause the firmware upload to fail whilst everything else updates as expected.

(Juan Manuel Sende) #11

Sorry to interrump but I’ve also botched my RF Module, the problem it’s if I go on directory /home/pi/RFM2Pi and use the it all seems to work but I got the error

strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe

Emonhub seems to start with out any problem

2019-01-06 21:55:46,016 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s
2019-01-06 21:55:48,037 INFO MainThread RFM2Pi device firmware version: [RF12demo.12]
2019-01-06 21:55:48,040 INFO MainThread RFM2Pi device current settings: E i5 g210 @ 433 MHz
2019-01-06 21:55:48,044 INFO MainThread Setting RFM2Pi quiet: 0 (0q)
2019-01-06 21:55:49,048 INFO MainThread Setting RFM2Pi calibration: 230V (1p)
2019-01-06 21:55:50,053 DEBUG MainThread Setting RFM2Pi subchannels: [‘ToRFM12’]
2019-01-06 21:55:50,056 DEBUG MainThread Setting RFM2Pi pubchannels: [‘ToEmonCMS’]

But no data comes from the EmonTX and also If I reboot I got the communication error problem, so it seems that avrdude it’s not writing the firmware.

(Juan Manuel Sende) #12

Well my bad, the module I have it’s a RFM69Pi V3 so I’ve to flash it again. If this happen to anyone this is the steps I followed to recover it.

I’ve tested

sudo service emonhub stop
minicom -b38400 -D/dev/ttyAMA0

And the press p but no info on the screen so I’ve to flash it again

avrdude -v -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 38400 -U flash:w:/home/pi/RFM2Pi/firmware/RFM69CW_RF_Demo_ATmega328/RFM69CW_RF12_Demo_ATmega328.cpp.hex.hex

This flashed ok, tested again with

minicom -b38400 -D/dev/ttyAMA0

This time p give me a output so I’m free to go

sudo service emonhub stop

And then ready to go

(Paul) #13

Or you could just use the “update emonbase” button from within emoncms. The initial issue caused when using a rfm12 is because the updater just overwrites the firmware with the rfm69 version, so in this case it would revert the incorrectly installed rf12 to the original rf69 version.

As a sidenote, the strace: |autoreset: Broken pipe messages are nothing to worry about, they are there on a successful upload too. Glad you are sorted now.