Hello. I am testing this code provided in the example folder of T-Call 800L, but cannot connect to Blynk. I get: Connecting to ny3.blynk.cloud:80, but nothing else.
/**************************************************************
*
* For this example, you need to install Blynk library:
* https://github.com/blynkkk/blynk-library/releases/latest
*
* TinyGSM Getting Started guide:
* https://tiny.cc/tinygsm-readme
*
**************************************************************
*
* Blynk is a platform with iOS and Android apps to control
* Arduino, Raspberry Pi and the likes over the Internet.
* You can easily build graphic interfaces for all your
* projects by simply dragging and dropping widgets.
*
* Blynk supports many development boards with WiFi, Ethernet,
* GSM, Bluetooth, BLE, USB/Serial connection methods.
* See more in Blynk library examples and community forum.
*
* http://www.blynk.io/
*
* Change GPRS apm, user, pass, and Blynk auth token to run :)
**************************************************************/
#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 10
// Please select the corresponding model
// #define SIM800L_IP5306_VERSION_20190610
#define SIM800L_AXP192_VERSION_20200327
// #define SIM800C_AXP192_VERSION_20200609
// #define SIM800L_IP5306_VERSION_20200811
#include "utilities.h"
// Select your modem:
#define TINY_GSM_MODEM_SIM800
// Set serial for debug console (to the Serial Monitor, default speed 115200)
#define SerialMon Serial
// Set serial for AT commands (to the module)
// Use Hardware Serial on Mega, Leonardo, Micro
#define SerialAT Serial1
// See all AT commands, if wanted
//#define DUMP_AT_COMMANDS
// Define the serial console for debug prints, if needed
#define TINY_GSM_DEBUG SerialMon
// set GSM PIN, if any
#define GSM_PIN ""
// Your GPRS credentials, if any
const char apn[] = "internet.telekom";
const char gprsUser[] = "telekom";
const char gprsPass[] = "tm";
#include <TinyGsmClient.h>
#include <BlynkSimpleTinyGSM.h>
#ifdef DUMP_AT_COMMANDS
#include <StreamDebugger.h>
StreamDebugger debugger(SerialAT, SerialMon);
TinyGsm modem(debugger);
#else
TinyGsm modem(SerialAT);
#endif
TinyGsmClient client(modem);
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
const char auth[] = "J6lGF2KKBzBUPO78jptLJG5qJGoYpFGe";
void setup()
{
// Set console baud rate
SerialMon.begin(115200);
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, gprsUser, gprsPass, "ny3.blynk.cloud", 8080);
}
void loop()
{
Blynk.run();
}
Any idea why is not working? Anyone has a working code for Lilygo T-call?
Your IP address tells me that you’re in Germany, but you’re using the New York server.
Is NY3 the region shown in the bottom right hand corner of your web console?
You don’t have #define BLYNK_TEMPLATE_ID or #define BLYNK_TEMPLATE_NAME in your sketch.
What version of the Blynk library are you us8ng, and where did this example sketch come from?
Have you examined the board to see which chip type you have?
Well, that’s a legacy example. You’ve obviously made s9me modifications of your own, but you didn’t mention that in your initial post and you’ve not shared the full details.
That wasn’t the chip I was asking about. You e selected the SIM800L AXP192…
but is this what’s actually on the board you are using?
If this is a legacy example, it is the only one, as far as I know, provided by the manufacturer of the board. Please let me know where to find a better (working) one.
The only modifications I did were to add my credentials ID, NAME, AUTH and SIM card parameters, which I am hiding here, yes.
If you are asking about “the chip”, I assume you refer to the microcontroller, but if you refer to the modem, it is actually SIM800L_IP5306_VERSION_20200811, which I have selected in the code, but still not connecting:
[161673] Connecting to blynk.cloud:80
[175690] Connecting to blynk.cloud:8080
It’s a while since I used a TTGO T-CALL and when I did it was using Blynk Legacy with a TTGO board that said “BLYNK_V1.3” on it. Not sure if this is the same as yours.
This is my old Legacy code with few changes that should allow it to function with Blynk IoT, but I’m away from home at the moment and don’t have any hardware here that would allow me to test it.
#define BLYNK_TEMPLATE_ID "REDACTED"
#define BLYNK_TEMPLATE_NAME "REDACTED"
#define BLYNK_AUTH_TOKEN "REDACTED"
#define BLYNK_PRINT Serial
#define BLYNK_HEARTBEAT 30
#define TINY_GSM_MODEM_SIM800
#include <TinyGsmClient.h>
#include <BlynkSimpleTinyGSM.h>
#include <Wire.h>
#include "utilities.h"
// TTGO T-Call pin definitions
#define MODEM_RST 5
#define MODEM_PWKEY 4
#define MODEM_POWER_ON 23
#define MODEM_TX 27
#define MODEM_RX 26
#define I2C_SDA 21
#define I2C_SCL 22
// Set serial for debug console (to the Serial Monitor, default speed 115200)
#define SerialMon Serial
// Hardware Serial on TTGO Call
#define SerialAT Serial1
const char apn[] = "TM";
const char user[] = "";
const char pass[] = "";
TinyGsm modem(SerialAT);
void setup()
{
// Set console baud rate
SerialMon.begin(115200);
delay(10);
// Keep power when running from battery
Wire.begin(I2C_SDA, I2C_SCL);
bool isOk = setPowerBoostKeepOn(1);
SerialMon.println(String("IP5306 KeepOn ") + (isOk ? "OK" : "FAIL"));
// Set-up modem reset, enable, power pins
pinMode(MODEM_PWKEY, OUTPUT);
pinMode(MODEM_RST, OUTPUT);
pinMode(MODEM_POWER_ON, OUTPUT);
digitalWrite(MODEM_PWKEY, LOW);
digitalWrite(MODEM_RST, HIGH);
digitalWrite(MODEM_POWER_ON, HIGH);
// Set GSM module baud rate and UART pins
SerialAT.begin(115200, SERIAL_8N1, MODEM_RX, MODEM_TX);
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");
SerialMon.print("Waiting for network...");
if (!modem.waitForNetwork(240000L)) {
SerialMon.println(" fail");
delay(5000);
return;
}
SerialMon.println(" OK");
if (modem.isNetworkConnected()) {
SerialMon.println("Network connected");
}
SerialMon.print(F("Connecting to APN: "));
SerialMon.print(apn);
if (!modem.gprsConnect(apn, user, pass)) {
SerialMon.println(" fail");
delay(5000);
return;
}
SerialMon.println(" OK");
Blynk.config (modem, BLYNK_AUTH_TOKEN, "lon1.blynk.cloud", 80);
Blynk.connect();
}
BLYNK_CONNECTED()
{
SerialMon.println("Blynk Connected");
}
void loop()
{
Blynk.run();
}
this is the utilities.h file…
#define IP5306_ADDR 0x75
#define IP5306_REG_SYS_CTL0 0x00
bool setPowerBoostKeepOn(int en)
{
Wire.beginTransmission(IP5306_ADDR);
Wire.write(IP5306_REG_SYS_CTL0);
if (en) {
Wire.write(0x37); // Set bit1: 1 enable 0 disable boost keep on
} else {
Wire.write(0x35); // 0x37 is default reg value
}
return Wire.endTransmission() == 0;
}
No idea if this will work for your hardware, and as I’ve said its untested on Blynk IoT
Many thanks, IT WORKS!!
I have replaced the Telekom card for a Telefonica card. I have also changed #define BLYNK_HEARTBEAT 60
to match the value in the Blynk console.
Great Pete, working!!
Note: my board is T-Call BLYNK_V1.4 20-08-11
The console displays the value set by the device, although you probably need to refresh the console after the device has connected.
The reason for having a value of 60 is the higher latency and poorer signal quality associated with GPRS connections. If the device is mobile, or you have disconnection issues then you may need to increase the heartbeat value.