[Etherlab-users] Paho MQTT in C for communication

Dr.-Ing. Wilhelm Hagemeister hm at igh.de
Wed Apr 28 18:06:06 CEST 2021


Hallo Faras,

Am 28.04.21 um 17:51 schrieb Brumand-Poor, Faras:
> 
> So I will add the rtipc Simulink block to my Etherlab Simulink model and than I can exchange the data with my MQTT Client in C.

Jep, see the folder: "test" in the repo. There is a cpp-example program.

> I want to exchange data from the MQTT Client in C to a Python MQTT Client. Could this arise an issue?

What you do "behind" the rtipc interface is up to you. There will be no 
impact on your Etherlab program.

One hint: read the README to understand what the library does.

One correction: the Simulink blocks for using "rticp" on the Simulink 
side are part of the EtherLab library!

Regards

Wilhelm

> 
> Best Regards
> 
> Faras
> 
> -----Urspr√ľngliche Nachricht-----
> Von: Etherlab-users <etherlab-users-bounces at etherlab.org> Im Auftrag von Dr.-Ing. Wilhelm Hagemeister
> Gesendet: Mittwoch, 28. April 2021 17:40
> An: etherlab-users at etherlab.org
> Betreff: Re: [Etherlab-users] Paho MQTT in C for communication
> 
> 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
>>
>>
>>
>>
>>
> --
> Etherlab-users mailing list
> Etherlab-users at etherlab.org
> https://lists.etherlab.org/mailman/listinfo/etherlab-users
> 


More information about the Etherlab-users mailing list