Giter Club home page Giter Club logo

mender-mcu-client's People

Contributors

joelguittet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mender-mcu-client's Issues

tls: integration of atecc608b to perform authentication

The purpose of this ticket is to provide TLS authentication using a secure element. An example should be shown.

For this purpose the current tls implementation should be reworked to keep private key inside the tls module. API with the mender-client, mender-api and mender-storage modules will move.

The cryptoauthlib from Microchip will be used to interface the atecc608b secure element.

Tasks includes:

  • Management of private key inside the tls module
  • Selection of the tls implementation through CMake and KConfig files (choices should be mbedtls or cryptoaauthlib for atecc608b)
  • Creation of a new specific example to demonstrate the usage of the secure element
  • Update of the documentation

References:

Failure to check for deployment when http response is chunked

Part: ESP32-S3-WROOM-1
ESP-IDF: 5.2.0

Hi there ๐Ÿ‘‹ I am attempting to integrate this client into an ESP32-S3 based design. However I am having issues getting it all to work. I am able to get the device added into my Mender account and successfully authenticated, however it always fails when attempting to check for deployments.

I (5776) info: Connected to AP!
I (6291) mender: ./components/mender-mcu-client/mender-mcu-client/platform/board/esp-idf/src/mender-storage.c (169): OTA ID or artifact name not available
I (6289) mender_ota: Mender inventory initialized
--------------------------------------------------------
Task Name       | Stack High Water Mark
--------------------------------------------------------
         mender | 10896 bytes
Keyboard Manage | 14928 bytes
   WiFi Manager | 10528 bytes
        Tmr Svc | 4640 bytes
           IDLE | 2800 bytes
           IDLE | 2752 bytes
            tiT | 6544 bytes
    USB Manager | 20048 bytes
  Power Manager | 16880 bytes
           ipc0 | 1984 bytes
     UI Manager | 252544 bytes
      esp_timer | 12384 bytes
           ipc1 | 1968 bytes
           wifi | 16800 bytes
        sys_evt | 6288 bytes
        TinyUSB | 13088 bytes
--------------------------------------------------------
Free Heap Size: 45687 bytes
Minimum Ever Free Heap Size: 43255 bytes
--------------------------------------------------------
I (6512) info: OTA service started.
E (9128) mender: ./components/mender-mcu-client/mender-mcu-client/core/src/mender-api.c (652): rcvd 0
E (9129) mender: ./components/mender-mcu-client/mender-mcu-client/core/src/mender-api.c (652): rcvd 512
I (9141) mender_ota: Mender client authenticated
E (9143) mender: ./components/mender-mcu-client/mender-mcu-client/platform/board/esp-idf/src/mender-ota.c (168): Unable to get running version state
I (10138) mender: ./components/mender-mcu-client/mender-mcu-client/core/src/mender-client.c (443): Checking for deployment...
E (11093) mender: ./components/mender-mcu-client/mender-mcu-client/core/src/mender-api.c (293): Invalid response
E (11093) mender: ./components/mender-mcu-client/mender-mcu-client/core/src/mender-client.c (445): Unable to check for deployment

I added a bit of debug code within mender-api.c trying to determine if I was just getting a 0 length response (Placed on line 651)

Line 651: mender_log_error("rcvd %d", response_length);

My config related to the client is as follows (which I believe is basically default aside from setting my server URL (obviously not FOO))

#
# Mender client Configuration
#
CONFIG_MENDER_SERVER_HOST="FOO"
CONFIG_MENDER_SERVER_TENANT_TOKEN=""
CONFIG_MENDER_CLIENT_AUTHENTICATION_POLL_INTERVAL=600
CONFIG_MENDER_CLIENT_UPDATE_POLL_INTERVAL=1800
# CONFIG_MENDER_CLIENT_ADD_ON_CONFIGURE is not set
CONFIG_MENDER_CLIENT_ADD_ON_INVENTORY=y
CONFIG_MENDER_CLIENT_INVENTORY_REFRESH_INTERVAL=28800
# end of Mender client Configuration

#
# Mender advanced Configuration
#
CONFIG_MENDER_RTOS_WORK_QUEUE_STACK_SIZE=20
CONFIG_MENDER_RTOS_WORK_QUEUE_PRIORITY=5
CONFIG_MENDER_RTOS_WORK_QUEUE_LENGTH=10
# end of Mender advanced Configuration

