Hamlabs / ArcticTracker-ESP32

Arctic Tracker on ESP32
GNU General Public License v3.0
36 stars 4 forks source link

OTA firmware upgrade issues #1

Closed ohanssen closed 5 years ago

ohanssen commented 5 years ago

I want to enable download and upgrade of firmware via the internet. Especially since I missed that I had to pull down two I/Os during FW upgrade when I designed the PCB. I could of course do this by shorting those two I/O pins on the ESP but it would be more convenient to use OTA.

I used the simple upgrade function and users can put the URL and the certiifcate into NVS flash using the web-interface. It works. However, there seems to be a problem when validating the certificate. The CN in the certificate doesn't seem to match the CN in the URL. I have tried with the domain hame and the IP adress. Tried and re-tried generating the (self-signed) certificate.

If I try to use HTTP instead of HTTPS, there is an issue with the magic first byte of the firmware file.

E (43106) esp_ota_ops: OTA image has invalid magic byte (expected 0xE9, saw 0xef

I have checked the file, also by using the URL, and have verified that the first byte is in fact 0xE9.

ohanssen commented 5 years ago

A closer look at what was returned in the HTTP call reveals that there is an issue with my router setup. The answer came from the router instead of the server when using the WIFI network.