GSoC 2026: Proposing MQTT client library for rtems-net-services

Hello everyone ,

I am Vedanth , I have completed PoW yesterday and would like to propose a project on an MQTT client library for rtems-net-services library seeing how NTP/TTCP were recent additions to the library and how coreMQTT transport interface is compatible with POSIX socket API.

Would this be a project of interest within rtems-net-services library in gsoc 2026?

and if so i have a few questions :

  • Would coreMQTT be of target interest or Paho MQTT or other implementations?

  • Would you prefer all stacks or lwip?

  • Would TLS be considered in scope or a stretched goal?

thanks ,
Vedanth
Gitlab:@av-vedanth

With any porting effot there are usually a few common considerations for planning the proposal.

  1. Can you build the software at all?
  2. Can you run the software on anything?
  3. Can you build the software with RTEMS?
  4. Can you run the software with RTEMS?

Answering these questions will help you to frame the proposal and to plan the work. Once you know how to do #1-4, then you can consider what is the best way to integrate the software with RTEMS. Here again there are a few choices:

  1. Integrate directly in tree through contrib?
  2. Integrate through a build recipe in RSB?

You’ll probably have to analyze the different MQTT implementations available and identify pros/cons. A few things to look at would include:

  • License compatibility
  • Software complexity/size
  • Upstream activity (sustainability)
  • Build system complexity

The purpose of the rtems-net-services is to provide cross-stack functionality, so we would want you to also look at libbsd. It is not necessary to provide support on the legacy stack for new features.

I cannot speak to the scope yet, that is something you may need to determine through your initial exploration of the project idea as you investigate it.

Thankyou for your feedback. I shall do more research on the various implementations available and get back to you on viability and implementation.

Hello @gedare

After going through different MQTT implementations (specifically coreMQTT , Paho MQTT and MQTT-C) i have concluded that coreMQTT is the best among all due to the following reasons:

  1. MIT license
  2. Has high upstream activity / actively maintained
  3. Minimal dependencies (no threading , no malloc , no networking dependencies)
  4. Architecture is state machine based, the caller drives all I/O so no internal threading is needed.
  5. coreMQTT cross-compiled for sparc/leon3 with -Os optimization. Total .text footprint across all 6 source files: ~42 KB.

MQTT-C (not considered due to low upstream activity):

  1. MIT license
  2. Very basic implementation and extremely lean has only 2 files
  3. minimal upstream activity which could become a sustainability risk
  4. Easy to build

Paho MQTT:

  1. Eclipse Public License 2.0 and the Eclipse Distribution License 1.0 . (more restrictive than MIT)
  2. High upstream activity / actively maintained.
  3. Architecture is Asynchronous client , thread based and requires OS abstraction layer mutexes and timers.
  4. Complex build as Cmake brings in ssl and testing dependencies which can be configured later.

Project considerations.

    • Can you build the software at all?

Was able to build coreMQTT with standard gcc with cmake on linux ( more specifically ubuntu 24 )with minimal platform config file.

Minimum dependencies (no threading , no malloc , no networking dependencies)

    • Can you run the software on anything?

TCP transport works. Broker log shows the client connecting as rtems-test with MQTTv5 protocol, clean session, keepalive 60 which matches the MQTTConnectInfo_t config. MQTT_Init returns 0 (success). MQTT_Connect returns status 4 MQTTSendFailed, likely because the nonblocking recv fires before the broker’s CONNACK comes back. The broker accepted the connection so the issue is on the client side socket configuration, not coreMQTT itself.

    • Can you build the software with RTEMS?

Cross-compiled all coreMQTT source files with sparc-rtems7-gcc targeting the leon3 BSP. Clean compilation with no errors or warnings, only requires -I source/include, -I source/interface, and -D_POSIX_C_SOURCE=200112L. No RTEMS-specific modifications to the coreMQTT source were needed.

    • Can you run the software with RTEMS?

coreMQTT cross-compiles cleanly for sparc/leon3 and the transport interface needs POSIX send()/recv() which RTEMS network stack already provides. The remaining work is wiring it into rtems-net-services with waf, writing the RTEMS wrapper API, and testing on QEMU leon3 with a network-enabled BSP. This is what I’m proposing to build.

  1. Integration approach Contrib vs RSB

As RSB is designed for large complex packages with a lot of dependencies. It makes sense to choose contrib for the following reasons:

  • coreMQTT has 6 source files and no external dependencies as seen from the images.

  • NTP , TTCP in rtems-net-services all use in tree contrib via JSON manifest and not RSB.

  • Contrib would allow waf builds to produce libmqtt.a which means users would not have extra steps to run separate recipes before building and avoids overheads.

  • coreMQTT can be added as git submodule to pin to specific upstream releases.

6 .libbsd and lwip

coreMQTT uses a transport interface with user defined function pointers send/recv.

My implementation would only be using POSIX socket calls socket() , connect() , send() , close() , recv()

lwIP stack:

  • POSIX socket API (socket, connect, send, recv, close) available through lwIP’s compatibility layer
  • MSG_DONTWAIT defined and fully implemented verified in rtems-lwip source.
  • MSG_NOSIGNAL defined but unimplemented, as lwIP does not generate SIGPIPE signals
  • No stack-specific config needed

libbsd stack:

  • Full POSIX socket API available through FreeBSD networking port
  • MSG_DONTWAIT and MSG_NOSIGNAL both fully supported
  • MSG_NOSIGNAL suppresses SIGPIPE on broken pipe which is needed on libbsd since it inherits BSD signal behavior
  • No stack-specific config needed

Since both stacks expose the same POSIX socket API, no #ifdef guards or stack-specific configuration files are needed. Legacy stack support is not required as per your earlier guidance.

Would appreciate feedback on the above approach and I will start working on the GSoC proposal.

That all looks good and should be included in your proposal, however I think in this case we should prefer integration in rtems-net-services (as in your project title).

PS: We avoid using submodules.

Thankyou

I will follow json import instead of git submodule like how ntp source files are imported in rtems-net-services

I shall start working on the proposal.

Hello @gedare

Please find attached the final draft for my proposal .

Any inputs and feedback will be highly appreciated !