-
I'm trying to use a Pixhawk 4 GPS module with a NEO-M8N directly from a Raspberry Pi (or Jetson). I have connected the 5V pin, RX to TX, TX to RX and ground. The GPS blinks every second showing signs of life and I have activated the serial communication on my Raspberry. I can kind of read stuff:
But I'm unable to parse the data: from serial import Serial
from pyubx2 import UBXReader
stream = Serial('/dev/ttyS0', 9600, timeout=3)
ubr = UBXReader(stream)
(raw_data, parsed_data) = ubr.read()
print(parsed_data) Always returns Same thing happens on my Jetson Xavier NX. I tried using a baud rate of 38400. Any ideas on this? :) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @aurelien-m I'm assuming you're using something like this GPS module, but I'm unclear which serial port you're actually monitoring - the Pixhawk's or the RPi's? What do you see if you simply type Firstly, have you configured your Pixhawk module to pass-through NMEA or UBX on the designated serial port? To the best of my knowledge it doesn't do this by default. You'll need to refer to the vendor's or manufacturer's specifications for configuration details. I'm not in a position to provide support for your specific device. Secondly, check that the pass-through baud rate is correct. The default UART baud rate on u-blox devices is 38400, but the Pixhawk may be configured differently - again, check the specifications. Once you've confirmed that you are actually getting a valid NMEA or UBX stream on the serial port, try this updated code snippet: from serial import Serial
from pyubx2 import UBXReader
stream = Serial('/dev/ttyS0', 9600, timeout=3)
ubr = UBXReader(stream)
for raw_data, parsed_data in ubr:
print(parsed_data) |
Beta Was this translation helpful? Give feedback.
-
It works now! I had to use the ublox center software to reset its settings and now I'm able to read the data. I'm not sure what was wrong with it but it seems to work fine now. Thanks for your time! |
Beta Was this translation helpful? Give feedback.
Hi @aurelien-m
I'm assuming you're using something like this GPS module, but I'm unclear which serial port you're actually monitoring - the Pixhawk's or the RPi's?
What do you see if you simply type
screen /dev/ttyS0
(orcat /dev/ttyS0
) at the terminal, without any intervening software?Firstly, have you configured your Pixhawk module to pass-through NMEA or UBX on the designated serial port? To the best of my knowledge it doesn't do this by default. You'll need to refer to the vendor's or manufacturer's specifications for configuration details. I'm not in a position to provide support for your specific device.
Secondly, check that the pass-through baud rate is correct. The default UART b…