RFM2Pi with RFM12B

Tags: #<Tag:0x00007f6e05a8e3f8>

So after a little time away from tinkering I’ve decided to try and get back into energy monitoring.

I’ve plugged my (As yet unused) rfm2pi into my Pi3, and followed the instructions located here:

It’s a v2.6 rfm2pi

Attempts to program firmware to the rfm2pi fail as follows

[email protected]:~/RFM2Pi/firmware/RF12_Demo_atmega328 $ avrdude -v  -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 38400 -U flash:w:RF12_Demo_atmega328.cpp.hex 
avrdude-original: Version 6.1, compiled on Jul  7 2015 at 10:29:47
                  Copyright (c) 2000-2005 Brian Dean,
                  Copyright (c) 2007-2014 Joerg Wunsch

                  System wide configuration file is "/etc/avrdude.conf"
                  User configuration file is "/root/.avrduderc"
                  User configuration file does not exist or is not a regular file, skipping

                  Using Port                    : /dev/ttyAMA0
                  Using Programmer              : arduino
                  Overriding Baud Rate          : 38400
avrdude-original: Using autoreset DTR on GPIO Pin 7
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
avrdude-original: stk500_recv(): programmer is not responding

Any pointers would be great. Is anyone using rfm2pi with a Pi3 ?



Hi Stuart, welcome back :slight_smile:

Firmware should be pre-loaded onto the RFM2Pi. Do you have an RFM12Pi or an RFM69Pi? Does the LED on the module lightup when the Pi is powered up?

If you have an RFM12Pi, set minicom to 9600 bps

sudo minicom -D /dev/ttyAMA0 -b9600

If you have an RFM69Pi, set minicom to 38400 bps

sudo minicom -D /dev/ttyAMA0 -b38400

Once you have the serial window open hit [v] to get the unit to return it’s firmware an settings.

Before you can use the serial port you will need to disconnect it from the terminal. Since your using a Pi3 first need to disable Bluetooth on the Pi3 and map UART1 back to UART0 (ttyAMA0), see blog post.

I highly recomend using our latest emonSD pre-built SD card image, it will work out of the box with the RFM69Pi. Follow user guide . The pre-built image is based on Raspiban Jessie has Emoncms, nodeRED and opneHAB all pre-installed.


It’s an RFM12Pi. Yes the LED does light up when the module powers up
Firstly a slight amendment it’s a Pi2 so no BT issues to resolve.

I’ve just tried the minicom test, and get nothing back :frowning:

I actually want to use the module for something a little off track, which needs an RFM12B.



Great. Have you disconnected the serial console from terminal? You will need to reboot afterwards. What base image are you running?

Highly recomend downloading the latest emonSD, even if it is just to have a common platform to test with initially.


Serial console very much disabled, and a reboot applied (I had previously).

Still no minicom.

Will download emonSD now.

Oh dear, did you try 9600 baud and sending serial ‘v’ ? You could try attaching the module while minicom is open to try and capture it;s initial serial output.

Ok, emonSD installed.
Lets see if I can make any further progress :slight_smile:


Success. Although I have had to use

sudo minicom -D /dev/ttyAMA0 -b57600

Lets see if I can reprogram it rfm12pi now :slight_smile:

The serial baud of the RFM2Pi 's prior to the RFM69Pi’s (RFM12Pi’s?) did change to 57600 for a short time with the change from rfm12b to rfm69cw modules, they then changed to 38400 til end of production. so a RFM2Pi can be 9600,38400 or 57600

The fact your device is 57600 means it is not likely to be an rfm12b module but the later rfm69cw module, I’m not sure how important that may be to your project. certainly when writing your firmware it is important.

With that in mind the sketch you were originally trying to upload was now written for the rfm69 models, although it should still upload it will not function, (or tell you why).

And just for the record

won’t actually have the expected result, the ‘v’ option to return the firmware version and current configuration wasn’t added until after the baud was changed to 57600, hopefully the unrecognized option would invoke a full print of the help text.

You will need to use a RFM2Pi sketch that has a “# define RF69_COMPAT 1” line near the top to get the right JeeLib functions.

Now you have confirmed a working serial connection I hope the upload works for you, if it doesn’t can confirm the reset line is working by checking the led on the rfm2pi flashes (just as it would at sttartup) when trying to upload?

It’s defiantly an RFM12B , the RFM69CW module wasn’t available at the time I got my RFM2Pi.

Firmware uploads do indeed work :slight_smile:

Onwards and upwards as they say.

Great, good work. Just make sure to set 57600 baud in emonhub.conf. RFM12B should work fine

Intention is to try something new, but hopefully it will have uses in emoncms. Might take some time, and I suspect alot of head scratching.