Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gps power management problems #376

Closed
a-f-G-U-C opened this issue Sep 10, 2020 · 3 comments
Closed

Gps power management problems #376

a-f-G-U-C opened this issue Sep 10, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@a-f-G-U-C
Copy link
Contributor

There have been reports of sub-par performance of the ublox NEO-M8N GPS module under Meshtastic, and I have experienced some of it myself.

Device model: T22_V1.1 20191212 w/ u-blox NEO-M8N-0-10 GPS

Here are my observations and tentative fixes.

"No UBLOX GPS"

Sometimes, on startup, the Sparkfun u-blox library fails to initialize the GPS module, causing a fallback to standard NMEA (on a finger-crossing basis, as NMEA may be disabled in the GPS settings). The relevant error message is:

ERROR: No UBLOX GPS found
Hoping that NEMA might work

This happens fairly frequently, for me it's a little more than one in two cases.

The suspected cause is a problem in the Sparkfun library, which is currently being tentatively mitigated by repeating the initialization command twice in quick sequence.
https://github.com/meshtastic/Meshtastic-device/blob/288363b3a67d978ffa3b174d2280e2d647836ee4/src/gps/UBloxGPS.cpp#L48-L50

This mitigation is moderately effective, and I was able to improve it by adding a delay between the attempts:

    // try it a few times
    for (int i = 0; (i < 3) && !tryConnect(); i++)
        delay(500);

This fixed the UBLOX initialization problem for me.

Long acquisition time, unstable tracking with frequent loss of lock

In areas with weak GPS signals, Meshtastic takes an exceptionally long time to acquire a satellite lock, much longer than other GPS receivers - up to 20 hours in one case. It also seems to have a weaker tracking ability, and the time to recover from a signal loss is painfully long, over 1h in some cases.
These periods of no-fix are visually indicated by a slow blink of the red GPS LED (5s on, 15s off).

What fixed this problem, in my case, was disabling the GPS power-saving mode, here:
https://github.com/meshtastic/Meshtastic-device/blob/288363b3a67d978ffa3b174d2280e2d647836ee4/src/gps/UBloxGPS.cpp#L84
(changing true to false above caused the GPS to perform as expected)

I suspect the cause of the problem is a too ambitious implementation of the power saving mode on the NEO-M8 GPS, which in my case resulted in a degraded experience. Fortunately, with the new GPS models from u-blox, the power-saving mode is not an on-off affair; it comes with a lot of fine-tuning options, and a good power-performance balance is probably achievable - just not with the default settings.

Further info: u-blox M8 Power Management doc

Additional information

May be related and relevant to the following issues: #373, #339

@geeksville
Copy link
Member

ooh great! I will definitely apply your hack and your power save fix. I'll also repurpose this bug to (eventually) look into careful power management experiments for the M8 boards.

geeksville added a commit to meshtastic/protobufs that referenced this issue Sep 10, 2020
geeksville added a commit to geeksville/Meshtastic-esp32 that referenced this issue Sep 10, 2020
@geeksville
Copy link
Member

This issue has been mentioned on Meshtastic. There might be relevant details there:

https://meshtastic.discourse.group/t/timed-reboot-feature/1226/6

Dafeman pushed a commit to Dafeman/Meshtastic-device that referenced this issue Sep 14, 2020
@geeksville geeksville changed the title Performance issues with GPS NEO-M8N Gps power management problems Sep 30, 2020
geeksville added a commit to meshtastic/protobufs that referenced this issue Sep 30, 2020
@geeksville geeksville self-assigned this Sep 30, 2020
@geeksville geeksville added the bug Something isn't working label Sep 30, 2020
geeksville added a commit to geeksville/Meshtastic-esp32 that referenced this issue Sep 30, 2020
geeksville added a commit to meshtastic/protobufs that referenced this issue Oct 1, 2020
geeksville added a commit to geeksville/Meshtastic-esp32 that referenced this issue Oct 1, 2020
@geeksville
Copy link
Member

This issue has been mentioned on Meshtastic. There might be relevant details there:

https://meshtastic.discourse.group/t/higher-power-consumption-than-expected/1424/5

geeksville added a commit to geeksville/Meshtastic-esp32 that referenced this issue Oct 5, 2020
geeksville added a commit to geeksville/Meshtastic-esp32 that referenced this issue Oct 5, 2020
geeksville added a commit to geeksville/Meshtastic-esp32 that referenced this issue Oct 5, 2020
geeksville added a commit to geeksville/Meshtastic-esp32 that referenced this issue Oct 5, 2020
geeksville added a commit to geeksville/Meshtastic-esp32 that referenced this issue Oct 5, 2020
geeksville added a commit to geeksville/Meshtastic-esp32 that referenced this issue Oct 6, 2020
geeksville added a commit to geeksville/Meshtastic-esp32 that referenced this issue Oct 6, 2020
geeksville added a commit to meshtastic/python that referenced this issue Oct 6, 2020
geeksville added a commit to geeksville/Meshtastic-esp32 that referenced this issue Oct 6, 2020
…causes

bogus wakes on TBEAMS because the USB->SERIAL chip pulls the RX input
to ground.  This feature is no longer needed because in !isRouter
nodes we force the node to never sleep anyways when on USB power.

    // this doesn't work on TBEAMs when the USB is depowered (causes bogus interrupts)
    // So we disable this "wake on serial" feature - because now when a TBEAM (only) has power connected it
    // never tries to go to sleep if the user is using the API
    // gpio_wakeup_enable((gpio_num_t)SERIAL0_RX_GPIO, GPIO_INTR_LOW_LEVEL);
geeksville added a commit to geeksville/Meshtastic-esp32 that referenced this issue Oct 7, 2020
rickmark pushed a commit to rickmark/meshtastic-firmware that referenced this issue Dec 26, 2024
…timeout_secs

Deprecate unused mesh_sds_timeout_secs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants