Actualizar 30 sensores ESP32 de habitación sin escalera: ¿de verdad tengo que enviar el .bin por MQTT?
Traducido del English por IA ·
Nuestro hotel tiene 30 placas ESP32 en los techos (temperatura, humedad, un contacto de puerta en algunas habitaciones), todas en Hermetry. El contratista que las instaló se marchó, y ahora necesitamos cambiar el intervalo de envío de datos y corregir un error: no se reconectan después de que el router se reinicie. Hasta ahora, cada actualización significaba una escalera y un portátil en 30 habitaciones.He encontrado muchos ejemplos de «OTA sobre MQTT» que dividen el .bin en fragmentos y los publican en el dispositivo. Parece complicado, y nuestro encargado de mantenimiento teme dejar inutilizadas placas situadas encima de las camas de los huéspedes. ¿Ofrece Hermetry algo para esto, o tengo que construir yo la lógica de fragmentos? No soy desarrollador, pero nuestro encargado de mantenimiento puede grabar un ESP32 si alguien le indica qué poner en el código.
Our hotel has 30 ESP32 boards in the ceilings (temperature, humidity, a door contact for some rooms), all on Hermetry. The contractor who built them left, and now we need to change the reporting interval and fix a bug where they don’t reconnect after the router reboots. Every update so far meant a ladder and a laptop in 30 rooms.
I found lots of «OTA over MQTT» examples that cut the .bin into chunks and publish it to the device. That looks complicated and our maintenance guy is nervous about bricking boards above guests’ beds. Does Hermetry have something for this, or do I have to build the chunk thing? I’m not a developer, but our maintenance guy can flash an ESP32 if someone tells him what to put in the code.
Traducido del English por IA ·
Hermetry tiene actualizaciones de firmware integradas, he visto un elemento Firmware en el menú IoT. Sin embargo, no tengo idea de cómo funciona el lado del dispositivo.
Hermetry has firmware updates built in, I’ve seen a Firmware item in the IoT menu. No idea how the device side works though.
Traducido del English por IA ·
No envíe el .bin por MQTT. La OTA de Hermetry indica al dispositivo dónde descargar la imagen por HTTPS, y el dispositivo hace el resto. Hice 140 controladores de armarios de calle de esta forma el año pasado. Las piezas:Lado de Hermetry (un Admin, y un Owner una vez para la clave):
- Perfil de los sensores de sala, pestaña Firmware: active «Permitir actualizaciones de firmware para este perfil». Deje desactivadas las imágenes sin firmar.
- Firmware > Signing keys: el Owner añade su clave pública Ed25519. Usted firma cada .bin en su portátil y sube el .sig junto con él. Hermetry nunca guarda la clave privada.
- Subir firmware: Name debe coincidir con lo que la placa informa como su título de firmware, por ejemplo
room-sensor, Version por ejemplo2.1.0. - Asígnelo, primero a One device (el de su oficina), luego a todo el perfil.
Lado del dispositivo, una vez con escalera, y después nunca más. La placa recibe estos atributos compartidos en v1/attributes/set:
{"fw_title":"room-sensor","fw_version":"2.1.0","fw_size":1183744,
"fw_checksum":"9c1e...","fw_checksum_algorithm":"SHA256",
"fw_url":"https://...","fw_sig":"..."}
Su código entonces: informe fw_state DOWNLOADING con fw_progress, descargue fw_url con HTTPClient en la partición OTA usando Update.h, verifique el SHA-256 y la firma, informe VERIFIED, luego UPDATING y reinicie. Tras el reinicio publique current_fw_title y current_fw_version. Hermetry solo marca la actualización como Updated cuando aparece esa nueva versión. Si algo falla, informe FAILED con fw_error y mantenga la imagen anterior.Advertencias: fw_url es válida durante 15 minutos, así que si una descarga se atasca, pida de nuevo fw_url en v1/attributes/req/1 y reanude con una petición HTTP Range. Además, el firmware nunca se ofrece por MQTT sin cifrar, así que las placas deben usar TLS.Página completa: Firmware updates (OTA)
Don’t push the .bin over MQTT. Hermetry’s OTA tells the device where to download the image over HTTPS and the device does the rest. I did 140 street-cabinet controllers this way last year. The parts:
Hermetry side (an Admin, and an Owner once for the key):
- Profile of the room sensors, Firmware tab: turn on «Allow firmware updates for this profile». Leave unsigned images off.
- Firmware > Signing keys: the Owner adds your Ed25519 public key. You sign each .bin on your laptop and upload the .sig with it. Hermetry never holds the private key.
- Upload firmware: Name must equal what the board reports as its firmware title, e.g.
room-sensor, Version e.g.2.1.0. - Assign it, first to One device (the one in your office), later to the whole profile.
Device side, once by ladder, after that never again. The board gets these shared attributes on v1/attributes/set:
{"fw_title":"room-sensor","fw_version":"2.1.0","fw_size":1183744,
"fw_checksum":"9c1e...","fw_checksum_algorithm":"SHA256",
"fw_url":"https://...","fw_sig":"..."}
Your code then: report fw_state DOWNLOADING with fw_progress, download fw_url with HTTPClient into the OTA partition using Update.h, check SHA-256 and the signature, report VERIFIED, then UPDATING, reboot. After the reboot publish current_fw_title and current_fw_version. Hermetry only marks it Updated when that new version shows up. If anything fails, report FAILED with fw_error and stay on the old image.
Gotchas: fw_url is valid 15 minutes, so if a download stalls, ask for fw_url again on v1/attributes/req/1 and resume with an HTTP Range request. And firmware is never offered over plain MQTT, so the boards need to be on TLS.
Full page: Firmware updates (OTA)
Traducido del English por IA ·
Y una vez que funcione en uno, usa «Enviar en oleadas» para el perfil, de modo que si la nueva versión es mala, se detenga después de las primeras habitaciones.
And once it works on one, use «Send in waves» for the profile, so if the new version is bad it stops after the first few rooms.
Traducido del English por IA ·
Nuestro encargado de mantenimiento hizo la ronda con escalera el mes pasado con el firmware compatible con OTA. Ayer subimos primero la 2.1.1 (la corrección de reconexión) a la placa de mi oficina y luego al perfil en tandas de 5. Las 30 muestran Updated, sin escalera. Una sala dio «No answer in time» porque el personal de limpieza desenchufó la placa; se actualizó a la mañana siguiente, al volver a conectarse. La primera carga fue rechazada porque el Name era «Room-Sensor» con mayúsculas y las placas reportan «room-sensor».
Our maintenance guy did the ladder round last month with the OTA-capable firmware. Yesterday we pushed 2.1.1 (the reconnect fix) to my office board first, then to the profile in waves of 5. All 30 show Updated, no ladder. One room went «No answer in time» because the board was unplugged by housekeeping, it updated the next morning when it came back. The first upload was refused because the Name was «Room-Sensor» with capitals and the boards report «room-sensor».
- Debes estar registrado para responder a este debate.
Únete a la conversación
Inicia sesión para preguntar y responder, dar me gusta a las publicaciones útiles y marcar la respuesta que resolvió tu problema. Cada aportación suma puntos y niveles.

