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

[ublox] Do not run AT+COPS=0 when performing warm bootup if already registering/registered #2139

Merged
merged 4 commits into from
Jun 29, 2020

Conversation

avtolstoy
Copy link
Member

Problem

image

Despite being registered, an AT+COPS=0 call under some conditions may take substantial amount of time, which will prolong the bootup times.

Solution

  1. Only perform AT+COPS=0 conditionally. This is only implemented for uBlox-based devices, as Quectel seems to behave correctly and also we cannot reliably tell whether it's attempting to perform registration or not (it may report +COPS: 0 even if it's not attempting to find an operator).
  2. Additionally we've enabled packet domain errors (AT+CGEREP) which are useful in debugging connectivity issues
  3. This PR also makes sure that failure to open muxer data channel used for PPP connections is treated as a non-recoverable failure, causing modem reset.

Steps to Test

  1. Make sure a cellular device is connected to the cloud
  2. Reset
  3. AT+COPS=0 should not be executed
  4. It should reconnect back to the cloud almost instantaneously without blocking for up to minutes in AT+COPS=0 despite being already registered

Example App

N/A

References

N/A


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

// If the set command with <mode>=0 is issued, a further set
// command with <mode>=0 is managed as a user reselection
r = CHECK_PARSER(parser_.execCommand(5 * 60 * 1000, "AT+COPS=0,2"));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One quick thought on this: As written in the attached AT manual, this will trigger a re-selection which we want to avoid for faster bootup times (which is all good). If we have to deal with roaming locations though, is it worth having an AT+COPS=0 setting to in fact trigger a re-selection because otherwise what if it doesn't attach to network as expected. Am I making sense? Should we have a check that tells when to set AT+COPS=0 and when not to set it? I know we have 10 min timeout, but even after 10min when we hit this line, looks like we won't do another AT+COPS=0 in case which we may not register on a given network with edge case roaming scenarios and such?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But after 10 mins and a modem reset the modem on its own will start a new registration process (auto-COPS), right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. good point. That's also right. It should. (Reset is supposed to be more powerful than anything else.)

@keeramis keeramis self-requested a review June 25, 2020 16:20
@keeramis
Copy link
Contributor

keeramis commented Jun 26, 2020

Please note the caveats that were discussed related to errors like 118 for Host is unreachable.
Log snippet:

0000098020 [lwip] TRACE: sent [IPCP ConfReq id=0x4 <addr 10.97.60.89> <msdns1 174.47.40.106> <msdns2 174.47.20.106>]
0000098023 [net.ppp.client] TRACE: TX: 29
0000098024 [lwip] TRACE: pppos_write[3]: len=26
0000099282 [net.ppp.client] TRACE: RX: 10
0000099284 [lwip] TRACE: pppos_input[3]: got 10 bytes
0000099286 [net.ppp.client] TRACE: RX: 28
0000099287 [lwip] TRACE: rcvd [IPCP ConfReq id=0x5]
0000099289 [lwip] TRACE: pppos_input[3]: got 28 bytes
0000099291 [net.ppp.ipcp] TRACE: input 4
0000099293 [lwip] TRACE: sent [IPCP ConfAck id=0x5]
0000099295 [net.ppp.client] TRACE: TX: 12
0000099296 [lwip] TRACE: pppos_write[3]: len=8
0000099298 [lwip] TRACE: rcvd [IPCP ConfAck id=0x4 <addr 10.97.60.89> <msdns1 174.47.40.106> <msdns2 174.47.20.106>]
.
.
0000100368 [lwip] TRACE: rcvd [IPCP ConfReq id=0x6]

@avtolstoy avtolstoy added ready to merge PR has been reviewed and tested and removed needs review labels Jun 29, 2020
@avtolstoy avtolstoy merged commit 73393b0 into develop Jun 29, 2020
@avtolstoy avtolstoy deleted the fix/cops-user-reselection branch June 29, 2020 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ready to merge PR has been reviewed and tested
Projects
None yet
2 participants