Skip to content

Instantly share code, notes, and snippets.

@ma2shita
Last active January 29, 2021 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ma2shita/8a3a977223fd7f3154d4f38c75e29e49 to your computer and use it in GitHub Desktop.
Save ma2shita/8a3a977223fd7f3154d4f38c75e29e49 to your computer and use it in GitHub Desktop.
AT debug console for EC21-J on WioLTE
/*
Working exapmle on Console;
```
>> Waiting for AT command
+CPIN: READY
+QUSIM: 1
+QIND: SMS DONE
+QIND: PB DONE
OK
AT+CGDCONT?[enter] <== input from you
+CGDCONT: 1,"IPV4V6","internet","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 2,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 3,"IPV4V6","ims","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 4,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,1
OK
```
*/
#define BAUDRATE 9600
#define CONSOLE SerialUSB
#define EC21J SerialModule
#include <WioLTEforArduino.h> /* https://github.com/SeeedJP/WioLTEforArduino */
WioLTE Wio;
void setup() {
CONSOLE.begin(BAUDRATE);
Wio.Init();
Wio.PowerSupplyLTE(true);
delay(5000L);
if (!Wio.TurnOnOrReset()) {
CONSOLE.println(F("### ERROR! ###"));
return;
}
delay(3000L);
EC21J.write("ATE1"); // echo back ON
EC21J.write(0x0d); // send CR
CONSOLE.println(F(">> Waiting for AT command"));
}
void loop() {
if (EC21J.available()) {
CONSOLE.write(EC21J.read());
}
if (CONSOLE.available()) {
EC21J.write(CONSOLE.read());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment