Git Product home page Git Product logo

Comments (34)

nopnop2002 avatar nopnop2002 commented on May 27, 2024 1

Here is a description of the BMP format.

You need to understand the BMP format correctly.

http://wiki.gis.com/wiki/index.php/BMP_file_format

https://en.wikipedia.org/wiki/BMP_file_format#:~:text=The%20BMP%20file%20format%20is,covers%20the%20BMP%20file%20format.

from esp-idf-st7789.

nguyenxuantan27112000 avatar nguyenxuantan27112000 commented on May 27, 2024 1

I used the paint tool on my PC to adjust the depth of the image from 1 to 24, then I added the font folder to run the program and display it. I have now created a QR code bmp with a depth of 1 bit and saved it to my device's spiffs memory

from esp-idf-st7789.

nopnop2002 avatar nopnop2002 commented on May 27, 2024 1

When I have time, I will add a display of monochrome images (QR code).

from esp-idf-st7789.

nopnop2002 avatar nopnop2002 commented on May 27, 2024 1

Maybe next weekend.

I have a job at weekday.

from esp-idf-st7789.

nopnop2002 avatar nopnop2002 commented on May 27, 2024 1

I added QRTest function()

Try latest.

st7789-QRCODE

from esp-idf-st7789.

nopnop2002 avatar nopnop2002 commented on May 27, 2024 1

This is 1 bit depth bmp file. I think you will need it.
qrcode_1bit.zip

This is currupt file.

$ identify qrcode_1bit.bmp
qrcode_1bit.bmp BMP3 105x105 105x105+0+0 1-bit sRGB 2c 1742B 0.000u 0:00.000
identify-im6.q16: length and filesize do not match `qrcode_1bit.bmp' @ error/bmp.c/ReadBMPImage/835.

from esp-idf-st7789.

nopnop2002 avatar nopnop2002 commented on May 27, 2024 1

You can fix it using convert,

$ convert qrcode_test.bmp qrcode_test2.bmp
convert-im6.q16: length and filesize do not match `qrcode_test.bmp' @ error/bmp.c/ReadBMPImage/835.
$ identify qrcode_test2.bmp
qrcode_test2.bmp BMP 84x84 84x84+0+0 1-bit sRGB 2c 1154B 0.000u 0:00.000

from esp-idf-st7789.

nopnop2002 avatar nopnop2002 commented on May 27, 2024 1

Can you edit the code file so that it generates the correct bmp file?

No.

This is not my issue.

from esp-idf-st7789.

nopnop2002 avatar nopnop2002 commented on May 27, 2024 1

I used on-line qr code generator.

Plz google [QR generator]

When I have a problem, can I contact you ?

If it's related to this repository, it's possible, but otherwise it's not possible.

from esp-idf-st7789.

nopnop2002 avatar nopnop2002 commented on May 27, 2024 1

Plz google [linux convert]

from esp-idf-st7789.

nopnop2002 avatar nopnop2002 commented on May 27, 2024 1

It's usually like this:

Create your QR code using online generator

Use the [identify] command to check the image format, number of colors and size of the BMP

Change image format if you want, using [convert] command

Resize image using [convert] command

Convert to monochrome image using [convert] command

It is OK if such a file is created at the end.

$ identify qrcode_test2.bmp
qrcode_test2.bmp BMP 84x84 84x84+0+0 1-bit sRGB 2c 1154B 0.000u 0:00.000

Please do your own research later.

Good luck!

from esp-idf-st7789.

nopnop2002 avatar nopnop2002 commented on May 27, 2024 1

The easiest way is to find a REST server that creates a BMP image of the QR code.

Example:

Send Get request to REST Server:
http://hogehoge.com/create-qr-code/?data=HelloWorld!&size=100x100&depth=1

Receive a BMP image that depth=1 from a REST server using GET.

Save the received BMP image in SPIFFS with the BMP extension.

But I can't find such a REST server.

from esp-idf-st7789.

nopnop2002 avatar nopnop2002 commented on May 27, 2024 1

Currently I have generated an ESP32 + ESP-IDF QR code (I sent it above for you to see) and saved it as a bmp file into the device's SPIFFS memory,

