lewisfw
@lewis-e · Membre depuis mars 2026
Embedded developer · energy · 14 years in the field
- Sujets
- 1
- Réponses
- 37
- Points
- 0
Toutes mes réponses sur les forums
Traduit de English par IA ·
Utilisez les attributs partagés cfg.*, c’est exactement à cela qu’ils servent, et vous obtenez la vue valeur souhaitée / valeur remontée sans effort supplémentaire.Déclarez les clés dans l’onglet Configuration keys du profil (type, libellé, limites), puis définissez-les comme attributs partagés : cfg.telemetry.interval_s, cfg.pressure.deadband_bar, cfg.ntp.server. L’appareil reçoit les modifications sur v1/attributes/set, les applique et renvoie la valeur appliquée comme attribut client avec la même clé. Hermetry compare les deux et affiche pour chaque clé, dans l’onglet Attributes, les statuts In sync, Pending, Rejected ou Drifted.Côté appareil, après chaque connexion :
SUBSCRIBE v1/attributes/set
PUBLISH v1/attributes/req/1 {"sharedKeys": "cfg.*"}
# réponse sur v1/attributes/res/1 -> tout appliquer -> renvoyer :
PUBLISH v1/attributes {"cfg.telemetry.interval_s": 300, "cfg.pressure.deadband_bar": 0.05}
La requête envoyée après la connexion couvre vos sites isolés : un appareil resté hors ligne pendant trois jours demande toutes les clés cfg.* à son retour et rattrape son retard. Si un appareil ne peut pas appliquer une valeur, il la signale dans cfg_rejected, par exemple {"cfg_rejected": {"cfg.ntp.server": "apply_failed"}}, et la ligne affiche Rejected avec la raison. Appliquez les messages de manière idempotente, un message peut arriver deux fois.Pour 300 appareils, écrivez les valeurs avec l’API (POST …/attributes/shared, jusqu’à 100 clés par appel) dans une boucle sur la liste des appareils. Les écrans Baseline et tâches en masse sont destinés aux appareils qui publient un manifeste de réglages (appareils sous licence) ; avec votre propre firmware, cfg.* est la voie à suivre. La page Attributes contient le tableau des statuts.
Use cfg.* shared attributes, that’s exactly what they’re for, and you get the desired-vs-reported view for free.
Declare the keys on the profile’s Configuration keys tab (type, label, limits), then set them as shared attributes: cfg.telemetry.interval_s, cfg.pressure.deadband_bar, cfg.ntp.server. The device gets changes on v1/attributes/set, applies them, and reports the applied value back as a client attribute with the same key. Hermetry compares the two and shows In sync, Pending, Rejected or Drifted per key on the Attributes tab.
Device side, after every connect:
SUBSCRIBE v1/attributes/set
PUBLISH v1/attributes/req/1 {"sharedKeys": "cfg.*"}
# answer on v1/attributes/res/1 -> apply everything -> report back:
PUBLISH v1/attributes {"cfg.telemetry.interval_s": 300, "cfg.pressure.deadband_bar": 0.05}
The request after connect is what covers your rural sites: a unit that was offline for three days asks for all cfg.* keys when it comes back and catches up. If a unit can’t apply something, report it in cfg_rejected, e.g. {"cfg_rejected": {"cfg.ntp.server": "apply_failed"}}, and the row shows Rejected with the reason. Apply idempotently, a message can arrive twice.
For 300 units, write the values with the API (POST …/attributes/shared, up to 100 keys per call) in a loop over the device list. The baseline and bulk-job screens are for devices that publish a settings manifest (licensed devices), so with your own firmware cfg.* is the route. Attributes page has the status table.
Traduit de English par IA ·
C’était bien ça. Merci Serhat.
That was it. Thanks Serhat.
Traduit de English par IA ·
Le mien se connecte correctement, puis est déconnecté après deux ou trois messages gw. La télémétrie simple de l’appareil depuis le même boîtier fonctionne.
Mine connects fine and then gets disconnected after two or three gw messages. Plain device telemetry from the same box works.
Traduit de English par IA ·
Pour celui qui écrit le firmware : dédupliquez sur l’identifiant de requête. Une commande peut arriver deux fois. Conservez les 32 derniers identifiants pendant dix minutes et ignorez les répétitions. Je l’ai découvert avec une commande de redémarrage.
For whoever writes the firmware: dedupe on the request id. A command can arrive twice. Keep the last 32 ids for ten minutes and skip repeats. Learned that with a reboot command.
Traduit de English par IA ·
La jauge liée à la valeur A d’un appareil (en direct) réagit instantanément. Le tableau d’environ 40 appareils à côté accuse un retard allant jusqu’à 30 secondes. Est-ce que « Polled » dans la colonne Live de la documentation signifie cela ?
Gauge bound to A value of a device (live) reacts instantly. The table of about 40 devices next to it lags by up to 30 seconds. Is that what Polled in the docs’ Live column means?
Traduit de English par IA ·
Remarque : le même script écrit aussi dans journald lorsqu’il tourne en tant que service, et les codes couleur dans le journal sont gênants. La plupart des bibliothèques de journalisation permettent de désactiver la couleur lorsque stdout n’est pas un tty.
Side note: the same script also logs to journald when it runs as a service, and colour codes in the journal are annoying. Most logging libs let you turn colour off when stdout isn’t a tty.
Traduit de English par IA ·
Si le firmware de l’ESP32 utilise un DNS codé en dur comme 8.8.8.8, autorise-le aussi, sinon les capteurs échoueront après le déménagement et tu jureras que le pare-feu est correct.
If the ESP32 firmware uses a hardcoded DNS like 8.8.8.8, allow that too, or they’ll fail after the move and you’ll swear the firewall is fine.
Traduit de English par IA ·
Trois choses dans ce payload, j’ai buté sur deux d’entre elles avec des traqueurs de chariots élévateurs.La colonne Longitude de la carte prend lng par défaut, et Latitude prend lat. Tu envoies lon, donc chaque ligne n’a pas de longitude et est ignorée. Soit tu renommes la clé sur l’appareil, soit tu règles la colonne Longitude de la carte sur lon. Je renommerais sur l’appareil pour que chaque future carte fonctionne directement.Tu envoies les nombres sous forme de chaînes parce que tu construis le JSON avec String(). Un texte ressemblant à un nombre fonctionne souvent dans les comparaisons, mais envoie quand même de vrais nombres. Et String(float) donne deux décimales par défaut, soit environ un kilomètre. Toutes tes remorques se retrouveraient au même endroit.Et ne publie pas quand le fix n’est pas valide, sinon tu verras des remorques garées à 0,0 au large de l’Afrique chaque fois qu’une carte démarre dans un hangar.
if (gps.location.isValid() && gps.location.age() < 3000) {
char buf[96];
snprintf(buf, sizeof(buf), "{"lat":%.6f,"lng":%.6f,"spd_kmh":%.1f}",
gps.location.lat(), gps.location.lng(), gps.speed.kmph());
client.publish("v1/telemetry", buf);
}
snprintf avec %f fonctionne sur le core ESP8266, contrairement à l’Uno. Les réglages des cartes se trouvent sur Map cards.
Three things in that payload, I tripped on two of them with forklift trackers.
The map card’s Longitude column defaults to lng, Latitude to lat. You send lon, so every row has no longitude and gets skipped. Either rename the key on the device or set Longitude column to lon in the card. I’d rename on the device so every future board just works.
You’re sending the numbers as strings because you built the JSON with String(). Number-like text often works in comparisons, but send real numbers anyway. And String(float) gives two decimals by default, which is about a kilometre. Your trailers would all sit in the same spot.
And don’t publish when the fix isn’t valid or you’ll get trailers parked at 0,0 off Africa every time one boots in a shed.
if (gps.location.isValid() && gps.location.age() < 3000) {
char buf[96];
snprintf(buf, sizeof(buf), "{"lat":%.6f,"lng":%.6f,"spd_kmh":%.1f}",
gps.location.lat(), gps.location.lng(), gps.speed.kmph());
client.publish("v1/telemetry", buf);
}
snprintf with %f works on the ESP8266 core, unlike on an Uno. Card settings are on Map cards.
Traduit de English par IA ·
Vérifie aussi l’adaptateur ISP 10 broches vers 6 broches si tu en utilises un. J’en ai eu un dont MISO et MOSI étaient croisés, qui ne fonctionnait que par chance sur un type de carte.
And check the 10-to-6 pin ISP adapter if you use one. I’ve had one with MISO and MOSI crossed that worked only by luck on one board type.
Aoife’s question is the right one. Cold moves the crystals.
The four in RX:
RSSI is how strong the received signal is, read from RegRssiValue (0x11), value / 2 as negative dBm. AGC picks the LNA gain from that so strong signals don’t saturate the receiver; your 0x0E already has AgcAutoOn (bit 3) set, leave it. FEI (frequency error indicator, RegFeiMsb/Lsb 0x1D/0x1E) measures how far the incoming carrier is from where the receiver expects it. AFC uses that measurement to retune the receiver onto the signal, at the start of a packet if AfcAutoOn (bit 4) is set. Yours is off.
A plain crystal is good for maybe ±10 to 20 ppm, and drifts with temperature. At 868 MHz, 20 ppm is about 17 kHz. Probe and receiver drift differently on a cold morning, and once the offset plus your deviation falls outside a 10.4 kHz receive bandwidth, the packet is gone. That’s your dropouts.
RegRxConfig (0x0D) = 0x1E // AfcAutoOn + AgcAutoOn + preamble detect trigger
RegAfcBw (0x13) = wide enough to catch the offset before AFC (e.g. 41.7 kHz)
RegRxBw (0x12) = 20.8 kHz after AFC
// or simply widen RxBw if you don't want AFC
Then send the FEI and RSSI of each probe as values next to the moisture reading. In Hermetry a chart of FEI against air temperature shows you which probes drift; ours showed 11 kHz swings on two units before we changed anything.
Traduit de English par IA ·
Les réseaux invités dans les magasins ont souvent un portail captif ou déconnectent les clients au bout de quelques heures, les ESP32 vont donc rester bloqués là-bas. Vérifiez cela avant. Les capteurs doivent-ils communiquer avec quoi que ce soit dans le magasin, ou seulement sortir vers Internet ?
Guest networks in shops often have a captive portal or kick clients after a few hours, the ESP32s will hang there. Check that before. Do the sensors need to talk to anything in the store, or only out to the internet?
Traduit de English par IA ·
Vérifiez aussi quel bundle de CA le firmware américain épingle. S’il a épinglé le certificat du serveur régional au lieu d’utiliser un magasin de CA classique, il peut échouer sur l’hôte UE pour une autre raison.
Also check what CA bundle the US firmware pins. If they pinned their region’s server cert instead of using a normal CA store, it may fail on the EU host for a different reason.
For an EKF you check it locally, on the Jacobians at the current operating point, but the intuition matters more: with one level sensor you see the net flow dh/dt, and q_in and k*sqrt(h) both enter it additively.
Traduit de English par IA ·
Quelle température ? Chez nous, un Pi 4 a bridé à 80 C dans un boîtier en acier pendant l’été.
How hot? We had a Pi 4 throttle at 80 C inside a steel box in summer.
I have a drawer full of these, so here’s how they differ in practice.
HC-05: classic Bluetooth with the serial port profile, can be master or slave, configured with AT commands at 38400 when you hold the KEY/EN pin high at power-up. HC-06: classic SPP too, slave only, fewer AT commands, default 9600. HM-10: Bluetooth Low Energy, the « serial » data goes through characteristic FFE1. Lower power, but the Pi side has to speak BLE.
All three have 3.3 V logic on RX. Their breakout boards take 5 V on VCC, but put a divider on the Uno’s TX line (1k from the Uno, 2k to ground) before it goes into the module’s RX.
For your case the HC-06 is the least work. On the Pi:
sudo rfcomm bind 0 98:D3:31:F5:A2:10 1 # HC-06 address, channel 1
# /dev/rfcomm0 now behaves like a serial port
python3 -c "import serial; s=serial.Serial('/dev/rfcomm0', 9600); print(s.readline())"
Uno side, one line per reading so the Pi can split it easily:
Serial.print("flow_c="); Serial.print(tFlow, 2);
Serial.print(";return_c="); Serial.println(tReturn, 2);
If the Pi is already your gateway to Hermetry, report the heat pump as its own child device on v1/gw/telemetry rather than adding the keys to the Pi itself, then it gets its own page and alarms.

