# Micropython with LoRaWAN support

**URL:** <https://www.thethingsnetwork.org/forum/t/micropython-with-lorawan-support/73571>\
**Category:** End Devices (Nodes)\
**Tags:** end-devices\
**Created:** [April 30, 2026, 3:17pm UTC](https://www.thethingsnetwork.org/forum/t/micropython-with-lorawan-support/73571 "2026-04-30T15:17:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ncruz](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ncruz/32/48224_2.png) [@ncruz](https://www.thethingsnetwork.org/forum/u/ncruz)\
**Post date:** [April 30, 2026, 3:17pm UTC](https://www.thethingsnetwork.org/forum/t/micropython-with-lorawan-support/73571/1 "2026-04-30T15:17:20Z")

</div>

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](https://github.com/nunomcruz/micropython-lorawan)

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.

---

<div class="post-metadata">

**Author:** ![stevencellist](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/stevencellist/32/46434_2.png) [@stevencellist](https://www.thethingsnetwork.org/forum/u/stevencellist)\
**Post date:** [April 30, 2026, 8:52pm UTC](https://www.thethingsnetwork.org/forum/t/micropython-with-lorawan-support/73571/2 "2026-04-30T20:52:14Z")

</div>

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()`?

---

<div class="post-metadata">

**Author:** ![ncruz](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ncruz/32/48224_2.png) [@ncruz](https://www.thethingsnetwork.org/forum/u/ncruz)\
**Post date:** [April 30, 2026, 11:49pm UTC](https://www.thethingsnetwork.org/forum/t/micropython-with-lorawan-support/73571/3 "2026-04-30T23:49:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![stevencellist](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/stevencellist/32/46434_2.png) [@stevencellist](https://www.thethingsnetwork.org/forum/u/stevencellist)\
**Post date:** [May 1, 2026, 5:44am UTC](https://www.thethingsnetwork.org/forum/t/micropython-with-lorawan-support/73571/4 "2026-05-01T05:44:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![stevencellist](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/stevencellist/32/46434_2.png) [@stevencellist](https://www.thethingsnetwork.org/forum/u/stevencellist)\
**Post date:** [May 2, 2026, 12:42pm UTC](https://www.thethingsnetwork.org/forum/t/micropython-with-lorawan-support/73571/5 "2026-05-02T12:42:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ncruz](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ncruz/32/48224_2.png) [@ncruz](https://www.thethingsnetwork.org/forum/u/ncruz)\
**Post date:** [May 3, 2026, 10:18pm UTC](https://www.thethingsnetwork.org/forum/t/micropython-with-lorawan-support/73571/6 "2026-05-03T22:18:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/6/2/6250ea44fd2b0d6259489e1a92748df681e1f970.png) [@system](https://www.thethingsnetwork.org/forum/u/system)\
**Post date:** [May 5, 2026, 4:15pm UTC](https://www.thethingsnetwork.org/forum/t/micropython-with-lorawan-support/73571/7 "2026-05-05T16:15:41Z")

</div>

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