Hey there,
so i´m having a pretty strange behavior. Using Blynk.Edgent i can´t read DS18B20 Sensors. It´s just measuring -127.00°C.
Using only BlynkSimpleEsp32_SSL it´s working fine, also does it when i comment BlynkEdgent.run() out.
What could cause this? Is the overhead that comes with the Edgent Library too big? I really would like to use Edgent because of the WiFi Manager and Blynk.Air . Maybe some of you know a solution to this.
/*==============================================================================
* Blynk Parameter
*============================================================================*/
#define BLYNK_TEMPLATE_ID "TMPLhsDUJ-un"
#define BLYNK_DEVICE_NAME "ThermoWatch 21041001"
#define BLYNK_FIRMWARE_VERSION "0.1.7"
#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG
//#define APP_DEBUG
/*==============================================================================
* Include Section
*============================================================================*/
#include "Arduino.h"
#include "BlynkEdgent.h"
#include <OneWire.h>
#include <DallasTemperature.h>
//#include <U8g2lib.h>
//#include <Wire.h>
//#include <string>
//using namespace std;
/*==============================================================================
* Sensor Bus Parameter
*============================================================================*/
#define ONE_WIRE_BUS 4
// SensorBus Init
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
// Sensor Adressen auf dem BUS
DeviceAddress sensor1 = { 0x28, 0xFF, 0x64, 0x1E, 0x23, 0x86, 0x07, 0x1D };
// Sensor Variablen
BlynkTimer SensorTimer;
byte resolution = 10; // Sensor Auflösung
float TempSensor1; // Zwischenspeicher zum auslesen
/*==============================================================================
* BUS Abfrage
*============================================================================*/
void readBusandSend()
{
sensors.requestTemperatures();
TempSensor1 = sensors.getTempC(sensor1);
Blynk.virtualWrite(1, TempSensor1);
Serial.println(TempSensor1);
}
void setup()
{
// Show Boot Screen
Serial.begin(115200);
// Sensor init
sensors.begin();
sensors.setResolution(sensor1, resolution);
//sensors.setWaitForConversion(false);
// Blynk init
BlynkEdgent.begin();
SensorTimer.setInterval(5000L, readBusandSend);
// Non Blocking Loop Delay start
}
/*==============================================================================
* Main Loop
*============================================================================*/
void loop()
{
// Start Blynk
BlynkEdgent.run();
SensorTimer.run();
}