Hi Don,
Thanks for the in depth troubleshooting! To clarify, I get valid NMEA1083 on about 2 out of every 3 pi boot-ups. The port speed is consistently 4800 and I never see anything else.
Code:
pi@openplotter:~ $ stty -F /dev/ttyAMA2
speed 4800 baud; line = 0;
min = 1; time = 0;
-brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
Code:
pi@openplotter:~ $ sudo dmesg | grep tty
[ 0.000000] Kernel command line: reboot=w coherent_pool=1M 8250.nr_uarts=1 pci=pcie_bus_safe cgroup_disable=memory numa_policy=interleave nvme.max_host_mem_size_mb=0 numa=fake=8 system_heap.max_order=0 iommu_dma_numa_policy=interleave smsc95xx.macaddr=88:A2:9E:71:15:61 vc_mem.mem_base=0x3fc00000 vc_mem.mem_size=0x40000000 console=tty1 root=PARTUUID=7ac8abd8-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles cfg80211.ieee80211_regdom=CA
[ 0.000095] printk: legacy console [tty1] enabled
[ 0.012520] 107d001000.serial: ttyAMA10 at MMIO 0x107d001000 (irq = 16, base_baud = 0) is a PL011 AXI
[ 0.274901] 107d50c000.serial: ttyS0 at MMIO 0x107d50c000 (irq = 33, base_baud = 6000000) is a Broadcom BCM7271 UART
[ 0.274939] serial serial0: tty port ttyS0 registered
[ 0.430966] 1f00038000.serial: ttyAMA2 at MMIO 0x1f00038000 (irq = 143, base_baud = 0) is a PL011 AXI
[ 0.431215] 1f00040000.serial: ttyAMA4 at MMIO 0x1f00040000 (irq = 145, base_baud = 0) is a PL011 AXI
[ 2.045081] systemd[1]: Created slice system-getty.slice - Slice /system/getty.
Code:
pi@openplotter:~ $ grep -i uart /boot/firmware/config.txt
dtoverlay=uart2-pi5
dtoverlay=uart4-pi5 (there's a wind sensor here which works great)
I haven't touched any dip switches on the HAT. I wasn't aware there were any (are there? I can't see any). I know of one jumper to terminate NMEA2k (which I have jumpered as my pi is a termination).
GPS is on NMEA0183 RX1+ (with a ground jumper from RX1- to the system ground) as the GPS-17 doesn't have a data- line.
GPS is powered by NMEA2k power (which also triggers a power module on the HAT to cause the pi to boot). So they boot up together each time.
SignalK data connection is serial, 3800, 8n1 (this is not configurable), no flow control (it's NMEA0183 - no handshake). Validate checksum: YES; Remove NULL characters: NO.
Code:
3. When you run this manually, does it always produce clean NMEA sentences?
Code
stty -F /dev/ttyAMA2 4800
It does
not...
But when I run:
Quote:stty -F /dev/ttyAMA2 4800 raw -echo
It fixes it right up. I have this in a UDEV rule, and it appears to run every boot; and manually running "sudo udevadm test /sys/class/tty/ttyAMA2" shows that it fires. And then valid NMEA.
I'll reboot a few times til it fails and then try the hot disconnect and will report back.
Thanks again!
(2026-05-16, 01:06 AM)SkipperDon Wrote: One more quick test
Unplug the GPS‑17’s data wires (leave ground connected) and run:
cat /dev/ttyAMA2
If garbage continues, the UART is misconfigured.
If garbage stops, the GPS is outputting valid 4800‑baud but the Pi is reading it wrong.
Your symptoms — especially “sometimes two Signal K restarts fixes it” — strongly suggest a UART initialization race condition or a baud override happening after boot. The info above will pinpoint which one.
Done. If I pull the whole phoenix strip (D+ and the gnd jumper), catting the ttyAMA2 gives no output.
If I hot reconnect it; it's back to garbage until I either:
- Restart SignalK (actually this doesn't seem to work anymore...?) OR;
- Restart the Pi OR;
- stty -F /dev/ttyAMA2 4800 raw -echo