Open jardous opened 4 months ago
I hade the same issue, and it seems to be caused by a part of the code in indicator_city.c Actually there is no issue with ssl but with the zonestr
To be precise it occurs in "static void __indicator_http_task(void *p_arg)"
I adjusted:
if( net_flag && ip_flag && !time_zone_flag) {
ESP_LOGI(TAG, "Get time zone...");
err = __time_zone_get(__g_city_model.ip);
if( err == 0) {
char zone_str[32];
float zone = __g_city_model.local_utc_offset / 3600.0;
if( zone >= 0) {
snprintf(zone_str, sizeof(zone_str) - 1, "UTC-%.1f", zone);
} else {
snprintf(zone_str, sizeof(zone_str) - 1, "UTC+%.1f", 0 - zone);
}
indicator_time_net_zone_set( zone_str );
time_zone_flag = true;
}
}
into
if( net_flag && ip_flag && !time_zone_flag) {
ESP_LOGI(TAG, "Get time zone...");
char zone_str[32];
snprintf(zone_str, sizeof(zone_str) - 1, "UTC-2:00");
indicator_time_net_zone_set( zone_str );
time_zone_flag = true;
}
I agree it is somewhat radical, and limits my zone to UTC-2:00, so please if you use this adjust this to your own zone But it works till it gets fixed. With this error you have, it will continue to loop through this procedure which seems a waste of resources.
If others know of a better fix, please share
Hey @metlinux
The actual issue is that the code fetches the UTC based on you IP address using an API. This UTC is then not properly formatted in the code, which causes the time error.
Yes you can either hard code the UTC or change the snprintf line so that the UTC is formatted properly as expected by dependent code
You can check this https://github.com/Seeed-Solution/SenseCAP_Indicator_ESP32/issues/25 issue as it is a similar one and I have provided the fix there.
I have a similar issue
but only with indicator_ha, indicator_basis uses identical code and does not produce this error. I do not understand why and how to fix it.
@yupyvovarov It seems to be connection issue with your wifi ?
Is It able to connect with your wifi ? The internal chip used here is esp32 which has issue connecting with 5 GHz wifi, so is you wifi having 2.4 Ghz ?
Have you used the same code provided in the release build ? and have you tried flashing different (previous) release builds ?
@the-confused-genius No it's not. The WiFi connection is OK. It can connect to the internet, retrieve location, and send metrics to HA, but do not set a time zone. As I mentioned, the basic example firmware works perfectly, the ha example - doesn't. The Indicator HA update release firmware works as expected, but failed when I tried to build it by myself.
I have a similar issue but only with indicator_ha, indicator_basis uses identical code and does not produce this error. I do not understand why and how to fix it.
I also just had it with indicator_ha. Do try the workaround that I mentioned above....
@metlinux Your fix will probably work. But I am curious why the same indicator_city code works for indicator_basic. What is the difference?
indicator_hr is showing one hour less than it should
Time Auto Update: ON
timezone Europe/Berlin
two possible culprits: