Martin's corner on the web

[OBSOLETE] RFM2Pi board v1 rev3

Revision for “[OBSOLETE] RFM2Pi board v1 rev3” created on December 23, 2018 @ 21:12:59

[OBSOLETE] RFM2Pi board v1 rev3
<h1 style="text-align: center;"><span style="color: #ff0000;">[This project is obsoleted and not supported]</span></h1> Note: There is a more advanced wiki at this address: <a href="" target="_blank" rel="noopener"></a> The RFM2Pi board is an <a href="" target="_blank" rel="noopener">Attiny84</a>+<a href="" target="_blank" rel="noopener">RFM12b</a> based expansion board that plugs on top the <a href="" target="_blank" rel="noopener">Raspberry Pi</a>'s GPIO pins and provides serial interface with the RFM12b module. The board is pre-programmed with<a title="RF12 Demo sketch for ATtiny84" href="" target="_blank" rel="noopener"> RFDemo sketch for Attiny84</a> and will output to Pi's UART the incoming packets. This revision of the board is created in collaboration with <a href="" target="_blank" rel="noopener"></a><a href=""><img class="alignnone size-large wp-image-820" title="RFM12B_to_Pi_sch" src="" alt="" width="584" height="513" /></a> <a href=""><img class="alignnone size-large wp-image-819" title="RFM12B_to_Pi_brd" src="" alt="" width="584" height="824" /></a> Eagle Design files are available <a href="">here</a> The interface is bi-directional, that means the board can be configured and used to send <a href="" target="_blank" rel="noopener">Jeelib</a> compatible packets as well. Software running on the Raspberry Pi side can parse and decode the serial input and make further processing, like posting to <a href="" target="_blank" rel="noopener">emoncms</a> or <a href="" target="_blank" rel="noopener">cosm</a>. Here is an example of capturing and decoding in perl: <a title="RaspberryPi+TinySensor as EmonBase" href="" target="_blank" rel="noopener">link</a>. The <a href="" target="_blank" rel="noopener">latest modular emoncms version</a> has <a href="" target="_blank" rel="noopener">add-on module to support the RFM2Pi</a> board. <strong>Note:</strong> Prior to going any further, please backup Raspberry Pi’s SD card By default, you Raspberry Pi will be running the console on the UART. In order to use it for the RFM2Pi board, we need to free it up from the console: <ul> <li>Make sure Raspberry Pi's UART is disconnected from the console and available for programs to use it <ul> <li>First, make a backup of the cmdline.txt file</li> </ul> </li> </ul> <pre>sudo cp /boot/cmdline.txt /boot/cmdline_backup.txt</pre> <ul> <li style="list-style-type: none;"> <ul> <li>Next, edit it to remove references to Pi's UART (ttyAMA0)</li> </ul> </li> </ul> <pre>sudo nano /boot/cmdline.txt</pre> <ul> <li style="list-style-type: none;"> <ul> <li>Originally it contains this</li> </ul> </li> </ul> <pre>dwc_otg.lpm_enable=0 rpitestmode=1 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait</pre> <ul> <li style="list-style-type: none;"> <ul> <li>Edit it to look like this</li> </ul> </li> </ul> <pre>dwc_otg.lpm_enable=0 rpitestmode=1 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait</pre> <ul> <li style="list-style-type: none;"> <ul> <li> Press Ctrl+O to save, then Ctrl+X to exit</li> <li>Next, type "sudo nano /etc/inittab"  and comment (or remove) the line (towards the end of the file)</li> </ul> </li> </ul> <pre> 2:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100</pre> <ul> <li>Restart the Raspberry Pi by typing "sudo reboot" so changes take effect</li> <li>I use minicom to view the serial data</li> </ul> <pre>sudo apt-get install minicom</pre> And to run it at 9600 baud (or change that to whaterver baud you used on TinySensor's side: <pre>minicom -b 9600 -o -D /dev/ttyAMA0</pre> Tip: you may use "sudo minicom -s" to store these settings as permanent <div> Only after the UART pins are freed up you can plug the RFM2Pi board.</div> The board plugs on-top the Raspberry Pi and utilizes the following pins: <a href=""><img class="alignnone size-large wp-image-626" title="PI_UART" src="" alt="" width="584" height="398" /></a> <a href=""><img class="alignnone size-large wp-image-816" title="IMG_1528" src="" alt="" width="584" height="438" /></a> <a href=""><img class="alignnone size-large wp-image-817" title="IMG_1533" src="" alt="" width="584" height="438" /></a>

OldNewDate CreatedAuthorActions
December 23, 2018 @ 21:12:59 Martin
March 6, 2013 @ 15:43:05 Martin
March 6, 2013 @ 15:42:24 Martin
October 26, 2012 @ 08:51:46 [Autosave] Martin
October 26, 2012 @ 08:50:40 Martin
October 24, 2012 @ 09:12:04 Martin
October 24, 2012 @ 09:11:28 Martin
October 24, 2012 @ 09:04:03 Martin
October 24, 2012 @ 09:03:52 Martin
October 24, 2012 @ 09:03:16 Martin

7 thoughts on “[OBSOLETE] RFM2Pi board v1 rev3

  1. PeterN

    Hi Martin,
    It looks like RaspberryPi_run.php supports sending data to remote server as well as local. I just can’t quiet figure out how to use same. Do you have working example or description.
    Thanks a mil. Cheers

    1. admin Post author

      Hi Peter,
      I haven’t used that myself, but there is a button “Sync feeds” on the bottom of the FEEDS tab, there you can select a URL and remote key. This is Trystan’s work so I suggest checking in the openenergymonitor’s forums.


      1. PeterN

        Thanks for speedy reply.
        Sorry I saw code in your raspberrypi_run.php that made me think you could point to another remote emoncms url e,g, post to both local and remote emoncms. Then you could always syn if you lost connection. I will look at syn.

  2. PeterN

    Hi Martin, Looks like Trystan has done it already, can’t keep up with new feature they coming that quick. In panel raspberrypi there’s and option “Forward data to remote emoncms server”. Not quiet sure how it works yet. Cheers Peter

    1. admin Post author

      I also thought about this at one point, but the Attiny84 doesn’t have hardware I2C, it can be done in the software with bit-banging. I also think the serial is more reliable due to buffering on the Pi’s side.

  3. PeterN

    emoncms, RFM12B module with raspberrypi_run.php and 3G dongle. Issue I hope you can help the 3G dongle (K3520) working (sakis3g/Umtskeeper) but won’t post to to remote URL after reboot. The 3G connection comes up on boot and I can browse internet, raspberry pi cron shows still running. Tried a number of fixs including restart of cron – raspberrypi_run.php. “To rectify the process used “I have to login to dashboard Raspberry Pi and change remote url to false URL and save, then revert changes so url is correct and save again”.

    This process obviously resets something for remote URL and API somewhere, or restores some missing data but I don’t know what. Anyone shed some light on what above process may do or what may be restored or reset during process it may help with fix e.g. cron job rather then manual process.