This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Connect M10 GPS
#1
I'm trying to connect a M10 GPS with compass to the NMEA port 1 on the MacArthur HAT.

The device comes with two wire bundles:
- four (red, black, yellow, green)
- two (white, orange). These are for the compass, ignore for now.

The red and black are connected to the 5V and GND terminals on the GPIO. That leaves the yellow and green wires. I tried `cat /dev/ttyAMA2` with every combination (yellow on RX+, yellow on RX-, green on RX+, and green on RX-), and with different baud rates, but it prints nothing.

Code:
for b in 4800 9600 38400 115200; do sudo stty -F /dev/ttyAMA2 $b cs8 -cstopb -parenb; echo "--- $b ---"; sudo timeout 2 cat /dev/ttyAMA2 | hexdump -C; done

The Internets say the device supports NMEA at 115200 baud. The AIs tell me the device won't send any data unless it's connected to a satellite, which it seems to be - the blue LEDs are blinking while it's next to the window. In the bowels of the garage they don't.

UART2 is enabled on the RPI (boot/firmware/config.txt):
Code:
dtparam=uart0=on
dtoverlay=uart2-pi5


Any suggestions on how to troubleshoot? I'm tempted to just toss it and get a USB version (for about double the price).
Reply
#2
Im using M10s and they are excellent GPS modules but they have their qwirks. I typicallt run them at 34200 baud, although they can run at 115200. The reason for this is that for whatever reason, I get faster aquisition time and just fewer jitter like errors at the faster speed, but those issues may be related to how I use them. The cold start aquisiton time can be 10-15 mins, but once a fix is made, they hold it and shift between sats very well (the long cold start time is due to their need to create a constellation map before connecting, one fix doe which is to use a battary power source or backup, they are super low power). Anyhow, until thay fix, you will see a solid blue LED which starts to flash one the fix is made. Thats probably off topic but I do think there is merit to connecting via the lower speed, why? Who knows.

Ive shared this before so forgive the redundancy but it has always been way easier and more foolproof for me to connect to them via USB with an ESP32 translating the signal to NMEA. It sounds like you have one with a compass with its own I2C pins. Feel free to use my code if you wanna connect this way, it should work fine as is even tho its written for more than just the GPS (the compass on mine is quite good to boot. Worst case it throws soke errors on boot when not finding the other sensors, but there are no dependencies on those so it should chug along fine thereafter.

Def try it before buying a USB version, if you have an ESP33 or want to buy one to front end that, the compass and some other sensors on a single USB cable. Heres the code if you want it: https://github.com/sv-enkidu/esp-32-sign...tData-puck
Reply
#3
(2026-06-16, 12:41 AM)saltwaterone Wrote: Ive shared this before so forgive the redundancy but it has always been way easier and more foolproof for me to connect to them via USB with an ESP32 translating the signal to NMEA.

I've reached the same conclusion. But I'm looking at a CP2102 adapter, not ESP32.

For the sake of the thread though, how did you wire the device? My setup is:
red -> GPIO pin 4 (5V)
black -> GPIO pin 6 (GND)
yellow -> RX 1+
green -> hanging

white and orange (compass) -> hanging for now

The puck powers up (red LED steady), and after some time the blue LEDs start flashing, which apparently means it has acquired a satellite. But... the NMEA RX/TX LEDs on the MacArthur HAT never light up. I've tried moving the yellow cable to RX 1-, tried same with the green cable. There's a 0-3V differential between each wire and GND, but the LEDs never turn on, and `cat` fails to read anything.
Reply
#4
(2026-06-16, 03:03 AM)alpe77 Wrote:
(2026-06-16, 12:41 AM)saltwaterone Wrote: Ive shared this before so forgive the redundancy but it has always been way easier and more foolproof for me to connect to them via USB with an ESP32 translating the signal to NMEA.

I've reached the same conclusion. But I'm looking at a CP2102 adapter, not ESP32.

For the sake of the thread though, how did you wire the device? My setup is:
red -> GPIO pin 4 (5V)
black -> GPIO pin 6 (GND)
yellow -> RX 1+
green -> hanging

white and orange (compass) -> hanging for now

The puck powers up (red LED steady), and after some time the blue LEDs start flashing, which apparently means it has acquired a satellite. But... the NMEA RX/TX LEDs on the MacArthur HAT never light up. I've tried moving the yellow cable to RX 1-, tried same with the green cable. There's a 0-3V differential between each wire and GND, but the LEDs never turn on, and `cat` fails to read anything.


Hi, my M10 is packaged with its compass on a board with a small 6 pin connector with pin labels that denote their puposes next to the connector wires, so the color scheme may not match yours, but on mine its as follows: red - 5v, black - GND (duh!,lol), yellow - RX, white - TX, green - SCL, blue - SDA. The GPS output (TX and RX) are UART, not I2C, so I assigned two ESP32 pins to those (I forget which ones), and wired the I2C SCL and SDA pins to two other (GPIO8 and 9) pins assigned as I2C.   

Come to think of it, I think I had some issues with RX and TX being the reverse on the ESP32 than what those lables suggest.  In other words. the "transmit" from the GPS was the "receive" pin logisally on the ESP32, and vice versa for "receive" (ie., the GPS "transmits" to an ESP pin that "receives" it, if that makes sense.  Anyhow, good luck!
Reply
#5
Got the GPS position to work. Issue was a bad config. Solution here.

But I'm not sure how to read the compass data. It's I2C (SDA/SCL), which can be accessed via GPIO pins 3, and 5. When wired, the I2C app shows device 0e on bus 1.

$ i2cdetect -y 1
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                        -- -- -- -- -- -- 0e --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- -- 

$ i2cdump -y 1 0x0e
No size specified (using byte-data access)
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 10 fa 00 00 00 00 00 00 00 00 00 0c 00 00 ff ff    ??.........?....
10: ff ff ff ff ff ff ff ff ff ff ff ff 00 00 ff ff    ................
20: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
40: 00 24 80 ff 00 ff 00 ff 00 00 00 ff 7f ff 0f 00    .$?.........?.?.
50: c8 ff c8 ff d6 ff 03 0f a3 06 20 00 20 00 20 00    ?.?.?.???? . . .
60: a4 38 00 00 ff ff ff ff ff ff ff ff ff ff ff ff    ?8..............
70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
80: 03 ff c8 c8 d6 24 a4 38 20 00 20 00 20 00 a3 06    ?.???$?8 . . .??
90: ff ff 10 fa 00 ff 00 00 00 19 0a 0c 3b 01 0e 00    ..??.....???;??.
a0: ee ff f3 ff 44 01 e8 ff f1 ff 03 00 39 01 ff ff    ?.?.D??.?.?.9?..
b0: ff ff 72 00 7b 00 fb 00 02 03 2e 05 1a fe 5d 19    ..r.{.?.??.???]?
c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................

Not sure what do with that. Tried i2cget on some of those addresses, but I have no idea what the values mean. I believe the protocol is UBX, and it only responds to specific commands. So I'd have to write some Python code, but I can't find any documentation for this chip (NEO-M10-0-10).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)