Skip to content

Commit aca5d7a

Browse files
committed
GSMClient example: enable GSM library debug
1 parent 7eecb7c commit aca5d7a

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

libraries/GSM/examples/GSMClient/GSMClient.ino

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
/*
2+
GSMClient
3+
4+
This sketch connects to a website (https://example.com)
5+
using the Portenta CAT.M1/NB IoT GNSS Shield.
6+
7+
*/
8+
19
#include <GSM.h>
10+
#include <Arduino_DebugUtils.h>
11+
#include <GSMDebug.h>
12+
#include "arduino_secrets.h"
213

3-
#include "arduino_secrets.h"
414
char pin[] = SECRET_PIN;
515
char apn[] = SECRET_APN;
616
char username[] = SECRET_USERNAME;
@@ -13,19 +23,22 @@ GSMClient client;
1323

1424
void setup() {
1525

26+
Serial.begin(9600);
27+
while(!Serial) {}
28+
1629
#if defined(ARDUINO_EDGE_CONTROL)
1730
// Power ON MKR2
1831
pinMode(ON_MKR2, OUTPUT);
1932
digitalWrite(ON_MKR2, HIGH);
2033
#endif
2134

22-
Serial.begin(115200);
23-
while(!Serial) {}
24-
2535
// To enable AT Trace debug uncomment the following lines
2636
//GSM.trace(Serial);
2737
//GSM.setTraceLevel(4);
2838

39+
Debug.setDebugOutputStream(&Serial);
40+
Debug.setDebugLevel(4);
41+
2942
Serial.println("Starting Carrier Network registration");
3043
if(!GSM.begin(pin, apn, username, pass, CATNB, BAND_20 | BAND_19)){
3144
Serial.println("The board was not able to register to the network...");

0 commit comments

Comments
 (0)