Git Product home page Git Product logo

mender-esp32-example's Issues

Stack overflow in task mender

Hi there,

I just tried to go through your intructions for connecting a ESP32 module with mender, unfortunately there are some errors displayed when flashing the device, i added a screenshot of the Error message in the terminal down below. (stack overflow)
Afterwards it starts rebooting multiple times with the same result.

I also tried to flash on another device but the error is still there, the main device I am using is an ESP32-WROOM-32, so I guess there should be no poblem about flash sizes or stuff like that. Do you have any advices how to fix this error?

Thanks in advance for any kind of help.

with best regards
Sam

Errorpicture

Condition never true in mender_api_perform_authentication

Hi @joelguittet,

Yes it's me again :)
This time it's not really an issue, but more a remark. I was looking to add an info to the identity of the device (we use a "Serial Number" field instead of the mac address to quickly find our device on Mender server). I found where to add it, but was surprise not to see it on server side. I just found out that it's because even if I don't have a tenant token, the else condition from the following code is never fired:

    /* Format payload */
    if (NULL != mender_api_config.tenant_token) {
        if (NULL
            == (payload = (char *)malloc(strlen("{ \"id_data\": \"{ \\\"mac\\\": \\\"\\\"}\", \"pubkey\": \"\", \"tenant_token\": \"\" }")
                                         + strlen(mender_api_config.mac_address) + strlen(public_key_pem) + strlen(mender_api_config.tenant_token) + 1))) {
            mender_log_error("Unable to allocate memory");
            ret = MENDER_FAIL;
            goto END;
        }
        sprintf(payload,
                "{ \"id_data\": \"{ \\\"mac\\\": \\\"%s\\\"}\", \"pubkey\": \"%s\", \"tenant_token\": \"%s\" }",
                mender_api_config.mac_address,
                public_key_pem,
                mender_api_config.tenant_token);
    } else {
        if (NULL
            == (payload = (char *)malloc(strlen("{ \"id_data\": \"{ \"Serial Number\": \"\"}\", \"pubkey\": \"\" }") + strlen(mender_api_config.serial_number)
                                         + strlen(public_key_pem) + 1))) {
            mender_log_error("Unable to allocate memory");
            ret = MENDER_FAIL;
            goto END;
        }
        sprintf(payload, "{ \"id_data\": \"{ \"Serial Number\": \"%s\"}\", \"pubkey\": \"%s\" }", mender_api_config.serial_number, public_key_pem);
    }

And it's simply because the tenant token initialized as NULL is then replace with "". So I'm not sure what would be the best, either adding a check box in the Kconfig, or completing the condition with != NULL & != "", so just wanted to open the discussion :)

esp-x509-crt-bundle: Failed to verify certificate

Hi,

I wanted to test your example before implementing it to my project, as it would be lovely for us to be able to use Mender on ESP32 (already using it with Raspberry Pi on production). But I'm getting an error after flashing your code without touching anything else than the Mender Host in SDKconfig:

I (5537) main: Running project 'mender-esp32-example' version '0.1'
I (5547) main: Mender client initialized
I (5557) mender: ./components/mender-mcu-client/mender-mcu-client/platform/storage/esp-idf/nvs/src/mender-storage.c (169): OTA ID or artifact name not available
I (5557) mender: ./components/mender-mcu-client/mender-mcu-client/platform/storage/esp-idf/nvs/src/mender-storage.c (242): Device configuration not available
I (5577) main: Mender configure initialized
I (5587) main: Mender inventory initialized
I (5587) main: Mender troubleshoot initialized
I (5597) main: Device configuration retrieved
I (7027) wifi:<ba-add>idx:1 (ifx:0, 34:60:f9:8b:a8:67), tid:0, ssn:0, winSize:64
E (7097) esp-x509-crt-bundle: Failed to verify certificate
E (7097) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x3000
E (7097) esp-tls: Failed to open new connection
E (7107) transport_base: Failed to open a new connection
E (7117) HTTP_CLIENT: Connection failed, sock < 0
E (7117) mender: ./components/mender-mcu-client/mender-mcu-client/platform/net/esp-idf/src/mender-http.c (122): Unable to open HTTP client connection: ESP_ERR_HTTP_CONNECT
E (7137) mender: ./components/mender-mcu-client/mender-mcu-client/core/src/mender-api.c (187): Unable to perform HTTP request
I (7147) main: Mender client authentication failed (1/3)

I also tried changing the mender_client_config.recommissioning from false to true, but still get the same issue:

I (5537) main: Running project 'mender-esp32-example' version '0.1'
I (5547) mender: ./components/mender-mcu-client/mender-mcu-client/platform/tls/generic/mbedtls/src/mender-tls.c (114): Delete authentication keys...
I (5557) main: Mender client initialized
I (5567) mender: ./components/mender-mcu-client/mender-mcu-client/platform/storage/esp-idf/nvs/src/mender-storage.c (90): Authentication keys are not available
I (5577) mender: ./components/mender-mcu-client/mender-mcu-client/platform/tls/generic/mbedtls/src/mender-tls.c (126): Generating authentication keys...
I (5617) mender: ./components/mender-mcu-client/mender-mcu-client/platform/storage/esp-idf/nvs/src/mender-storage.c (242): Device configuration not available
I (5617) main: Mender configure initialized
I (5627) main: Mender inventory initialized
I (5627) main: Mender troubleshoot initialized
I (5637) main: Device configuration retrieved
I (12357) mender: ./components/mender-mcu-client/mender-mcu-client/platform/storage/esp-idf/nvs/src/mender-storage.c (169): OTA ID or artifact name not available
I (13817) wifi:<ba-add>idx:1 (ifx:0, 34:60:f9:8b:a8:67), tid:0, ssn:0, winSize:64
E (13867) esp-x509-crt-bundle: Failed to verify certificate
E (13867) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x3000
E (13867) esp-tls: Failed to open new connection
E (13877) transport_base: Failed to open a new connection
E (13877) HTTP_CLIENT: Connection failed, sock < 0
E (13887) mender: ./components/mender-mcu-client/mender-mcu-client/platform/net/esp-idf/src/mender-http.c (122): Unable to open HTTP client connection: ESP_ERR_HTTP_CONNECT
E (13897) mender: ./components/mender-mcu-client/mender-mcu-client/core/src/mender-api.c (187): Unable to perform HTTP request
I (13907) main: Mender client authentication failed (1/3)

Any idea of what I'm missing here?

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.