Project

General

Profile

Raspberry Pi direct RFM12B interface

Added by saturno about 5 years ago

Hello everyone,

I’m trying to build a project in which I need to receive data sent from some sensors with RFM12B in a Raspberry Pi as a central server/collector.
I already saw the post about connecting JeeLink to the RPi and the necessary code. I think this is a good way to get RPi and RFM12B nodes (JeeNodes) to talk to each other in a quick and easy manner.
For a long term project, my intention is to connect an RFM12B directly to the RPi as it seems to me that is possible to use RPi GPIO for this.
If this is possible, can anyone share a way to do this both in connecting and “talking” to the RFM12B form the RPi?
Thanks.

Regards,
Miguel


Replies (9)

RE: Raspberry Pi direct RFM12B interface - Added by martynj about 5 years ago

saturno,

An interesting project. Attempts before have shown though that the interrupt latency on the RPi is too great for reliable communications with the RFM12B - there is very limited buffering of received characters on the module. Writing a dedicated interrupt handler may be sufficient. The other approach is to use some processing power dedicated to the RFM12B as in this design.

RE: Raspberry Pi direct RFM12B interface - Added by JohnO about 5 years ago

I use a Jeenode Micro to interface to my RasPi. I will be changing it to Atmega328 based solution when the RF69x project comes up with a RF12Demo compatible sketch.

RE: Raspberry Pi direct RFM12B interface - Added by saturno about 5 years ago

Hi,

@Martynj, thanks for your insight. I wasn’t aware of the possible interrupt latency issues when interfacing RPi with the RFM12B. It would be really good interface them without any additional hardware…

@JohnO if the “direct connection” is not possible, your solution on using a Jeenode Micro seems doable for my intention. Can you share why are you thinking to change your actual solution for the RF69x? Are you not using (or want to use) all computational capabilities of the RPi?
In my case I’m thinking to rely on RPi to store my home sensors data for example, or to be able to have more capabilities to do some kind of automation…

Thank you both for your comments.

Regards,

Miguel

RE: Raspberry Pi direct RFM12B interface - Added by martynj about 5 years ago

saturno,

When the RFM69W is configured in full packet mode, the attached MPU load is only interrupts per packet rather than per rx/tx byte - more manageable by a general purpose, non real-time executive. Jeenode library support for the RFM69W is in development now, though the priority is for non packet mode for backwards compatibility with RFM12B-based nodes.

There are some RFM69W support libraries already out there, but what I have seen use status polling, which is even more problematic vis-a-vis the interrupt world.

RE: Raspberry Pi direct RFM12B interface - Added by JohnO about 5 years ago

saturno,

I use a cut down version of the RF12Demo sketch to feed my serial RF stream into my RasPi. It currently uses software serial to handle the serial output since the Micro doesn’t have a hardware UART. In this configuration I am right up against the hardware limitations of the ATTiny84, only a few bytes of FLASH remaining and using most of the RAM. When the RFM69 is available I want to archive the the RSSI values of my received packets and possibly fine tune my TX & RX powers to better manage battery life.

RE: Raspberry Pi direct RFM12B interface - Added by saturno about 5 years ago

Hi Everyone!

Thank you all for your contributions, they all were useful.
Considering your suggestions and some Googling, I found that there is already a Linux driver (here: https://github.com/gkaindl/rfm12b-linux) that allows the Raspberry Pi to “talk” to the RFM12b directly without additional hardware.
It seems to work like a charm.

Does anyone have any experience with this approach?

RE: Raspberry Pi direct RFM12B interface - Added by JohnO about 5 years ago

There are four open issues which don’t appears to be responded to. When you say it works like a charm I take it that you have it up and running - is that so?

RE: Raspberry Pi direct RFM12B interface - Added by saturno about 5 years ago

Humm good point JohnO,

No, I did not had the opportunity to test it yet.
I only saw the video demo (provided on GitHub project page) in which the simple connectivity sketches were running apparently fine.
I didn’t pay attention to those opened issues…
Even so, when I have some time, I will try this driver to see how it works.

Thanks

RE: Raspberry Pi direct RFM12B interface - Added by garethcoleman about 5 years ago

I have this working, it seems pretty good most of the time, occasional drop-outs of packets especially when across the house but that’s to be expected I think!

Certainly I’ve not seen any stability issues over the few weeks that I’ve been using it.

It is running on a raspberry pi that also runs node-red, gammu-smsd, mosquitto and a couple of other things, not very stressed but not completely idle either!

Up to now I’ve been installing the (slightly) older branch of the kernel that’s in the default repositories - currently that’s 3.10-3-rpi.

I find that just installing the packages linux-image-rpi-rpfv & linux-headers-rpi-rpfv (together with editing the /boot/config.txt to reboot using the alternative kernel) is enough to get the rfm12b driver installed without needing the Module.symvers file fix.

Of the open issues on github, a couple relate to the documentation and a couple are people struggling to install it with various kernels and headers, not really core issues with the code, apart from one or two legitimate issues such as not releasing the SPI device nicely if the kernel module is removed. For those wanting to use multiple devices on the SPI bus I can see this being a problem, but luckily that’s not me.

I have only used the read functionality so far, but intend to explore the other direction fairly soon. But overall it seems good, no memory leaks or crashes evident.

In comparison to the JeeLink, it feels much more ‘bare metal’ in that their is literally nothing between the Pi and the rfm12b module, on the device I got, not even a single decoupling cap! So you have to handle any configuration you want yourself - there isn’t a flash memory as in a JeeLink for example to store node/group ID.

For regular users I would still recommend using a JeeLink because it’s easier and the dedicated mcu/memory gives richer functionality. One of my main reasons for exploring a direct connection was to reduce the footprint, so go this way if that’s vital for you (I had already bought a box for it, forgetting about the usb devices - and I hate to discard anything!)

    (1-9/9)