Add RAK12501 L76K GPS support for RAK3401#2927
Conversation
Merge dev branch
Address review comments
Co-authored-by: Copilot <copilot@github.com>
…on-parse-failure Fix: CMD_SEND_RAW_PACKET not freeing packet on parse failure
…off-to-uA-202607 Fixed hibernate / poweroff for BLE companions and repeaters to stay at uA
fix misspelled RF switch pin macros in SX1268/LLCC68/SX1276 radio wrappers
Previously load() returned true unconditionally on file-open success, masking truncated or corrupt /regions2 files. Additionally, the first field of each entry record (r->id) used the same success-chaining pattern as subsequent fields, so a clean EOF at a record boundary set success=false and would have been indistinguishable from real corruption once the return value was fixed. The r->id read is now split out: n==0 is a clean EOF (break, success retains its prior value from the header read), n!=sizeof(r->id) is a partial read or corruption (break, success=false). load() now returns success instead of an unconditional true, so its return value reflects the actual parse outcome. Companion fix to meshcore-dev#2372, which fixed the same return-true hardcoding in save(). (meshcore-dev#1891 originally reported this on load() but was closed when meshcore-dev#2372 landed — that PR only touched save(); this addresses the load() side.)
External watchdog support was added (but never merged) for MeshTower V1. The update's V2's #defines to follow the conventions set there and piggy back off the support already written for V1.
The M6 is the only board whose simple_repeater env ships with MESH_DEBUG=1 and GPS_NMEA_DEBUG=1 enabled. MESH_DEBUG=1 adds a 5-second boot delay (examples/simple_repeater/main.cpp) plus verbose per-packet serial prints on the hot RX/TX path; GPS_NMEA_DEBUG=1 echoes every GPS UART character to the serial console (MicroNMEALocationProvider.h). Every sibling repeater env (M1, M3, t1000-e, RAK, Heltec) ships these off, and the M6 room_server env in this same file already has them commented. Comment them out to match.
next_check and next_gps_update stored a future millis() value in a signed long and compared with a naive '>'. After the ~24.8-day millis() sign flip the deadline sits above the wrapped millis(), so the block never runs again and GPS->RTC time-sync (and the location cache refresh) stall permanently until reboot. Switch to unsigned deadlines with the wrap-safe signed- difference compare '(long)(millis() - deadline) > 0', matching the idiom in Dispatcher::millisHasNowPassed. Also: reorder the MicroNMEALocationProvider ctor init-list to declaration order (silences -Wreorder) and drop the always-true 'if (_claims > 0)' guard in claim() (claim() always runs after _claims++, so it is >= 1).
Without ROOM_PASSWORD the guest password defaults to empty, and a client sending a blank password is granted read+write access (can post). Every other board's room_server env sets ROOM_PASSWORD; the ThinkNode M6 and M1 were the only two shipping an open room. Default them to "hello" to match the rest of the tree; operators can still change it at runtime with 'set guest.password'.
|
You might also want to enable Glonass and if your board has known time, inject that too for a quicker fix. (In theory you could also provide approximate location as well or entire almanac, but that's harder to ship.) |
…-default-password ThinkNode M6/M1 room_server: set ROOM_PASSWORD default
…-debug-flags ThinkNode M6 repeater: disable leftover MESH_DEBUG/GPS_NMEA_DEBUG
…d_watchdog_2 Feed external hardware watchdog on Heltec Tower V2 (aka MeshTower V2) Implementation 2
Update RadioLib to v7.7.1-6d893483
Add support for Elecrow ThinkNode M7
…c-millis-overflow sensors: fix millis() rollover that stalls GPS time-sync on long-uptime nodes
Add support for Elecrow ThinkNode M9
|
Looks good, but need you to change the base branch to 'dev' |
|
Please make sure to rebase it on the dev branch too, and not just change to dev branch in GitHub UI ;) Otherwise it will pull in all the commits from your main base branch. |
…eof-handling fix(RegionMap): load() returns actual read success instead of hardcoded true
|
Heads up that this overlaps with #2640, which already includes the same |
9d251c4 to
ecbd327
Compare
|
@liamcottle I rebased my RAK3401/RAK12501 GPS branch onto Thanks for the heads up that this overlaps with #2640 on the RAK3401 pin swap/shared-rail handling, I will yield to let #2640 merge first. @disq after that lands, I’ll rebase my branch on top of the updated |
Summary
Adds RAK12501 / Quectel L76K UART GPS initialization for the RAK3401 1W target.
This keeps the change scoped to the RAK3401 variant by:
MicroNMEALocationProviderinvariants/rak3401/target.cppSerial1.setPins(PIN_GPS_TX, PIN_GPS_RX)call maps to MCU RX/TX correctlyWB_IO2 / PIN_3V3_ENas a GPS enable pin, because that rail is shared with the RAK13302 1W PA support railGPS init behavior
The RAK12501/L76K wrapper sends: