Giter Site home page Giter Site logo

Comments (8)

metlinux avatar metlinux commented on August 18, 2024

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

from sensecap_indicator_esp32.

the-confused-genius avatar the-confused-genius commented on August 18, 2024

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 #25 issue as it is a similar one and I have provided the fix there.

from sensecap_indicator_esp32.

yupyvovarov avatar yupyvovarov commented on August 18, 2024

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.

from sensecap_indicator_esp32.

the-confused-genius avatar the-confused-genius commented on August 18, 2024

@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 ?

from sensecap_indicator_esp32.

yupyvovarov avatar yupyvovarov commented on August 18, 2024

@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.

from sensecap_indicator_esp32.

metlinux avatar metlinux commented on August 18, 2024

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....

from sensecap_indicator_esp32.

yupyvovarov avatar yupyvovarov commented on August 18, 2024

@metlinux Your fix will probably work. But I am curious why the same indicator_city code works for indicator_basic. What is the difference?

from sensecap_indicator_esp32.

lordmortis avatar lordmortis commented on August 18, 2024

that mbedtls_ssl_setup error implies that there isn't enough memory. If you check out components/mbedtls/mbedtls/include/mbedtls/ssl.h, line 112 (of a checked out project) MBEDTLS_ERR_SSL_ALLOC_FAILED is mapped to -0x7F00.

What's a bit interesting is I added a log for getting the current heap free (ESP_LOGI(TAG, "Heap Free: %i", esp_get_free_heap_size());) just before the get request call (line 440 in examples/indicator_ha/main/model/indicator_city.c) and it showed there was 5 meg free (I (8594) city: Heap Free: 5173796), so it seems odd, unless i've got the wrong format specifier there

from sensecap_indicator_esp32.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.