RFM2Pi board v1 rev3

Revision for “RFM2Pi board v1 rev3” created on March 6, 2013 @ 15:43:05

Title
RFM2Pi board v1 rev3
Content
Note: There is a more advanced wiki at this address: <a href="http://wiki.openenergymonitor.org/index.php?title=Raspberry_Pi" target="_blank">http://wiki.openenergymonitor.org/index.php?title=Raspberry_Pi</a> The RFM2Pi board is an <a href="http://www.atmel.com/Images/doc8006.pdf" target="_blank">Attiny84</a>+<a href="http://cdn.shopify.com/s/files/1/0038/9582/files/RFM12B.pdf?1262060244" target="_blank">RFM12b</a> based expansion board that plugs on top the <a href="http://www.raspberrypi.org/faqs" target="_blank">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="http://harizanov.com/2012/06/rf12-demo-sketch-for-attiny84/" target="_blank"> 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="http://openenrgymonitor.org" target="_blank">openenrgymonitor.org</a><a href="http://harizanov.com/wp-content/uploads/2012/10/RFM12B_to_Pi_sch.png"><img class="alignnone size-large wp-image-820" title="RFM12B_to_Pi_sch" alt="" src="http://harizanov.com/wp-content/uploads/2012/10/RFM12B_to_Pi_sch-1024x900.png" width="584" height="513" /></a> <a href="http://harizanov.com/wp-content/uploads/2012/10/RFM12B_to_Pi_brd.png"><img class="alignnone size-large wp-image-819" title="RFM12B_to_Pi_brd" alt="" src="http://harizanov.com/wp-content/uploads/2012/10/RFM12B_to_Pi_brd-725x1024.png" width="584" height="824" /></a> Eagle Design files are available <a href="https://github.com/mharizanov/RFM2Pi">here</a> The interface is bi-directional, that means the board can be configured and used to send <a href="https://github.com/jcw/jeelib" target="_blank">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="http://openenergymonitor.org/emon/emoncms" target="_blank">emoncms</a> or <a href="https://cosm.com/" target="_blank">cosm</a>. Here is an example of capturing and decoding in perl: <a title="RaspberryPi+TinySensor as EmonBase" href="http://harizanov.com/2012/08/raspberrypitinysensor-as-emonbase/" target="_blank">link</a>. The <a href="https://github.com/emoncms/emoncms" target="_blank">latest modular emoncms version</a> has <a href="https://github.com/emoncms/raspberrypi" target="_blank">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> <ul> <li>Next, edit it to remove references to Pi's UART (ttyAMA0)</li> </ul> </ul> <pre>sudo nano /boot/cmdline.txt</pre> <ul> <ul> <li>Originally it contains this</li> </ul> </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> <ul> <li>Edit it to look like this</li> </ul> </ul> <pre>dwc_otg.lpm_enable=0 rpitestmode=1 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait</pre> <ul> <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> </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="http://harizanov.com/wp-content/uploads/2012/06/PI_UART.png"><img class="alignnone size-large wp-image-626" title="PI_UART" alt="" src="http://harizanov.com/wp-content/uploads/2012/06/PI_UART-1024x698.png" width="584" height="398" /></a> <a href="http://harizanov.com/wp-content/uploads/2012/10/IMG_1528.jpg"><img class="alignnone size-large wp-image-816" title="IMG_1528" alt="" src="http://harizanov.com/wp-content/uploads/2012/10/IMG_1528.jpg" width="584" height="438" /></a> <a href="http://harizanov.com/wp-content/uploads/2012/10/IMG_1533.jpg"><img class="alignnone size-large wp-image-817" title="IMG_1533" alt="" src="http://harizanov.com/wp-content/uploads/2012/10/IMG_1533.jpg" width="584" height="438" /></a>
Excerpt


OldNewDate CreatedAuthorActions
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 “RFM2Pi board v1 rev3

  1. 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
    Peter

    • 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.

      Martin

      • 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.
        Thanks
        Peter

  2. 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

    • 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. 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.

    Cheers

    Peter

Comments are closed.