[Etherlab-users] Paho MQTT in C for communication

Dr.-Ing. Wilhelm Hagemeister hm at igh.de
Wed Apr 28 17:40:20 CEST 2021


Hallo Faras,

I suggest you run your MQTT software in a different program and transfer 
your data between the MQTT program and the real time EtherLab process 
with "rtipc":

https://build.opensuse.org/package/show/science:EtherLab/rtipc

This library enables you to exchange data between different EtherLab 
processes or an EtherLab process and an other C programm (real time or 
not). Because there is no locking, there will be no problems with real 
time behavior. The library comes with Simulink blocks and an C interface.

Regards Wilhelm

Am 28.04.21 um 13:24 schrieb Brumand-Poor, Faras:
> Hello,
> 
> 
> I wrote a C program, which uses the Paho MQTT libary 
> <https://github.com/eclipse/paho.mqtt.c>. From this C file I can create 
> a Simulink block and add it to my Simulation.
> 
> I am also able to compile the Simulink model to C and run it.
> 
> 
> However if I try to do this in Etherlab, I always get an error regarding 
> some safety threads.
> 
> 
> I looked in the Paho library and realised that I implemented the MQTT in 
> a synchronous manner. There is also a asynchronous approach so I was 
> thinking about reimplementing the code
> 
> so the communication is asynchron. Synchron means that all processes are 
> stopped when a message is published are received. Asynchron means that 
> the communication is run parallel on
> 
> other threads.
> 
> 
> Does anyone have experience with MQTT and Etherlab or does someone know 
> if my approach is wrong?
> 
> Because I don't know if the asynchron libary is going to work.
> 
> 
> Thank you in advance for your help.
> 
> 
> Best regards,
> 
> 
> Faras Brumand
> 
> 
> 
> 
> 


More information about the Etherlab-users mailing list