-
Notifications
You must be signed in to change notification settings - Fork 3k
Cellular: Make ATHandler::cmd_start() virtual #7564
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
@wajahat-ublox Could the implementation be similar to |
Thank you for your suggestion. I will surely consider your proposal and get a more through understanding. One thing i want to highlight is that each modem has a different wake-up mechanism e.g. the SARA-U2 requires a pin toggle so in future the wake-up mechanism would be target dependent. I think it would be much easier to manage this vendor specific feature in one place.
We currently plan to override the cmd_start method. A timer
The wake-up mechanism is to send a character, wait a few milliseconds, send AT command and test response to make sure modem is awake. Please correct me if i am wrong but I think this is the least intrusive way of doing it. We have handled redundancy and robustness as well. At bottom level, it is just one extra character and few ms delay once every 5 seconds if and only if there is an inactivity.
Actually the 6s is the time-to-goto-sleep, i.e. if there is no communication between modem and hostMCU in past 6 seconds, the modem goes to sleep. |
@wajahat-ublox yes, it looks like a good idea to make Thanks for sharing also the code, here are a couple of suggestions.
It could be also good to change The code could then look something like (not tested): |
@AriParkkila |
/morph build |
Build : SUCCESSBuild number : 2707 Triggering tests/morph test |
Exporter Build : FAILUREBuild number : 2336 |
Test : SUCCESSBuild number : 2438 |
/morph export-build |
Exporter Build : SUCCESSBuild number : 2347 |
You should also change destructor as virtual |
@jarvte |
@wajahat-ublox no props, you should not need to rebase. |
/morph build |
Build : SUCCESSBuild number : 2718 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 2353 |
Test : SUCCESSBuild number : 2450 |
/morph mbed2-build |
@AriParkkila |
Cellular: Make ATHandler::cmd_start() virtual
Description
Ublox cellular modems, in particular SARA-R4, feature a proprietary power saving mode also known as idle mode. This idle mode is not to be confused with 3GPP Power Saving Mode. It can be enabled or disabled using AT+UPSV command. Once the idle mode is enabled, modem goes to sleep mode if there is an inactivity on serial interface between modem and hostMCU for more than 6 seconds.
The mechanism to wake the modem up from sleep mode is to send a character (e.g. 'A') to the modem before sending the actual AT command. However modem takes a while (~1ms) before it is ready to accept AT commands. This mean that to communicate with the modem while it is asleep, we need to send AT command like this:
Send 'A'
Delay(1)
Send <AT_command>
In order to incorporate the wake-up mechanism, we need to make the ATHandler::cmd_start() virtual so that it can be overridden with our own implementation. This means that modem will always be waken up irrespective of the AT_xxxxxxx class from where function call is made.
Pull request type