brooksdata
@megan_b40 · Mitglied seit September 2025
Data analyst · water and wastewater
- Themen
- 2
- Antworten
- 47
- Punkte
- 0
Erstellte Forenantworten
Von English mit KI übersetzt ·
Der Log-Tab erspart einem so viel Raterei. +1
The Log tab saves so much guessing. +1
Von English mit KI übersetzt ·
Dasselbe Problem: Zwei meiner Backpacks vom selben Verkäufer hatten 0x3F.
Same experience, two of my backpacks from the same seller were 0x3F.
Von English mit KI übersetzt ·
Gleiche Physik wie bei Davids Lautsprecher, ja. Der HF-Burst wird von der Eingangsstufe des ADC (oder einem beliebigen Halbleiterübergang in der Leitung) gleichgerichtet, und das zeigt sich als DC-Offset für die Dauer des Bursts. 2G-artige Bursts bei 217 Hz sind am schlimmsten, aber auch LTE-Uplink-Bursts verursachen das. In einem Schaltschrank, den ich bei der Arbeit betreue, sah es genau so aus wie bei dir, Spitzen nur während der Uploads.Was bei uns geholfen hat, vom günstigsten zum teuersten:
- Die Antenne aus dem Schaltschrank herausholen. Eine Antenne mit kurzem Kabel auf dem Dach des Schaltschranks. In einem Stahlkasten schreit der Router aus 30 cm Entfernung deine Verkabelung an.
- Geschirmte verdrillte Leitung für die 4-20-mA-Strecke, Schirm nur am Steuerungsende erden.
- Ein RC-Filter direkt am ADC-Pin, 1 k und 100 nF, dazu ein 100-pF-Kondensator nahe am Pin für die HF selbst. Dein Füllstand ändert sich nicht in Millisekunden, das kannst du dir leisten.
- Ein Clip-Ferrit auf dem Signalpaar dort, wo es in die Steuerung eintritt.
- Falls der Router eine Einstellung hat, mit der er auf LTE fixiert wird und nicht auf 2G zurückfällt, nutze sie.
Nach den ersten beiden Maßnahmen waren die Spitzen bei uns verschwunden. Alte Spitzen bleiben in deiner Historie erhalten. Falls jemand auf diesen Füllstand einen Alarm gesetzt hat, prüfe, ob sie ihn ausgelöst haben. Eine Entprellung von 2 oder 3 aufeinanderfolgenden Messwerten bei der Hochstandsregel verbirgt jeden verbliebenen Einzelwert.
Same physics as David’s speaker, yes. The RF burst gets rectified by the input stage of the ADC (or any semiconductor junction on the line), and that shows up as a DC offset for the length of the burst. 2G-style bursts at 217 Hz are the worst, but LTE uplink bursts do it too. A cabinet I look after at work had exactly your picture, spikes during uploads only.
What fixed ours, cheapest first:
- Get the antenna out of the cabinet. A short-cable antenna on the cabinet roof. Inside a steel box the router is shouting at your wiring from 30 cm.
- Shielded twisted pair for the 4-20 mA run, shield grounded at the controller end only.
- An RC filter right at the ADC pin, 1 k and 100 nF, plus a 100 pF cap close to the pin for the RF itself. Your level doesn’t change in milliseconds, you can afford it.
- A clip-on ferrite on the signal pair where it enters the controller.
- If the router has a setting to lock it to LTE and not fall back to 2G, use it.
After the first two the spikes were gone for us. Old spikes stay in your history, so if anyone set an alarm on that level, check whether they were tripping it. A readings-in-a-row debounce of 2 or 3 on the high-level rule hides any single leftover.
Von English mit KI übersetzt ·
Ist dafür nicht das Custom topics im Profil gedacht? Ich erinnere mich an eine Einstellung, die jedes Topic außerhalb von v1/ akzeptiert.
Isn’t that what Custom topics on the profile are for? I remember a setting that accepts any topic outside v1/.
Von English mit KI übersetzt ·
Hast du an einem der beiden Enden Abschluss und Bias?
Do you have termination and bias on either end?
Von English mit KI übersetzt ·
Der eigentliche erste Schritt ist also ein Datensatz. Du hast in Hermetry bereits wochenlange Messwerte, es fehlen nur die Labels: Die Ein- und Auscheckzeiten der Housekeeping würden genügen.
So the real first step is a dataset. You already have weeks of readings in Hermetry, you just need labels: housekeeping’s check-in/check-out times would do.
Von English mit KI übersetzt ·
Wir haben unsere mit der fertigen Lösung Personnel tracking umgesetzt, für die Raumebene brauchten wir Safe nicht.
We did ours with the Personnel tracking ready solution, didn’t need Safe for room-level.
Von English mit KI übersetzt ·
Auf der Hermetry-Seite solltest du prüfen, ob battery_v als Zahl gesendet wird. Ich habe schon erlebt, dass es als Text „11.9V“ rausging, und dann funktioniert nichts.
On the Hermetry side, check battery_v is sent as a number. I’ve seen it go out as „11.9V“ text before and then nothing works.
Von English mit KI übersetzt ·
Genau das ist das Problem, ich habe bei meinem ersten Aufbau exakt dasselbe gemacht. Die I2C-Pins sind physischer Pin 3 (das ist BCM GPIO2, SDA) und physischer Pin 5 (BCM GPIO3, SCL). Du hast SDA an GPIO3 angeschlossen, das in Wirklichkeit SCL ist, und SCL an GPIO5, das physischer Pin 29 ist und überhaupt nicht I2C. Deshalb antwortet auf dem Bus kein Gerät und du bekommst das leere Raster. Die Sensoren sind mit ziemlicher Sicherheit in Ordnung.Verschiebe SDA auf physischen Pin 3 und SCL auf physischen Pin 5, dann solltest du 0x77 (oder 0x76, je nach SDO-Jumper) für den BME280 und 0x10 für den VEML7700 sehen. Der Pi hat an diesen beiden Pins bereits 1,8 kΩ Pull-up-Widerstände, und die Breakouts bringen ihre eigenen mit, also keine weiteren hinzufügen.Das Auslesen und Senden ist dann kurz. Ich verwende die Adafruit-CircuitPython-Treiber plus paho:
import json, time, board, adafruit_bme280.basic as bme, adafruit_veml7700
import paho.mqtt.client as mqtt
i2c = board.I2C()
env = bme.Adafruit_BME280_I2C(i2c, address=0x77)
lux = adafruit_veml7700.VEML7700(i2c)
c = mqtt.Client(client_id="lab-env-01")
c.username_pw_set(TOKEN) # token as username, no password
c.tls_set()
c.connect(BROKER_HOST, 8883, 60)
c.loop_start()
while True:
msg = {"temp_c": round(env.temperature, 2), "rh": round(env.humidity, 1),
"pressure_hpa": round(env.pressure, 1), "lux": round(lux.lux, 1)}
c.publish("v1/telemetry", json.dumps(msg), qos=1)
time.sleep(30)
Flaches Objekt, daher stempelt Hermetry es mit der Empfangszeit, was für 30-s-Messwerte passt. Die Payload-Regeln findest du hier, falls du später Zeitstempel ergänzen willst: MQTT topics and payload reference.
That’s the problem, I did exactly the same thing on my first build. The I2C pins are physical pin 3 (that’s BCM GPIO2, SDA) and physical pin 5 (BCM GPIO3, SCL). You have SDA on GPIO3, which is actually SCL, and SCL on GPIO5, which is physical pin 29 and not I2C at all. So the bus has no device answering and you get the empty grid. The sensors are almost certainly fine.
Move SDA to physical pin 3 and SCL to physical pin 5, then you should see 0x77 (or 0x76, depends on the SDO jumper) for the BME280 and 0x10 for the VEML7700. The Pi has 1.8 kΩ pull-ups on those two pins already, and the breakouts add their own, so don’t add more.
Then reading and sending is short. I use the Adafruit CircuitPython drivers plus paho:
import json, time, board, adafruit_bme280.basic as bme, adafruit_veml7700
import paho.mqtt.client as mqtt
i2c = board.I2C()
env = bme.Adafruit_BME280_I2C(i2c, address=0x77)
lux = adafruit_veml7700.VEML7700(i2c)
c = mqtt.Client(client_id="lab-env-01")
c.username_pw_set(TOKEN) # token as username, no password
c.tls_set()
c.connect(BROKER_HOST, 8883, 60)
c.loop_start()
while True:
msg = {"temp_c": round(env.temperature, 2), "rh": round(env.humidity, 1),
"pressure_hpa": round(env.pressure, 1), "lux": round(lux.lux, 1)}
c.publish("v1/telemetry", json.dumps(msg), qos=1)
time.sleep(30)
Flat object, so Hermetry stamps it with the receive time, fine for 30 s readings. Payload rules are here if you want to add timestamps later: MQTT topics and payload reference.
Von English mit KI übersetzt ·
Haha, gut, dass mich jemand korrigiert hat. Ich werde mir „aus Sicht des Pi“ merken.
Ha, good that someone corrected me. I’ll remember „from the Pi’s view“.
Von English mit KI übersetzt ·
WiFiManager fällt erneut auf das Portal zurück, wenn keine Verbindung hergestellt werden kann, das ist bereits abgedeckt.Bei den Zugangsdaten ist ein gemeinsamer Token schlechter als gar keiner. Hermetry erlaubt pro Gerät nur eine Sitzung, daher werfen sich 30 Boards mit demselben Token ständig gegenseitig raus. Verwenden Sie stattdessen das Provisioning des Profils. Sie flashen dieselbe Firmware mit dem Provisioning-Schlüssel und -Secret des Profils, und jedes Board fordert beim ersten Start seine eigene Zugangsdaten an:
// first boot only, after Wi-Fi is up
// MQTT connect: username "provision", empty password, TLS
subscribe("v1/provision/res");
publish("v1/provision/req",
"{"deviceName":"logger-" + chipId + "","
""provisionDeviceKey":"pk_...","provisionDeviceSecret":"ps_..."}");
// answer: {"status":"SUCCESS","credentialsType":"ACCESS_TOKEN","credentialsValue":"..."}
// store credentialsValue in NVS, reconnect with it, never provision again
Im Reiter Provisioning des Profils wählen Sie eine Strategie. Mit Neue Geräte erstellen erlauben landet jedes neue Board in Quarantäne, und seine Daten werden verworfen, bis ein Administrator es aktiviert. Mit Nur vorab bereitgestellte Geräte legen Sie die Namen logger-<chipId> für Ihre 30 Boards vorab an, und ein geleakter Schlüssel kann keine Fremden hinzufügen. Für 30 Geräte würde ich sie vorab anlegen. Hermetry stellt für einen bestehenden Namen nie ein neues Zugangsdatum aus, bewahren Sie den Token daher sicher im NVS auf. Details unter Geräte hinzufügen und beanspruchen.
WiFiManager falls back to the portal again if it can’t join, that part’s handled.
For the credential, one shared token is worse than wrong. Hermetry allows one session per device, so 30 boards on one token keep throwing each other off. Use the profile’s provisioning instead. You flash the same firmware with the profile’s provisioning key and secret, and each board asks for its own credential on first start:
// first boot only, after Wi-Fi is up
// MQTT connect: username "provision", empty password, TLS
subscribe("v1/provision/res");
publish("v1/provision/req",
"{"deviceName":"logger-" + chipId + "","
""provisionDeviceKey":"pk_...","provisionDeviceSecret":"ps_..."}");
// answer: {"status":"SUCCESS","credentialsType":"ACCESS_TOKEN","credentialsValue":"..."}
// store credentialsValue in NVS, reconnect with it, never provision again
On the profile’s Provisioning tab you pick a strategy. With Allow creating new devices, each new board lands in quarantine and its data is dropped until an admin activates it. With Only pre-provisioned devices you create logger-<chipId> names beforehand from your 30 boards, and a leaked key can’t add strangers. For 30 units I’d pre-create them. Hermetry never re-issues a credential for an existing name, so keep the token safe in NVS. Details on Adding and claiming devices.
Von English mit KI übersetzt ·
Daniel hat recht. Ich hatte genau dieses Problem letztes Jahr auf einem Pi in einer Pumpstation. Zwei Dinge konfigurieren eth0: dhcpcd startet beim Booten, findet keinen DHCP-Server, weist dem Port eine Link-Local-Adresse 169.254.x.x sowie Routen zu, und dann versucht ifup, seine eigene Adresse und Standardroute hinzuzufügen. Die Route existiert bereits, daher antwortet der Kernel mit „File exists“ und ifup gibt auf. Je nachdem, welcher Prozess beim Booten das Rennen gewinnt, kommt das Gateway hinaus oder nicht.Entscheiden Sie sich für eines. Unter Bullseye heißt das dhcpcd. Entfernen Sie den eth0-Block aus /etc/network/interfaces (die Datei enthält dann nur noch die Zeile source) und legen Sie das statische Setup in /etc/dhcpcd.conf ab:
interface eth0
static ip_address=10.40.2.20/24
static routers=10.40.2.1
static domain_name_servers=10.40.2.1
noipv4ll
Anschließend ohne Neustart aufräumen:
sudo ip addr flush dev eth0
sudo systemctl restart dhcpcd
ip addr show eth0
noipv4ll verhindert die 169.254-Adresse. Wenn Sie später auf Bookworm umsteigen, ist dhcpcd entfernt, und Sie machen dasselbe mit nmcli. Notieren Sie sich das deshalb.
Daniel has it. I hit exactly this on a pumping station Pi last year. Two things are configuring eth0: dhcpcd starts at boot, finds no DHCP server and gives the port a 169.254 link-local address plus routes, and then ifup tries to add its own address and default route. The route is already there, so the kernel answers „File exists“ and ifup gives up. Depending on which one wins the race at boot, your gateway gets out or not.
Pick one. On Bullseye that means dhcpcd. Remove the eth0 block from /etc/network/interfaces (leave the file with only the source line) and put the static setup in /etc/dhcpcd.conf:
interface eth0
static ip_address=10.40.2.20/24
static routers=10.40.2.1
static domain_name_servers=10.40.2.1
noipv4ll
Then clean up without a reboot:
sudo ip addr flush dev eth0
sudo systemctl restart dhcpcd
ip addr show eth0
noipv4ll stops the 169.254 address. If you move to Bookworm later, dhcpcd is gone and you do the same with nmcli, so keep a note of that.
Von English mit KI übersetzt ·
Beides sind Ihre Probleme, ich hatte letztes Jahr dasselbe Paar an batteriebetriebenen Wasserzähler-Tags.Strom: Wenn das UART-Peripheriegerät aktiviert ist, bleibt der HF-Takt eingeschaltet, das allein sind im aktiven Zustand hunderte uA und im Leerlauf zehn uA. Setzen Sie im Release-Build CONFIG_SERIAL=n und CONFIG_LOG=n (oder CONFIG_PM_DEVICE und suspendieren Sie die UART). Aktivieren Sie außerdem den DC/DC-Wandler (CONFIG_BOARD_ENABLE_DCDC=y, dafür muss die Spule auf Ihrer Platine bestückt sein) und achten Sie darauf, dass nicht genutzte GPIOs nicht floaten. Damit sind wir von etwa 35 uA auf 3 uA gekommen.Online-Status: Bei untergeordneten Geräten übernimmt Hermetry den Online-Status aus den Nachrichten v1/gw/connect und v1/gw/disconnect des Gateways. Ihr Gateway meldet also, dass die Tags verschwunden sind. Bei 60 s Advertising und einem 60 s Timeout bedeutet ein verpasstes Advertisement bereits eine Trennung. Lassen Sie das Gateway 5 verpasste Advertisements abwarten, bevor es die Trennung sendet.Für den Alarm stellen Sie bei der Regel „Gerät offline“ bei „Öffnen nach“ etwa 900 Sekunden ein, damit eine kurze Lücke niemanden alarmiert. Mehr dazu, wie der Status untergeordneter Geräte funktioniert: Gateways and devices behind a gateway.
Both of those are your problems, I had the same pair on battery water meter tags last year.
Current: the UART peripheral being enabled keeps the HF clock up, that alone is hundreds of uA when active and tens when idle. Set CONFIG_SERIAL=n and CONFIG_LOG=n in the release build (or CONFIG_PM_DEVICE and suspend the UART). Also enable the DC/DC (CONFIG_BOARD_ENABLE_DCDC=y, needs the inductor fitted on your board), and make sure unused GPIOs aren’t floating. That got us from about 35 uA to 3.
Online status: for child devices Hermetry takes the online state from the gateway’s v1/gw/connect and v1/gw/disconnect messages, so your gateway is telling it the tags are gone. With 60 s advertising and a 60 s timeout, one missed advert means a disconnect. Make the gateway wait for 5 missed adverts before sending disconnect.
For the alarm, set the Device offline rule’s Open after to something like 900 seconds so a short gap doesn’t page anyone. More on how child status works: Gateways and devices behind a gateway.
Von English mit KI übersetzt ·
Und halte die Batches vernünftig klein: Der Standardwert liegt bei 10 Nachrichten pro Sekunde und Gerät. Ein großer Rückstau auf einmal wird verworfen.
And keep the batches reasonable, the default is 10 messages a second per device. A big backlog in one go gets dropped.
Von English mit KI übersetzt ·
Von der Datenseite: Egal, wofür Sie sich entscheiden, lassen Sie das Gateway beim Abfragen ts setzen, dann landen verspätete Uploads nach einem Wi-Fi-Abbruch am Gateway zur richtigen Zeit.
From the data side: whatever you choose, have the gateway stamp ts when it polls, then late uploads after a Wi-Fi drop at the gateway land at the right time.

