RP6conrad / ESP-GPS-Logger

GPS logger for Speedsurfing, based on ESP32 & Ublox M8N hardware.
MIT License
28 stars 16 forks source link

Auto-detect baud rate and chip type #18

Closed prichterich closed 1 year ago

prichterich commented 1 year ago

At initialization, the firmware should determine the baud rate to use, and the type of chip (M8 or M10 based). Currently, supporting different chips is done by setting flags in the code, which is adequate for initial development, but not distribution.

Baud rate can be determined by sending "get info" commands, and checking that an "ACK" response as well as the expected content is received, trying different baud rates.

Basically, this means that the software verifies at the start that communication with the GPS works as expected. This should be done, anyway, but becomes essential when supporting different GPS chips and chip generations.

RP6conrad commented 1 year ago

Is now in the latest SW 5.73. Auto detect start with 9600bd, message MON VER to ublox. HW-version is evaluated, if not readable, switch to 38400 bd and evaluate MON VER again. Tested with Beitian BN (M8 9600bd), Beitian BE (M10 38400bd), Mateksys (M10 9600bd) and Bainianxing (M10 38400 bd).