I installed micropython on my esp32 for easier coding - no more waiting for the arduino code to recompile, and easy testing of new code.
All good for now.
A few problems started to appear.
When using a LCD a ST7735 the refresh is very slow, you can see the screen being painted from top to bottom. Its not terrible but not that great, on arduino with C code was fine.
Second problem, when I tried to log some data online with urequest, or even with sockets.
I started to get: OSError: (-29312, 'MBEDTLS_ERR_SSL_CONN_EOF')
The problem comes from SSL part - if the server is using anything more powerfull then RSA for the HTTPS certificate we have a problem.
ESP32 is left with too little memory and cpu from running micropython.
Two solutions.
If you remove the TFT library it works, but this is not really a solution, since I want the data displayed on the screen as well.
I went through the library and started to remove pieces of code not required, like they have 3 functions to initrb, initrg, initrr - to initialize the screen with red, green or blue. Just keep the red one and remove the others.
I also removed the drawing functions like circle, line, rect etc - I only needed text.
After this trimming, I got the first success, urequests actually working, but not all the time.
So second solution was to ditch the HTTPS.
Setup the server to accept http. Then it works fine.
No comments:
Post a Comment