RFM65 radio with MicroPython

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
qjb
Posts: 2
Joined: Sun May 28, 2017 8:09 pm

Re: RFM65 radio with MicroPython

Post by qjb » Mon May 29, 2017 2:26 pm

Is this something that can be easily reworked into something that runs on MicroPython compatible hardware?:

https://github.com/etrombly/RFM69

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: RFM65 radio with MicroPython

Post by pythoncoder » Tue May 30, 2017 4:56 am

Well it's a good starting point: if I were doing it I'd use it. RFM69.py is written for Python 2 so you need to check for and fix any incompatibilities with Python 3 - I haven't spotted any obvious problems here. You need to replace the GPIO and spi stuff with the correct MicroPython calls: this should be straightforward. With that I think it would run on a Pyboard V1.1 (in preference to a Lite as these have less RAM).

On the Raspberry Pi RAM is plentiful. On microcontrollers it is not. So it could be significantly optimised for MicroPython, and having (hopefully) got it working on a Pyboard I'd then address this. The RFM69registers.py file has 969LOC defining constants each of which will consume 4 bytes. With judicious use of micropython.const this could be reduced to zero. There may well be ways to reduce the size of the RFM69.config dictionary by replacing integers with bytes. And so on. But these are details which can be addressed later, unless you hit memory problems before you get it running. By all means post a query about optimisation when you reach that stage.

A final comment. Developing radio links is hard if you're using development software at both ends. I'd start with a pair of Raspberry Pi's and run a link between them. Shut down one end and move its radio to the Pyboard. You'll then have a known good unit to talk to while you develop the other end on the Pyboard. Another merit of starting with a pair of Pi's is that you can run the original code on the Pi under Python3 to verify its compatibility.
Peter Hinch
Index to my micropython libraries.

thetreerat
Posts: 15
Joined: Thu Apr 27, 2017 6:40 pm

Re: RFM65 radio with MicroPython

Post by thetreerat » Fri Jun 02, 2017 3:41 pm

@qjb

Where you planning on reworking the project https://github.com/etrombly/RFM69 that you posted about?

I have needs for a lora radio support and would be willing to help port and test if your going to work on it.

Hal

qjb
Posts: 2
Joined: Sun May 28, 2017 8:09 pm

Re: RFM65 radio with MicroPython

Post by qjb » Fri Aug 25, 2017 11:19 am

No I have plans at the moment to create the port. We switch to LoRaMAC for a demo using LoPy's.

Please note that the RFM65/69 do not support LoRa as far as I know.

Post Reply