This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

MQTT broker example
#1
Here is a step by step guide to make LogicMachine act as MQTT broker.

1. Install these packages:
Power CPU:
https://dl.openrb.com/pkg/libmosquitto_1.6.2-1_imx6.ipk
https://dl.openrb.com/pkg/mosquitto_1.6.8-2_imx6.ipk

Old CPU:

https://dl.openrb.com/pkg/libmosquitto_1.6.8-1_mxs.ipk
https://dl.openrb.com/pkg/mosquitto_1.6.8-2_mxs.ipk


2. Server will start automatically. Keep in mind that there's no protection by default - no encryption and username/password auth.

3. If you need to get the data on LogicMachine in grp addresses, you can use MQTT client example and connect to localhost: 
https://forum.logicmachine.net/showthrea...6#pid10926

4. If you are connecting to broker running on the same device you can set broker IP to 127.0.0.1. This way you can reuse script on other devices without having to specify the new IP.

5. SSL is not used, default port is 1883

6. Remove username/password variables as broker does not have any kind of authentication enabled by default.

7. As for topic/message payload - there's no specific format here. You can choose anything you like but it's a good practice to use one topic for one value instead of publishing complex data structures (JSON or similar) to a single topic.
Reply
#2
I have 2 errors:

error loading module 'mosquitto' from file 'Library mosquitto.so':
Error loading shared library libssl.so.1.1: No such file or directory (needed by /usr/lib/libmosquitto.so.1)
stack traceback:
[C]: at 0x00055d50
[C]: in function 'require'

Resident script:112: bad argument #2 to 'selectfds' (number expected, got nil)
stack traceback:
[C]: in function 'selectfds'

My hw is a HL with old cpu
Reply
#3
no help?
Reply
#4
Wait for RC2 firmware. It will have broker built-in and there will be an app for configuration.
Reply
#5
(18.03.2020, 17:29)admin Wrote: Wait for RC2 firmware. It will have broker built-in and there will be an app for configuration.
I too have same issue as below same as Cekca , is there a fix for this? or how long do we wait for RC2?
 13.03.2020, 16:17
I have 2 errors:

error loading module 'mosquitto' from file 'Library mosquitto.so':
Error loading shared library libssl.so.1.1: No such file or directory (needed by /usr/lib/libmosquitto.so.1)
stack traceback:
[C]: at 0x00055d50
[C]: in function 'require'

Resident script:112: bad argument #2 to 'selectfds' (number expected, got nil)
stack traceback:
[C]: in function 'selectfds'

My hw is a HL with old cpu
Reply
#6
Unfortunately these packages require some other system packages to be updated. This is only possible via full firmware upgrade.
Reply
#7
(19.03.2020, 07:23)admin Wrote: Unfortunately these packages require some other system packages to be updated. This is only possible via full firmware upgrade.

When is RC2 available?
Reply
#8
RC2 has been postponed. We can provide current firmware build if you have direct access to your LM and are willing to test it. But there's no guarantee that it's 100% stable.
Reply
#9
If the MQTT broker is ready, i am willing to test on my own system
Reply
#10
Ok, which LM hardware do you have?
Reply
#11
(14.04.2020, 09:29)admin Wrote: Ok, which LM hardware do you have?
reactor V3
Reply
#12
Firmware:
https://dl.openrb.com/lm-20-mxs/mxs-reactorv3.img

Configuration app (install through App > Plus icon > Top left menu > Install from file):
https://dl.openrb.com/lm-20-imx6/pkg/mqt...200403.ipk
Reply
#13
Hi! Is there any changes in Z-wave here? i am having big trouble after update. cannot start/stop daemon. tried rebooting several times. tried unplugging usb device..
any tips?
Reply
#14
I'll forward this to ZWave app developer. Can you send your project backup via PM?
Reply
#15
Hi, I have been using Kappelt's online gbridge broker to communicate with Google Home.
His solution has been down for several weeks now. Is there any possibility to get the RC2 to get the broker to work with google home?
I have a LM5 PMC.
Reply
#16
Broker on LM will not solve this problem.
------------------------------
Ctrl+F5
Reply
#17
I have installed the gbridge on a local raspberry and the setup is now working fine. I have installed a preliminary mqtt broker on my ubuntu and get all the messages from google home to the broker, but i think I messed up a little bit with the logicmachine. I can`t send any mqtt messages from/to the LM. When I connect the LM with the script to the ubuntu broker I get that the connection is accepted. I also are monitoring the same topic, both on the broker and LM, but still no luck. Could I please test the RC2?

Attached Files Thumbnail(s)
       
Reply
#18
The script above should work fine in RC1, Did you try to use MQTT Explorer to see all the messages?
------------------------------
Ctrl+F5
Reply
#19
Just tried the MQTT explorer. 
It confirms that LM connects/disconnect when i look at active clients on the server. 

When i change the value on the knx bus which I am subscribing on both server and LM, only the set value (status) updates in the MQTT Explorer. When I change the value from google home the value only changes the value for write, as it should. 

I have this running in a resident script 0, and I also enables/disables everytime I do some changes in the script.

Seems like there is something wrong with my:
-- topic to object map
  mqtt_to_object = {
    ['gBridge/u1/d1/onoff'] = '1/0/1',


Are my packages correct?   
Libmosquitto 1.6.3-1
Luamosquitto 0.3-5
Luasocket 2.0.2-20191009
Reply
#20
What value do you get from gbridge? maybe there is a need for some conversion?
------------------------------
Ctrl+F5
Reply


Forum Jump: