Page 1 of 1

Esp32 QRCode generation and decode

Posted: Thu Jan 22, 2026 8:56 pm
by mnfisher
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.

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)
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

Re: Esp32 QRCode generation and decode

Posted: Thu Jan 22, 2026 11:01 pm
by mnfisher
... and a first attempt at drawing a QR code - Here on an esp32s3 with and ili9488 (parallel) display. I had to make each 'pixel' a 5 x 5 rectangle - 1 x 1 is too tiny for my phone to read!
It also ignores the x,y co-ords at the moment and always draws the code at 0,0.
However - it successfully demonstrates using a callback to draw the code :-)