I'd like to mark some log data with "after upload" when a boot came as a consequence of an upload, versus a "regular boot" like after the boot button pressed.
Is that possible? I am using the Arduino framework under platformio with an Espressif ESP32-dev board.
Can it be determined that a boot came as consequence of an upload?
-
- Posts: 826
- Joined: Mon Jul 22, 2019 3:20 pm
Re: Can it be determined that a boot came as consequence of an upload?
OTA doesn't actually restart the system when complete, you have to do that. So, there's not really any way to signal that, and it isn't really a good method to use anyhow (someone might unplug the device after upgrading, and then you miss it).
Why not just throw a flag into nvs/Preferences after the upload is complete, and process for that at startup?
Why not just throw a flag into nvs/Preferences after the upload is complete, and process for that at startup?
Re: Can it be determined that a boot came as consequence of an upload?
Setting a flag is what I want, but I am not talking about OTA (which I use and it works). I have the ESP connected via USB cable. After modifying my code I compile, build and upload (all under platformio in vscode). Then the ESP automatically boots. It is this boot which I want to register, and not any other boots, be they after a crash, or after intentional reboot via code, or after pressing the boot button.
Is that possible?
Is that possible?
Who is online
Users browsing this forum: No registered users and 131 guests