I have the following hardware:
- RPI 4 2gb with a basic install of raspbian
- Garmin echomap plus 45cv
- USB to NMEA cable (https://www.ebay.com.au/itm/172429550240)
- 12v 7.0Ah battery
The garmin has four wires:
- red connected to the positive terminal on the battery
- black connected to the negative terminal on the battery
- blue (NMEA tx) connected to USB NMEA white (rx)
- brown (NMEA rx) not connected
The USB NMEA cable has three wires at one end and a male USB at the other:
- black - ground connected to the negative terminal on the battery
- white - NMEA rx connected to the Garmin blue NMEA tx cable
- green - NMEA tx not connected
- USB - plugged into the RPI (non USB3 port)
I have the following code in a python file:
import serial
def init():
ser = serial.Serial()
ser.baudrate = 4800
ser.port = '/dev/ttyUSB0'
ser.open()
while True:
line = ser.read(1)
print ord(line)
init()
When I have the python code running, with the Garmin turned on, I can see data feeding into the application in ticks, but the data is garbled. The following is the output from one tick, I applied ord(line) in order to show the characters which for the most part are invisible or question marks or random nonsensical characters without ord applied.
91
125
197
101
245
157
125
167
157
167
167
167
167
167
167
167
167
167
167
167
167
167
167
167
171
157
117
229
235
If I run the python file just printing ser, i get the following:
Serial<id=0xb67755f0, open=True>(port='/dev/ttyUSB0', baudrate=4800, bytesize=8, parity='N', stopbits=1, timeout=None, xonxoff=False, rtscts=False, dsrdtr=False)
Troubleshooting I've tried:
- If I turn the Garmin off, the ticks stop. So I know that it is recieving the signal, just not interpretting it properly.
- All of the reading I have found says that garbled messages means that the baud rate is wrong. The garmin manuals say that the rate is supposed to be 4800 for NMEA standard. (The Garmin has a setting for NMEA standard or NMEA high speed. I have it set to standard.) I have tried every buad rate under the sun. The garbled characters seem to garble differently, but none of them are useful.
- Some other suggestions were to try and connect the USB NMEA tx with the rx only, which I did. I then ran the python script and in a seperate window I ran; echo helloworld > /dev/ttyUSB0. This appeared in the terminal running the script. So I'm confident that the USB cable is sending and recieving as expected.
For whatever reason I cannot get ungarbled signal from the Garmin. It should be printing an NMEA sentence.
What am I doing wrong?