You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Just in case someone defined the wrong thing..
#if TINY_GSM_USE_GPRS && not defined TINY_GSM_MODEM_HAS_GPRS
#undef TINY_GSM_USE_GPRS
#undef TINY_GSM_USE_WIFI
#define TINY_GSM_USE_GPRS false
#define TINY_GSM_USE_WIFI true
#endif
#if TINY_GSM_USE_WIFI && not defined TINY_GSM_MODEM_HAS_WIFI
#undef TINY_GSM_USE_GPRS
#undef TINY_GSM_USE_WIFI
#define TINY_GSM_USE_GPRS true
#define TINY_GSM_USE_WIFI false
#endif
while (SerialAT.available()) {
char c = SerialAT.read();
SerialMon.write(c);
}
}
void atCommands(){
//This function contains an AT command log to connect to AWS IoT core. Since the modem will not connect in the first place, this is //not the issue and I have not included it
return;
}
void setup() {
// Set console baud rate
SerialMon.begin(115200);
delay(10);
// Restart takes quite some time
// To skip it, call init() instead of restart()
SerialMon.println("Initializing modem...");
//modem.restart();
modem.init();
String modemInfo = modem.getModemInfo(); //Returns nothing, nothing past this line works.
SerialMon.print("Modem Info: ");
SerialMon.println(modemInfo);
SerialMon.print("Waiting for network...");
if (!modem.waitForNetwork()) {
SerialMon.println(" fail");
delay(10000);
return;
}
SerialMon.println(" success");
if (modem.isNetworkConnected()) { SerialMon.println("Network connected"); }
#if TINY_GSM_USE_GPRS
// GPRS connection parameters are usually set after network registration
SerialMon.print(F("Connecting to "));
SerialMon.print(apn);
if (!modem.gprsConnect(apn, gprsUser, gprsPass)) {
SerialMon.println(" fail");
delay(10000);
return;
}
SerialMon.println(" success");
if (modem.isGprsConnected()) { SerialMon.println("GPRS connected"); }
#endif
In the past, this code block has worked, but currently it will not. I am unable to receive the name of the modem from the getModemInfo() function, and thus unable to do anything with the board via Arduino code. The board is functioning when using the micro usb port and an AT command tester.
Expected result
In the past, this code has functioned as intended and for seemingly no reason it has stopped working. The code should setup the modem and then connect to AWS IoT core.
Actual result
The board will not be identified and thus will not connect or setup as intended.
Debug and AT command log
The modem does not initialize and thus AT commands don't work
The text was updated successfully, but these errors were encountered:
[x] I have read the Troubleshooting section of the ReadMe
What type of issues is this?
[ ] Request to support a new module
[ ] Bug or problem compiling the library
[ ] Bug or issue with library functionality (ie, sending data over TCP/IP)
[x] Question or request for help
What are you working with?
Modem: DIYMalls SIM7000A Revision: B04
Main processor board: ESP32
TinyGSM version: 0.11.7
Code:
Some code has been changed to arbitrary values such as the apn
#define TINY_GSM_MODEM_SIM7000SSL
#define SerialMon Serial
#include <SoftwareSerial.h>
SoftwareSerial SerialAT(16, 17);
#define TINY_GSM_USE_GPRS true
// Your GPRS credentials, if any
const char apn[] = "apn";
const char gprsUser[] = "";
const char gprsPass[] = "";
#include <TinyGsmClient.h>
#include <PubSubClient.h>
// Just in case someone defined the wrong thing..
#if TINY_GSM_USE_GPRS && not defined TINY_GSM_MODEM_HAS_GPRS
#undef TINY_GSM_USE_GPRS
#undef TINY_GSM_USE_WIFI
#define TINY_GSM_USE_GPRS false
#define TINY_GSM_USE_WIFI true
#endif
#if TINY_GSM_USE_WIFI && not defined TINY_GSM_MODEM_HAS_WIFI
#undef TINY_GSM_USE_GPRS
#undef TINY_GSM_USE_WIFI
#define TINY_GSM_USE_GPRS true
#define TINY_GSM_USE_WIFI false
#endif
TinyGsmClient client(modem);
PubSubClient mqtt(client);
uint32_t lastReconnectAttempt = 0;
void newPrintAT(String message){
SerialAT.println(message);
SerialMon.println(message);
delay(5000);
while (SerialAT.available()) {
char c = SerialAT.read();
SerialMon.write(c);
}
}
void atCommands(){
//This function contains an AT command log to connect to AWS IoT core. Since the modem will not connect in the first place, this is //not the issue and I have not included it
return;
}
void setup() {
// Set console baud rate
SerialMon.begin(115200);
delay(10);
SerialMon.println("Wait...");
// Set GSM module baud rate
//TinyGsmAutoBaud(SerialAT, GSM_AUTOBAUD_MIN, GSM_AUTOBAUD_MAX);
SerialAT.begin(9600);
delay(6000);
// Restart takes quite some time
// To skip it, call init() instead of restart()
SerialMon.println("Initializing modem...");
//modem.restart();
modem.init();
String modemInfo = modem.getModemInfo(); //Returns nothing, nothing past this line works.
SerialMon.print("Modem Info: ");
SerialMon.println(modemInfo);
SerialMon.print("Waiting for network...");
if (!modem.waitForNetwork()) {
SerialMon.println(" fail");
delay(10000);
return;
}
SerialMon.println(" success");
if (modem.isNetworkConnected()) { SerialMon.println("Network connected"); }
#if TINY_GSM_USE_GPRS
// GPRS connection parameters are usually set after network registration
SerialMon.print(F("Connecting to "));
SerialMon.print(apn);
if (!modem.gprsConnect(apn, gprsUser, gprsPass)) {
SerialMon.println(" fail");
delay(10000);
return;
}
SerialMon.println(" success");
if (modem.isGprsConnected()) { SerialMon.println("GPRS connected"); }
#endif
// MQTT Broker setup
mqtt.setServer(broker, 1883);
mqtt.setCallback(mqttCallback);
atCommands();
}
void loop() {
}
Scenario, steps to reproduce
In the past, this code block has worked, but currently it will not. I am unable to receive the name of the modem from the getModemInfo() function, and thus unable to do anything with the board via Arduino code. The board is functioning when using the micro usb port and an AT command tester.
Expected result
In the past, this code has functioned as intended and for seemingly no reason it has stopped working. The code should setup the modem and then connect to AWS IoT core.
Actual result
The board will not be identified and thus will not connect or setup as intended.
Debug and AT command log
The modem does not initialize and thus AT commands don't work
The text was updated successfully, but these errors were encountered: