Last active
February 26, 2019 10:04
-
-
Save 2matzzz/4cc584066accbefc872f313ad3527a00 to your computer and use it in GitHub Desktop.
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
#include <WioCellLibforArduino.h> | |
WioCellular Wio; | |
void setup() { | |
delay(200); | |
SerialUSB.begin(115200); | |
SerialModule.begin(115200); | |
SerialUSB.println(""); | |
SerialUSB.println("--- START ---------------------------------------------------"); | |
SerialUSB.println("### I/O Initialize."); | |
Wio.Init(); | |
SerialUSB.println("### Power supply ON."); | |
Wio.PowerSupplyCellular(true); | |
delay(500); | |
SerialUSB.println("### Turn on or reset."); | |
#ifdef ARDUINO_WIO_LTE_M1NB1_BG96 | |
Wio.SetAccessTechnology(WioCellular::ACCESS_TECHNOLOGY_LTE_M1); | |
Wio.SetSelectNetwork(WioCellular::SELECT_NETWORK_MODE_MANUAL_IMSI); | |
#endif | |
if (!Wio.TurnOnOrReset()) { | |
SerialUSB.println("### ERROR! ###"); | |
return; | |
} | |
SerialUSB.println("### Connecting to \"soracom.io\"."); | |
if (!Wio.Activate("soracom.io", "sora", "sora")) { | |
SerialUSB.println("### ERROR! ###"); | |
return; | |
} | |
SerialUSB.println("### Setup completed."); | |
} | |
void loop() { | |
if (SerialUSB.available()) { | |
SerialModule.write(SerialUSB.read()); | |
} | |
if (SerialModule.available()) { | |
SerialUSB.write(SerialModule.read()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment