-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
drivers:modem: introducing config for cereg/creg for gsm #63769
drivers:modem: introducing config for cereg/creg for gsm #63769
Conversation
Please fix code compliance related issues. |
thanks sir for the comment, will address tomorrow. thanks for your patience. |
Just a comment, since this is a this or that, maybe this Kconfig symbol should be a choice symbol? In that case please remember to name the choice so a default choice can be selected in some overriding Kconfig. |
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.
would it be possible to use the COND_CODE1
? I just thought that it might look cleaner
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.
In that case please remember to name the choice so a default choice can be selected in some overriding Kconfig.
+1
thanks for the remarks, actually different manufacterers have shown different results although all of them are 4G, still I can think about it and work on it if that seems more intuitive to use in modem_gsm_type choice. thanks |
cd2bebc
to
ee84182
Compare
This contribution addresses the support for various types of modems in gsm driver. As some 4G modems have failed to return correct output from AT+CREG?, so AT+CEREG? is the right AT command in such situation. This commit provides the possibility for user to select one type of AT command. This PR fixes zephyrproject-rtos#63917 Signed-off-by: Tahir Akram <mtahirbutt@hotmail.com>
ee84182
to
2388054
Compare
Please review the changes. I have introduced a choice now. I have also worked with main branch, also thinking of creating a new PR with main branch. As Backport error is occuring here as I already created the issue and mention "Fix #1234" |
I dont think you can push something into a released branch like this, you will have to push things into the |
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.
please create another PR against main
Use particular type of AT command for registration status. | ||
|
||
config MODEM_GSM_SELECT_CREG | ||
bool "CREG command" |
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 think this can be a string type with "CREG"
as the default value
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.
Thanks. I tried but zephyr is not allowing me to use string as a type of choice. i do not find any example either. is there any?
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.
oops, didn't know that, sorry, how about
config MODEM_GSM_STATUS_COMMAND
string "Status command"
default "CREG" if MODEM_GSM_STATUS_CMD_USE_CREG
default "CEREG" if MODEM_GSM_STATUS_CMD_USE_CEREG
?
I found some similar things here: zephyrproject/modules/hal/espressif/components/esptool_py/Kconfig.projbuild
In any case, you should really create another PR against main
for better documentation of this development
Use this if the modem works only with AT+CREG?. | ||
|
||
config MODEM_GSM_SELECT_CEREG | ||
bool "CEREG command" |
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.
and this, with "CEREG"
as default value
@@ -36,6 +36,24 @@ config MODEM_GSM_QUECTEL | |||
|
|||
endchoice | |||
|
|||
choice MODEM_GSM_STATUS_COMMAND_TYPE |
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.
Then this can just be
choice MODEM_GSM_STATUS_COMMAND_TYPE | |
choice MODEM_GSM_STATUS_COMMAND |
static const struct modem_cmd check_net_reg_cmd = | ||
#if defined(CONFIG_MODEM_GSM_SELECT_CEREG) | ||
MODEM_CMD("+CEREG: ", on_cmd_net_reg_sts, 2U, ","); |
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.
then you can do this in one liner by concatenating:
"+" "CONFIG_MODEM_GSM_STATUS_COMMAND"
Please check the new PR #64025. All requested changes addressed. I will close this PR after a while. thanks. |
Moved to a new PR. |
As some tests with our 4G modems shown that AT+CREG? does not work as expected with the modems. Therefore, the modem does not get internet connection as the modem expects AT+CREG=0,5 for successful PPP connection but this is never accomplished as some modems do not return AT+CREG=0,5 on successful connection to an operator rather AT+CEREG? is the right AT command to use for such modems. Therefore, a new CONFIG is added to use AT+CEREG? for such modems.
The user can select AT+CREG? or AT+CEREG? according to the type the modem supports.
This PR fixes #63917