Hi, I have followed great tutorial to get short micropython code on ESP32 from here:
After trying and failing for a while I got it working finally. However, during that process I came several times to the situation where uPyCraft was not seeing or recognizing software on ESP32 and it was suggesting me to burn firmware. First i did it couple of times, then it works for a while and suddenly looses ESP32 again. It still sees COM port that ESP32 is connected to, PC also shows that specific COM PORT active.
Since that ESP32 is programmed to publish simple mqtt message every 5 sec, I can still see messages coming to mqtt broker. Meaning that ESP32 does what it is intended to do, so it has all files in tact.
I have thought usb cable is faulty. It can not be that it is just a power usb cable (without data) as I used same cable to program it. But I tried several cables anyway, same result. I have then thought that PC USB might not provide enough power to ensure communication, so I tried different USB on same PC. PC recognizes also I see COM port appear in uPyCraft, however, when I select it uPyCraft suggest me to burn firmware. I also tried external USB bridge with separate power supply, still the same.
So I got stuck a bit. Could that be that bitrate set in COM port settings might have something to do with it? I see that uPyCraft under Tools, Preferences, Serial baud is set by default on 115 200 ( I ceckon that is bits per second), while PC COM port settings has 9 600 bits per second.
Hello, thanks for providing all the details. The baud rate for MicroPython firmware is 115200, do not change it or try with a different baud rate, because it will not work.
It also looks like you’re using a good USB cable with data wires, otherwise you wouldn’t even see the board in your computer.
Basically, I think this is what’s happening: if you’re running a script in your board sometimes it’s busy running the script and performing the tasks.
So, you might need to try to open the COM port multiple times or restart the ESP to catch it available to establish the serial communication with uPyCraft IDE…
If you’re running a script that is using Wi-Fi or doing multiple tasks and try 3 or 4 times to establish the communication and you can’t, I usually re-flash the ESP with MicroPython…
I have then tried uPyLoader IDE and that connects successfully and sees/opens files inside ESP32. So it must be something wrong with uPyCraft settings I guess. I prefer uPyCraft due to its editor, that looks better than uPyLoader.
I rarely have that problem, but sometimes with a script that is running that uses a lot of resources, it takes some attempts to establish the serial communication with uPyCraft IDE…
It’s a limitation and a bit frustrating, but I still think it’s the best option to program the ESP with MicroPython.