I have no problem building and executing an OTA using the mender example project for ESP32 that you provide but I'm at a total loss as to what could be the problem. Digging into the error within mender-api.c it appears that the response pointer is still NULL and thus when it's handed to cJSON for parsing the output cJSON object pointer is NULL thus the error.

I attempted to follow the callbacks and I could never even find where the *response variable would ever be allocated. My assumption at this point is a memory problem but I just don't understand where or how to solve it.. Any help is greatly appreciated!

Enable function to take scheduling of deployments poll outside of library.

I would very much like to be able to take care of scheduling deployment polls on my own. However as things stand all methods are locked behind mender-client.c. Not to mention if I didn't missed something polls one cannot disable periodic polling at all.

I have no problem writing it a pull request myself - something like where 0 value would denote disabled polling and declarations of these functions (poll for deployment, reauthorize) would be moved to header file for client. Just wanted to confirm this doesn't clash with your vision for the project.

Thank you in advance

add-on: integration of Device Configure

The purpose of this ticket is to integrate Device Configure API.

Tasks includes:

  • rework of the artifact parser
  • integration of the Device Configure API
  • creation of the configure add-on (will be optional based on build configuration)
  • update of examples to show the usage of the Device Configure API
  • update of the documentation

The build of the Device Configure add-on the MCU must provides:

  • option to include the add-on
  • option to optionally save the configuration in the storage

The API of the Device Configure add-on the MCU must provides:

  • initialization option to set refresh interval of the configuration with the server
  • getter and setter of the device configuration to allow usage and modification of the device configuration from the application
  • callback function to be informed of the device configuration when no storage is used

References:

c++ linkage

Would it be possible to add an extern C linkage for applications written in C++? That's a common thing for esp32 libraries to add to each header file at the beginning:

#ifdef __cplusplus
extern "C" {
#endif

and at the end:

#ifdef __cplusplus
}
#endif

architecture: rework to integrate add-ons

The purpose of this task is to rework the architecture of the mender-mcu-client in order to permit the future development of add-ons (Device Configuration, Device Monitoring, etc).

Add-on will be optionally integrated based on compilation config. This permit each project to limit the size of the mender-mcu-client library while having the minimum set of functionalities required.

For this purpose the current mender inventory implementation will be moved to an add-on (well indeed it's highly recommended to have it anyway!)

Tasks includes:

  • separation of the mender-client "update" support and mender-inventory functionality
  • creation of the mender-inventory add-on
  • rework of tasks to limit the memory consumption due to increasing number of tasks for each add-on (work-queue will be used instead)
  • general cleanup and update of the examples, update of the documentation

Support platform linux with libcurl

Feature

I want to ask if there is a plan for linux with libcurl (or other)

Why

For our use case mender client binary is too be big for our module with Yocto linux.

add-on: integration of Device Troubleshoot

The purpose of this ticket is to integrate Device Troubleshoot API.
Particularly the ability to have a remote terminal on the device from the mender server should be demonstrated. This can be done using mender-stm32l4a6-zephyr-example to access the Zephyr console.

Tasks includes:

  • integration of the Device Connect API
  • integration of websocket API by renaming platform "http" directory to "net"
  • creation of the troubleshoot add-on (will be optional based on build configuration)
  • update of examples to show the usage of the Device TroubleShoot API
  • update of the documentation

The build of the Device Troubleshoot add-on the MCU must provides:

  • option to include the add-on

The API of the Device Troubleshoot add-on the MCU must provides:

  • function to connect/disconnect the Troubleshoot add-on to the mender server
  • callback function when data are received from the end user and API to print data on the terminal
  • callback function to be informed of the shell status (connection and disconnection of the end user)

References:

platform : zephyr mender_rtos_task_create does not use stack_size

Currently zephyr has no API to create a dynamic stack. This should be available in a near future (v3.4.0 ?)

References:

As a consequence a stack size is used in the mender_rtos.c zephyr implementation. This is suitable for the moment because only one thread is created. This should be reworked when dynamic API will be available.

Note: today the mender client thread consumes a stack size of 14KB. A work is scheduled to avoid mender client thread to be active every time in order to reduce the memory used. This is particularly interesting because the mender client runs rarely (periods are minutes and probably hours or days in industrial projects).

This issue will have no impact on the mender client API (will be managed internally).

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.