• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Flash and execute main.py in a ESP32 without a PC connected

Q&A Forum › Category: ESP32 › Flash and execute main.py in a ESP32 without a PC connected
0 Vote Up Vote Down
Scott Dahl asked 4 years ago

Hello,
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.

Thanks,
Scott

Question Tags: #boot, Remote Flash
4 Answers
0 Vote Up Vote Down
Scott Dahl answered 4 years ago

Hello,
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,
Scott
 

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi Scott.
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.
Regards,
Sara

0 Vote Up Vote Down
Scott Dahl answered 4 years ago

Hi Sara,
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.
Thanks,
Scott
 

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi Scott.
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.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.