Hello.
I am following the course of mycropython programming with ESP32 and ESP8266. I have python 3 installed (comes with the ubuntu distribution) and have downloaded uPyCraft from your site. When installing, I get the following:
./uPyCraft_linux_V1.0
Traceback (most recent call last):
File “uPyCraft.py”, line 2, in <module>
File “/usr/local/lib/python3.5/dist-packages/PyInstaller/loader/pyimod03_importers.py”, line 714, in load_module
ImportError: /tmp/_MEI1EGcaR/libz.so.1: version `ZLIB_1.2.9′ not found (required by /usr/lib/x86_64-linux-gnu/libpng16.so.16)
[31627] Failed to execute script uPyCraft
I don’t know what to do next. Thank you in advance for your help.
Hello! Thanks for reporting that problem. Unfortunately I’ve never encountered that error before. I’ve searched for it and this seems to solve your exact error: https://stackoverflow.com/questions/48306849/lib-x86-64-linux-gnu-libz-so-1-version-zlib-1-2-9-not-found
Can you download that file and follow the procedure that “Kamrul hassan” recommended?
Thanks for your patience!
Hello, I’ve tried the method described in the url you gave me. The compilation went ok, make also went well and make install needed to be executed with sudo, but went well too and finally I create the link and erase the directory where zlib was unziped, but the execution of uPyCraft gave the same results as before:
./uPyCraft_linux_V1.0
Traceback (most recent call last):
File “uPyCraft.py”, line 2, in <module>
File “/usr/local/lib/python3.5/dist-packages/PyInstaller/loader/pyimod03_importers.py”, line 714, in load_module
ImportError: /tmp/_MEI3sKPrO/libz.so.1: version `ZLIB_1.2.9′ not found (required by /usr/lib/x86_64-linux-gnu/libpng16.so.16)
[4683] Failed to execute script uPyCraft
Any sugestion?
Thank you.
Hello, I apologize for taking so long to get back to you, but I’ve been trying to figure out how I would solve that problem myself.
I’ve tried to compile it and I’ve encountered the same error. After many failed attempts, I can’t make it work either. So, I’ve decided to work on another method to program the ESP32/ESP8266 with MicroPython.
I’ve just posted a new blog post about that subject a few minutes ago:
- Learn how to Flash MicroPython Firmware with esptool.py on ESP32 and ESP8266
- Getting Started with Thonny MicroPython (Python) IDE for ESP32 and ESP8266
Can you try to program the ESP with Thonny IDE? It looks like it’s a better alternative for Linux.
Let me know your results, because I plan to update the eBook to include different methods to program with MicroPython firmware.
Thanks for your patience.
Hello again. I have followed the steps of installing thonny and thonny-esp. Then I restart thonny and when I try to flash micropython in the esp8266, there is no device menu, so I can’t continue. Also, when I go to options-interpreter,there is no micropython on esp8266 option or micropython on an generic device. Running the program from the terminal, I have some error messages about module micropython:
thonny
INFO: Loading early plugins from [‘/usr/bin’, ‘/usr/lib/python36.zip’, ‘/usr/lib/python3.6’, ‘/usr/lib/python3.6/lib-dynload’, ‘/usr/local/lib/python3.6/dist-packages’, ‘/usr/lib/python3/dist-packages’, ‘/home/alfredo/.thonny/plugins/lib/python3.6/site-packages’]
ERROR: Failed loading plugin ‘thonnycontrib.esp’
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/thonny/workbench.py”, line 243, in _load_plugins_from_path
m = importlib.import_module(module_name)
File “/usr/lib/python3.6/importlib/__init__.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “<frozen importlib._bootstrap>”, line 994, in _gcd_import
File “<frozen importlib._bootstrap>”, line 971, in _find_and_load
File “<frozen importlib._bootstrap>”, line 955, in _find_and_load_unlocked
File “<frozen importlib._bootstrap>”, line 665, in _load_unlocked
File “<frozen importlib._bootstrap_external>”, line 678, in exec_module
File “<frozen importlib._bootstrap>”, line 219, in _call_with_frames_removed
File “/home/alfredo/.thonny/plugins/lib/python3.6/site-packages/thonnycontrib/esp/__init__.py”, line 1, in <module>
from thonny.plugins.micropython import MicroPythonProxy, MicroPythonConfigPage,\
ModuleNotFoundError: No module named ‘thonny.plugins.micropython’
ERROR: Failed loading plugin ‘thonnycontrib.esp’
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/thonny/workbench.py”, line 243, in _load_plugins_from_path
m = importlib.import_module(module_name)
File “/usr/lib/python3.6/importlib/__init__.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “<frozen importlib._bootstrap>”, line 994, in _gcd_import
File “<frozen importlib._bootstrap>”, line 971, in _find_and_load
File “<frozen importlib._bootstrap>”, line 955, in _find_and_load_unlocked
File “<frozen importlib._bootstrap>”, line 665, in _load_unlocked
File “<frozen importlib._bootstrap_external>”, line 678, in exec_module
File “<frozen importlib._bootstrap>”, line 219, in _call_with_frames_removed
File “/home/alfredo/.thonny/plugins/lib/python3.6/site-packages/thonnycontrib/esp/__init__.py”, line 1, in <module>
from thonny.plugins.micropython import MicroPythonProxy, MicroPythonConfigPage,\
ModuleNotFoundError: No module named ‘thonny.plugins.micropython’
It seems that the IDE can’t load the plugin of micropython.
Sorry for my insistence.
I recommend using esptool.py to flash MicroPython firmware: Learn how to Flash MicroPython Firmware with esptool.py on ESP32 and ESP8266. We weren’t able to successfully flash some boards with Thonny IDE. So, I recommend leaving the “Generic MicroPython device” selected in the options…
Can you try to use esptool.py? Then, in Thonny IDE use “Generic MicroPython device”?
That worked for us in all Operating systems successfully and reliably.
Thanks for your patience throughout this process!
Hello again. I have flashed micropython in my esp8266, as you told me. Then I connect the esp8266 to the computer and run thonny. I have already installed the plugin thonny-esp. The behavior of the program is the same: the menu option – interpreter does not have the possibility of selecting micropython in the drop-down list, so I can’t select something that is not present. Also, there is no menu named device, so I cant access the esp8266. The errors runing the program from the command line are the same as before. Seems that the version of thonny is different than yours. I have followed your instructions and still nothing. I don’t understand what causes the problem.
Thank you for your interest.
Hello again. I finally have thonny running. I have seen a message in the forum: thonny IDE in ubuntu 18.04 and there explains how to get running thonny. The problem were that the version of thonny installed by the command sudo apt install thonny is different that the one you show in the tutorial. Following the instructions of the post mentioned before, the problem solves: first remove the version installed of thonny with sudo apt remove thonny and after install the last one with bash <(curl -s https://thonny.org/installer-for-linux) .
After that, everything went OK and I can follow the rest of the tutorials of the book (not all yet).
Thank you for your interest and your patience.
I hope to read more of your tutorials soon, they are very nice to follow.
Hi, thank you for pointing that out.
We’ve already updated the tutorial.
See our answer here: https://rntlab.com/question/thonny-ide-on-ubuntu-18-04/
Regards,
Sara 🙂
Ho w can I have an update version of the tutorial? The one I have bought does not have this modifications.
Many thanks, Ezio Somà