i tried to access "pool.ntp.org" from ESP32 through inline c to retrieve date and time
and every thing works will,,,,,
but while uploading with medication has no relation with the code it gives problem the attached in the image
and my inline c code is
and solution to return Unicode back???
and every thing works will,,,,,
but while uploading with medication has no relation with the code it gives problem the attached in the image
and my inline c code is
inline c code:
#if C
#include "time.h"
#ifdef ESP8266
int chip_id = ESP.getChipId();
#elif defined(ESP32)
int chip_id = ESP.getEfuseMac();
#endif
const char* ntpServer = "pool.ntp.org";
const long gmtOffset_sec = 3600;
const int daylightOffset_sec = 3600;
void initime(B4R::Object* o){
// Initialize the sensor - calibration
configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
}
void printLocalTime(B4R::Object* o)
{
struct tm timeinfo;
if(!getLocalTime(&timeinfo)){
Serial.println("Failed to obtain time");
return;
}
char* t;
time_t now = time(nullptr);
t=ctime(&now);
B4R::B4RString s;
s.wrap(t);
b4r_main::_timelog=&s;
b4r_main::_chpid=chip_id;
}
#End If
and solution to return Unicode back???