RFM69 library port to Beaglebone or RaspberryPi

Started by Explorer, September 08, 2014, 04:59:10 AM

Charly86

that's amazing  ;D because I just started to work back on it last night with itead SDK, but if your works, I will use it

Thanks for sharing

abouillot

I guess itead SDK allows you to run Arduino sketches. In my case, you will have to make some Linux dev instead.

Charly86

Yes Itead provide the ability to compile Arduino files, but any type of file in fact.

When building the SDK, It provide low level libraries for SPI, I2C, DigitalWrite, Attach Interrupt, ... that you can call in C, C++ and they even made a Python Wrapper.

It add some kind of WiringPi but with full Arduino syntax. They already pushed some Arduino Lib such as NRF24L01 and as soon you got the library compiled, your C code will be linked with it.

I think it's a quick way to port Arduino Library, I wanted to try, but you done it, so may be on another lib if I need  ;)

kobuki

#18
Nice going with the lib :) I'm amazed how well supported the Pi still is, considering its age... But it seems no viable replacement on the horizon.

Explorer

FYI:
I finally did "port" the RFM69 to the Beaglebone Black using python but it did not work well.
Reason probably is that python was too slow to handle the interrupt so I ran into problems every so often.
I did make sure the interrupt was doing the minimum (quick read of the data).

Probably would work fine if ported as "C" code and compiled (I haven't tried that...)

**
Related - has anyone tried the pyBBIO library?

wcalvert

Hello all,

Sorry to bump an old thread, but I have been working on porting the RFM69 library to the Beaglebone Black. Currently I can receive packets (encrypted or clear) from a Moteino, but I am having difficulty sending the ack back. You will need some Linux experience to get this working, but it is not too bad.

The code is hosted here: https://github.com/wcalvert/rfm69-python

I have also ran the Moteino firmware on a Teensy 3.1, with minor modifications required (mostly related to dropping the SPI Clock if the F_BUS gets too high).

Thanks goes to Felix for writing very clean code and providing the Moteino and RFM69 modules at a very good price!

Felix

Quote from: wcalvert on January 10, 2015, 01:11:24 AM
Thanks goes to Felix for writing very clean code and providing the Moteino and RFM69 modules at a very good price!
Good work, and I need to say not everyone is of the same opinion :P

Charly86


This is starting to have an excellent compatibility with lot of hardware. :)

Since it's always quite complicated to have library always "up to date" in the same time for all targets, and as Felix is the only maintainer what about to integrate modification on the master library ?

meaning just add on the include file some constant defining the target architecture ? except the fact that this add code adding some #ifdef blahblah, it does not hurt and it could be very cool to have the lib at only one place for Moteino (Arduino), Raspberry PI, beaglebone, Teensy and Spark Core (as soon as we stay in c coding of course).

Just an idea, and I agree, I will love it because it will remove me pain of multiple version not "up to date" and adding Felix's changes each time....


obstler42

Quote from: wcalvert on January 10, 2015, 01:11:24 AM
Sorry to bump an old thread, but I have been working on porting the RFM69 library to the Beaglebone Black. Currently I can receive packets (encrypted or clear) from a Moteino, but I am having difficulty sending the ack back. You will need some Linux experience to get this working, but it is not too bad.

I'm using abouillot's C port of the RFM69 library on a Raspberry Pi, and while it is basically working fine, I have exactly the same problem of  not being able to send an ACK back. Did you ever solve this, and if so, what was the cause?

I'd really like to get sendACK() working properly to be able to use sendWithRetry() on the Moteino nodes...

obstler42

Quote from: Charly86 on January 19, 2015, 09:47:48 AM

This is starting to have an excellent compatibility with lot of hardware. :)

Since it's always quite complicated to have library always "up to date" in the same time for all targets, and as Felix is the only maintainer what about to integrate modification on the master library ?

meaning just add on the include file some constant defining the target architecture ? except the fact that this add code adding some #ifdef blahblah, it does not hurt and it could be very cool to have the lib at only one place for Moteino (Arduino), Raspberry PI, beaglebone, Teensy and Spark Core (as soon as we stay in c coding of course).

Just an idea, and I agree, I will love it because it will remove me pain of multiple version not "up to date" and adding Felix's changes each time....

I strongly support that idea -- the Raspberry Pi C port makes use of #ifdefs whereever needed already, and is already out of date compared to the original RFM69 library, so this would be a prime candidate for merging, and would greatly ease keeping it up to date.

Felix

Anyone can make contributions to the RFM69 lib. However they will get scrutinized before merging the main line code. I like to keep it lean and clean, so I will not merge any kind of changes.

wcalvert

#26
Quote from: obstler42 on January 20, 2015, 10:37:32 AM
I'm using abouillot's C port of the RFM69 library on a Raspberry Pi, and while it is basically working fine, I have exactly the same problem of  not being able to send an ACK back. Did you ever solve this, and if so, what was the cause?

I'd really like to get sendACK() working properly to be able to use sendWithRetry() on the Moteino nodes...
Yes it's been fixed. I had a very minor typo in the code. The repository that I linked to has been updated.

Regarding making my code part of Felix's library... it is not possible right now, since mine is Python. I do have plans and ideas of possibly creating a C or C++ version for the BBB but I would never attempt to submit that as a patch to Felix's library. I have maintained code with a million #ifdefs before and it is not fun. The current RFM69 library is simple enough, with few enough changes being pushed, that porting each change to my library would be easy.

chandan

Quote from: wcalvert on February 06, 2015, 12:06:27 AM
Quote from: obstler42 on January 20, 2015, 10:37:32 AM
I'm using abouillot's C port of the RFM69 library on a Raspberry Pi, and while it is basically working fine, I have exactly the same problem of  not being able to send an ACK back. Did you ever solve this, and if so, what was the cause?

I'd really like to get sendACK() working properly to be able to use sendWithRetry() on the Moteino nodes...
Yes it's been fixed. I had a very minor typo in the code. The repository that I linked to has been updated.

Regarding making my code part of Felix's library... it is not possible right now, since mine is Python. I do have plans and ideas of possibly creating a C or C++ version for the BBB but I would never attempt to submit that as a patch to Felix's library. I have maintained code with a million #ifdefs before and it is not fun. The current RFM69 library is simple enough, with few enough changes being pushed, that porting each change to my library would be easy.

Hello, I am following the progress on integrating rfm69 to raspberry pi directly.  I discovered Basti at hawkes blog https://www.the-hawkes.de/pymygw-a-simple-mysensors-gateway.html has integrated mysensors-openhab using raspberry pi. He is using serial device to connect between arduino/radio network and raspberry pi. I am very little knowledge on programming but wanted to ask how difficult will it be to use your code instead of serial port?

wcalvert

I'm sorry, I really don't know. I am not familiar with that technology stack.