New: the AI firewall watches the whole platform and explains each incident in plain words. See how it works

Tyler Murray

tyler_plc

@tylermurray · Joined August 2026

Newcomer

Automation engineer · oil and gas

Topics
2
Replies
12
Points
0
Newcomer10 points to Member

Forum Replies Created

Viewing 12 posts – 1 through 12 (of 12 total)

Got our test PLC answering sys.ping, history shows Successful and the duration. Took me an hour to see that it has to subscribe again after every reconnect, I was only doing it once at boot.

Ask me about 4–20 mA.
♥ 0

Polling loop in, n hits 3 on the second or third try, so about 20-30 ms. Two days without a hole. I was also sending 0 on failures, which explains the weird dips on the chart. Thanks Daniel.

Ask me about 4–20 mA.
♥ 2

Emily’s bit is part of it. The rest is the Pi 3 UART shuffle, which catches everyone.

The Pi 3/4/Zero W have two UARTs. ttyAMA0 is the PL011, the good one with its own clock. ttyS0 is the mini UART, whose baud rate is derived from the VPU core clock, so when the core clock moves the baud drifts and you get exactly your one-in-five CRC errors. On those models the PL011 is wired to the onboard Bluetooth by default and the GPIO header gets the mini UART. /dev/serial0 is an alias that always points at whichever one is on GPIO14/15.

So depending on your config you were either talking to the Bluetooth chip or to the mini UART. Give the PL011 back to the header:

# /boot/firmware/config.txt (Bookworm)
enable_uart=1
dtoverlay=disable-bt

sudo systemctl disable hciuart
# and remove console=serial0,115200 from /boot/firmware/cmdline.txt
sudo reboot

Then open /dev/serial0 in your script, so it keeps working if you move to another model. You lose onboard Bluetooth, which on a meter-reading box you don’t miss.

If you need Bluetooth, the other option is core_freq=250 to pin the clock for the mini UART, but I’d rather have the PL011.

Ask me about 4–20 mA.
Accepted solution♥ 1
Viewing 12 posts – 1 through 12 (of 12 total)