mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-10 20:55:34 +00:00
NTP_SendRequest: Unable to send message - retry quickly after reboot
This commit is contained in:
@ -413,10 +413,10 @@ static int http_tasmota_json_status_STS(void* request, jsonCb_t printer, bool bA
|
||||
printer(request, "{");
|
||||
strftime(buff, sizeof(buff), "%Y-%m-%dT%H:%M:%S", localtime(&localTime));
|
||||
JSON_PrintKeyValue_String(request, printer, "Time", buff, true);
|
||||
format_time(Time_getUpTimeSeconds(), buff, sizeof(buff));
|
||||
format_time(g_secondsElapsed, buff, sizeof(buff));
|
||||
JSON_PrintKeyValue_String(request, printer, "Uptime", buff, true);
|
||||
//JSON_PrintKeyValue_String(request, printer, "Uptime", "30T02:59:30", true);
|
||||
JSON_PrintKeyValue_Int(request, printer, "UptimeSec", Time_getUpTimeSeconds(), true);
|
||||
JSON_PrintKeyValue_Int(request, printer, "UptimeSec", g_secondsElapsed, true);
|
||||
JSON_PrintKeyValue_Int(request, printer, "Heap", 25, true);
|
||||
JSON_PrintKeyValue_String(request, printer, "SleepMode", "Dynamic", true);
|
||||
JSON_PrintKeyValue_Int(request, printer, "Sleep", 10, true);
|
||||
@ -653,9 +653,9 @@ static int http_tasmota_json_status_generic(void* request, jsonCb_t printer) {
|
||||
JSON_PrintKeyValue_String(request, printer, "GroupTopic", CFG_DeviceGroups_GetName(), true);
|
||||
JSON_PrintKeyValue_String(request, printer, "OtaUrl", "https://github.com/openshwprojects/OpenBK7231T_App/releases/latest", true);
|
||||
JSON_PrintKeyValue_String(request, printer, "RestartReason", "HardwareWatchdog", true);
|
||||
JSON_PrintKeyValue_Int(request, printer, "Uptime", Time_getUpTimeSeconds(), true);
|
||||
JSON_PrintKeyValue_Int(request, printer, "Uptime", g_secondsElapsed, true);
|
||||
struct tm* ltm;
|
||||
int ntpTime = NTP_GetCurrentTime() - Time_getUpTimeSeconds();
|
||||
int ntpTime = NTP_GetCurrentTime() - g_secondsElapsed;
|
||||
ltm = localtime((time_t*)&ntpTime);
|
||||
|
||||
if (ltm != 0) {
|
||||
|
||||
@ -71,7 +71,6 @@ const char* methodNames[] = {
|
||||
#endif
|
||||
|
||||
void misc_formatUpTimeString(int totalSeconds, char* o);
|
||||
int Time_getUpTimeSeconds();
|
||||
|
||||
typedef struct http_callback_tag {
|
||||
char* url;
|
||||
@ -265,7 +264,7 @@ void http_html_end(http_request_t* request) {
|
||||
poststr(request, "<br>");
|
||||
poststr(request, g_build_str);
|
||||
|
||||
hprintf255(request, "<br>Online for <span id=\"onlineFor\" data-initial=\"%i\">-</span>", Time_getUpTimeSeconds());
|
||||
hprintf255(request, "<br>Online for <span id=\"onlineFor\" data-initial=\"%i\">-</span>", g_secondsElapsed);
|
||||
|
||||
WiFI_GetMacAddress((char*)mac);
|
||||
|
||||
|
||||
@ -819,7 +819,7 @@ static int http_rest_post_logconfig(http_request_t* request) {
|
||||
static int http_rest_get_info(http_request_t* request) {
|
||||
char macstr[3 * 6 + 1];
|
||||
http_setup(request, httpMimeTypeJson);
|
||||
hprintf255(request, "{\"uptime_s\":%d,", Time_getUpTimeSeconds());
|
||||
hprintf255(request, "{\"uptime_s\":%d,", g_secondsElapsed);
|
||||
hprintf255(request, "\"build\":\"%s\",", g_build_str);
|
||||
hprintf255(request, "\"ip\":\"%s\",", HAL_GetMyIPString());
|
||||
hprintf255(request, "\"mac\":\"%s\",", HAL_GetMACStr(macstr));
|
||||
|
||||
Reference in New Issue
Block a user