Remote LCD Nokia5510/JLX12864 with ESP32 - Printable Version +- OpenMarine (https://forum.openmarine.net) +-- Forum: Pypilot (https://forum.openmarine.net/forumdisplay.php?fid=17) +--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=18) +--- Thread: Remote LCD Nokia5510/JLX12864 with ESP32 (/showthread.php?tid=3849) |
RE: Remote LCD Nokia5510/JLX12864 with ESP32 - kagouraki - 2022-01-10 Hello Sean, i cant make it work. These are the steps i followed: following this guide : https://github.com/micropython/micropython/tree/master/ports/esp32 Code: sudo apt-get install esptool It builds! So everything is ok until now. i uploaded with : Code: make erase It uploads and micropython is working on the esp32 Now, when i : Code: cd ~/Desktop The .mpy files are created and uploaded to my esp32. I can see the files when i connect to the esp32's console and type : Code: import os when i press the reboot button on the esp32 pcb and look at the console i see import pypilot module not found in the font.py file. Ok i knew it because the ugfx module in not in the esp32 and in the font.py file here : Code: try: If it fails to load ugfx module, it thinks it is in raspberry enviroment. SO NOW ! Now the fun starts. Compiling the micropython with your micropython_ugfx module. Code: cd ~/micropython/esp32/micropython This one FAILS with Code: CMake Error at /home/labcnc/Desktop/micropython/py/usermod.cmake:42 (include): I found a very usefull link : https://docs.micropython.org/en/latest/develop/cmodules.html In this link it says that you need to point to the .cmake file but you dont have a .cmake file in github repo. So i took the one in the example folder and altered it and copied it in: ~/micropython/esp32/micropython/modules/ugfx/micropython.cmake This is the file: Code: # Create an INTERFACE library for our C module. then again: Code: cd ~/micropython/esp32/micropython/ports/esp32/ Code: /home/labcnc/Desktop/micropython2/modules/ugfx/modugfx.c:184:35: error: 'ugfx_surface_free_obj' defined but not used [-Werror=unused-const-variable=] I edited the mofugfx.c file and commented out line 184 since it is not used. I rerun the make clean and make commants above and this time it FINISHED and i had a smile until my ears ! But lasted not so long I uploaded the binaries with make erase and make deploy and restarted the esp32 with no errors on the console. I tried to import ugfx in the console and ... No existing module named ugfx I thought that maybe the CFLAGS_EXTRA="-DMODULE_UGFX_ENABLED=1" is not recognized because when i runned the make command i saw that the files where builded So i edited the modugfx.c file again and in the end i changed the line : MP_REGISTER_MODULE(MP_QSTR_ugfx, mp_module_ugfx, MODULE_UGFX_ENABLED); to MP_REGISTER_MODULE(MP_QSTR_ugfx, mp_module_ugfx, 1); again : Code: make clean This time it FAILS after Linking CXX executable micropython.elf with : Code: /home/labcnc/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: CMakeFiles/micropython.elf.dir/home/labcnc/Desktop/micropython2/modules/ugfx/modugfx.c.obj:(.literal+0x14): undefined reference to `ugfx_surface_c_free' Now i am stucked I tried esp-idf 4.0.2 and 4.1.1 and 4.2 i tried the official micropython repository with the same results Any Ideas ? Giorgos RE: Remote LCD Nokia5510/JLX12864 with ESP32 - seandepagnier - 2022-01-11 did you modify it to support the lcd you have? yes obviously you are building it wrong basically you commented out a function to suppress a warning treated as an error that should not have been considered an error then this leads to new problems linking, so fix the -Wno-error flag to not set RE: Remote LCD Nokia5510/JLX12864 with ESP32 - kagouraki - 2022-01-11 (2022-01-11, 02:38 AM)seandepagnier Wrote: did you modify it to support the lcd you have? No i didnt change anything yet. I will try it with the same screen you have to see that its working and then i will see what i can do for the jlx12864 screen. I will try this flag in the afternoon after work and i will post back. Could you also post the pinout connections from the esp to the screen and the buttons ? Thank you Sean you are awesome ! RE: Remote LCD Nokia5510/JLX12864 with ESP32 - seandepagnier - 2022-01-11 i am using ttgo t display module you can find the schematic: https://github.com/Xinyuan-LilyGO/TTGO-T-Display/blob/master/schematic/ESP32-TFT(6-26).pdf You can redefine the pins by changing the code too. RE: Remote LCD Nokia5510/JLX12864 with ESP32 - kagouraki - 2022-01-11 No... i cant figure it out how i input the -Wno-error=unused-const-variable and -Wno-unused-const-variable flags. can you tell me what to do ? EDIT: I figured how to insert the flags. Now it gets past the previus error. But cant still not compile. I am again in the point of my previous post. Here... Code: /home/labcnc/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: CMakeFiles/micropython.elf.dir/home/labcnc/Desktop/micropython/modules/micropython_ugfx/modugfx.c.obj:(.literal+0x14): undefined reference to `ugfx_surface_c_free' The flags are inserted in the micropython.cmake file i posted above. Just add this line at the end : Code: target_compile_options(usermod_ugfx INTERFACE -Wno-error=unused-const-variable -Wno-unused-const-variable) Now...does anyone have any suggestions how to proceed ? Giorgos RE: Remote LCD Nokia5510/JLX12864 with ESP32 - seandepagnier - 2022-01-12 Did you apply the patch in the README to support c++? RE: Remote LCD Nokia5510/JLX12864 with ESP32 - kagouraki - 2022-01-12 No i didnt apply the patch. Where and how do i apply it ? EDIT: Ok so i have done my homework. i understand that this thing you posted in the readme.md is the output of the git diff command when you made the changes in the /ports/esp32/Makefile. Code: diff --git a/ports/esp32/Makefile b/ports/esp32/Makefile The thing is that i have the stock Makefile and i dont know where to add thoose. I tried to copy them to a file named test.patch and runned from the repository's root the git apply test.patch but this is returning error. Could you please give me some usable help here and not only just a few words? I will write a guide for the others afterwards. If you have no time there is no problem. Just say it and i will give up and sleep more RE: Remote LCD Nokia5510/JLX12864 with ESP32 - seandepagnier - 2022-01-13 You could manually apply it is so trivial, anyway, I just invoke patch directly, eg: patch -p3 < patchfile do you have your micropython repository online or can show me the exact branch you are using? I can diff from mine. RE: Remote LCD Nokia5510/JLX12864 with ESP32 - kagouraki - 2022-01-13 I cloned your micropython fork RE: Remote LCD Nokia5510/JLX12864 with ESP32 - seandepagnier - 2022-01-13 and your only error is because of a warning being treated as an error? |