# RFM2Pi with RFM12B

**URL:** <https://community.openenergymonitor.org/t/rfm2pi-with-rfm12b/387>\
**Category:** Hardware\
**Tags:** rfm2pi\
**Created:** [13 May 2016 12:16 UTC](https://community.openenergymonitor.org/t/rfm2pi-with-rfm12b/387 "2016-05-13T12:16:48Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![GadgetUK](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/g/b4bc9f/32.png) [@GadgetUK](https://community.openenergymonitor.org/u/GadgetUK)\
**Post date:** [13 May 2016 12:16 UTC](https://community.openenergymonitor.org/t/rfm2pi-with-rfm12b/387/1 "2016-05-13T12:16:48Z")

</div>

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:

[https://wiki.openenergymonitor.org/index.php/RFM12Pi\_V2](https://wiki.openenergymonitor.org/index.php/RFM12Pi_V2)

It’s a v2.6 rfm2pi

Attempts to program firmware to the rfm2pi fail as follows

```
pi@raspberrypi:~/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, http://www.bdmicro.com/
                  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 ?

Thanks

Stuart

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [13 May 2016 13:33 UTC](https://community.openenergymonitor.org/t/rfm2pi-with-rfm12b/387/2 "2016-05-13T13:33:28Z")

</div>

Hi Stuart, welcome back 🙂

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](https://github.com/openenergymonitor/emonpi/blob/master/docs/SD-card-build.md#disable-serial-console-boot). Since your using a Pi3 first need to disable Bluetooth on the Pi3 and map UART1 back to UART0 (ttyAMA0), see [blog post](https://blog.openenergymonitor.org/2016/03/raspberry-pi-3/).

* * *

I highly recomend using our latest [emonSD pre-built SD card image](https://github.com/openenergymonitor/emonpi/wiki/emonSD-pre-built-SD-card-Download-&-Change-Log), it will work out of the box with the RFM69Pi. Follow [user guide](https://guide.openenergymonitor.org/). The pre-built image is based on Raspiban Jessie has Emoncms, nodeRED and opneHAB all pre-installed.

---

<div class="post-metadata">

**Author:** ![GadgetUK](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/g/b4bc9f/32.png) [@GadgetUK](https://community.openenergymonitor.org/u/GadgetUK)\
**Post date:** [13 May 2016 13:42 UTC](https://community.openenergymonitor.org/t/rfm2pi-with-rfm12b/387/3 "2016-05-13T13:42:43Z")

</div>

Ok.

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 ☹

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

Cheers

Stuart

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [13 May 2016 13:47 UTC](https://community.openenergymonitor.org/t/rfm2pi-with-rfm12b/387/4 "2016-05-13T13:47:06Z")

</div>

Great. Have you [disconnected the serial console from terminal](https://github.com/openenergymonitor/emonpi/blob/master/docs/SD-card-build.md#disable-serial-console-boot)? 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.

---

<div class="post-metadata">

**Author:** ![GadgetUK](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/g/b4bc9f/32.png) [@GadgetUK](https://community.openenergymonitor.org/u/GadgetUK)\
**Post date:** [13 May 2016 13:52 UTC](https://community.openenergymonitor.org/t/rfm2pi-with-rfm12b/387/5 "2016-05-13T13:52:07Z")

</div>

Ok.

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

Still no minicom.

Will download emonSD now.

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [13 May 2016 14:03 UTC](https://community.openenergymonitor.org/t/rfm2pi-with-rfm12b/387/6 "2016-05-13T14:03:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![GadgetUK](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/g/b4bc9f/32.png) [@GadgetUK](https://community.openenergymonitor.org/u/GadgetUK)\
**Post date:** [14 May 2016 16:41 UTC](https://community.openenergymonitor.org/t/rfm2pi-with-rfm12b/387/7 "2016-05-14T16:41:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![GadgetUK](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/g/b4bc9f/32.png) [@GadgetUK](https://community.openenergymonitor.org/u/GadgetUK)\
**Post date:** [14 May 2016 16:49 UTC](https://community.openenergymonitor.org/t/rfm2pi-with-rfm12b/387/8 "2016-05-14T16:49:08Z")

</div>

Ok.

Success. Although I have had to use

`sudo minicom -D /dev/ttyAMA0 -b57600`

Lets see if I can reprogram it rfm12pi now 🙂

---

<div class="post-metadata">

**Author:** ![pb66](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/pb66/32/27_2.png) [@pb66](https://community.openenergymonitor.org/u/pb66)\
**Post date:** [14 May 2016 20:06 UTC](https://community.openenergymonitor.org/t/rfm2pi-with-rfm12b/387/9 "2016-05-14T20:06:05Z")

</div>

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

> [@glyn.hudson](#):
>
> try 9600 baud and sending serial ‘v’

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?

---

<div class="post-metadata">

**Author:** ![GadgetUK](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/g/b4bc9f/32.png) [@GadgetUK](https://community.openenergymonitor.org/u/GadgetUK)\
**Post date:** [14 May 2016 20:33 UTC](https://community.openenergymonitor.org/t/rfm2pi-with-rfm12b/387/10 "2016-05-14T20:33:53Z")

</div>

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

Firmware uploads do indeed work 🙂

Onwards and upwards as they say.

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [15 May 2016 13:00 UTC](https://community.openenergymonitor.org/t/rfm2pi-with-rfm12b/387/11 "2016-05-15T13:00:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![GadgetUK](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/g/b4bc9f/32.png) [@GadgetUK](https://community.openenergymonitor.org/u/GadgetUK)\
**Post date:** [15 May 2016 16:08 UTC](https://community.openenergymonitor.org/t/rfm2pi-with-rfm12b/387/12 "2016-05-15T16:08:33Z")

</div>

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.
