Skip to content

Instantly share code, notes, and snippets.

@2matzzz
Last active February 26, 2019 10:04
Show Gist options
  • Save 2matzzz/4cc584066accbefc872f313ad3527a00 to your computer and use it in GitHub Desktop.
Save 2matzzz/4cc584066accbefc872f313ad3527a00 to your computer and use it in GitHub Desktop.
#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