Hello, I have a project for my Thesis, i Want to upload to blynk the values from several sensors with TTGO-TCALL through GSM network.
The project connecting to internet, connecting to blynk server (:80 old one),and seems to upload data correctly but nothink appears in web dashboard even if the tag in dashboard is (online).
Attach and some images
This is my code with only one sensor connecting for testing porpose, if anyone can help i apreciate.
#define BLYNK_TEMPLATE_ID "TMPLkjL4LPXy" REDACTED
#define BLYNK_DEVICE_NAME "4AssistanceV2" REDACTED
#define BLYNK_AUTH_TOKEN "R2_cYvJJnWDejCG3ticRZ-nyY4kN1r-4" REDACTED
#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
// 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"
#include "secrets.h"
#include "ThingSpeak.h"
#include "Wire.h"
#include "OneWire.h"
#include "DallasTemperature.h"
#define ONE_WIRE_BUS_1 2
OneWire ourWire1(ONE_WIRE_BUS_1);
DallasTemperature sensor1(&ourWire1);
float RawLow = 0.75;
float RawHigh = 100.12;
float ReferenceLow = 0;
float ReferenceHigh = 100.06;
float RawRange = RawHigh - RawLow;
float ReferenceRange = ReferenceHigh - ReferenceLow;
float RawValue =0;
float TrueValue =0;
char TmpStr[8];
// 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"; // search for apn of your network provider on Google
const char gprsUser[] = "";
const char gprsPass[] = "";
#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);
float Body_Tmp_Flag1_previous_Value = 0;
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
const char auth[] = BLYNK_AUTH_TOKEN;
BlynkTimer timer;
void Vupdate()
{
sensor1.requestTemperatures();
RawValue = sensor1.getTempCByIndex(0);
TrueValue = (((RawValue - RawLow) * ReferenceRange) / RawRange) + ReferenceLow;
dtostrf(TrueValue, 5, 2, TmpStr);
Serial.print("Sens. 1 ");
Serial.println(TrueValue, 1);
Blynk.virtualWrite(V1, TmpStr);
Blynk.syncVirtual(V1);
if (TrueValue != Body_Tmp_Flag1_previous_Value)
{
Body_Tmp_Flag1_previous_Value = TrueValue;
Serial.println("Values Updated");
}
}
void setup()
{
// Set console baud rate
SerialMon.begin(115200);
sensor1.begin();
sensor1.setResolution(11);
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);
// Setup a function to be called every second
timer.setInterval(1000L, Vupdate);
}
void loop()
{
Blynk.run();
timer.run();
}