Start GPS reading thread.
(self)
| 242 | return path |
| 243 | |
| 244 | # Stage 3: raw device nodes — covers USB serial, native UART, and Raspberry |
| 245 | # Pi serial ports (/dev/ttyAMA0, /dev/serial0) that have no by-id symlink. |
| 246 | candidates = [] |
| 247 | for pattern in ('/dev/ttyACM*', '/dev/ttyUSB*', '/dev/ttyS[0-9]*', '/dev/ttyAMA*'): |
| 248 | candidates.extend(glob.glob(pattern)) |
| 249 | for fixed in ('/dev/serial0', '/dev/serial1'): |
| 250 | if os.path.exists(fixed): |
| 251 | candidates.append(fixed) |
| 252 | seen = set() |
| 253 | for dev in sorted(candidates): |
| 254 | real = os.path.realpath(dev) |
| 255 | if dev in exclude or real in exclude or real in seen: |
| 256 | continue |
| 257 | seen.add(real) |
| 258 | if _probe_nmea(dev): |
| 259 | return dev |
| 260 | |
| 261 | return None |
no test coverage detected