MicroPython Programming With ESP32 and ESP8266 Troubleshooting V1 1
MicroPython Programming With ESP32 and ESP8266 Troubleshooting V1 1
Troubleshooting
We’ve discovered some common problems and error messages that occur with
uPyCraft IDE. Usually restarting your ESP with the on-board EN/RST button fixes
your problem or pressing the uPyCraft IDE “Stop” button and repeating your
desired action. In case it doesn’t work for you, read these next common errors and
>>>
Select Serial Port could not open port 'COM4':
FileNotFoundError(2, 'The system cannot find the file
specified.', None, 2)
Or an equivalent message:
>>>
could not open port 'COM4': PermissionError(13, 'A device
attached to the system is not functioning.', None, 31)
Unplug, and plug back your ESP board. Then, double-check that you’ve selected
the right serial port in the ToolsSerial menu. Then, click the
This error might also mean that you have your serial port being used in another
program (like a serial terminal or in the Arduino IDE). Double-check that you’ve
closed all the programs that might be establishing a serial communication with
your ESP board. Then, unplug and plug back your ESP board. Finally, restart the
uPyCraft IDE – try to select the serial port in the ToolsSerial menu.
>>>
already in download mode, please wait.
Press the “Stop” button in uPyCraft IDE (1 or 2 times) to make sure any code that
was running stops. After that, press the “Download and run” button to upload the
Error #3: After uploading a new script, if you see the following message:
>>>
Ready to download this file,please wait!
...
download ok
os.listdir('.')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'os' isn't defined
Or this message:
>>>
Ready to download this file,please wait!
...
download ok
os.listdir('.')
OSError: [Errno 98]
it printed the “download ok” message. Press the ESP on-board “EN/RST” button to
restart your board and re-run the new uploaded script from the beginning.
Error #4: Problem restarting your board, running a script or opening the serial port:
>>>
Brownout detector was triggered
The “Brownout detector was triggered” error message means that there’s some
sort of hardware problem. It’s often related to one of the following issues:
Solution: try a different shorter USB cable (with data wires), try a different
computer USB port or use a USB hub with an external power supply.
Error #5: When I try to open a serial communication with the ESP32/ESP8266 in
uPyCraft IDE, sometimes it prompts the “Burn Firmware” window asking to re-flash the
MicroPython firmware.
Basically, we think this is what’s happening: when you’re running a script in your
board, sometimes it’s busy running that script and performing the tasks. So, you
need to try opening the COM port multiple times or restart the ESP to catch it
If you’re running a script that uses Wi-Fi, deep sleep, or it's doing multiple tasks, I
Some computers don’t have the SourceCodePro font installed. You can ignore that
If you want to install the SourceCodePro font, please follow these instructions:
1. Download the following .zip folder and unzip it to find the font file
inside: https://randomnerdtutorials.com/SourceCodeProFont
2. Then, you need double-click that file to open it and press the “Install” button:
After that, re-open uPyCraft IDE and it will not prompt that warning message again.
Error #7: You get one of the following indentation error messages:
Or
If you upload a new script to your ESP board and it prompts one of the preceding
error messages, it means that there’s a space or multiple spaces missing in your
script. Python doesn’t use ; or {} to know where each line ends. Python uses
indentation (everything is done using spaces). Double-check that all the spaces are
copying/pasting the code directly from the GitHub link provided in each example.
We’ve discovered some common problems and error messages that occur with
Thonny IDE. Usually restarting your ESP with the on-board EN/RST button fixes
your problem. Or pressing the Thonny IDE “Stop/Restart backend” button and
repeating your desired action. In case it doesn’t work for you, read these next
Or:
Or:
Unplug, and plug back your ESP board. Then, double-check that you’ve selected
the right serial port in the Tools Options Interpreter Port. Then, click the
These errors might also mean that you have your serial port being used in another
program (like a serial terminal or in the Arduino IDE). Double-check that you’ve
closed all the programs that might be establishing a serial communication with
your ESP board. Then, unplug and plug back your ESP board. Finally, restart
Thonny IDE.
When this happens, you can usually close that window and it will continue to work.
When you press the “Stop/Restart backend” button, you need to wait a few
seconds. The ESP needs time to restart and establish the serial communication
with Thonny IDE. If you press the “Stop” button multiple times or if you press the
button very quickly, the ESP will not have enough time to restart properly and it’s
Error #4: Problem restarting your ESP board, running a new script or opening the serial
port:
Or if the ESP keeps restarting and printing the ESP boot information:
reboots means that there’s some sort of hardware problem. It’s often related to
Solution: try a different shorter USB cable (with data wires), try a different
computer USB port or use a USB hub with an external power supply.
recommend re-flashing your ESP board with the latest version of MicroPython
firmware.
Error #5: When I try to establish a serial communication with the ESP32/ESP8266 in
We think this is what’s happening: when you’re running a script in your board,
sometimes it’s busy running that script and performing the tasks.
So, you need to try start the connection by pressing “Stop/Restart backend”
button multiple times or restart the ESP to catch available to establish the serial
communication.
Warning: don’t press the “Stop/Restart backend” button multiple times very
quickly. After pressing that button, you need to be patient and wait a few seconds
If you’re running a script that uses Wi-Fi, deep sleep, or it’s doing multiple tasks, I
Thonny IDE debug tools aren’t available for MicroPython. The debug tools are only
available for the Python Interpreter, so being grayed out is the expected behavior.
Or
Or
error messages, it means that there’s a space or multiple spaces missing in your
script. Python doesn’t use ; or {} to know where each line ends. Python uses
indentation (everything is done using spaces). Double-check that all the spaces are
copying/pasting the code directly from the GitHub link provided in each example.