-
-
Save yuta-imai/15adc3184b8c9f41d154c745aeb83ebf to your computer and use it in GitHub Desktop.
AT debug console for EC21-J on WioLTE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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