MQTT issues with FORTE running on Raspberry Pi [message #1732630] |
Wed, 18 May 2016 09:07 |
|
Hi everyone,
I'd like to use MQTT to link my FORTE Installation on a Raspberry Pi based hardware to openHAB (Java OSGi Framework for Homeautomation).
I followed Monikas instructions in the FORTE documentation to compile Eclipse Paho MQTT Support into FORTE (crosscompiled on a Linux VM with Eclipse CDT Mars SR2, ok not entirely true, the Eclipse Paho MQTT C library was built in the command line without Eclipse CDT). So far everything went fine. I installed a local Mosquitto Broker on the Raspberry Pi and used a Publish FB to send some current temperature values from FORTE to the Broker. I can subscribe to the topic within my local network.
Now two things happen:
1. After a couple of cycles (cycle time 250ms) , lets say some minutes, FORTE crashes with a Segmentation fault, which seems to happen in the _IO_vprintf_internal() function according to the GDB stacktrace.
2. a character is added to my payload automatically. My identifier of the Publish FB looks like this fbdk[].mqtt[tcp://127.0.0.1:1883, forte, conmeleon/Temp]
So when I publish "247" (means 24.7°C). The subscribing MQTT Client (MQTT.fx on OSX Yosemite) receives "p247". The "p" might be the last character of the topic descriptor, but i didn't test this yet.
Any hints and tipps would be highly appreciated
Herwig
|
|
|
|
Re: MQTT issues with FORTE running on Raspberry Pi [message #1732658 is a reply to message #1732630] |
Wed, 18 May 2016 20:18 |
|
Hi,
the segfault is very strange. Do you have a stack trace with more details who is calling this function?
Regarding your second issue, this is the correct behavior of the fbdk layer. The FBDK layer performs an ASN.1 encoding accourding to the Interoperability Provisions defined in the "IEC 61499 Compliance Profile for Feasibility Demonstrations" [1]. The ASN.1 encoding defines that 3 bytes are added for strings: one byte for the string identifier and two bytes for the string length. If you want to just the naked string to be sent you should have a look at the raw layer (i.e., raw[].mqtt[tcp://127.0.0.1:1883, forte, conmeleon/Temp]). This layer just takes strings as inputs or outputs of Publishers/Subscribers and hands the string on to the next layer (in your case mqtt) to be sent.
Cheers,
Alois
[1] http://holobloc.com/doc/ita/index.htm
|
|
|
Re: MQTT issues with FORTE running on Raspberry Pi [message #1732733 is a reply to message #1732630] |
Thu, 19 May 2016 10:39 |
|
Thanks Monika and Alois for your quick feedback.
I tried the raw layer and the data seems to be correct now, at least the "p" is gone.
Also FORTE runs quite stable for the last two hours and is still running. The segfaults appeared much quicker. The only thing which seems to be unusual, is that the monitoring features of the IDE stopped working after approx. 40 minutes. The watches of the IW and Publisher blocks now all show N/A even though i could see the correct values from the beginning. According to the terminal output FORTE is still working correctly and also the MQTT client subscriber gets the values.
I have attached the GDB trace if you want to investigate a little bit
greetings
Herwig
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02391 seconds