Generated QR Code for LCD module not working

For my project I need to generate a QR code to a website and display it on the LCD display.
For this purpose I used the code from the Wifi Router project:

However the code that is generated is not recognized as a valid QR code.
I have analysed both the imported qrcode library as well as the bc lcd modules used but I cannot find the cause. Btw I am not a seasoned C programmer so it may be a simple solution (I hope).

My Git project:

Example of a generated QR Code is in the img directory (/img/2020-01-01.jpg).

Hello Robert,
I’m goint to look at this issue. I’ve tested your firmware and I also have issues of scanning the code. I’ll do more tests and let you know later.

1 Like

I’ve uploaded my initial QR code code on which was later used to Radio Wifi QR code project. This one works and now I’ll compare what could be wrong.

Can you try this binary and confirm that your phone can scan them? I’ve done a release which could be found here

After many hours of comparing the code I’ve figured that out :crazy_face:. You replaced qr library qrcodegen.c with different version from the author’s website.

The author doesn’t version them, so I don’t know if yours is newer, but they are different.


Is there any reason you need different version of that library? I’m not sure I could debug that further, not sure what the author changed in his code. It could be also bug in his library.

When updating my previous example, I’ve changed some variables to static. It works ok, but bigger buffers should be in the static memory and not on the stack. Just add static to these lines:

static uint8_t qrcode[qrcodegen_BUFFER_LEN_MAX];
static uint8_t tempBuffer[qrcodegen_BUFFER_LEN_MAX];

Thanks Martin for your swift response, I cloned your code v1.0.0 and this works fine!
I’ll continue with my project using this code instead.

The idea is that I send an orderID and containerID from a website via MQTT to the module linked to the containerID who then displays a QR code with “URL+’?orderid=’+orderID”.
When the customer scans the code he can confirm with a signed transaction the delivery of the goods and release the escrowed payments that are locked in a smart contract on Ethereum.
The project is used to demonstrate some innovative ideas in a logistics simulation game in our local university.