what triggers an OTA update?
Posted: Sat Apr 21, 2018 12:12 am
I installed the esp-idf toolchain on my Windows 7 computer following the instructions on the esp-idf.readthedocs.io site. I can make, erase, flash, and run several of the example programs on my Sparkfun ESP32 Thing board, but I'm testing mainly with the "blink" program so I can see what version of "blink" is being executed at any given time based on the pattern of blue LED flashes that I programmed in the "blink.c" file.
Then to try the OTA updates, I run "make menuconfig" in the ota directory, and edit the Example Configuration (SSID, PW, server IP/port, and HTTP GET filename of "blink.bin"). I start the python SimpleHTTPServer and can browse the files in the build directory in a web browser, including "blink.bin". Then I "make erase_flash flash monitor" in the ota directory, and I see nothing but what appear to be success messages including "ota: Connect to WiFi! Start to Connect to Server", "Send GET request to server succeeded", and then two or three hundred lines of "ota: Have written image length xxxxx", etc. I can see it successfully downloaded my latest version of "blink.bin" based on the pattern of the LED blinks on the ESP32 board.
Next I disconnect the ESP32 from my computer's USB cable, and power the board from just a power supply. I can then edit "blink.c" with yet another set of time delay values for a new distinctive LED blink, then make "blink" again, resulting in a new "blink.bin" in the build directory. Then I reset the ESP32 board expecting it to connect to the python HTTP server via WiFi, download the new "blink.bin" file, and execute it, but it doesn't work. The ESP32 is still running the same version of blink downloaded previously via the USB cable.
My question is, "When I reset the ESP board, should it access the python HTTP server and download the latest version of "blink.bin" and execute it?" Or maybe I should just ask, "How is it supposed to work?"
Thanks,
Jim
Then to try the OTA updates, I run "make menuconfig" in the ota directory, and edit the Example Configuration (SSID, PW, server IP/port, and HTTP GET filename of "blink.bin"). I start the python SimpleHTTPServer and can browse the files in the build directory in a web browser, including "blink.bin". Then I "make erase_flash flash monitor" in the ota directory, and I see nothing but what appear to be success messages including "ota: Connect to WiFi! Start to Connect to Server", "Send GET request to server succeeded", and then two or three hundred lines of "ota: Have written image length xxxxx", etc. I can see it successfully downloaded my latest version of "blink.bin" based on the pattern of the LED blinks on the ESP32 board.
Next I disconnect the ESP32 from my computer's USB cable, and power the board from just a power supply. I can then edit "blink.c" with yet another set of time delay values for a new distinctive LED blink, then make "blink" again, resulting in a new "blink.bin" in the build directory. Then I reset the ESP32 board expecting it to connect to the python HTTP server via WiFi, download the new "blink.bin" file, and execute it, but it doesn't work. The ESP32 is still running the same version of blink downloaded previously via the USB cable.
My question is, "When I reset the ESP board, should it access the python HTTP server and download the latest version of "blink.bin" and execute it?" Or maybe I should just ask, "How is it supposed to work?"
Thanks,
Jim