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

fix #4367 make USB power detection work correctly on seeed trackers #4376

Merged
merged 3 commits into from
Aug 3, 2024

Conversation

geeksville
Copy link
Member

for wio tracker 1110 and 1000-E and possibly other nrf52 boards. The problem was that nrf52 power stuff wasn't generating regular powerstatus notifications (because that code was guarded by a batteryLevel check which was null for those boards). So I've cleaned up the battery status stuff a bit and we now have fewer special cases.
Tested on a 1000-E, tracker 1110 and a rak4631 board.

(fix #4367)

…trackers

for wio tracker 1110 and 1000-E and possibly other nrf52 boards.
The problem was that nrf52 power stuff wasn't generating regular
powerstatus notifications (because that code was guarded by a batteryLevel
check which was null for those boards).  So I've cleaned up the battery status stuff
a bit and we now have fewer special cases.
Tested on a 1000-E, tracker 1110 and a rak4631 board.
@geeksville geeksville marked this pull request as ready for review August 2, 2024 22:55
@thebentern
Copy link
Contributor

Legend!
I be willing to bet that's a regression from some of the recent work on using INA sensors for device battery level voltage.

@fifieldt
Copy link
Contributor

fifieldt commented Aug 3, 2024

nice! Care to add to the wio-sdk-wm1110 too?

@geeksville
Copy link
Member Author

nice! Care to add to the wio-sdk-wm1110 too?

hmm - I'm not sure if it will work there because on that board the USB isn't really going to the nrf52840, instead it is going to a little USB serial chip (oops). I'll check the schematic though.

@geeksville
Copy link
Member Author

@fifieldt just checked schematic. Alas, this approach won't work for that board.

Btw is a bummer they forgot to include (at-least) a voltage-divider circuit to let the CPU sense the battery voltage (as far as I can tell - haven't checked super carefully).

I hope they included battery level sensing in the 1000-E board because if they didn't: ouch.

@geeksville
Copy link
Member Author

oh they did for the 1000-E. good!

#define BATTERY_PIN 2
#define ADC_MULTIPLIER (2.0F)

#define ADC_RESOLUTION 14
#define BATTERY_SENSE_RESOLUTION_BITS 12

@fifieldt
Copy link
Contributor

fifieldt commented Aug 3, 2024

ah! I forgot about that. Thank you very much for investigating.

@thebentern thebentern merged commit dd552a9 into meshtastic:master Aug 3, 2024
100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Seeed Tracker T1000-E tracker doesn't detect when USB power is applied
3 participants