Micropython with LoRaWAN support

Hi all,

I have been using micropython from Pycom with my patch for TTGO T-Beam devices for a long time. Since Pycom has long gone I got fed up and added the latest semtec driver to the latest micropython release.

It’s available here: GitHub - nunomcruz/micropython-lorawan: MicroPython with LoRaWAN support · GitHub

It has mostly been tested, ABP, OTAA, Class A, C, Multicast, MAC commands, boards with SX1276 and SX1262 with TTGO T-Beam boards (possibly works with others). I have only tested within EU868 and TTN. But other bands are coming but I’m unable to test them.

Class B I don’t have a gateway configured for class B support so I haven’t tested it.

This was only possible with the help of LLMs and most of the code was generated. Possibly not the most optimised code, but hey it works.

3 Likes

Cool cool, nice work! I’ve been thinking about doing something similar with an LLM but it didn’t cross my mind to simply wrap an existing code base as a C module which is perfectly possible.

One thing that I’d like to see is that the user is forced to try and receive downlinks. Lots of people will want to try and not receive downlinks because they think they don’t need it or for maximum power savings. However, it is mandatory and necessary and may even turn out to be better for power saving given ADR.
So can you maybe make it into one TxRx/transmitReceive function for example instead of a separate recv()?

1 Like

Thanks!

I didn’t understand your request, recv isn’t mandatory, adr and other Mac commands (for example the NewChannelReq don’t require you to call recv (or register an on_recv handler), the stack running on the background deals with that and with rx1, rx2. recv() only returns the last application data downlink.

Ahh, all good then! I didn’t dig into the source code to be honest, was merely looking at the examples :slight_smile:

@ncruz does this require a custom MicroPython build or can it be downloaded an imported as a standalone module?

This requires a custom micropython build because the C module needs to be compiled with the firmware and a new board has been defined for the t-beam.

But the build is available to be downloaded or flashed directly using the web flasher.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.