El contador de cajas en un servidor web Uno sigue colgándose; nuestro ERP necesita los totales del turno
Traducido del English por IA ·
Como jefe de planta, lo describiré tal como me lo explicaron. La línea de embalaje 3 tiene un Arduino Uno con un shield Ethernet (W5100) y un fotoojo que cuenta las cajas. Un contratista lo configuró como un pequeño servidor web, y la tarea de importación de nuestro ERP llama a http://10.20.3.41/count al final de cada turno para registrar la producción.Dos veces este mes el Uno dejó de responder y perdimos la cifra de un turno; la gente tuvo que contar los pallets a mano. Además, el equipo de operaciones quiere ver el conteo en vivo en nuestro panel Hermetry junto con las temperaturas de la línea, algo que ahora mismo no es posible.Mi pregunta es si conviene arreglar el servidor web o hacerlo de otra manera. Preferiría tener un solo lugar donde viva el número.
Plant manager, so I’ll describe this the way it was explained to me. Packing line 3 has an Arduino Uno with an Ethernet shield (W5100) and a photo-eye counting cases. A contractor set it up as a little web server, and our ERP’s import job calls http://10.20.3.41/count at the end of each shift to book production.
Twice this month the Uno stopped answering and we lost a shift’s figure, people had to count pallets. Also the ops team wants the count live on our Hermetry board with the line’s temperatures, which right now it isn’t.
My question is whether to fix the web server or do this differently. I’d rather have one place the number lives.
Traducido del English por IA ·
El W5100 solo tiene 4 sockets y los sketches de servidor web habituales no siempre los cierran. Basta con un escáner o dos navegadores conectándose para que se queden sin sockets. Se puede arreglar, pero seguirá siendo frágil.
The W5100 has only 4 sockets and the usual web server sketches don’t always close them. A scanner or two browsers hitting it and it runs out. Fixable, but it’ll stay fragile.
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 ·
Un total por turno, los cambios de turno son a las 06:00, 14:00 y 22:00. El ERP está en un servidor dentro de nuestra red y el departamento de TI no lo abre a internet, eso ya fue una pelea.
One total per shift, shifts change at 06:00, 14:00 and 22:00. The ERP is on a server inside our network and IT won’t open it to the internet, that was already a fight.
Traducido del English por IA ·
Entonces invierta el planteamiento para que nadie tenga que llamar al Uno. El Uno publica su contador en Hermetry, y el ERP obtiene el total del turno desde Hermetry. El tráfico entrante a su red permanece cerrado.Uno: envíe el total acumulado (nunca lo reinicie en el Uno) cada minuto a la API HTTP del dispositivo con su token. Un W5100 no puede usar TLS, así que o bien coloque delante una pequeña placa compatible con TLS o, lo más sencillo, cambie el Uno por un ESP32 con Ethernet y publique por HTTPS. El cuerpo es solo {"cases_total": 184233}.Lado del ERP: una clave de API con el preajuste Read only para telemetría, permitida solo para la dirección del servidor del ERP. A las 06:05, 14:05 y 22:05, el trabajo de importación solicita el incremento durante el turno:
GET /tenant/{tenantId}/api/telemetry/series?kind=iot_device&entityId={line3}
&keys=cases_total&from={shift_start_ms}&to={shift_end_ms}&bucket=1h&agg=increase
Sume los 8 valores horarios. increase gestiona correctamente el contador, y no le importa si el dispositivo estuvo desconectado 10 minutos en medio, el total se recupera. En el tablero, la misma clave en un gráfico con increase ofrece a operaciones los casos en vivo por hora.En su caso, evitaría enviar datos desde un flow al ERP: el bloque de solicitud HTTP rechaza las direcciones privadas, así que de todos modos no puede llegar a 10.x. Con la extracción (pull) TI queda satisfecho. Referencia: The history API.
Then flip it around so nobody calls the Uno at all. The Uno posts its counter to Hermetry, and the ERP pulls the shift total from Hermetry. Inbound to your network stays closed.
Uno: send the running total (never reset it on the Uno) every minute to the device HTTP API with its token. A W5100 can’t do TLS, so either put a small TLS-capable board in front or, simplest, swap the Uno for an ESP32 with Ethernet and post over HTTPS. The body is just {"cases_total": 184233}.
ERP side: an API key with the Read only preset for telemetry, allowlisted to the ERP server’s address. At 06:05, 14:05 and 22:05 the import job asks for the increase over the shift:
GET /tenant/{tenantId}/api/telemetry/series?kind=iot_device&entityId={line3}
&keys=cases_total&from={shift_start_ms}&to={shift_end_ms}&bucket=1h&agg=increase
Add up the 8 hourly values. increase handles the counter properly and you don’t care if the device was offline for 10 minutes in between, the total catches up. On the board, the same key on a chart with increase gives ops the live cases per hour.
I’d avoid pushing from a flow to the ERP in your case: the HTTP request block refuses private addresses, so it can’t reach 10.x anyway. The pull keeps IT happy. Reference: The history API.
Traducido del English por IA ·
El contratista cambió el Uno por una placa ESP32-ETH la semana pasada, con el mismo fotoojo. La tarea del ERP ahora obtiene los incrementos por hora, y la primera semana completa coincidió con el conteo manual con una diferencia de 2 piezas. Un problema: al principio enviaron el conteo como texto entre comillas, así que se mostraba como último valor pero no se graficaba nada. Al enviar un número se solucionó.
Contractor swapped the Uno for an ESP32-ETH board last week, same photo-eye. The ERP job now pulls the hourly increases, and the first full week matched the hand count within 2 cases. One snag: they first sent the count as text in quotes, so it showed as a latest value but nothing charted. Sending a number fixed it.
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.
- 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.

