2024-02-23 02:06 PM
Hi everybody,
I'm trying to implement into a custom board, the dynamic Qrcode generation algorithm.
I'm using touchgfx 4.23.0, an SPI display with partial buffer strategy.
I would like to draw the string "https://support.touchgfx.com" . Display seem to draw it correctly but when I'm try to read it using my phone, this one is not readle. it seems not valid..
I'm using the following initialization sequence:
void Screen_QrCodeView::setupScreen()
{
Screen_QrCodeViewBase::setupScreen();
QR *code;
sprintf( string, "https://support.touchgfx.com");
code = new QR( string );
qrCode.setXY(10,10);
qrCode.setQRCode(code);
qrCode.setScale(8);
add(qrCode);
}
I don't understand the reason. If I change the size of QrCode using qrCode.setScale the result is the same.
Is it possibile to change the resoltuion of the QrCode? Is the QrCode resolution too poor respect the modern APP algorithm?
Does someone ahs the same issue? Please, Can someone try to draw the string https://support.touchgfx.com and share the picture for a comparison, ?
What can I check in the project?
Thanks to all
Solved! Go to Solution.
2024-02-26 03:19 AM
Hello @MPast.1
Please find attached a custom container of a QrCode generator that I have made.
Note that the QrCode uses the Nayuki library in C++ (quite big) github.com/nayuki/QR-Code-generator with MIT license.
We are working on making a QrCode using the C version of the library in the near future.
From your last post, it seem like your board works fine with no tearing. Somehow the tearing only happens with the QrCode which is unfortunate but indicates that it could be an issue with the QrCode generation rather than tearing.
Does the tearing happens with scaling of 1?
To make the QrCode works even with the tearing you could try to increase the correction level (from what I know there is 4 levels of correction [this is different from the version number, the version number defines the number of dots]).
Finally, 2 QrCode displaying the same data could look different just because their version is not the same.
Here is mine running on TouchGFX simulator with quartile (3rd highest) level of correction (also works on board):
Regards,
2024-02-23 02:51 PM
2024-02-24 01:22 AM
Why your Qrcode is so different?
Can you share your sources files, you use in the project?
Thanks
2024-02-24 01:36 AM
@MPast.1 wrote:Display seem to draw it correctly
What makes you say that?
It's drawn something - but, clearly, what it's drawn is not correct!
There's a lot of "tearing" in your image:
Can you correctly draw any other text as a QR code?
sprintf( string, "https://support.touchgfx.com");
code = new QR( string );
You haven't shown the definition of string
What if you just do
code = new QR( "https://support.touchgfx.com" );
2024-02-24 01:41 AM
@MPast.1 wrote:Why your Qrcode is so different?
Indeed it's very different:
Apart from the "tearing", yours seems to be missing a lot of points
2024-02-24 02:00 AM
I know that is present a little tearing on Qrcode: i saw it and and I'm trying to understand if is QrCode sources files can be the cause.
At the moment I dont think its a big problem because Qrcode is technology has bits corrections so a little noise on the picture should not be a problem. (you imaging if a qrcode printed on a metalized label could be a little bit scratched. Your App always read it without "any" problem). The real problem is that Qrcode has a lot of missing dots.
I'm working without any optimization on code, but I don't think this is the problem
all the images and texts I'm using are drawn correctly
2024-02-24 02:15 AM - edited 2024-02-24 02:17 AM
@MPast.1 wrote:I dont think its a big problem because Qrcode is technology has bits corrections so a little noise on the picture should not be a problemtly
Exactly. So this shows that there's not just a small error in your QR code display - it is very wrong!
Probably it's a symptom of what's going wrong in creating the QR code - rather than the cause of not reading it?
Again:
2024-02-24 02:32 AM
2024-02-24 05:55 AM
@MPast.1 sorry cannot provide source. Just used a QR utility on my phone and checked that generated picture is recognized.
2024-02-24 06:44 AM
As you can see an example of correct scren with buttons, text and images.
String as decalred like "char"
QRCodeWidget qrCode;
char string[50];
Can be depend by display orientation?