For testing I need to make a B523/B524 run a specific network technology, in this case 2G with the Quectel specific command AT+QCFG=“nwscanmode”,1,1
I tried the doc example here: Device OS API | Reference Documentation | Particle but in setup instead of loop.
SerialLogHandler logHandler(LOG_LEVEL_TRACE);
void setup()
{
WITH_LOCK(Cellular) {
Cellular.command("AT+QCFG=“nwscanmode”,1,1\r\n");
}
}
void loop(){
}
But it does not have any effect, and a trace show an “ERROR” response.
[connected ...]
0000041549 [system] INFO: Cloud connected
0000041550 [ncp.at] TRACE: > AT+QCFG=“nwscanmode”,1,1
0000041553 [ncp.at] TRACE: < ERROR
[... etc.]
I later tried this logging the cellular.command response, and that is = -3 meaning RESP_ERROR
.
With “AT” (or AT+CPAS) it works fine:
0000004721 [system] INFO: Cloud connected
0000004722 [ncp.at] TRACE: > AT
0000004723 [ncp.at] TRACE: < OK
[... etc.]
Also tried AT commands including quotes just requesting status info such as AT+QCFG=“nwscanmode”
and AT+QCFG=“nwscanseq”
, that I believe should get an OK, but it is still an error response.
So I am wondering if quotation marks in AT commands are making trouble, and how to handle that in cellular.command()
?