Repository navigation
Big GPS refactor - #3753
Big GPS refactor#3753fdlamotte wants to merge 27 commits into
Conversation
|
This is exciting to see. Please make sure to factor in the NMEA auto-baud selection from #3729. This fixes GROVE GPS modules from M5Stack, for example. And it would also be good to fold in #3736. Also, does the common virtual API of the base class facilitate devices like the Thinknode M1 that have a physical on/off switch that relies on the firmware to actually disable/enable the GPS (as opposed to a switch that physically disconnects power from the GPS module)? |
Yes, #3729 can easily be implemented in GpsDriver, I think #3736 would better sit in LocationProvider
Are you sure the physical button on M1 is not an hw switch as on M5 ? I've just refactored both to use the same path (because if switch is HW there is no need to poll) but your comment make me think maybe I'm wrong (and I still don't have the M1 to test that) edit: I have confirmation the switch is purely software on M1 ... too bad. I should probably take care of sw gps switch in the driver then (to keep coherent with the gps state) |
|
I own a v1 M1. The switch is just a GPIO input; it does not physically disconnect/power down the GPS module in the M1. |
Some targets have been modified to meet the new interface Most of the low level stuff has moved to the GpsDriver class The most impacted ports are : - Nano G2 Ultra - MeshTracker X1 - Heltec Tracker - both Muzi SuperIO radios - T1000E - ThinkNode M1/M5 - Heltec Mesh Solar - MeshAdventurer Builds run on all these highly impacted variants, but could only test on T1000e and ThinkNode M1. Meshsolar has strange build issues as companion but it probably predates the refactoring, builds well as repeater
64bd276 to
5284a6c
Compare
|
Ok, the refactoring has been ported to all ports. I think I now need some feedbacks on what I possibly have broken ;) I'm doing tests on my side with what I have ... The feedback I'd need would be on:
I've notice a build issue with meshsolar companions, this predates this PR (also happens in dev) |
aa297fd to
3988a52
Compare
|
I just saw #3760 got opened, which suggests it too has a software GPS switch. (I don't own this hardware, so can't check, myself.) |
|
Look like the new GPS module is coming. |
79f2839 to
700fb7e
Compare
|
I just checked the rak serial nmea gps path using a modified variant using rak classes and it works Still need some input from people using rak with i2c gps module |
…which is coherent)
The refactor no longer calls Serial1.setPins() on nRF52, so Serial1 uses PIN_SERIAL1_RX/TX directly. Those were swapped (the GPS transmits on P0.20), so no data was received. Fix them and define PIN_GPS_TX/RX by the gps module's side, as other variants do. The ATGM336H keeps its NMEA output config across power cycles, and other firmware may leave every sentence disabled. Re-enable GGA + RMC after each power-up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested on a Muzi Base Uno + SuperIO, following up on #3760. As-is, the Muzi GPS gets no data: the refactor no longer calls The new switch handling works well: off at boot in the middle position, on at the top, and both the switch and the UI toggle power the GPS down and back up correctly. PR with the pin fix and the ATGM336H NMEA re-enable on top of your branch: fdlamotte#1 |
muzi_base: fix GPS UART pins and re-enable ATGM336H NMEA output
Thank you very much ... So I'll check for lost assignations I could have missed in the process ;) |
|
I'm restoring setPins Think I found some way to simplify things too |
13fe808 to
11db2a0
Compare
Following #3684 I'll work here on refactoring GPS management
The idea is to keep LocationProvider as the interface to the loop, but adding GpsDriver class to manage low-level things
I also tried to pull all i2c RAK GPS related things out of EnvironmentSensorManager ... this was huge and I hope I didn't do any mistake as I don't have i2c rak gps ... if someone can help me with testing ...
periodic wakeup has been added, and a command is available for the repeater CLI, will make a GPSPrefs class to share gps command between repeater and companion
Still a long way to go (as I've seen lots of bad things in current code with active waits on gps frames for instance !)