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 ·
MOSI y MISO son las dos líneas de datos de SPI. Creo que en la tuya DO es MOSI, ¿no? Data out, es decir, salida de datos.
MOSI and MISO are the two data lines of SPI. I think DO is MOSI on yours? Data out.
Traducido del English por IA ·
Persona de datos preguntando: ¿entonces la placa tiene pads vacías a propósito?
Data person asking: so the board has empty pads on purpose?
Traducido del English por IA ·
Tenemos algo casi igual en unas cuantas estaciones de bombeo pequeñas, así que le comento un par de cosas.El Pi en medio es buena idea por sus cortes. Haga que actúe como pasarela: un dispositivo en Hermetry marcado como «This device is a gateway», y cada habitación se convierte en un dispositivo hijo la primera vez que el Pi la reporta. Node-RED recoge los mensajes de las habitaciones desde Mosquitto, los guarda en un archivo o en una pequeña tabla SQLite mientras no hay internet, y luego los envía con sus propias marcas de tiempo:
topic v1/gw/telemetry
{"Room 4": [{"ts": 1793000000000, "values": {"temperature": 22.1, "humidity": 51, "door_open": 0}},
{"ts": 1793000300000, "values": {"temperature": 22.0, "humidity": 51, "door_open": 1}}]}
Asegúrese de que el Pi tenga la hora correcta (NTP tras el arranque) antes de poner un ts en cualquier dato. Una cola grande se vacía un poco más despacio porque las reproducciones tienen su propio límite de velocidad en el perfil; es normal.El control del calentador de agua puede pasar por el mismo Pi. Un comando enviado a un dispositivo hijo llega a su pasarela por v1/gw/rpc, así que Node-RED se suscribe a ese topic y lo reenvía a la habitación correcta. O bien haga del controlador del calentador un dispositivo propio que se conecte directamente a Hermetry. Para un calentador, yo iría directo, con menos piezas móviles.Los topics de pasarela están descritos en Devices behind a gateway.
We run nearly this at a few small pump stations, so a couple of things from that.
The Pi in the middle is a good call because of your outages. Have it act as a gateway: one device in Hermetry marked «This device is a gateway», and each room becomes a child device the first time the Pi reports it. Node-RED collects the room messages from Mosquitto, keeps them in a file or a small SQLite table while the internet is down, and then sends them on with their own timestamps:
topic v1/gw/telemetry
{"Room 4": [{"ts": 1793000000000, "values": {"temperature": 22.1, "humidity": 51, "door_open": 0}},
{"ts": 1793000300000, "values": {"temperature": 22.0, "humidity": 51, "door_open": 1}}]}
Make sure the Pi has the right time (NTP after boot) before you put a ts on anything. A big backlog drains a bit slower because replays have their own rate limit on the profile, that’s normal.
Geyser switching can go through the same Pi. A command sent to a child device comes down to its gateway on v1/gw/rpc, so Node-RED subscribes to that and passes it on to the right room. Or make the geyser controller its own device that connects to Hermetry directly. For a geyser I’d go direct, fewer moving parts.
Gateway topics are described in Devices behind a gateway.
Traducido del English por IA ·
Eso es para el lado del dispositivo, que espera comandos. Creo que necesitas una clave de API en lugar del token del dispositivo; hace un tiempo hice algo parecido con python requests, pero no recuerdo la ruta.
That one is for the device side, it waits for commands. I think you need an API key instead of the device token, I did something like this with python requests a while ago but I don’t remember the path.
Traducido del English por IA ·
Genial. Vigila el turno de las 22:00 alrededor del cambio de hora en primavera y otoño; nuestras marcas de tiempo están en UTC y una vez tuvimos un desfase de 7 horas.
Nice. Watch the 22:00 shift around the clock change in spring and autumn, our timestamps are UTC and we got a 7 hour shift once.
Traducido del English por IA ·
Grove es solo una convención de conectores: cablea con cables Grove a jumper hembra (o corta un cable por la mitad). Hice un kit de aula de este tipo con ESP32.Módulos digitales y analógicos:
yellow SIG (la señal principal: salida digital o analógica)
white NC o segunda señal (sin usar en la mayoría de módulos simples)
red VCC
black GND
Los módulos I2C usan yellow = SCL, white = SDA.El voltaje es lo que hay que comprobar en cada módulo. El sensor de luz (v1.2) y el sensor de ruido son analógicos y funcionan bien a 3,3 V; su salida se mantiene por debajo de 3,3 V, así que se pueden conectar directamente a los pines ADC1 del ESP32 (GPIO32-39). ADC2 no funciona con el Wi-Fi activado. El módulo DHT11 también funciona a 3,3 V, con un cable corto. La bobina del relé Grove es de 5 V: alimentala desde el pin de 5 V (VIN en la DevKit con USB); su entrada acepta bien una señal de 3,3 V.No alimentes ningún módulo con 5 V si su salida va a un pin del ESP32, ya que el ESP32 no tolera 5 V.El sensor de ruido da una envolvente, no audio. Muéstréalo cada 50 ms y envía el máximo y la media del minuto, por ejemplo {"temperature": 21, "light": 1830, "noise_avg": 312, "noise_max": 744}, para que un montacargas que pasa aparezca como un pico.
Grove is just a connector convention, wire it with Grove-to-female-jumper cables (or cut one cable in half). Did a classroom kit like this on ESP32s.
Digital and analog modules:
yellow SIG (the main signal: digital or analog out)
white NC or second signal (unused on most single modules)
red VCC
black GND
I2C modules use yellow = SCL, white = SDA.
Voltage is the part to check per module. The light sensor (v1.2) and loudness sensor are analog and run fine at 3.3 V, their output stays below 3.3 V, so straight into ESP32 ADC1 pins (GPIO32-39; ADC2 doesn’t work while Wi-Fi is on). The DHT11 module works at 3.3 V too, with a short cable. The Grove relay coil is 5 V: power it from the 5 V pin (VIN on the DevKit with USB), its input is happy with a 3.3 V signal.
Don’t feed any module 5 V if its output goes into an ESP32 pin, the ESP32 isn’t 5 V tolerant.
The loudness sensor gives an envelope, not audio. Sample it every 50 ms and send the max and average for the minute, e.g. {"temperature": 21, "light": 1830, "noise_avg": 312, "noise_max": 744}, so a forklift going past shows up as a peak.
Traducido del English por IA ·
¿Qué necesita exactamente el ERP: un total por turno o un recuento acumulado?
What does the ERP need exactly, one total per shift or a running count?
Traducido del English por IA ·
Vale la pena enviar un contador de errores junto con las lecturas, modbus.crc_errors o similar. En nuestras instalaciones, que ese contador subiera siempre fue la primera señal de un cable A/B suelto.
Worth sending an error counter next to the readings, modbus.crc_errors or similar. On our sites that counter going up was always the first sign of a loose A/B wire.
Traducido del English por IA ·
No está resuelto: el ESP32 puede enrutar I2C a casi cualquier pin mediante su matriz GPIO. Que el escáner funcione demuestra que su cableado está bien.Lo que ocurre es que sht4.begin() e ina219.begin() sin argumentos llaman de nuevo a Wire.begin() dentro de la biblioteca, y un Wire.begin() sin parámetros devuelve el bus a los pines predeterminados 21 y 22. Así, I2C se aleja de sus sensores y pasa a su transceptor RS-485, lo que también explica el segundo síntoma.Pase a las bibliotecas el bus que ya inició:
Wire.begin(32, 33);
Wire.setClock(100000);
if (!sht4.begin(&Wire)) Serial.println("SHT40 not found");
if (!ina219.begin(&Wire)) Serial.println("INA219 not found");
La mayoría de las bibliotecas de Adafruit aceptan un TwoWire*. Si alguna no lo acepta, use Wire1 para los sensores y deje Wire como está.Sobre la elección de pines: los pines 34 a 39 son solo de entrada, así que nunca los use para SDA o SCL. Y evite los pines de strapping 0, 2, 12 y 15 si puede; una resistencia pull-up en el 12 puede impedir que la placa arranque.
Not fixed, the ESP32 can route I2C to almost any pin through its GPIO matrix. The scanner working proves your wiring is fine.
What happens is that sht4.begin() and ina219.begin() with no arguments call Wire.begin() again inside the library, and a bare Wire.begin() puts the bus back on the default pins 21 and 22. That moves I2C away from your sensors and onto your RS-485 transceiver, which explains the second symptom too.
Give the libraries the bus you already started:
Wire.begin(32, 33);
Wire.setClock(100000);
if (!sht4.begin(&Wire)) Serial.println("SHT40 not found");
if (!ina219.begin(&Wire)) Serial.println("INA219 not found");
Most of the Adafruit libraries take a TwoWire*. If one does not, use Wire1 for the sensors and leave Wire alone.
On pin choice: 34 to 39 are input only, so never SDA or SCL. And stay off the strapping pins 0, 2, 12 and 15 if you can, a pull-up on 12 can stop the board from booting.
Traducido del English por IA ·
¿Desactivaste el Bluetooth? En la Pi 3, la UART buena se asigna al Bluetooth por defecto.
Did you turn Bluetooth off? On the Pi 3 the good UART goes to Bluetooth by default.
Traducido del English por IA ·
Trabajo en el área de datos de una operadora de agua, así que veo este argumento de parte de quienes quieren paneles. Nuestras instalaciones funcionan exactamente con esta división y lleva años dando buenos resultados.El PLC controla: escanea las E/S cada pocos milisegundos tanto si la red está activa como si no, sus entradas y salidas están diseñadas para cableado de campo de 24 V y armarios con ruido eléctrico, tiene opciones de seguridad certificadas, y el técnico del turno de noche puede abrir la lógica de escalera y ver por qué no arrancó una bomba. Un ESP32 puede ejecutar la lógica, pero tendrías que diseñar y certificar todo eso por tu cuenta, y luego mantenerlo durante 15 años.Hermetry hace monitorización y supervisión: histórico, alarmas, paneles, operadores que envían comandos. Incluso la solución de agua lista para usar de Hermetry lo mantiene así: el arranque y paro automático de las estaciones de bombeo permanece en el controlador de la estación, y la nube solo cambia el modo manual y activa bombas bajo orden. Véase Water site. Si internet se cae, una regla en la nube no puede detener un transportador.Donde sí tienen sentido los ESP32: sensores adicionales que el PLC no tiene, como vibración en un motor, temperaturas en un armario, medidores de energía. Son baratos, sin riesgo, y envían los datos directamente a Hermetry.Kevin, la pregunta del coste hay que responderla con números: una hora de parada en una línea frente al precio de un S7-1200.
I’m on the data side at a water operator, so I see this argument from the people who want dashboards. Our sites run exactly this split and it’s held up for years.
The PLC does control: it scans I/O every few milliseconds whether the network is up or not, its inputs and outputs are made for 24 V field wiring and noisy cabinets, it has certified safety options, and the night-shift technician can open the ladder logic and see why a pump didn’t start. An ESP32 can do the logic, but you’d be building and certifying all of that yourself, then supporting it for 15 years.
Hermetry does monitoring and supervision: history, alarms, dashboards, operators sending a command. Even Hermetry’s own ready-made water solution keeps it that way, the pump stations’ automatic start and stop stays in the station’s controller and the cloud only switches manual mode and pumps on command. See Water site. If the internet drops, a cloud rule can’t stop a conveyor.
Where ESP32s do make sense: extra sensors the PLC doesn’t have, like vibration on a motor, temperatures in a cabinet, energy meters. Cheap, no risk, and they go straight to Hermetry.
Kevin, the cost question is the one to answer with numbers: one hour of downtime on a line versus the price of an S7-1200.
Traducido del English por IA ·
¡Arreglado! La versión con printf funciona, aparecen las siete claves .up y raw dejó de actualizarse. Al final seguí la idea de Ciaran porque el equipo de operaciones añadirá más sitios, así que ahora cada sitio es un hijo con una sola clave up y una regla. La Pump 6 tuvo una avería real anoche y la alarma se abrió tras 5 minutes, como debe ser.
Fixed! printf version works, all seven .up keys show up and raw stopped updating. Went with Ciaran’s idea in the end because ops will add more sites, so now each site is a child with a single up key and one rule. Pump 6 had a real outage last night and the alarm opened after 5 minutes like it should.
Traducido del English por IA ·
Se ejecuta, el valor raw se actualiza cada minuto. Así que es el tema de las comillas. Siempre me lío con las comillas de bash.
It runs, raw updates every minute. So it’s the quoting. I always get confused by bash quotes.
Traducido del English por IA ·
La Rev B ya está lista: plano superior cosido cada 4 mm, zonas de exclusión de antenas despejadas en todas las capas, antenas en esquinas opuestas. El tiempo hasta el primer fix pasó de unos 3 minutos a 35 s, y el SNR de LoRa en el mismo punto de prueba mejoró 6 dB. La comparación de gráficos fue muy satisfactoria para alguien de datos.
Rev B is back: stitched top pour every 4 mm, antenna keep-outs cleared on all layers, antennas on opposite corners. Time to first fix went from about 3 minutes to 35 s, and LoRa SNR at the same test spot improved by 6 dB. The chart comparison was very satisfying for a data person.
Traducido del English por IA ·
Caja de plástico. Buena idea, de todos modos.
Plastic box. Good thought though.

