Skip to content

Commit 056831d

Browse files
committed
GSM: examples, power on MKR2 slot on edge control
1 parent f4b9903 commit 056831d

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

libraries/GSM/examples/GNSSClient/GNSSClient.ino

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@ char username[] = SECRET_USERNAME;
88
char pass[] = SECRET_PASSWORD;
99

1010
void setup() {
11+
12+
#if defined(ARDUINO_EDGE_CONTROL)
13+
// Power ON MKR2
14+
pinMode(ON_MKR2, OUTPUT);
15+
digitalWrite(ON_MKR2, HIGH);
16+
#endif
17+
1118
Serial.begin(115200);
1219
while (!Serial) {}
1320

21+
// To enable AT Trace debug uncomment the following lines
22+
//GSM.trace(Serial);
23+
//GSM.setTraceLevel(4);
24+
1425
Serial.println("Starting Carrier Network registration");
1526
if(!GSM.begin(pin, apn, username, pass, CATNB)){
1627
Serial.println("The board was not able to register to the network...");

libraries/GSM/examples/GSMClient/GSMClient.ino

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#include <GSM.h>
22

3-
REDIRECT_STDOUT_TO(Serial);
4-
53
#include "arduino_secrets.h"
64
char pin[] = SECRET_PIN;
75
char apn[] = SECRET_APN;
@@ -14,8 +12,20 @@ int port = 80;
1412
GSMClient client;
1513

1614
void setup() {
15+
16+
#if defined(ARDUINO_EDGE_CONTROL)
17+
// Power ON MKR2
18+
pinMode(ON_MKR2, OUTPUT);
19+
digitalWrite(ON_MKR2, HIGH);
20+
#endif
21+
1722
Serial.begin(115200);
1823
while(!Serial) {}
24+
25+
// To enable AT Trace debug uncomment the following lines
26+
//GSM.trace(Serial);
27+
//GSM.setTraceLevel(4);
28+
1929
Serial.println("Starting Carrier Network registration");
2030
if(!GSM.begin(pin, apn, username, pass, CATNB, BAND_20 | BAND_19)){
2131
Serial.println("The board was not able to register to the network...");

libraries/GSM/examples/GSMSSLClient/GSMSSLClient.ino

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,20 @@ int port = 443;
2020
GSMSSLClient client;
2121

2222
void setup() {
23+
24+
#if defined(ARDUINO_EDGE_CONTROL)
25+
// Power ON MKR2
26+
pinMode(ON_MKR2, OUTPUT);
27+
digitalWrite(ON_MKR2, HIGH);
28+
#endif
29+
2330
Serial.begin(115200);
2431
while(!Serial) {}
32+
33+
// To enable AT Trace debug uncomment the following lines
34+
//GSM.trace(Serial);
35+
//GSM.setTraceLevel(4);
36+
2537
Serial.println("Starting Carrier Network registration");
2638
if(!GSM.begin(pin, apn, username, pass, CATM1, BAND_3 | BAND_20 | BAND_19)){
2739
Serial.println("The board was not able to register to the network...");

0 commit comments

Comments
 (0)