OpenMarine

Full Version: Which device maps to NMEA 1?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to write some Python code to talk to a Modbus wind sensor. The sensor itself is RS485, but it's connected to a RS422 adapter, which is plugged into the NMEA 1 port. I have some basic code that tries to connect, but I can't figure out which device to talk to.

Code:
$ ls /dev/tty*
/dev/tty    /dev/tty14  /dev/tty20  /dev/tty27  /dev/tty33  /dev/tty4   /dev/tty46  /dev/tty52  /dev/tty59  /dev/tty8
/dev/tty0   /dev/tty15  /dev/tty21  /dev/tty28  /dev/tty34  /dev/tty40  /dev/tty47  /dev/tty53  /dev/tty6   /dev/tty9
/dev/tty1   /dev/tty16  /dev/tty22  /dev/tty29  /dev/tty35  /dev/tty41  /dev/tty48  /dev/tty54  /dev/tty60  /dev/ttyAMA0
/dev/tty10  /dev/tty17  /dev/tty23  /dev/tty3   /dev/tty36  /dev/tty42  /dev/tty49  /dev/tty55  /dev/tty61  /dev/ttyAMA10
/dev/tty11  /dev/tty18  /dev/tty24  /dev/tty30  /dev/tty37  /dev/tty43  /dev/tty5   /dev/tty56  /dev/tty62  /dev/ttyOP_gps
/dev/tty12  /dev/tty19  /dev/tty25  /dev/tty31  /dev/tty38  /dev/tty44  /dev/tty50  /dev/tty57  /dev/tty63  /dev/ttyprintk
/dev/tty13  /dev/tty2   /dev/tty26  /dev/tty32  /dev/tty39  /dev/tty45  /dev/tty51  /dev/tty58  /dev/tty7

$ ls /dev/serial*
/dev/serial0

- ttyAMA0 is the GPIO14-15, that's not it.
- AMA10 is the debug UART.
- ttyOP_gps is a symlink to AMA0.
- Tried all the ttyN devices, but got permission denied. User is in the dialout group.
- serial0 says "Failed to connect [Errno 11] Could not exclusively lock port"
Are you running OpenPlotter? If not, you will have to edit the Pi's configuration files to load the correct dtoverlay. Or maybe you can do it on the fly with pinctrl.

On the MacArthur HAT, NMEA1 is on UART3 (pins 29/7 for RX/TX), NMEA2 on UART5 (pins 33/32). UART numbering might be different between Raspberry Pi 4 and 5.
Yes, OpenPlotter 4. I'd forgotten to enable UART 2 (on RPI5) in the Serial app. As as soon as I did that a new device appeared under ttyAMA2.

Now the NMEA TX LED flashes when I try to send something. No response yet, but it's progress.