RFM12B not working on new SD build


I have an old piB with RFm12B, running since 2010 with emonTx V1 to log my HomeEnergy.
I could not manage to update this directly to latest Version so I decided to
reinstall a new sd Card with latest emonCMS version.

I would like to sync all my passt logs to a local hard drive and log localy in the futur.

I have an error with RFM12B and I can’t see my feeds anymore…

How do I activate the RFM12B receiver ? I cannot remember and on top I am not an expert of linux commandos…
Here the log

ERROR    MainThread [Errno 2] could not open port /dev/ttyAMA0: [Errno 2] No such file or directory: '/dev/ttyAMA0'
2018-05-20 12:09:18,104 ERROR    MainThread Unable to create 'RFM2Pi' interfacer: 'bool' object has no attribute 'write'
2018-05-20 12:09:18,117 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT' 
2018-05-20 12:09:18,133 DEBUG 

If someone could help me … with detailed steps it would be nice !

Is this a self build SD card image or a downloaded pre-built emonSD image?

I suspect the latter, but at first glance it sounds like you have not configured the serial port correctly, possibly by using raspi-config?

Or it may be that your image refers to the serial port using another address, eg /dev/ttyS0, you could try running this command and post the results so we can see what serial ports are available.

ls -la /dev/{tty{ACM,AMA,S,USB},serial}*

and also

cat /boot/cmdline.txt

just so we can see if the serial console has been disabled.

I reinstalled pi and after Installation and updates I have following results

[email protected](rw):~$ ls -la /dev/{tty{ACM,AMA,S,USB},serial}*
ls: cannot access /dev/ttyACM*: No such file or directory
ls: cannot access /dev/ttyS*: No such file or directory
ls: cannot access /dev/ttyUSB*: No such file or directory
ls: cannot access /dev/serial*: No such file or directory
crw-rw---- 1 root dialout 204, 64 May 24 17:36 /dev/ttyAMA0

[email protected](rw):~$ cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=tty1 elevator=noop root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes rootwait

When I activate serial via raspi-config, I get a big big kernel error on booting…
So I flashed my sdCard again…

The results from the 2 commands don’t really show any issues. The first one confirms there is a single serial port available on /dev/ttyAMA0 which is what we would expect for a Pi B. The second shows us that the serial console is disabled and pretty much confirms you are using a emonSD image, although I cannot tell if this is definitely a downloaded pre-built image or a self-built emonSD image.

Assuming you are using the downloaded pre-built emonSD image, there should be no need for you to use raspi-config as the serial port should be already setup and to the best of my knowledge, it is still ok for Pi3’s, but it has been quite a while since anyone has confirmed it still works as expected for a Pi B, I wonder if the image has evolved and the Pi B has been forgotten and not tested. If you are using a freshly downloaded emonSD image without modification AFAIK it should “just work” with a Pi B.

Are you still seing the same error in emonhub.log?

Your first post shows an error saying “[Errno 2] No such file or directory: ‘/dev/ttyAMA0’” whilst the results of the test commands show it does exist after a reinstall, so has the error changed or is it the same?

If you install a fresh unmodified emonSD image and all else works except the inputs from the RFM2Pi, is it possible you have used the “update emonbase” button in emoncms?

DO NOT USE the “update emonbase” button with a rfm12b device, there is a warning there telling you not to. If you have used it, the update routine will have overwritten your “rfm12b” based device’s firmware with “rfm69cw” frimware and you will need to manually re-install the correct firmware to get it running again.

However, if this is the case, emonhub should still be able to connect to it succesfully, there just wouldn’t be any data. The error previously seen in emonhub.log should no longer be there.

Hi Paul,

Thanks for your help. Yes I am using a downloaded pre-built emonSD image.
After a new installation I discovered the emonHub config part… :slight_smile:

Here I just modifyed the baud to 9600 and freq to 868 and then I got the signal from emonTX.on chanel 10.
Here I just have to adapt a little what is sending order, I have only 3 power send, and 4 Temp from a 1-wire bus and the mapping seems not to be as it was, i must also check the scale…
I am missing my 2 Funky rf temperatur measurement on nodes 24-25, perhaps I need to reprogramm them to post to the new emonCMS (write key?) or just have the write config set in the emonHub for them…

FYI, after reading how to configure the emonHub which was totaly new compared to my installed version, I managed t configure my emonBase to receive the data from emonTX1 (node10) and from my 2 FunkyV2 transceiver nodes 24 + 25

Now I have the measuring working with the latest emonPi sd image.

I have also the Sync module, but when I try to use it to get all my data from online to local, I have an error saying : Authentication failure username or password incorrect

Using https://emoncms.org + myuser and pwd …
Don’t know what is the problem …