I am now using uPYCraft to flash the ESP32 firmware and down load boot.py, main.py, and umqttsimple.py. I now want to place this ESP32 in a remote location within my house without being physically connected to a PC. Once in this remote location and I connect battery power to the ESP32, how can I remote flash it, down load the Python programs and start program execution?
It appears when power is removed from the ESP32, the firmware and Python programs are wiped from memory.
I’m using a ESP-WROOM 32 Dev Kit.
I have searched the last couple of days.
After further investigation I’m going to answer my question from yesterday.
- When the ESP-WROOM 32 Dev Kit is Flashed, and downloaded with main.py and boot.py with uPyCraft, the ESP will retain this software if power is removed by pulling the micro USB cord from it.
- The next time the micro USB cord is plugged into the ESP or when +5 battery power is applied to the ESP Vcc pin, the ESP will automatically boot-up and run main.py .
- Now if you plug the micro USB cord into the ESP and select a port connection to uPyCraft app, uPyCraft will force you to re-Flash the ESP and re-load boot.py and main.py.
- I tested this on a second ESP Dev Kit and the above observations are consistent.
- Should you ever want to reload the ESP Dev Kit, when you have it deployed around the house, you will need to retrieve it and connect it to a PC to reload with new software.
- Best I can tell it is not possible to perform Over-The-Air (OTA) software updates to the ESP. If I’m wrong please correct me.
- On a different thread, I noticed I do not need to press the ESP board “EN” bottom for Flashing and having the ESP start main.py execution when power is re-applied.
Thanks for sharing your observations.
I think it is possible to perform OTA updates with MicroPython. The problem is that you want to update new files and not reflash or overwrite the firmware. I found this discussion: https://forum.micropython.org/viewtopic.php?t=7979
Unfortunately, I’m not familiar with OTA updates with MicroPython and we don’t have any resources about that.
I’m sorry that I can’t help much.
Thank You for the reply. I agree with you. After a furtherer search, a YouTube search for “ESP32 MicroPython OTA” yielded a few Vids on this topic. OTA is enabled by downloading an OTA “.py” file. It appears the Vid authors have developed this OTA “.py” and made available on GitHub. For the time being I have enough information to keep me going.
On a side note, I wish to express how impressed I am with the work you and Rui are doing. You two do amazing work. Your website and detailed project examples has saved me countless hours in coming up the ESP32 learning curve. Thank You. If you ever happen to be in the Minneapolis – St Paul region of the United States, please send me an Email, I’ll buy you two dinner.
I’m glad you found out a solution. I have to take a look at that too.
Thanks for your nice words and for welcoming us in your state. Maybe one day we’ll visit the USA.
I’ll mark this issue as resolved.
If you need further help, you just need to open a new question in our forum.