Good!!

I searched for something like that but couldn't find it.

Very original.

Plz Publish it on github when you're done.

from esp-idf-st7789.

nguyenxuantan27112000 avatar nguyenxuantan27112000 commented on May 27, 2024

Thanks for your reply, after I researched based on your link I found an example of a 2×2 pixel, 24-bit bitmap (Windows DIB header BITMAPINFOHEADER) with pixel format RGB24 and an example of a 4 ×2 pixels, 32-bit bitmap. I can't find 1-bit bitmap example, can I use bmp header, dib header in your library for my purpose? If not, can you guide me? Currently I want to display QR image on TTGO, but I can only create QR bmp file with 1 bit depth and I need your help. I'm just a student, so I don't have the ability, experience to fully understand, hope you can take the time to help me to complete this project. I will try to learn all your guidance,
Thank you.

from esp-idf-st7789.

nguyenxuantan27112000 avatar nguyenxuantan27112000 commented on May 27, 2024

I used your library and here are the results. This is a 24 bit depth bmp image
810E1CFC-23B6-4269-93FB-C1FE7A902BFB
This is a 1 bit depth bmp image
4CEB7293-1106-4F87-9B35-5647471D4EA3

from esp-idf-st7789.

nopnop2002 avatar nopnop2002 commented on May 27, 2024

I used your library and here are the results. This is a 24 bit depth bmp image

I want your 24 bit depth bmp image file.

from esp-idf-st7789.

nguyenxuantan27112000 avatar nguyenxuantan27112000 commented on May 27, 2024

qrcode_24bit.zip
The bmp file is inside

from esp-idf-st7789.

nguyenxuantan27112000 avatar nguyenxuantan27112000 commented on May 27, 2024

When I have time, I will add a display of monochrome images (QR code).

Thank you for your help, can you tell me how long it will take? Because I also have to finish before the deadline. Sorry if this took your time. If you need anything from me please contact me immediately, I am happy to receive it.

from esp-idf-st7789.

nguyenxuantan27112000 avatar nguyenxuantan27112000 commented on May 27, 2024

Maybe next weekend.

I have a job at weekday.

Thank you so much !!!

from esp-idf-st7789.

nguyenxuantan27112000 avatar nguyenxuantan27112000 commented on May 27, 2024

This is 1 bit depth bmp file. I think you will need it.
qrcode_1bit.zip

from esp-idf-st7789.

nguyenxuantan27112000 avatar nguyenxuantan27112000 commented on May 27, 2024

Thank you very much, I will try it next monday and give you feedback. Hope they help me.

from esp-idf-st7789.

nguyenxuantan27112000 avatar nguyenxuantan27112000 commented on May 27, 2024

I added QRTest function()

Try latest.

st7789-QRCODE

Hello,
I tried running with your bmp file with width and height of 240 pixels and it was successful on TTGO T-Display ESP32. Then I tried to use the image with width and height less than 240 pixels, TTGO T-Display ESP32 got error Guru Meditation Error: Core 1 panic'ed (LoadProhibited).
After I debug I found the command line
if ( (sdbuffer[buffidx] & mask) != 0) colors[index] = WHITE;
I don't know if the memory allocation for the sdbffer pointer is related to the error when I change another bmp file with a size other than 240 pixel
Screenshot 2022-08-01 114138
s.

from esp-idf-st7789.

nopnop2002 avatar nopnop2002 commented on May 27, 2024

I tested with a 120x120 BMP file.
It worked fine.

$ identify qrcode.bmp
qrcode.bmp BMP 120x120 120x120+0+0 1-bit sRGB 2c 2050B 0.000u 0:00.000

IMG_3252

Check your bmp using identify.

There is another cause.

from esp-idf-st7789.

nguyenxuantan27112000 avatar nguyenxuantan27112000 commented on May 27, 2024

