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

drivers: modem: add Quectel EG25-G #64746

Merged
merged 1 commit into from Nov 13, 2023

Conversation

ldenefle
Copy link
Contributor

@ldenefle ldenefle commented Nov 2, 2023

No description provided.

@zephyrbot zephyrbot added area: Devicetree Binding PR modifies or adds a Device Tree binding area: Modem labels Nov 2, 2023
@ycsin
Copy link
Collaborator

ycsin commented Nov 2, 2023

Commit should have message and sign-off

@bbilas
Copy link
Collaborator

bbilas commented Nov 2, 2023

Would be not better if we put all of those definitions into separate headers? I mean something like

...snip...
#if DT_HAS_COMPAT_STATUS_OKAY(quectel_eg25_g)
#include "quectel_eg25_g.h"
#endif

#if DT_HAS_COMPAT_STATUS_OKAY(quectel_egXX)
#include "quectel_egXX.h"
#endif
...snip...

(or use some macrology)
where quectel_eg25_g.h would contain:

MODEM_CHAT_SCRIPT_CMDS_DEFINE(quectel_eg25_g_init_chat_script_cmds,
			      MODEM_CHAT_SCRIPT_CMD_RESP("ATE0", ok_match),
			      MODEM_CHAT_SCRIPT_CMD_RESP("AT+CFUN=4", ok_match),
			      MODEM_CHAT_SCRIPT_CMD_RESP("AT+CMEE=1", ok_match),
			      MODEM_CHAT_SCRIPT_CMD_RESP("AT+CREG=1", ok_match),
			      MODEM_CHAT_SCRIPT_CMD_RESP("AT+CGREG=1", ok_match),
			      MODEM_CHAT_SCRIPT_CMD_RESP("AT+CEREG=1", ok_match),
			      MODEM_CHAT_SCRIPT_CMD_RESP("AT+CREG?", ok_match),
			      MODEM_CHAT_SCRIPT_CMD_RESP("AT+CEREG?", ok_match),
			      MODEM_CHAT_SCRIPT_CMD_RESP("AT+CGREG?", ok_match),
			      MODEM_CHAT_SCRIPT_CMD_RESP("AT+CGSN", imei_match),
			      MODEM_CHAT_SCRIPT_CMD_RESP("", ok_match),
			      MODEM_CHAT_SCRIPT_CMD_RESP("AT+CGMM", cgmm_match),
			      MODEM_CHAT_SCRIPT_CMD_RESP_NONE("AT+CMUX=0,0,5,127,10,3,30,10,2",
							      0));

MODEM_CHAT_SCRIPT_DEFINE(quectel_eg25_g_init_chat_script, quectel_eg25_g_init_chat_script_cmds,
			 abort_matches, modem_cellular_chat_callback_handler, 10);

MODEM_CHAT_SCRIPT_CMDS_DEFINE(quectel_eg25_g_dial_chat_script_cmds,
			      MODEM_CHAT_SCRIPT_CMD_RESP_MULT("AT+CGACT=0,1", allow_match),
			      MODEM_CHAT_SCRIPT_CMD_RESP("AT+CGDCONT=1,\"IP\","
							 "\""CONFIG_MODEM_CELLULAR_APN"\"",
							 ok_match),
			      MODEM_CHAT_SCRIPT_CMD_RESP("AT+CFUN=1", ok_match),
			      MODEM_CHAT_SCRIPT_CMD_RESP_NONE("ATD*99***1#", 0),);

MODEM_CHAT_SCRIPT_DEFINE(quectel_eg25_g_dial_chat_script, quectel_eg25_g_dial_chat_script_cmds,
			 dial_abort_matches, modem_cellular_chat_callback_handler, 10);

@bjarki-trackunit
Copy link
Collaborator

@bbilas We definitely need to separate it out somehow, I still don't know exactly what the best solution is though, and it should be its own PR I think :)

@ldenefle ldenefle force-pushed the quectel-eg25-g branch 2 times, most recently from 241c70a to b1021fe Compare November 3, 2023 15:39
rerickson1
rerickson1 previously approved these changes Nov 3, 2023
ycsin
ycsin previously approved these changes Nov 4, 2023
@ldenefle
Copy link
Contributor Author

ldenefle commented Nov 6, 2023

rebased and added periodic chat scripts

This commit introduces support for the modem EG25-G from Quectel.

Signed-off-by: Lucas Denefle <lucas.denefle@converge.io>
Copy link
Collaborator

@ycsin ycsin left a comment

Choose a reason for hiding this comment

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

Is it possible to generalize Quectel chat scripts? They look pretty similar, EC21 and its variants would be using the same init process as well

@ldenefle
Copy link
Contributor Author

ldenefle commented Nov 7, 2023

They all look very similar tbf, I think there's a potential for a refacto there but should it be done in a separate PR ?
I also don't have other quectel modems with me so won't be able to test any changes.

@ldenefle
Copy link
Contributor Author

Hello, what's the update on the status of this PR ?
I could potentially merge the quectel init scripts but I could also do this in a separate PR, I'd like to get this one merged :)

@bjarki-trackunit
Copy link
Collaborator

Sorry, forgot about it :) @rerickson1 @ycsin

@MaureenHelm MaureenHelm merged commit f9d0a4c into zephyrproject-rtos:main Nov 13, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Devicetree Binding PR modifies or adds a Device Tree binding area: Modem Drivers area: Modem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants