nopnop2002 / esp-idf-GPS-Repeater

Transfer GPS NMAE messages over Wifi
19 stars 4 forks source link

GPS Module Initialisation option #4

Open raintonr opened 2 years ago

raintonr commented 2 years ago

Thank you so much for this awesome utility. I built a Bluetooth gateway in one afternoon with ESP32 + Neo-M8:

image

The only thing missing, at least in this context, is an option to write configuration settings to the GPS module at power on.

Scenario is this: the Neo-M8 can allegedly support concurrent reception from 3 GNSS but that isn't default behaviour (default is GPS & GLONASS). The most economic version of this package is the NEO-M8M which does not include flash so if one therefore wants to use something other than default GPS & GLONASS the command to switch GNSS in use has to be sent at power on.

nopnop2002 commented 2 years ago

Where can I find command documentation for using anything other than the default GPS and GLONASS?

raintonr commented 2 years ago

The spec is here: https://www.u-blox.com/sites/default/files/products/documents/u-blox8-M8_ReceiverDescrProtSpec_UBX-13003221.pdf

Seems like UBX-CFG-GNSS is the required command.

There may be some clues in this project (only just found this - I should have experimented with it before boxing up my project and installing in a vehicle - doh!) https://gpsd.gitlab.io/gpsd/ubxtool.html (https://gitlab.com/gpsd/gpsd)

nopnop2002 commented 2 years ago

Thank you for information.

Seems like UBX-CFG-GNSS is the required command.

To try this, I need to buy NEO-M8M.

raintonr commented 2 years ago

If you could suggest where to start I could try and make some changes and if they work submit a PR?

nopnop2002 commented 2 years ago

Thank you for your offer.

Unfortunately, the current code cannot send UART.

It needs to be reviewed from the ground up.

raintonr commented 2 years ago

At first thought, one could place some code in app_main() to open UART, write command string, close UART and carry on a usual.

I would imagine an optional 'GPS init command string' configuration option would be needed (along with TXD pin). If this is set, the string is sent to the GPS module on power-up, otherwise ignored.

Do you see any problem with such an inclusion?

nopnop2002 commented 2 years ago

That looks like a good idea. I'll try it.

raintonr commented 2 years ago

There is a utility here http://wiki.openmoko.org/wiki/Neo_FreeRunner_GPS (see UBX protocol section) for appending header & calculating checksum for these devices, so the use case for me would be:

  1. Figure out exactly what UBX-CFG-GNSS I need.
  2. Use ubxgen.py script from above page to create necessary ublox configuration packet.
  3. Copy/paste configuration packet into build configuration for esp-idf-GPS-Repeater.
  4. Connect TX and configure TX Pin.
  5. Rebuild & flash updated esp-idf-GPS-Repeater.
  6. Cross fingers! ;)
raintonr commented 2 years ago
  1. Figure out exactly what UBX-CFG-GNSS I need.

There are some good clues here: https://github.com/renatobo/bonogps/blob/main/hardware/GPS/README.md#gps-sbas

jessejgm commented 2 years ago

I can parse nmea messagens to send over bluetooth?

nopnop2002 commented 2 years ago

@jessejgm

I can parse nmea messagens to send over bluetooth?

Yes. It works for GPS Server for Bluetooth GPS. It works for Acceptor.

I use this initiator. https://play.google.com/store/apps/details?id=googoo.android.btgps