C mender client

I participated in discussions in the old issue tracker and mailing lists about a mender client that works on bare metal MCUs. We actually did end up implementing one and have been using it in the field for several years now. Unfortunately it took quite some time to make it open-source but here you go: GitHub - grandcentrix/cmender: Based on the Mender OTA client. Written in C and optimized for low memory usage so it can be used on low power devices like MCUs

There is also an accompanying blog article: Implementing a mender client in C (sorry about the bad formatting, we have some issues).

I’m aware of the recent work of rewriting the official client in C++ and there is a short mention of it in the blog post. TL;DR: it didn’t exist back then and even today it wouldn’t quite fit our requirements, yet.

I hope that somebody will find this useful :slightly_smiling_face:


@M1cha many thanks for sharing it. I’m looking for similar implementation to run on esp32. Perfect timing ;).

Thanks a lot for sharing @M1cha. Its great to see such things emerge as open source from the community.

Maybe there also can be some exchange or collaboration @joelguittet?


Interesting to see other solution appear :slight_smile:
Looks similar approach to my client as well with core and platform separation.
@M1cha I don’t see examples by the way and a little bit trouble by the dependencies to Linux libraries for http etc.
@MarekBelisko so now you have two separated solutions !

Advantage of the solution cmender seems to be there is no dynamic memory allocation (I rely on platform such as esp IDF or zephyr that provide memory allocation for my client : GitHub - joelguittet/mender-mcu-client: Mender client for MCU, just because it's cool to have it)

1 Like

I’m looking for similar implementation to run on esp32

We’re actually running it on esp8266 and esp32, so I’m sure you can get it running :slight_smile: We didn’t publish it because the way we abstracted the platform API(e.g. inventory data), it’s very customer specific and it’s easy to write your own. We are also still using the old non-cmake IDF so it’s not really all that useful anyway.

little bit trouble by the dependencies to Linux libraries for http etc.

There are no dependencies on Linux. We used the portable http library “http_parser” and are using mbedtls for HTTPS. We are using cmender on esp-IDF based MCUs.

The cmake build system in the repository is (currently) only intended to build for CI, unit tests and the linux test client. Users of this are supposed to set up their own build system where they can select every platform module separately. Since many MCU operating systems like zephyr or the esp-idf implement a basic POSIX API, you can probably use all of the modules in platform/posix.

I don’t see examples by the way

In platform/linux you can see all the stuff that you probably want to implement for every project separately. There you have sample implementations of all of the platform-sepcific modules like identity data and the key store as well as a test client that you can compile for linux and use as a virtual device that can talk to a real server.