Golang implementation for communicating with u-blox GPS via I2C?

I have been looking around for a golang implementation for binary communication with the u-blox M8-series GPS receivers via the I2C-bus. No luck so far.

I have written an implementation using the USB port and NMEA messages but I fear that will turn out to be a bit slow for my application.

After reading the specs for the u-blox (in may case the GPS is a part of the RY836AI board), I’m under the impression that the implementation will not be as trivial as the ordinary i2c-bus communication especially if using binary communication rather than the lengthy NMEA messages.

Before I spend my fast-moving youth on this project, I turn to you helpful people here. Any takers?

Best /Brusan

1 Like

Looks like you could use this on a Raspberry Pi to communicate using I2C.

I haven’t used this before, but it’s the first hit searching for ‘golang i2c’ :slight_smile:

iNav (and Betaflight) are flight control software projects used in remote controlled aircraft such as quadcopters and flying wings. You should be able to figure out how they talk to u-blox GPS devices and implement that in Go. See the iNav source code https://github.com/iNavFlight/inav/blob/912d131556302cf6ea67d59308e43dfe65ca8026/src/main/drivers/gps_i2cnav.c

I am using the https://periph.io/ project for I2C communication both for the Raspberry Pi and to some extent the Rock64 as I think the devs behind it is very committed to high quality and good architecture.

The iNav project is indeed interesting as is the stratux implementation.

Thank you!

what is your platform ? if you are on something like Raspberry Pi, Beaglebone or any other “little” board like that, it could be easy because you got an hardware I2C interface and there are some code existing already. if you are on a regular PC, you need an hardware interface. eventually FTDI should have things like that, to connect to an USB port. and then they have drivers and examples, but you will probably have to make the golang binding…
(if you search " golang ftdi" on Google there are several replies, so maybe there’s already something…)

[Edit:] and if you are on Linux (I’m on Windows), it seem’s that it could be even easier : https://dave.cheney.net/2014/08/03/tinyterm-a-silly-terminal-emulator-written-in-go

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.