I m trying to compile the sketch ‘analog input pot’. I get a message:
'error compiling for board esp32 module. File "/home/marconi/.arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py" line 37 in <module> import serial. Import error no module named serial.
I can get to ‘esptool.py’ on the terminal but i do not know what it contains or how to access it. Where do I go from here?
Hello John, I hope you are doing well and I apologize for taking so long to get back to you.
- Did you compile the ESP32 WiFi Scan sketch successfully?
- Can you try to compile again, but make you that you selected the ESP32 COM Port in the Arduino IDE?
Thanks for your patience!
Hi Rui,
WiFi Scan sketch does not compile. An empty sketch does not compile and gives an error message.
"Traceback (most recent call last) File "home/marconi/.arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py" line 37 in <module> import serial. Input error No module named serial exit status 1 Error compiling for board ESP32 Dev Module.
It appears no esp32 sketches will compile. ESP8266 WiFi sketch will compile and run.
IDE is running on Linux Ubuntu. Version has been updated from 1.8.5 to 1.8.9
Regards,
John
Hello John, which Python version do you have installed? This shouldn’t be necessary, but can you re-install the esptool?
pip install esptool
I’ve never encountered that error before… Does it also happen when you simply click the “compile” button in your Arduino IDE? (I’m not talking about the upload button, just the “compile” button).
Hello Rui,
No change after recompiling ‘esptool’. Error occurs with ‘compile/verify’ only.
I have attempted to remove previous versions of IDE and install IDE 1.8.9. I have tried to install the ‘WiFi scan’ sketch for board ESP32 Dev Module. I get the following message:
Traceback (most recent call last):
File “/home/john/.arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py” , line 37, in <module> import serial
Import Error: No module named serial
Multiple libraries were found for “WiFi.h”
Used: /home/john/.arduino15/packages/esp32/hardware/esp32/1.0.2/libraries/WiFi
Not Used: /home/john/arduino-1.8.9/libraries/WiFi
Exit status 1
Error compiling for board ESP32 Dev Module
.arduino15 file is part of a previous version IDE 1.8.5. it is hidden.
Library for ‘WiFi.h’ is taken from .arduino15 not from arduino-1.8.9 which is the current build. Preferences file is in .arduino15.
It seems that remnants of previous builds are causing problems.
Where do we go now?
Regards,
John.
You should definitely clean and remove everything from the old installation.
However, I don’t think that’s the problem, because according to the debug information it’s using the correct WiFi library for the ESP32:
Used: /home/john/.arduino15/packages/esp32/hardware/esp32/1.0.2/libraries/WiFi
It says the library that was used for compiling (and that’s the correct one).
I thought that if you re-installed esptool.py it would fix the problem. Instead, can you manually install pyserial? Run that command:
python -m pip install pyserial
(Run that command with Arduino IDE closed, then re-open the Arduino IDE and compile again the code)
Hi Rui,
I removed the directory .arduino15 and reinstalled IDE 1.8.9. I now have the message:
Adding desktop shortcut, menu item and file associations for Arduino IDE.
rm: cannot remove ‘/usr/local/bin/arduino’ Permission denied. Removing symlink failed. Hope that’s OK. If not then rerun as root with sudo.
mv: replace ‘/home/john/.config/mimeapps.list’
overriding mode 0644 (rw-r-r–)
ln failed to create symbolic link ‘/usr/local/bin/arduino’ File exists. Adding symlink failed. Hope that’s OK. If not rerun as root with sudo.
done!
Program now works only with arduino boards. ‘Preferences will not now accept 8266 or esp32 additions.Preferences File is still listed as .arduino15.
Installing pyserial has not changed situation.
regards John
Hello Rui,
I currently have IDE 1.8.9 running with arduino and esp8266 boards.
esp32 addition will not load with message: “Error downloading https://dl/espressive.com/dl/package_esp32_index.json”
No indication why.
regards,
John.
Hi
I had a similar problem …
https://rntlab.com/question/json-esp32-error/
Arduino exists
C:\Users\****\AppData\Local\Arduino15\
delete this as well as Arduino IDE
Hope it helps
derek
Hi Rui,
The IDE is working now with esp8266 and esp32. I have no idea how. I have been removing bits and re-installing and suddenly it began working. I must have found a fairy godmother!
It would be nice to know what went wrong in case it happens again but at least I can now get started with the ‘Learning ESP32 course.’
Best regards,
John.
Hello John, I apologize for the trouble getting started, I was trying to re-install a Virtual Machine to see if I could reproduce the error on my end, but it installed just fine. To be honest I’m not sure what happened and what made it work in your case.
If you need further help with the course, feel free to open a new question: https://rntlab.com/ask-question/