brooksdata
@megan_b40 · Se unió el septiembre 2025
Data analyst · water and wastewater
- Temas
- 2
- Respuestas
- 47
- Puntos
- 0
Respuestas de foro creadas
Traducido del English por IA ·
La pestaña Log evita mucho adivinar. +1
The Log tab saves so much guessing. +1
Traducido del English por IA ·
Misma experiencia: dos de mis backpacks de el mismo vendedor eran 0x3F.
Same experience, two of my backpacks from the same seller were 0x3F.
Traducido del English por IA ·
La misma física que el altavoz de David, sí. La ráfaga de RF es rectificada por la etapa de entrada del ADC (o por cualquier unión semiconductora en la línea), y eso aparece como un offset de CC durante la duración de la ráfaga. Las ráfagas tipo 2G a 217 Hz son las peores, pero las ráfagas de subida de LTE también lo hacen. Un armario que superviso en el trabajo presentaba exactamente tu caso: picos solo durante las subidas de datos.Lo que nos solucionó el problema, de más barato a más caro:
- Saca la antena del armario. Una antena con cable corto en el techo del armario. Dentro de una caja de acero, el router le está gritando a tu cableado desde 30 cm.
- Par trenzado apantallado para el lazo de 4-20 mA, con la pantalla conectada a tierra solo en el extremo del controlador.
- Un filtro RC justo en el pin del ADC, 1 k y 100 nF, más un condensador de 100 pF cerca del pin para la propia RF. Tu nivel no cambia en milisegundos, así que te lo puedes permitir.
- Una ferrita de tipo clip en el par de señal donde entra al controlador.
- Si el router tiene una opción para fijarlo a LTE y que no vuelva a 2G, actívala.
Después de las dos primeras medidas, los picos desaparecieron en nuestro caso. Los picos antiguos permanecen en tu histórico, así que si alguien configuró una alarma sobre ese nivel, comprueba si la estaban disparando. Un antirrebote de 2 o 3 lecturas consecutivas en la regla de nivel alto oculta cualquier resto aislado.
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.
Traducido del English por IA ·
¿No es para eso la opción Custom topics del perfil? Recuerdo un ajuste que acepta cualquier topic fuera de v1/.
Isn’t that what Custom topics on the profile are for? I remember a setting that accepts any topic outside v1/.
Traducido del English por IA ·
¿Tienes terminación y polarización (bias) en alguno de los dos extremos?
Do you have termination and bias on either end?
Traducido del English por IA ·
Así que el verdadero primer paso es un conjunto de datos. Ya tienes semanas de lecturas en Hermetry, solo te faltan las etiquetas: los horarios de entrada y salida que registra limpieza bastarían.
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.
Traducido del English por IA ·
Nosotros hicimos el nuestro con la solución lista Personnel tracking; no necesitamos Safe para el nivel de sala.
We did ours with the Personnel tracking ready solution, didn’t need Safe for room-level.
Traducido del English por IA ·
Por el lado de Hermetry, comprueba que battery_v se envía como número. Ya he visto que se enviaba como texto «11.9V» y entonces nada funciona.
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.
Traducido del English por IA ·
Ese es el problema, yo hice exactamente lo mismo en mi primer montaje. Los pines I2C son el pin físico 3 (es el BCM GPIO2, SDA) y el pin físico 5 (BCM GPIO3, SCL). Tú tienes SDA en GPIO3, que en realidad es SCL, y SCL en GPIO5, que es el pin físico 29 y no es I2C en absoluto. Por eso el bus no tiene ningún dispositivo respondiendo y obtienes la cuadrícula vacía. Casi con toda seguridad los sensores están bien.Mueve SDA al pin físico 3 y SCL al pin físico 5; entonces deberías ver 0x77 (o 0x76, según el jumper SDO) para el BME280 y 0x10 para el VEML7700. La Pi ya tiene resistencias pull-up de 1,8 kΩ en esos dos pines, y las placas breakout añaden las suyas, así que no añadas más.Luego la lectura y el envío son breves. Uso los drivers de CircuitPython de Adafruit más 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)
Objeto plano, así que Hermetry le asigna la hora de recepción, lo cual sirve para lecturas de 30 s. Las reglas del payload están aquí si más adelante quieres añadir marcas de tiempo: 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.
Traducido del English por IA ·
Ja, qué bien que alguien me corrigiera. Recordaré «desde la perspectiva de la Pi».
Ha, good that someone corrected me. I’ll remember «from the Pi’s view».
Traducido del English por IA ·
WiFiManager vuelve a mostrar el portal si no puede conectarse, eso ya está resuelto.En cuanto a la credencial, un token compartido es peor que incorrecto. Hermetry permite una sola sesión por dispositivo, así que 30 placas con el mismo token se desconectan continuamente entre sí. Use mejor el aprovisionamiento del perfil. Grabe el mismo firmware con la clave y el secreto de aprovisionamiento del perfil, y cada placa solicitará su propia credencial en el primer arranque:
// 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
En la pestaña Provisioning del perfil eliges una estrategia. Con Permitir crear dispositivos nuevos, cada placa nueva entra en cuarentena y sus datos se descartan hasta que un administrador la active. Con Solo dispositivos preaprovisionados, creas de antemano los nombres logger-<chipId> para tus 30 placas, y una clave filtrada no puede añadir desconocidos. Para 30 unidades, yo los crearía de antemano. Hermetry nunca vuelve a emitir una credencial para un nombre existente, así que guarda el token a salvo en NVS. Detalles en Añadir y reclamar dispositivos.
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.
Traducido del English por IA ·
Daniel tiene razón. Me pasó exactamente esto en una Pi de una estación de bombeo el año pasado. Hay dos cosas configurando eth0: dhcpcd arranca con el sistema, no encuentra ningún servidor DHCP, asigna al puerto una dirección link-local 169.254 y rutas, y luego ifup intenta añadir su propia dirección y ruta por defecto. La ruta ya existe, así que el kernel responde «File exists» y ifup se rinde. Según cuál gane la carrera al arrancar, tu gateway sale o no.Elige uno. En Bullseye eso significa dhcpcd. Quita el bloque de eth0 de /etc/network/interfaces (el archivo debe quedar solo con la línea source) y pon la configuración estática en /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
Luego limpia sin reiniciar:
sudo ip addr flush dev eth0
sudo systemctl restart dhcpcd
ip addr show eth0
noipv4ll evita la dirección 169.254. Si más adelante pasas a Bookworm, dhcpcd ya no está y haces lo mismo con nmcli, así que anótalo.
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.
Traducido del English por IA ·
Ambos problemas son tuyos; yo tuve el mismo par en etiquetas de contadores de agua con batería el año pasado.Corriente: el periférico UART habilitado mantiene activo el reloj HF, lo que por sí solo supone cientos de uA en activo y decenas en reposo. Configura CONFIG_SERIAL=n y CONFIG_LOG=n en la compilación de release (o CONFIG_PM_DEVICE y suspende la UART). Además, activa el DC/DC (CONFIG_BOARD_ENABLE_DCDC=y, requiere que la bobina esté instalada en tu placa) y asegúrate de que los GPIO sin usar no queden flotando. Así pasamos de unos 35 uA a 3.Estado en línea: para los dispositivos hijos, Hermetry toma el estado en línea de los mensajes v1/gw/connect y v1/gw/disconnect de la pasarela, así que tu pasarela le está indicando que las etiquetas han desaparecido. Con anuncios cada 60 s y un tiempo de espera de 60 s, un anuncio perdido equivale a una desconexión. Haz que la pasarela espere a 5 anuncios perdidos antes de enviar la desconexión.Para la alarma, establece en la regla Dispositivo fuera de línea el valor de Abrir después en algo como 900 segundos, para que una pausa breve no avise a nadie. Más información sobre cómo funciona el estado de los dispositivos hijos: 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.
Traducido del English por IA ·
Y mantén los lotes en un tamaño razonable: el valor por defecto es de 10 mensajes por segundo y por dispositivo. Una acumulación grande enviada de una vez se descarta.
And keep the batches reasonable, the default is 10 messages a second per device. A big backlog in one go gets dropped.
Traducido del English por IA ·
Desde el lado de datos: elija lo que elija, haga que la pasarela registre ts al sondear; así, las subidas tardías tras una caída de Wi-Fi en la pasarela llegarán con la hora correcta.
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.

