uQR: Generate QR Codes in MicroPython

This last week I ported the python-qrcode library to MicroPython. The result is uQR!

Porting python-qrcode to MicroPython involved:

  1. Removing libraries unavailable in MicroPython.
  2. Rewriting syntax that is unavailable in MicroPython.
  3. Removing Py2/Py3 cross-compatibility code.
  4. Removing QR code image generation.
  5. Rewriting recursive function calls into loops: MicroPython has a much shallower recursion limit than CPython.
  6. Consolidating all of the code into one file, for easier MicroPython deployment.

The result:A microcontroller connected to a miniature LED display, depicting a QR code.

Due to memory limitations, I can only create small QR codes on the ESP8266 microcontroller. But I’m getting an ESP32 and a slightly larger screen: I’d like to make a project and video about accepting lightning network payments with the ESP32.