@@ -178,7 +178,7 @@ If you have found TinyGSM to be useful in your work, research or company, please
|
|||||||
4. Ensure that you have a stable power supply to the module of at least **2A**.
|
4. Ensure that you have a stable power supply to the module of at least **2A**.
|
||||||
5. Check if serial connection is working (Hardware Serial is recommended)
|
5. Check if serial connection is working (Hardware Serial is recommended)
|
||||||
Send an ```AT``` command using [this sketch](tools/AT_Debug/AT_Debug.ino)
|
Send an ```AT``` command using [this sketch](tools/AT_Debug/AT_Debug.ino)
|
||||||
6. Try out the [WebClient](https://github.com/vshymanskyy/TinyGSM/blob/master/examples/WebClient/WebClient.ino) example/
|
6. Try out the [WebClient](https://github.com/vshymanskyy/TinyGSM/blob/master/examples/WebClient/WebClient.ino) example
|
||||||
|
|
||||||
#### Writing your own code
|
#### Writing your own code
|
||||||
|
|
||||||
|
@@ -38,8 +38,8 @@
|
|||||||
#define SerialAT Serial1
|
#define SerialAT Serial1
|
||||||
|
|
||||||
// or Software Serial on Uno, Nano
|
// or Software Serial on Uno, Nano
|
||||||
//#include <SoftwareSerial.h>
|
// #include <SoftwareSerial.h>
|
||||||
// SoftwareSerial SerialAT(2, 3); // RX, TX
|
// SoftwareSerial SerialAT(2, 3); // RX, TX
|
||||||
|
|
||||||
// See all AT commands, if wanted
|
// See all AT commands, if wanted
|
||||||
// #define DUMP_AT_COMMANDS
|
// #define DUMP_AT_COMMANDS
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
// Range to attempt to autobaud
|
// Range to attempt to autobaud
|
||||||
#define GSM_AUTOBAUD_MIN 9600
|
#define GSM_AUTOBAUD_MIN 9600
|
||||||
#define GSM_AUTOBAUD_MAX 115200
|
#define GSM_AUTOBAUD_MAX 57600
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tests enabled
|
* Tests enabled
|
||||||
@@ -58,16 +58,16 @@
|
|||||||
#define TINY_GSM_TEST_WIFI false
|
#define TINY_GSM_TEST_WIFI false
|
||||||
#define TINY_GSM_TEST_TCP true
|
#define TINY_GSM_TEST_TCP true
|
||||||
#define TINY_GSM_TEST_SSL true
|
#define TINY_GSM_TEST_SSL true
|
||||||
#define TINY_GSM_TEST_CALL true
|
// #define TINY_GSM_TEST_CALL true
|
||||||
#define TINY_GSM_TEST_SMS true
|
// #define TINY_GSM_TEST_SMS true
|
||||||
#define TINY_GSM_TEST_USSD true
|
// #define TINY_GSM_TEST_USSD true
|
||||||
#define TINY_GSM_TEST_BATTERY true
|
#define TINY_GSM_TEST_BATTERY true
|
||||||
#define TINY_GSM_TEST_TEMPERATURE true
|
#define TINY_GSM_TEST_TEMPERATURE true
|
||||||
#define TINY_GSM_TEST_GSM_LOCATION true
|
#define TINY_GSM_TEST_GSM_LOCATION true
|
||||||
#define TINY_GSM_TEST_TIME true
|
#define TINY_GSM_TEST_TIME true
|
||||||
#define TINY_GSM_TEST_GPS true
|
#define TINY_GSM_TEST_GPS false
|
||||||
// powerdown modem after tests
|
// powerdown modem after tests
|
||||||
#define TINY_GSM_POWERDOWN false
|
#define TINY_GSM_POWERDOWN true
|
||||||
|
|
||||||
// set GSM PIN, if any
|
// set GSM PIN, if any
|
||||||
#define GSM_PIN ""
|
#define GSM_PIN ""
|
||||||
@@ -77,7 +77,8 @@
|
|||||||
// #define CALL_TARGET "+380xxxxxxxxx"
|
// #define CALL_TARGET "+380xxxxxxxxx"
|
||||||
|
|
||||||
// Your GPRS credentials, if any
|
// Your GPRS credentials, if any
|
||||||
const char apn[] = "YourAPN";
|
const char apn[] = "YourAPN";
|
||||||
|
// const char apn[] = "ibasis.iot";
|
||||||
const char gprsUser[] = "";
|
const char gprsUser[] = "";
|
||||||
const char gprsPass[] = "";
|
const char gprsPass[] = "";
|
||||||
|
|
||||||
@@ -119,16 +120,25 @@ void setup() {
|
|||||||
|
|
||||||
// !!!!!!!!!!!
|
// !!!!!!!!!!!
|
||||||
// Set your reset, enable, power pins here
|
// Set your reset, enable, power pins here
|
||||||
pinMode(23, OUTPUT);
|
pinMode(A5, OUTPUT);
|
||||||
digitalWrite(23, HIGH);
|
DBG("Pin HIGH");
|
||||||
|
digitalWrite(A5, HIGH);
|
||||||
|
delay(5000);
|
||||||
|
DBG("Pin LOW");
|
||||||
|
digitalWrite(A5, LOW);
|
||||||
|
delay(1300);
|
||||||
|
digitalWrite(A5, HIGH);
|
||||||
|
DBG("Pin HIGH");
|
||||||
|
// pinMode(20, OUTPUT);
|
||||||
|
// digitalWrite(20, HIGH);
|
||||||
// !!!!!!!!!!!
|
// !!!!!!!!!!!
|
||||||
|
|
||||||
DBG("Wait...");
|
DBG("Wait...");
|
||||||
delay(6000);
|
delay(6000);
|
||||||
|
|
||||||
// Set GSM module baud rate
|
// Set GSM module baud rate
|
||||||
TinyGsmAutoBaud(SerialAT, GSM_AUTOBAUD_MIN, GSM_AUTOBAUD_MAX);
|
// TinyGsmAutoBaud(SerialAT, GSM_AUTOBAUD_MIN, GSM_AUTOBAUD_MAX);
|
||||||
// SerialAT.begin(9600);
|
SerialAT.begin(9600);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
@@ -138,7 +148,6 @@ void loop() {
|
|||||||
if (!modem.restart()) {
|
if (!modem.restart()) {
|
||||||
// if (!modem.init()) {
|
// if (!modem.init()) {
|
||||||
DBG("Failed to restart modem, delaying 10s and retrying");
|
DBG("Failed to restart modem, delaying 10s and retrying");
|
||||||
delay(10000L);
|
|
||||||
// restart autobaud in case GSM just rebooted
|
// restart autobaud in case GSM just rebooted
|
||||||
// TinyGsmAutoBaud(SerialAT, GSM_AUTOBAUD_MIN, GSM_AUTOBAUD_MAX);
|
// TinyGsmAutoBaud(SerialAT, GSM_AUTOBAUD_MIN, GSM_AUTOBAUD_MAX);
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user