Hi,
I have been using Blynk via Wifi for a few years now, and have found it great! I am now trying to increase the range of my projects by using GSM/GPRS, SIM800C at the moment. My microcontroller of choice recently has been the ESP32, which has been working very well for me over WiFi.
I am now in a position where I have got a working SIM800C module which has got a 3A 5V supply, can connect to APN and generally is working ok.
I am having issues when trying to get the simple BlynkClient code to work. It gets thorught to connecting to Blynk, but never properly connects, it just constantly cycles on " Connecting to blynk-cloud.com:80"
After doing lotsa of research and forum reading, I have tried the followng combinations:
Variant 1 :
• Hardware - ESP32WROOM & Sim800C
• SIM - Giff Gaff
• Blynk server
• Blynk Library version - 0.6.1
Variant 2 :
• Hardware - ESP32WROOM & Sim800C
• SIM - O2
• Blynk server
• Blynk Library version - 0.6.1
Variant 3 :
• Hardware - Arduino Uno & Sim800C
• SIM - Giff Gaff
• Blynk server
• Blynk Library version - 0.6.1
Variant 4 :
• Hardware - Arduino Uno & Sim800C
• SIM - O2
• Blynk server
• Blynk Library version - 0.6.1
Variant 5 :
• Hardware - Arduino Uno & Sim800C
• SIM - Vodafone
• Blynk server
• Blynk Library version - 0.6.1
When changing between the ESP32 and the Uno I have been setting up the serial line correctly and taking note of the requirements for the ESP32. I have added the Blynk debug to try and get a better understanding of what is going on, but I cannot find any ref to the infomration it is giving me.
My code is:
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#define BLYNK_DEBUG
// Default heartbeat interval for GSM is 60
// If you want override this value, uncomment and set this option:
//#define BLYNK_HEARTBEAT 30
// Select your modem:
#define TINY_GSM_MODEM_SIM800
#include <TinyGsmClient.h>
#include <BlynkSimpleSIM800.h>
// Set serial for debug console (to the Serial Monitor, default speed 115200)
#define SerialMon Serial
// Hardware Serial on Mega, Leonardo, Micro
//HardwareSerial Serial2(1);
//#define SerialAT Serial2
// or Software Serial on Uno, Nano
#include <SoftwareSerial.h>
SoftwareSerial SerialAT(2, 3); // RX, TX
// Your GPRS credentials
// Leave empty, if missing user or pass
//GIFFGAFF//
/*
char apn[] = "giffgaff.com";
char user[] = "giffgaff";
char pass[] = "";
*/
//Vodafone//
/*
char apn[] = "internet";
char user[] = "web";
char pass[] = "web";
*/
//O2//
/*
char apn[] = "wap.o2.co.uk";
char user[] = "o2web";
char pass[] = "password";
*/
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
const char auth[] = "?????????????";
TinyGsm modem(SerialAT);
void setup()
{
// Set console baud rate
SerialMon.begin(115200);
delay(10);
// Set GSM module baud rate
//SerialAT.begin(9600, SERIAL_8N1, 4, 2, false);
SerialAT.begin(9600);
delay(3000);
// Restart takes quite some time
// To skip it, call init() instead of restart()
SerialMon.println("Initializing modem...");
modem.restart();
String modemInfo = modem.getModemInfo();
SerialMon.print("Modem: ");
SerialMon.println(modemInfo);
// Unlock your SIM card with a PIN
//modem.simUnlock("1234");
Blynk.begin(auth, modem, apn, user, pass);
}
void loop()
{
Blynk.run();
}
My Serial monitor output is:
Initializing modem...
Modem: SIM800 R14.18
[8939]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.6.1 on Arduino Uno
[8948] Modem init...
[10082] Connecting to network...
[14495] Network: vodafone
[14495] Connecting to internet ...
[24417] Connected to GPRS
[24486] Connecting to blynk-cloud.com:80
[25752] <[1D|00|01|00] adf63610003d4e329b5ac72930208df8
[26172] Cmd error
[26272] Connecting to blynk-cloud.com:80
[26908] <[1D|00|01|00] adf63610003d4e329b5ac72930208df8
[27310] Cmd error
[27409] Connecting to blynk-cloud.com:80
[28067] <[1D|00|01|00] adf63610003d4e329b5ac72930208df8
[28486] Cmd error
[28587] Connecting to blynk-cloud.com:80
[29247] <[1D|00|01|00] adf63610003d4e329b5ac72930208df8
[29746] Cmd error
nitializing modem...
Modem: SIM800 R14.18
[12632]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.6.1 on Arduino Uno
[12641] Modem init...
[13773] Connecting to network...
[18469] Network: O2
[18469] Connecting to giffgaff.com ...
[24672] Connected to GPRS
[24741] Connecting to blynk-cloud.com:80
[25635] <[1D|00|01|00] adf63610003d4e329b5ac72930208df8
[26012] Cmd error
[26114] Connecting to blynk-cloud.com:80
[26792] <[1D|00|01|00] adf63610003d4e329b5ac72930208df8
[27170] Cmd error
[27271] Connecting to blynk-cloud.com:80
[27831] <[1D|00|01|00] adf63610003d4e329b5ac72930208df8
[28310] Cmd error
Dosent matter which combination of hardware or SIM I use, just does not seem to connect properly. The hardware is connecting to Blynk as it is showing as online through the app, it is not getting thorugh to the loop section though.
Any help would be much appreciated.
Thank you