14
14
// #define CAYENNE_DEBUG // Uncomment to show debug messages
15
15
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
16
16
17
- // Select your modem:
17
+ // Uncomment your modem type :
18
18
#define TINY_GSM_MODEM_SIM800
19
19
// #define TINY_GSM_MODEM_SIM808
20
20
// #define TINY_GSM_MODEM_SIM900
@@ -28,13 +28,15 @@ Steps:
28
28
29
29
#include < CayenneMQTTGSM.h>
30
30
31
- // This sketch uses a software serial connection. You can replace this with a hardware serial if
32
- // your device supports it, e.g. Mega, Leonardo, etc.
31
+ // This sketch uses a software serial connection.
33
32
#include < SoftwareSerial.h>
34
33
SoftwareSerial gsmSerial (2 , 3 ); // RX, TX
34
+ // If you are using a device that supports a hardware serial (Mega, Leonardo, etc.) and prefer to use
35
+ // that you can comment out the above lines and uncomment the one below.
36
+ // #define gsmSerial Serial1
35
37
36
38
// GSM connection info.
37
- char apn[] = " AccessPointName " ; // Access point name. Leave empty if it is not needed.
39
+ char apn[] = " " ; // Access point name. Leave empty if it is not needed.
38
40
char gprsLogin[] = " " ; // GPRS username. Leave empty if it is not needed.
39
41
char gprsPassword[] = " " ; // GPRS password. Leave empty if it is not needed.
40
42
char pin[] = " " ; // SIM pin number. Leave empty if it is not needed.
@@ -46,6 +48,8 @@ char clientID[] = "CLIENT_ID";
46
48
47
49
void setup () {
48
50
Serial.begin (9600 );
51
+ // Auto-detect the GSM serial baud rate. You can manually set it instead if you want to save a bit of space.
52
+ TinyGsmAutoBaud (gsmSerial);
49
53
Cayenne.begin (username, password, clientID, gsmSerial, apn, gprsLogin, gprsPassword, pin);
50
54
}
51
55
0 commit comments