timmbogner / Farm-Data-Relay-System

A system that uses ESP-NOW, LoRa, and other protocols to transport sensor data in remote areas without relying on WiFi.
MIT License
485 stars 108 forks source link

enhancement: OTA updates #61

Closed aviateur17 closed 1 year ago

aviateur17 commented 1 year ago

Would be good to support Over The Air updates for the MQTT gateway (as that has WiFi enabled by default) and eventually the UART gateway and remote devices. For the UART gateway and remote devices maybe have a button ( would need to be added and could support other functionality in addition) that, if held down for 5 seconds or so, would enable WiFi and receive OTA updates?

Thoughts?

thefeiter commented 1 year ago

OTA updates are quite powerful, I use them for the ESPs in my home.

But I think the Sensors, once working should be fine without OTA updates. And if you go to them to press a Button for updates, you could also be standing there with your laptop for 30 seconds to update via serial.

Also the WIFi range is not that big so you would have to bring the node closer to your router to update (assuming you have a more distributed network in the field).

aviateur17 commented 1 year ago

OTA updates are quite powerful, I use them for the ESPs in my home.

But I think the Sensors, once working should be fine without OTA updates. And if you go to them to press a Button for updates, you could also be standing there with your laptop for 30 seconds to update via serial.

Also the WIFi range is not that big so you would have to bring the node closer to your router to update (assuming you have a more distributed network in the field).

For the nodes I was thinking of running SoftAP mode and then connecting to the node via Wifi. I believe there's a web interface where you can just upload a bin file and be done with it. Easier than unplugging whatever power source it's on or connecting manually to the UART pins. Just reboot and hold down the button and then connect to the Wifi network created by the sensor and upload the bin file via the web interface. I think ESP rainmaker project also makes it simpler with QR code and BLE.

timmbogner commented 1 year ago

I think adding full OTA may be a bit extra at this point in time. The idea is that this system extends beyond WiFi and having a functionality that relies on it is sort of off-brand.

However, the concept of being able to reconfigure sensors in the field has been discussed in #15 . While the talk there is mostly about serial, I envision a way to get/set the config parameters via ESP-NOW as well.

timmbogner commented 1 year ago

I mean, actually with sensors I guess you are free to add whatever capability you like since it's just a library. Especially since it sounds like it would be a fully separate mode. I just don't think it's within the scope of FDRS to handle. Maybe for MQTT mode if it's super-unobtrusive.

timmbogner commented 1 year ago

Haha sorry for all the posts, but I misunderstood your post. If there's really a way to update via an AP mode web interface then I'm actually more interested. I didn't know that was possible.

aviateur17 commented 1 year ago

Low priority issue to be taken up later after higher priority jobs are completed.