Hi Glyn. I’m running emonTxV3_RFM12B_DiscreteSampling. Not recieving any inputs. I’ve never had this setup working before- my previous system was about 3 years ago, so pretty different.
Here is a log of emonbase from when I restarted it this morning;
2017-02-10 09:00:30,282 DEBUG MainThread SIGINT received.
2017-02-10 09:00:30,284 INFO MainThread Exiting hub...
2017-02-10 09:00:30,497 INFO MainThread Exit completed
2017-02-10 09:00:32,932 INFO MainThread EmonHub emonHub 'emon-pi' variant v1.2
2017-02-10 09:00:32,934 INFO MainThread Opening hub...
2017-02-10 09:00:32,937 INFO MainThread Logging level set to DEBUG
2017-02-10 09:00:32,940 INFO MainThread Creating EmonHubJeeInterfacer 'RFM2Pi'
2017-02-10 09:00:32,948 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 9600 bits/s
2017-02-10 09:00:34,954 WARNING MainThread Device communication error - check settings
2017-02-10 09:00:34,957 INFO MainThread Setting RFM2Pi frequency: 868 (8b)
2017-02-10 09:00:35,961 INFO MainThread Setting RFM2Pi group: 210 (210g)
2017-02-10 09:00:36,965 INFO MainThread Setting RFM2Pi quiet: 0 (0q)
2017-02-10 09:00:37,969 INFO MainThread Setting RFM2Pi baseid: 5 (5i)
2017-02-10 09:00:38,973 INFO MainThread Setting RFM2Pi calibration: 230V (1p)
2017-02-10 09:00:39,977 DEBUG MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2017-02-10 09:00:39,980 DEBUG MainThread Interfacer: Subscribed to channel' : ToRFM12
2017-02-10 09:00:39,983 DEBUG MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2017-02-10 09:00:39,986 DEBUG MainThread Interfacer: Subscribed to channel' : ToRFM12
2017-02-10 09:00:39,990 INFO MainThread Creating EmonHubMqttInterfacer 'MQTT'
2017-02-10 09:00:39,995 INFO MainThread MQTT Init mqtt_host=127.0.0.1 mqtt_port=1883 mqtt_user=emonpi
2017-02-10 09:00:40,005 DEBUG MainThread MQTT Subscribed to channel' : ToEmonCMS
2017-02-10 09:00:40,009 INFO MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2017-02-10 09:00:40,015 DEBUG MainThread emoncmsorg Subscribed to channel' : ToEmonCMS
2017-02-10 09:00:40,119 INFO MQTT Connecting to MQTT Server
2017-02-10 09:00:40,133 INFO MQTT connection status: Connection successful
2017-02-10 09:00:40,137 DEBUG MQTT CONACK => Return code: 0
2017-02-10 09:00:40,242 INFO MQTT on_subscribe
What transmitter units have you got (e.g. emonTx etc)? Are these units powered up? Is the RED led flashing once every 10s? Are you sure these units are on 868Mhz. Does the LED on the RFM12Pi flash once every 10’s in sync with the emonTx
Does the LED on the RFM12Pi light up when the Pi is booted?
The issue could be with the RFM12Pi. Let’s try to see if we can communicate directly with it. Can you connect via ssh then run
sudo service emonhub stop
minicom -D /dev/ttyAMA0 -b9600
You should now see a serial window, try pressing v to prompt the RFM12Pi to return it’s version number and status, please post what you see.
To exit minicom [ctrl + a] then [x] then enter.
Could also try a different baud rate in case you have a new unit:
The emonhub.log shows us there is no communication with the RFM2Pi board (at 9600)
2017-02-10 09:00:32,940 INFO MainThread Creating EmonHubJeeInterfacer 'RFM2Pi'
2017-02-10 09:00:32,948 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 9600 bits/s
2017-02-10 09:00:34,954 WARNING MainThread Device communication error - check settings
Am I right to assume you are now using the latest emonSD image? can you confirm?
If you are have you changed anything else related to the serial port other than the “com_baud=” in emonhub.conf?
Can you confirm what model of Pi B you are using? Is it a B(256mb ram), B(512mb ram) or B+ ? (I am not sure the emonSD will even run on an original 256mb Pi B).
If using a B or B+ (possibly even a 2B) and the com_baud is set correctly but still no joy it maybe a serial port mapping issue see “EmonBase with RPi B1+ - no serial data”
Can you also post the result of running this from the command line ?
ls -la /dev/{tty{AMA,S,USB},serial}*
[edit] Can you also confirm YOU HAVE NOT used the “update emonBase” (or “update RFM69Pi” depending on time of last update) button on the admin page of emonCMS?
If you haven’t please avoid doing so. Since your device is RFM12 using the update will stop it in it’s tracks as it will install RFM69 firmware which will not progress beyond initialization from boot. If you have then the firmware will need reverting to a RFM12 version.
Ah, the old RFM12Pi have green LED instead of red. This is nothing to worry about.
The fact the LED stays on is more worrying. This indicates that the unit could be running the incorrect firmware for the RF module. Are you sure you have an RFM12B? Learn | OpenEnergyMonitor
OK, so I tried to update the RFM12B (using this), but I had a few issues. See below. Couldn’t clone several Git folders, and RF12_Demo_atmega328 couldn’t be found. And it then freezes after the last command. Have I done something wrong?
Those instructions assume staring from a blank Pi, since you are running an emonSD your Pi already setup with avrdude upload and the RFM2Pi firmware folder
To update the firmware and try and flash the unit run:
rpi-rw
cd RFM2Pi
git pull
cd old/RF12_Demo_atmega328
sudo service emonhub stop
sudo avrdude -v -p atmega328p -c avrispmkII -P usb -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xE2:m -U flash:w:RF12_Demo_atmega328.cpp.hex:i -B 10
The RFM2Pi folder on the emonPi image has “root” folders preventing the user pi from performing a git pull, to fix the repo you must recursively chown the folder contents.
Also the path is incorrect it needs another “firmware” level.
Plus you are connecting via the GPIO serial port “/dev/ttyAMA0” not a USB connected “avrispmkII” try the following
rpi-rw
sudo chown pi:pi -R RFM2Pi
cd RFM2Pi
git pull
cd firmware/old/RF12_Demo_atmega328
sudo service emonhub stop
sudo avrdude -v -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 38400 -U flash:w:RF12_Demo_atmega328.cpp.hex
Although I’m afraid I’m no longer sure which is the correct firmware since it’s been moved around again, there is an update script in the RFM2Pi folder that uses firmware/RFM69CW_RF_Demo_ATmega328/RFM12_Demo_ATmega328.cpp.hex which although in a “RFM69CW…” folder appears to be for the RFM12 and older than the RFM12 firmware in the “old” folder, I suspect there is some confusion over what is “old firmware” and what is “current firmware for old hardware”. When installing a FW to debug an issue it is essential you know what you are installing to make sense of the result.
Before updating the firmware can you do 2 things? firstly just try running this command and post the result
this will try and communicate with the ATmega328p without overwriting the FW to confirm the serial port and serial lines are all ok. Secondly just take a look at the connections between the RFM12b module (the sub-board with the tin can and black circle on) and the RFM2Pi board, if any of those connections in the 2 rows of 7 connections are cracked or causing a bad connection it could cause the RFM to fail to initialize and stall the FW with the LED illuminated, we have seen it before once or twice.
If comms’n’conns are good then you could try uploading a new sketch (or 2?). Assuming the RFM2Pi worked at some point in time, the “wrong firmware” just doesn’t sound like a natural occurrence unless you used the “update rfm69pi” button on the emoncms admin page or have tried deliberately changing it in the past.
Thank you- I tried the first part, and nothing happens.
Looking at the board, one of the solder joints does look a bit dry. I will
get the iron out and touch them all up to be sure.
I did previously hit the “emonbase update” button on emoncms local. But
since then I have redone the SD card image. Will this have written onto the
RFM12B as well? Having said that, I don’t think it worked before I hit
update.
When you say to try putting another sketch onto the RFM12Pi, how would this
be done (through the Pi, or another means?)
Yes! this would have most definitely have been the cause of the issue if it hadn’t already not worked, so you may have more than one issue now.
Yes, sorry another way of saying “installing firmware”. The RFM2Pi board’s software is referred to as firmware in a more general term, but also refered to as a “sketch” in Arduino speak.
What Glyn and I have tried walking you though (above) is installing a firmware to the RFM2Pi via the Pi. The firmware is in “hex file” form which is the result of compiling the “sketch” in an IDE (Integrated Development Environment).