With old Blynk (Legacy) you’ll need to use library 0.6.1
You’re using 1.0.1 now, which is for new Blynk.
Your screenshot shows “Connecting to blynk-cloud:8080” and “Connecting to blynk:8080”.
These should say "Connecting to blynk-cloud.com:8080"
so you are somehow using the incorrect URL.
Without seeing your sketch it’s impossible to say why this is happening.
Pete.
Hi Pete,
Thank you for your prompt reply.
Let me investigate and revert back to you!
I will also send code.
Best regards,
Chris
Here is the code Pete:
#define BLYNK_PRINT Serial
/* Fill-in your Template ID (only if using Blynk.Cloud) */
//#define BLYNK_TEMPLATE_ID "TMPLzXui7aCz"
//#define BLYNK_DEVICE_NAME "GSM Turn Relay Module ON and OFF "
//#define BLYNK_AUTH_TOKEN "epbp2MQbhMZHE2jQidVKlgXcLqGIkTDQ";
// Please select the corresponding model
#define SIM800L_IP5306_VERSION_20200811
// Select your modem:
#define TINY_GSM_MODEM_SIM800
#define TINY_GSM_RX_BUFFER 1024 // Set RX buffer to 1Kb
// 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 <BlynkSimpleTinyGSM.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "ClG8HfYsOmc1-jGdPhKUX72HoBuqZGBs";
// Your GPRS credentials
// Leave empty, if missing user or pass
char apn[] = "internet";
char user[] = "";
char pass[] = "";
// set GSM PIN, if any
// #define GSM_PIN "1234"
// Hardware Serial on Mega, Leonardo, Micro
#define SerialAT Serial1
// Set serial for debug console (to the Serial Monitor, default speed 115200)
#define SerialMon Serial
// See all AT commands, if wanted
// #define DUMP_AT_COMMANDS
// Define the serial console for debug prints, if needed
#define TINY_GSM_DEBUG SerialMon
// or Software Serial on Uno, Nano
//#include <SoftwareSerial.h>
//SoftwareSerial SerialAT(2, 3); // RX, TX
#include "utilities.h"
#define relay1 18
#define relay2 14
#define relay3 15
#define relay4 19
#ifdef DUMP_AT_COMMANDS
#include <StreamDebugger.h>
StreamDebugger debugger(SerialAT, SerialMon);
TinyGsm modem(debugger);
#else
TinyGsm modem(SerialAT);
#endif
TinyGsmClient client(modem);
BLYNK_WRITE(V0)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
digitalWrite(relay1, !pinValue);
// process received value
}
BLYNK_WRITE(V1)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
digitalWrite(relay2, !pinValue);
// process received value
}
BLYNK_WRITE(V2)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
digitalWrite(relay3, !pinValue);
// process received value
}
BLYNK_WRITE(V3)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
digitalWrite(relay4, !pinValue);
// process received value
}
void setup()
{
// Debug console
Serial.begin(115200);
pinMode(relay1, OUTPUT);
pinMode(relay2, OUTPUT);
pinMode(relay3, OUTPUT);
pinMode(relay4, OUTPUT);
digitalWrite(relay1, HIGH);
digitalWrite(relay2, HIGH);
digitalWrite(relay3, HIGH);
digitalWrite(relay4, HIGH);
delay(10);
setupModem();
SerialMon.println("Wait...");
// Set GSM module baud rate and UART pins
SerialAT.begin(115200, SERIAL_8N1, MODEM_RX, MODEM_TX);
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();
SerialMon.print("Modem Info: ");
SerialMon.println(modemInfo);
// Unlock your SIM card with a PIN
// modem.simUnlock("1234");
Blynk.begin(auth, modem, apn, user, pass, "blynk", 8080);
}
void loop()
{
Blynk.run();
}
@ChrisCronje please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```
Pete.
Thank you for the advice Pete! Done
This is where your second message is coming from, I don’t know where the first one is coming from…
As I said earlier, this should be:
Blynk.begin(auth, modem, apn, user, pass, "blynk-cloud.com", 8080);
if you’re using Legacy.
Pete.
Hello Pete,
Changes made without success.
Please see message?
I am definitely reaching the internet, but not blynk cloud.
Is the firmware an issue?
Best regards,
Chris
I mean the library?
You ignored the advice about using library version 0.6.1
Pete.
Pete,
I must have missed it in the comments…I will test using V0.6.1
Thank you,
Chris
This was the comment…
Pete.
Hello Pete,
Please see message after changes to v0.6.1
Best regards,
Chris
SUCCESS!!!
and Online
My changes: Revert back to Lib V0.6.1
and Blynk.begin(auth, modem, apn, user, pass);
Best regards,
Chris
Nice!
Do you see the difference?
Indeed, thank you Peter, Bazzio and Joel for your guidance.
Enjoy the rest of your evening/day.
Best regards,
Chris
Dear Blynkers,
ESP32 GSM connected to blynk cloud was working fine. I switched ESP off and the next day on but did not connect to cloud.
I have tried and tested again today without success.
Please assist?
Best regards,
Chris
Reboot your router?
Pete.