The module is blinking each 3 sec aprox. which means that sim card is working and connected.
My Hardware: NodeMCU + SIM800L + LM2596
USB charger is 5V 2.4A and LM2596 delivers 4.1V to SIM800L
Code:
#define BLYNK_PRINT Serial
// Select your modem:
#define TINY_GSM_MODEM_SIM800
// Default heartbeat interval for GSM is 60
// If you want override this value, uncomment and set this option:
//#define BLYNK_HEARTBEAT 30
#include <TinyGsmClient.h>
#include <BlynkSimpleSIM800.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "XXXXXXXX";
// Your GPRS credentials
// Leave empty, if missing user or pass
char apn[] = "gprs.oi.com.br";
char user[] = "oi";
char pass[] = "oi";
// Hardware Serial on Mega, Leonardo, Micro
//#define SerialAT Serial1
// or Software Serial on Uno, Nano
#include <SoftwareSerial.h>
SoftwareSerial SerialAT(13, 15); // RX, TX
TinyGsm modem(SerialAT);
void setup()
{
// Debug console
Serial.begin(9600);
delay(10);
// Set GSM module baud rate
SerialAT.begin(115200);
delay(1000);
// Restart takes quite some time
// To skip it, call init() instead of restart()
Serial.println("Initializing modem...");
//modem.restart();
// Unlock your SIM card with a PIN
//modem.simUnlock("1234");
Blynk.begin(auth, modem, apn, user, pass);
}
void loop()
{
Blynk.run();
}
I’m struggling for 3 weeks in this project.
Any idea??
Well, that might mean it is connected to your Cell provider at least…
But is that enough for full operation?
You will also want to confirm that you are crossing the RX (on ESP) to TX (on shield) and vice versa.
This seems a little fast for Software Serial… yes, I know it should work in theory, but generally communication with Blynk Server over serial “shields” work better at 9600 (of course you will need to program your SIM800 for the same rate.
BTW, are you using the correct SoftwareSerial Library for ESP8266… and supported pins? I have never used SWS on ESP, but I understand it is a bit different then on Arduino.
The ESP8266 does have one and a half serial ports. The ‘half a port’ is Tx only, which makes it ideal for serial debug via an FTDI adapter.
Obviously wired software updates (as opposed to OTA) still use the primary serial port, so the SIM800 would need to be disconnected to allow new firmware to be uploaded via the primary UART.
My Arduino Nano has arrived and… still “Cannot init…”
Yes.
Yes, I crossed. I cross all the time.
Reduced to 9600. Still not working.
Now I’m trying on an Arduino Nano.
Both sim cards are working on phones, apns are double-checked, tried different kinds of power sources, always taking care not to over power (V and A).
Still nothing.
Should it be the SIM800L??
I have no idea why an Arduino Nano would be a better choice of MCU in this case than an ESP. If anything, I would have thought a Mega would have been a better choice as you’d have multiple UARTS.
It’s also worth remembering that not all SIM cards will work well with modules like the SIM800 as it still relies on the firmware of the SIM800 to work with the SIM card. I had a UK GifGaf SIM card that refused to work with a SIM900 and eventually had to buy a different brand of SIM to get it to work, despite the GifGaf card working in my phone.
The best way to test it is to connect an FTDI adapter to the SIM800 and talk to it direct from your PC’s serial monitor with AT commands to diagnose what’s happening.
There are also SIM800 test scripts out there that can be used to diagnose what’s happening with the module.
Hi!
Some progress after changing SIM800L
Now I can test AT commands and even put a simple Blynk project online. Hardware is OK!
Still issues with the bigger project. During setup with GPS and DS18B20, the SIM800L “cannot init…”.
GPS and temperature sensor were working great in a NodeMCU project, so I discarted any hardware or wiring problem.
void setup()
{
delay(3000);
// Debug console
Serial.begin(9600);
delay(10);
// Set GSM module baud rate
SerialAT.begin(9600);
delay(3000);
// Restart takes quite some time
// To skip it, call init() instead of restart()
Serial.println("Initializing modem...");
//modem.init();
// Unlock your SIM card with a PIN
//modem.simUnlock("1234");
delay(10000);
Serial.println("Initializind GPS...");
ss.begin(GPSBaud);
delay(3000);
gpstimer.setInterval(5000L, checkGPS); // every 5s check if GPS is connected, only really needs to be done once
//Blynk.begin(auth, ssid, pass); //for Wi-FI
Blynk.begin(auth, modem, apn, user, pass); //for GSM
DS18B20.begin();
timer.setInterval(5000L, getSendData); // every 5s reades temperature
}```
Any idea?
Thanks!
Have you been through al the issues discussed here, and the usual stuff too?
Providing sufficient power to the SIM800 (that can draw a couple of amps)
Tx to Rx and Rx to Tx
Communicating at the correct baud rate
If you’re using SoftwareSerial on an Arduino then not exceeding 9600 baud
Not using the same serial port for debugging and SiM800 comms
This might help you to understand some of those issues better…