Esp32 QRCode generation and decode
Posted: Thu Jan 22, 2026 8:56 pm
So QR code (Quick Response code) - were mentioned - and I thought I'd experiment with the esp32 components for this...
First up. Generation - note that Flowcode includes a DrawQRCode component - and this will display a code on a display.
However - to test decoding, to allow use in a web page from an esp32 server, or for other uses - I tested the component. Here is a very simple program that generates a QR code - and outputs it to UART. The component allows a range of sizes / error corrections etc (as does the Flowcode component - and that is not limited to esp32)
To add the component - create the FC project (DO NOT call your project qrcode! - this will cause things to break) - and attempt to compile (which will fail)
Navigate to the project directory in a cmd prompt.
Open a terminal to the esp32 (using PuTTY or similar) - and check the QR code using your phone (it works!)
Next to look at outputting the QR code to a display (mimicking the FC component) - and then onto testing the quirc decoder. Then the camera module - to create a QR code reader!
Martin
First up. Generation - note that Flowcode includes a DrawQRCode component - and this will display a code on a display.
However - to test decoding, to allow use in a web page from an esp32 server, or for other uses - I tested the component. Here is a very simple program that generates a QR code - and outputs it to UART. The component allows a range of sizes / error corrections etc (as does the Flowcode component - and that is not limited to esp32)
To add the component - create the FC project (DO NOT call your project qrcode! - this will cause things to break) - and attempt to compile (which will fail)
Navigate to the project directory in a cmd prompt.
Code: Select all
C:\Espressif\frameworks\esp-idf-v5.5\export (Adjust path to suit)
git init
idf.py add-dependency "espressif/qrcode^0.2.0"
idf.py fullclean (or idf.py menuconfig and alter the flash size or other setting to force a rebuild)
idf.py -p COMn -b 921600 (set COMn to suit or rebuild from Flowcode)
Next to look at outputting the QR code to a display (mimicking the FC component) - and then onto testing the quirc decoder. Then the camera module - to create a QR code reader!
Martin