-
Notifications
You must be signed in to change notification settings - Fork 123
Improve cellular client reconnection #302
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
Conversation
Restart system if it already too long Bump airgradient-client: Improve ensureClientConnection
Restart system if it already too long
Check calls happen in both task
examples/OneOpenAir/OneOpenAir.ino
Outdated
bool resetModule = true; | ||
if ((millis() - startTimeClientNotReady) > (60 * 60000)) { | ||
Serial.println("Power cycling module"); | ||
cell->powerOff(); |
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.
cell -> cellularCard
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.
Change it to cellularModule. Don't really agree to say cellular card, since its actually a cellular module. Or do you have an opinion for this?
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.
For me the module is the code and the card the hardware. Here we have a problem with the hardware (or network), not with the code? Or does cellularModule refer to the A7672G chip on the CE card? Then there could still be issues like e.g. the A7672G not being able to communicate with the SIM card, so cellularModule referring to the A7672G would be misleading in such a case?
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.
Ahh, we have a different definition then. I guess the convention in c or c++ is never saying module, instead of library. But even though if it is, we never add module when declaring variable or library (eg. agClient not agClientLibrary).
Or does cellularModule refer to the A7672G chip on the CE card
yes
I'm not agree with CE card because the chip is not actually communicate with the sim card, but the module. I think we can say sim card as the part of the whole module, since its actually can be a common sim card or e-sim. What you think?
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.
OK, yes, library for the software makes sense. But the hardware we called CE-Card from the very start, not CE-module.
In the lib "Failed reinitialized cellular module |
Propose to also add a sample log where we see the two mechanisms kick in to the PR |
Attached the logs, module unplugged around 17:28 Point of interest:
|
examples/OneOpenAir/OneOpenAir.ino
Outdated
/** | ||
* If in 2 hours still not ready, then restart esp | ||
*/ | ||
void checkCellularClientNotReady() { |
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.
I still don't like the name, we can't guess what it does.
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.
Updated to restartIfCeClientIssueOverTwoHours
examples/OneOpenAir/OneOpenAir.ino
Outdated
while (i != 0) { | ||
if (ag->isOne()) { | ||
String tmp = "Rebooting in " + String(i); | ||
oledDisplay.setText("CE error", "since 1h", tmp.c_str()); |
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.
should it say 2h
Rename checkCellularClientNotReady to restartIfCeClientIssueOverTwoHours
examples/OneOpenAir/OneOpenAir.ino
Outdated
Serial.println("Cellular client not ready, ensuring connection..."); | ||
// Start time if value still default | ||
if (agCeClientProblemDetectedTime == 0) { | ||
agCeClientProblemDetectedTime = MICROS_TO_MINUTES(); |
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.
minor, I think it should be named
minutes()
or so (similar to millis()), we do not pass anything in
Changes