@vshymanskyy, Dear Volodymyr,
I am using the icomsat 1.1 SIM900 GSM with arduino Mega. I tried the tests with AT_Debug.ino, and I did not succeed. I thought it was my SIM900.
Module does not respond!
Check your Serial wiring
Check the module is correctly powered and turned on
but I tried sending sms with another code and it worked. Do you know if you have any problems with icomsat 1.1 SIM900 GSM.
Follows the code used for sms.
#include <SoftwareSerial.h>
SoftwareSerial gsm(50, 3);
void setup()
{
gsm.begin(9600);
Serial.begin(9600);
Serial.println("Type 'a' and hit Enter to send the test sms");
Serial.println("Note: Enter only the letter without the single quotation marks.");
}
void loop() // run over and over
{
char comando = Serial.read();
if (comando == 'a') {
enviaSMS();
}
}
void enviaSMS() {
gsm.print("AT+CMGF=1\r"); // Sets sms as text mode
delay(500);
gsm.println("AT+CMGS=\"+551499326984\"\r"); // Send command + destination phone number
delay(500);
gsm.println("Teste arduino\r"); // Text for the message
delay(500);
gsm.println((char)26);// End the commands and send the sms
delay(500);
Serial.println("SMS Sent with success");
}
I already bought a sim800l module. I started compiling the sketch that already comes ready inside the “Boards_GSM” folder of the blynk library called “SIM800_SIM900” and a compilation error occurred (I’m using Arduino Mega):
Exit status 1
No matching function for call to ‘TinyGsm :: GsmClient :: GsmClient (HardwareSerial &)’
Does anyone know how to fix this?
PS:The code:
//#define BLYNK_DEBUG
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
// 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[] = "YourAuthToken";
// Your GPRS credentials
// Leave empty, if missing user or pass
char apn[] = "YourAPN";
char user[] = "";
char pass[] = "";
// Hardware Serial on Mega, Leonardo, Micro
#define GsmSerial Serial1
// or Software Serial on Uno, Nano
//#include <SoftwareSerial.h>
//SoftwareSerial GsmSerial(2, 3); // RX, TX
TinyGsmClient gsm(GsmSerial);
void setup()
{
// Set console baud rate
Serial.begin(115200);
delay(10);
// Set GSM module baud rate
GsmSerial.begin(115200);
delay(3000);
// Restart takes quite some time
// You can skip it in many cases
Serial.println("Restarting modem...");
gsm.restart();
Blynk.begin(auth, gsm, apn, user, pass);
}
void loop()
{
Blynk.run();
}
Try the BlynkClient from TinyGSM lib example. It compiles (it is slightly different) but for me it doesn’t work either. It can’t connect with internet after calling AT+CSTT=... I’m working on it by myself, but as for now - no joy.
ok, it compiled… it uploaded to the board… and I have a steady blink every 3 seconds on my linksprite sim900 shield which implies it found a network and joined the APN, but the Blynk app is saying the Arduino Uno is offline. How best do I go about troubleshooting this ?
Thanks Marvin 7 for the advice. I tried the BlinkClient but I did not succeed in compiling either. Apparently it will have to be created from the outside the library examples.
No, the example indicated compiles fine! What board?
And check Blynk lib in library repository in Arduino IDE. I don’t know why, but it informed me about awaiting updates and among other there was a Blynk library. Updating this way helped.
Thank you again, I got it wrong, sorry. My board is Mega and module SIM800L. I updated the Blynk library inside the Arduino IDE and I compiled and received the error similar to that of Evan_Urue on ‘gsm was not declared’ in gsm.restart. I commented on this line and compiled it successfully. I’ll test tomorrow to see if it will work in the module.
I have used (modified for needs) example from TinyGsm library branch (BlynkClient). The one from Blynk branch have (or had?) some errors (compile error). Keep in mind the above note from @vshymanskyy, regarding modem.restart()
Handling PIN-LOCKED SIM is supported too, just call: modem.simUnlock("xxxx"); after modem.restart();
When using SoftwareSerial library, do not use (defaulted) BaudRate of 115200. It does not work correctly. I lowered it to 38400 and seems to be OK now.
Remember - IT IS GSM, and usually there are limited data packet. Keep it in mind when choosing updating interval (usually there is no need to update data every 1sec)
I’m still testing new connection method, but using simple project results in quite stable connection, although for 3 hours running time i had 5 reconnection attempts to Blynk server.