Struggling to get some battery powered ESP8266 (Wemos D1) properly managed in my network. Since they are in deep sleep I have tried to follow the instructions on MQTT messaging to keep the nodes alive to perform OTA but no luck so far.
Are there are way to get the node to check an URL for an updated firmware and perform the OTA update with the firmware from that URL? Would be nice to have this done once a day for example.
I have monitoring of 10 beehives running on battery powered D1s waking up every 90 minutes to report temperature. Would be nice to have a way to flash them if needed without having to collect the boxes
Hello, this is something i wasl looking for in those days, but when i compile i have this problem:
Compiling .pioenvs/00-esp8285-batt-test/src/esphome/components/output/float_output.cpp.o
Compiling .pioenvs/00-esp8285-batt-test/src/esphome/components/rtttl/rtttl.cpp.o
Compiling .pioenvs/00-esp8285-batt-test/src/esphome/components/sntp/sntp_component.cpp.o
src/esphome/components/ota_http/ota_http.cpp: In function ‘bool esphome::ota_http::http_connect(HTTPClient*, std::string)’:
src/esphome/components/ota_http/ota_http.cpp:63:23: error: ‘const class String’ has no member named ‘compare’; did you mean ‘compareTo’?
63 | bool secure_ = url_.compare(0, 6, “https:”) == 0;
| ^~~~~~~
| compareTo
src/esphome/components/ota_http/ota_http.cpp:68:28: error: ‘using element_type = class WiFiClient’ {aka ‘class WiFiClient’} has no member named ‘setInsecure’
68 | wifi_client_secure_->setInsecure();
| ^~~~~~~~~~~
src/esphome/components/ota_http/ota_http.cpp:69:28: error: ‘using element_type = class WiFiClient’ {aka ‘class WiFiClient’} has no member named ‘setBufferSizes’
69 | wifi_client_secure_->setBufferSizes(512, 512);
| ^~~~~~~~~~~~~~
src/esphome/components/ota_http/ota_http.cpp:86:18: error: ‘client’ was not declared in this scope; did you mean ‘client_’?
86 | begin_status = client->begin(*wifi_client_, url_);
| ^~~~~~
| client_
*** [.pioenvs/00-esp8285-batt-test/src/esphome/components/ota_http/ota_http.cpp.o] Error 1
========================= [FAILED] Took 107.86 seconds =========================
i am using esphome v2023.6.4, woojtekk did you tried it?, this is something it will be perfect for many users
Hi, I encountered the same problem as you did. The library mentioned in the article does not seem to support ESP8266. I tried using it with ESP8266 but was not successful.
oarcher this is absolutely amazing. I reeeeeeaaaaalllly need it Any chance you can support esp-idf ? The devices I use need to have TLS as well, and as far as I am aware, the TLS support is only available for esp-idf.
I using ota_http on esp-01 and esp-d1 mini and it works perfectly.
Several of my devices work away from home using MQTT and a slow GPRS connection (mainly weather stations, irrigation monitoring and the like).
So far I have not had any problems.
Hi @oarcher
I tried your component and it throw the following error:
[21:38:09][D][button:010]: 'Firmware update' Pressed.
[21:38:09][D][esp32.preferences:114]: Saving 1 preferences to flash...
[21:38:09][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[21:38:09][D][ota_http:054]: Trying to connect to https://mywebpage.com.vn/firmwares/[mydeviceddns]/firmware.bin
[21:38:12][D][ota_http:101]: firmware is 1132272 bytes length.
[21:38:12][I][ota_http:111]: Progress: 0.1%
[21:38:12][E][ota_http:103]: Error code (131) writing binary data to flash at offset 4000 and size 1132272
[21:38:12][E][ota_http:150]: Abort OTA backend
[21:38:12][E][ota_http:153]: Abort http con
[21:38:12][E][ota_http:155]: previous safe mode didn't succed. ota_http skipped
[21:38:12][D][main:603]: This message should be not displayed(reboot)
My esphome configuration is here
ota_http:
button:
- platform: template
name: "Firmware update"
on_press:
then:
- ota_http.flash:
url: https://mywebpage.com.vn/firmwares/mydeviceddns/firmware.bin # revise it here
verify_ssl: false
- logger.log: "This message should be not displayed(reboot)"
Where does the problem occurred, please advise with thanks. (I doubt I used https, in fact I don’t have an http server)
Man thanks for your attention and support!
It looks like https://mywebpage.com… is just an example. You need to provide the http link you manage and where the OTA files will come from. Unless that is your web page and thats hilarious.
Hi,
I just removed the real web address and replace with this to avoid exposure to all on the working things!
But that was the response from log on the correct version.