I tested it and it returns the following result
$ identify qrcode_test.bmp
qrcode_test.bmp BMP3 84x84 84x84+0+0 1-bit sRGB 2c 1.07KB 0.000u 0:00.000
identify-im6.q16: length and filesize do not match `qrcode_test.bmp' @ error/bmp.c/ReadBMPImage/826.

Looks like I created a bmp file that doesn't match, although when I scan it still works. The difference that I see is the file format BMP3 and BMP and both are 1 bit depth.
This is the library used to generate the QR code that I am using. Can you help me take a look and fix it for TFT?
gen-qrcode.zip

from esp-idf-st7789.

nopnop2002 avatar nopnop2002 commented on May 27, 2024

For some unknown reason, this program does not create the correct BMP.

$ identify qrcode_test.bmp
qrcode_test.bmp BMP3 84x84 84x84+0+0 1-bit sRGB 2c 1070B 0.000u 0:00.000
identify-im6.q16: length and filesize do not match `qrcode_test.bmp' @ error/bmp.c/ReadBMPImage/835.

from esp-idf-st7789.

nguyenxuantan27112000 avatar nguyenxuantan27112000 commented on May 27, 2024

Thank you, I will try it !!!

You can fix it using convert,

$ convert qrcode_test.bmp qrcode_test2.bmp
convert-im6.q16: length and filesize do not match `qrcode_test.bmp' @ error/bmp.c/ReadBMPImage/835.
$ identify qrcode_test2.bmp
qrcode_test2.bmp BMP 84x84 84x84+0+0 1-bit sRGB 2c 1154B 0.000u 0:00.000

from esp-idf-st7789.

nguyenxuantan27112000 avatar nguyenxuantan27112000 commented on May 27, 2024

You can fix it using convert,

$ convert qrcode_test.bmp qrcode_test2.bmp
convert-im6.q16: length and filesize do not match `qrcode_test.bmp' @ error/bmp.c/ReadBMPImage/835.
$ identify qrcode_test2.bmp
qrcode_test2.bmp BMP 84x84 84x84+0+0 1-bit sRGB 2c 1154B 0.000u 0:00.000

It worked fine.
Can you edit the code file so that it generates the correct bmp file?

from esp-idf-st7789.

nguyenxuantan27112000 avatar nguyenxuantan27112000 commented on May 27, 2024

Sorry and thank you for your support.
I want the device to be able to generate QR codes on its own and they can be displayed on the screen, but currently the way to generate QR codes is not correct.
Can you guide me how to generate the correct QR code? When I have a problem, can I contact you ?

from esp-idf-st7789.

nguyenxuantan27112000 avatar nguyenxuantan27112000 commented on May 27, 2024

Thank you !!!

from esp-idf-st7789.

nopnop2002 avatar nopnop2002 commented on May 27, 2024

I have a one hint.

It helps if you know how to use the convert command.

from esp-idf-st7789.

nguyenxuantan27112000 avatar nguyenxuantan27112000 commented on May 27, 2024

I think the way you instruct is how to generate a QR code when using a command entered from the keyboard. But I need to write a library so that when loaded into the chip it will automatically generate a QR code when conditions are met.
I wonder is it possible to create a function that functions like the convert command? That seems like an impossibility, right?
I tried convert and it worked. Thanks for this helped me.

from esp-idf-st7789.

nopnop2002 avatar nopnop2002 commented on May 27, 2024

But I need to write a library so that when loaded into the chip it will automatically generate a QR code when conditions are me

You can create a QR code BMP file using ESP32 + ESP-IDF.

However, it is inappropriate to include that feature in this repository.

This will be a completely different repository.

It is necessary to consider how to enter the text string that is the basis of the QR code.

from esp-idf-st7789.

nguyenxuantan27112000 avatar nguyenxuantan27112000 commented on May 27, 2024

With my current ability the things you suggest are first known. Currently I have generated an ESP32 + ESP-IDF QR code (I sent it above for you to see) and saved it as a bmp file into the device's SPIFFS memory, but the generated file has problems and it doesn't show up on the screen. I will fix the file save function first, if not I will learn your way.
Thank you very much.

from esp-idf-st7789.

nguyenxuantan27112000 avatar nguyenxuantan27112000 commented on May 27, 2024

Okkk !!!

from esp-idf-st7789.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.