Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Debugging Paho in 4DIAC FORTE(Paho won't connect)
Debugging Paho in 4DIAC FORTE [message #1839565] Wed, 24 March 2021 00:16 Go to next message
Neil Higgins is currently offline Neil HigginsFriend
Messages: 18
Registered: September 2016
Location: Brisbane
Junior Member
Nobody's favourite topic, I gather.

I can run and exercise a Mosquitto broker on a Raspberry Pi 4.

I built a version of FORTE with Paho for the RPi4, but I cannot get either Pub or Sub to connect to the broker. See the attached picture ( I have been manually INITing the blocks for debugging purposes). "NO_SOCKET" on the publisher is preceded by "INVALID_ID".

"Debug" level logging was enabled in the FORTE build, but I can't find the log file.

How can I get some trace on what is going on?

My view: I don't sense much enthusiasm for Paho, but I think Paho is potentially a valuable addition to 4DIAC, because it provides a way to integrate non-4DIAC resources in an unsophisticated way (unsophisticated - that's me). I would like to get it working, if it's viable. I suppose an alternative might be to to use the Lua pathway to access MQTT, but that means I have to learn yet another language (yuk).




  • Attachment: MQTT2.JPG
    (Size: 262.97KB, Downloaded 71 times)
Re: Debugging Paho in 4DIAC FORTE [message #1839571 is a reply to message #1839565] Wed, 24 March 2021 04:22 Go to previous messageGo to next message
Neil Higgins is currently offline Neil HigginsFriend
Messages: 18
Registered: September 2016
Location: Brisbane
Junior Member
I tried to build FORTE with LuaJIT for Raspberry Pi using the guidance here: https://www.eclipse.org/4diac/en_help.php?helppage=html/4diacIDE/dynamicTypeLoader.html
The Lua make worked ok, generating libluajit.so (and libluajit.a) in the build directory.
I adapted the FORTE CMake configuration to point to the shared object, but linking failed with the following error message:
/usr/bin/ld: cannot find -lluajit
Pointing at libluajit.a did not change the outcome.
Worst case outcome: FORTE with LuaJIT is not supported in Linux. Is this the case, or have I missed something?

[Updated on: Wed, 24 March 2021 04:23]

Report message to a moderator

Re: Debugging Paho in 4DIAC FORTE [message #1839575 is a reply to message #1839571] Wed, 24 March 2021 06:18 Go to previous messageGo to next message
Neil Higgins is currently offline Neil HigginsFriend
Messages: 18
Registered: September 2016
Location: Brisbane
Junior Member
Sadly, trying to go the other way - to Windows rather than to Linux - I can build FORTE with LuaJIT but I cannot build FORTE with Paho (errors all over the place).

BTW, is the Lua code exposed for editing if I use the dynamic types? This would be essential for the purpose of adding MQTT support via Lua.

[Updated on: Wed, 24 March 2021 06:20]

Report message to a moderator

Re: Debugging Paho in 4DIAC FORTE [message #1839578 is a reply to message #1839575] Wed, 24 March 2021 07:00 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1584
Registered: January 2014
Senior Member

First of all Lua is not needed for MQTT. However, 4diac FORTE definitely works with LuaJIT on Linux. Done that already a few times myself. The best option is to not build LuaJIt yourself but use the provided dev packages for your distribution. With that LuaJIT on Linux should be much easier. No Lua code is currently not exposed.

What is a bit strange is the invalid id error. at least for the publisher everything should be correct. For the subscriber I would assume that the raw layer is already stopping initialization as it is expecting a single output of type STRING.

The NO_Socket is produced when you send an REQ to a not initialized FB.

[Updated on: Wed, 24 March 2021 07:01]

Report message to a moderator

Re: Debugging Paho in 4DIAC FORTE [message #1839580 is a reply to message #1839578] Wed, 24 March 2021 07:25 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 16
Registered: January 2021
Junior Member
The logging of forte it outputted to the terminal. Check there if your see an error

If the broker is running on the same devie, try using 127.0.0.1 as IP. Maybe forte is actually no being able to connect to the broker for some other reason
Re: Debugging Paho in 4DIAC FORTE [message #1839593 is a reply to message #1839580] Wed, 24 March 2021 11:00 Go to previous messageGo to next message
Neil Higgins is currently offline Neil HigginsFriend
Messages: 18
Registered: September 2016
Location: Brisbane
Junior Member
Thank you, Alois. As always, you are a gold mine of information and knowhow.

I am unsure where to find "the provided dev packages for your distribution", although I am very much in favour of using them, as opposed to building my own. Can you further enlighten me? Of course I am looking for the Paho (especially) and Lua (less urgently) variants of FORTE for the Raspberry Pi (or both combined). Also the Paho variant for Windows 10.

[Edit] To elaborate: If I download from Downloads/4diac FORTE 1.13.0//Linux ARM, all I get is a zip file containing a copy of FORTE- with no information about what options are included. Not quite what I expected.

Thanks in advance,
Neil

[Updated on: Wed, 24 March 2021 11:17]

Report message to a moderator

Re: Debugging Paho in 4DIAC FORTE [message #1839597 is a reply to message #1839593] Wed, 24 March 2021 12:31 Go to previous messageGo to next message
Neil Higgins is currently offline Neil HigginsFriend
Messages: 18
Registered: September 2016
Location: Brisbane
Junior Member
Similar errors in my Paho FORTE build and in the pre-built FORTE (for Raspberry Pi).

It's almost as if the MQTT stuff is not there at all, because when I change the ID back to a UDP multicast address, everything starts working.

When the right-most square bracket was missing from the end of the MQTT ID (minor bug - it didn't paste in properly) , FORTE complained about the missing square bracket. That's about the only useful debug info I got from the FORTE console.

I tried 192.168.0.211, 127.0.0.1 and "localhost". None of them worked.

I re-tested some Python code to make sure that the local MQTT broker was working, - it was.
Re: Debugging Paho in 4DIAC FORTE [message #1839599 is a reply to message #1839597] Wed, 24 March 2021 12:43 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1584
Registered: January 2014
Senior Member

Did you enable the raw layer in the Cmake config for your 4diac FORTE?
Re: Debugging Paho in 4DIAC FORTE [message #1839638 is a reply to message #1839599] Wed, 24 March 2021 23:05 Go to previous messageGo to next message
Neil Higgins is currently offline Neil HigginsFriend
Messages: 18
Registered: September 2016
Location: Brisbane
Junior Member
"The -raw- layer?"

Not as such.

It is mentioned in the documentation (https://www.eclipse.org/4diac/documentation/html/communication/mqttPaho.html), but there is no instruction to explicitly enable it. Live and learn ...

I'm happy to give it a go and report back.

Until then ...

N
Re: Debugging Paho in 4DIAC FORTE [message #1839639 is a reply to message #1839638] Thu, 25 March 2021 00:27 Go to previous messageGo to next message
Neil Higgins is currently offline Neil HigginsFriend
Messages: 18
Registered: September 2016
Location: Brisbane
Junior Member
FORTE_COM_RAW was already enabled in the build. I'll grep around the sources and see if I can find a few places to insert debug output statements. Wish me luck.
Re: Debugging Paho in 4DIAC FORTE [message #1839640 is a reply to message #1839639] Thu, 25 March 2021 01:01 Go to previous messageGo to next message
Neil Higgins is currently offline Neil HigginsFriend
Messages: 18
Registered: September 2016
Location: Brisbane
Junior Member
CORRECTION!!
FORTE_COM_RAW was -NOT- enabled in my CMAKE configuration for Paho MQTT. When I enabled it, everything worked. Problem solved.
FORTE_COM_RAW -was- enabled in my build configuration for LuaJIT. CMAKE came up pointing to that, hence my previous incorrect statement.
Thanks for your assistance, Alois. Well done!
Re: Debugging Paho in 4DIAC FORTE [message #1839689 is a reply to message #1839640] Thu, 25 March 2021 18:55 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1584
Registered: January 2014
Senior Member

Great that I could be of help. I think we have to improve on the error messages.
Previous Topic:4diac IEC 61499 Execution Sequence
Next Topic:Using 4DIAC in a simulation system
Goto Forum:
  


Current Time: Tue Apr 23 12:09:29 GMT 2024

Powered by FUDForum. Page generated in 0.04829 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top