Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIM7000A Not being detected #787

Open
robersont1 opened this issue Mar 31, 2024 · 0 comments
Open

SIM7000A Not being detected #787

robersont1 opened this issue Mar 31, 2024 · 0 comments

Comments

@robersont1
Copy link

[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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant