joelguittet / mender-mcu-client Goto Github PK
View Code? Open in Web Editor NEWMender client for MCU, just because it's cool to have it
License: MIT License
Mender client for MCU, just because it's cool to have it
License: MIT License
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:
References:
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!
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
The purpose of this ticket is to integrate Device Configure API.
Tasks includes:
The build of the Device Configure add-on the MCU must provides:
The API of the Device Configure add-on the MCU must provides:
References:
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
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:
I want to ask if there is a plan for linux with libcurl (or other)
For our use case mender client binary is too be big for our module with Yocto linux.
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:
The build of the Device Troubleshoot add-on the MCU must provides:
The API of the Device Troubleshoot add-on the MCU must provides:
References:
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).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.