-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
PPP: add "battery status" read stub functions #10043
Conversation
replaced all function protections with a #define to simplify code functionality. Also added "getBattery" functions to leverage "esp_modem_get_battery_status" call in ESP-MODEM.
👋 Hello WebDust21, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
libraries/PPP/src/PPP.cpp
Outdated
int volt, bcs, bcl; | ||
esp_err_t err = esp_modem_get_battery_status(_dce, volt, bcs, bcl); | ||
if (err != ESP_OK) { | ||
//log_e("esp_modem_get_battery_status failed with %d %s", err, esp_err_to_name(err)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are the log lines commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I copied the functionality from other functions in PPP.cpp (RSSI + BER), which had them commented out:
arduino-esp32/libraries/PPP/src/PPP.cpp
Line 515 in 690bdb5
// log_e("esp_modem_get_signal_quality failed with %d %s", err, esp_err_to_name(err)); |
arduino-esp32/libraries/PPP/src/PPP.cpp
Line 534 in 690bdb5
// log_e("esp_modem_get_signal_quality failed with %d %s", err, esp_err_to_name(err)); |
I guess I'm not sure why those two are commented out...when none of the others in the entire file are.
That's literally the only reason I commented them out...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the were commented out because they were causing floods during normal operation. If you expect the battery functions to often fail, you can leave them commented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL, OK...well...I uncommented those two lines referenced above in the latest commit...oops?
I would not expect those commands to be "frequent failures", but maybe they are problematic. No issues on my end though.
Description of Change
Tests scenarios
Tested on an ESP32-S2 with a SIM7080G modem. Love the PPP functionality, it just works! Just providing some functional extensibility to functionality that is already present.
output result
showing that the modem VCC power supply is 3.846v.
Related links
ESP-MODEM "esp_modem_get_battery_status": https://github.com/espressif/esp-protocols/blob/906e447193710c1772305a218a9d0b315a549de4/components/esp_modem/src/esp_modem_c_api.cpp#L280-L293
Initially I thought that "esp_modem_get_battery_status" was leveraging AT+CADC, but it's not: it's using AT+CBC: https://github.com/espressif/esp-protocols/blob/906e447193710c1772305a218a9d0b315a549de4/components/esp_modem/src/esp_modem_command_library.cpp#L207-L234