Closed rmi1974 closed 9 months ago
Hmm, could you try to get exact headers that tasmota sends? I'd like to make unit test...
Initially i designed that parsing for my own version string format like here:
(i.e. fw:1.2.3 hw:1.0 core:foo
)
@rmi1974 i think should be fixed now. Could you please check?
Hello @vooon
thanks for the bugfix, I can confirm it works. Here are the requested log entries for completeness:
esp-ota-server | 2024-01-23T20:28:08.430279000Z {"time":"2024-01-23T20:28:08.42934969Z","level":"-","prefix":"echo","file":"server.go","line":"79","esp_request_headers":{"Connection":["close"],"Content-Length":["0"],"User-Agent":["ESP8266-http-Update"],"X-Esp8266-Ap-Mac":["82:64:6F:81:17:65"],"X-Esp8266-Chip-Id":["8460133"],"X-Esp8266-Chip-Size":["2097152"],"X-Esp8266-Free-Space":["372736"],"X-Esp8266-Mode":["sketch"],"X-Esp8266-Sdk-Version":["2.2.2-dev(38a443e)"],"X-Esp8266-Sketch-Md5":["75527e3d45b55bbcfac9162494214fcc"],"X-Esp8266-Sketch-Size":["655248"],"X-Esp8266-Sta-Mac":["80:64:6F:81:17:65"],"X-Esp8266-Version":["13.3.0.3(tasmota)"]}}
esp-ota-server | 2024-01-23T20:28:08.436067000Z {"time":"2024-01-23T20:28:08.435672611Z","level":"-","prefix":"echo","file":"server.go","line":"104","esp_version_map":{"ver":"13.3.0.3(tasmota)"}}
esp-ota-server | 2024-01-23T20:31:37.907449000Z {"time":"2024-01-23T20:31:37.90687794Z","level":"-","prefix":"echo","file":"server.go","line":"79","esp_request_headers":{"Connection":["close"],"Content-Length":["0"],"User-Agent":["ESP8266-http-Update"],"X-Esp8266-Ap-Mac":["9A:CD:AC:1D:2D:44"],"X-Esp8266-Chip-Id":["1912132"],"X-Esp8266-Chip-Size":["4194304"],"X-Esp8266-Free-Space":["1454080"],"X-Esp8266-Mode":["sketch"],"X-Esp8266-Sdk-Version":["2.2.2-dev(38a443e)"],"X-Esp8266-Sketch-Md5":["4d76b17c945b23a919214b0d9dfbc6e2"],"X-Esp8266-Sketch-Size":["639344"],"X-Esp8266-Sta-Mac":["98:CD:AC:1D:2D:44"],"X-Esp8266-Version":["13.3.0.3(tasmota-4M)"]}}
esp-ota-server | 2024-01-23T20:31:37.907905000Z {"time":"2024-01-23T20:31:37.906910568Z","level":"-","prefix":"echo","file":"server.go","line":"104","esp_version_map":{"ver":"13.3.0.3(tasmota-4M)"}}
esp-ota-server | 2024-01-23T20:32:17.709282000Z {"time":"2024-01-23T20:32:17.709054323Z","level":"-","prefix":"echo","file":"server.go","line":"79","esp_request_headers":{"Cache-Control":["no-cache"],"Connection":["close"],"User-Agent":["ESP32-http-Update"],"X-Esp32-Ap-Mac":["A0:B7:65:6C:5B:4D"],"X-Esp32-Chip-Size":["4194304"],"X-Esp32-Free-Space":["2949120"],"X-Esp32-Mode":["sketch"],"X-Esp32-Sdk-Version":["4.4.6.231011"],"X-Esp32-Sketch-Md5":["b5b226c6a084e2461a6cee7ace745600"],"X-Esp32-Sketch-Sha256":["F8FB136202B1C28EC2A55FEE31B76668B57E78D81DD6127FFB8753B99981E482"],"X-Esp32-Sketch-Size":["789424"],"X-Esp32-Sta-Mac":["A0:B7:65:6C:5B:4C"],"X-Esp32-Version":["13.2.0.1(safeboot)"]}}
esp-ota-server | 2024-01-23T20:32:17.709893000Z {"time":"2024-01-23T20:32:17.709086595Z","level":"-","prefix":"echo","file":"server.go","line":"104","esp_version_map":{"ver":"13.2.0.1(safeboot)"}}
Regards
Hello! Thanks for the nice little project.
I'm using the ESP OTA server for updating my OMG BLE gateways which works fine. The server is running in Docker container in my homelab.
I have various esp8266 and esp32 based "IOT" devices, flashed with Tasmota firmware. I've tried to use the OTA server as well for them to serve tasmota firmware images The tasmota firmware is built locally and deployed to the OTA server directory. My OTA folder structure looks like this:
Communication to tasmota devices is done via curl/http Tasmota Commands.
When requesting a firmware update over the same command interface (setting OTA url and initiating the update with special command), it doesn't work.
The server crashes when the binary is requested from the target device. Relevant part of crash:
Here is a case that works (OMG BLE device), with no "Version" data returned:
Apparently the OTA server code requires
Version
value(s) in specific format. It can't handle version strings of format13.3.0.3(tasmota-4M)
.The problem seems to be here:
https://github.com/vooon/esp-ota-server/blob/ff477f6b501de1e4dd16f18bc6c56d532746d1a1/server/server.go#L105
Maybe such cases, that is any non-conformant version data returned could be ignored and pretend there was no version data sent by the device.
Regards