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
#21
Enabled logging in your script and post what you get:
Code:
mclient.ON_LOG = log
Reply
#22
Only 0 and 1.

Sorry admin, didnt see your post. I enabled logging and it seems like I am receiving a 1 byte on this one.. thats weird because the trait in gbridge is a onoff..

Thank you very much for your help :-)
Using my old script now that has conversion.

Attached Files Thumbnail(s)
   
Reply
#23
I've installed broker package from the first post on LM5 Lite + Ext (i.MX6) SW: 20191015, installation went without errors but mosquitto process have not started. I've also installed UI package, but it says i need to have at least 2020xxx firmware. I'm really interested in moving my broker to LM to reduce amount of dedicated hardware (and points of failure) needed to run automation, is there any updates on general availability?
Reply
#24
I will send you Beta FW to PM but we are not far of with RC2 release. It contains some bugs.
------------------------------
Ctrl+F5
Reply
#25
(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.

Hi,
am also getting same errors like
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'


but my Hardware is LM5p2-DR
with latest version (V052021)
Reply
#26
Have you installed MQTT packages separately? You don't have to do this, MQTT support is already built into the 2021 firmware. Try reinstalling the firmware to revert the packages.
Reply
#27
Is there a manual for using the internal MQTT broker?
Reply
#28
(20.08.2021, 14:27)admin Wrote: Have you installed MQTT packages separately? You don't have to do this, MQTT support is already built into the 2021 firmware. Try reinstalling the firmware to revert the packages.

can you Please send the latest firmware link which is suitable for my hardware.

(20.08.2021, 14:27)admin Wrote: Have you installed MQTT packages separately? You don't have to do this, MQTT support is already built into the 2021 firmware. Try reinstalling the firmware to revert the packages.

hi,
after the new version am getting the error like...

Mqttt 20.08.2021 20:08:47

* arg: 1
  * string: mqtt disconnect
* arg: 2
  * bool: false
* arg: 3
  * number: 7
* arg: 4
  * string: unexpected disconnect
* arg: 5
  * nil
Reply
#29
(20.08.2021, 14:30)Bobby Wrote: Is there a manual for using the internal MQTT broker?
You need to install the MQTT broker configuration" app from the store to use it. Do you have any specific questions?


(20.08.2021, 14:33)dharma@srujan-infotech.com Wrote: hi,
after the new version am getting the error like...

Mqttt 20.08.2021 20:08:47
* arg: 1
  * string: mqtt disconnect
* arg: 2
  * bool: false
* arg: 3
  * number: 7
* arg: 4
  * string: unexpected disconnect
* arg: 5
  * nil
Install these packages and try again. There will be a more descriptive error report.
https://dl.openrb.com/pkg/libmosquitto_2...1_imx6.ipk
https://dl.openrb.com/pkg/luamosquitto_2...0_imx6.ipk
Reply
#30
Hi!As i am new to MQTT broker, i dont know how to use it.I want to use my smartthings hub to all my Z.wave applications, since LM dont support it anymore. How do i set things up to get it to talk together?sorry for lame questions, this is probably a walk in the park for you.

Br Bobby

(24.08.2021, 05:44)admin Wrote:
(20.08.2021, 14:30)Bobby Wrote: Is there a manual for using the internal MQTT broker?
You need to install the MQTT broker configuration" app from the store to use it. Do you have any specific questions?
Reply
#31
I don't know how to setup your smartthing hub but LM must subscribe to the same topics what your hub. There are several MQTT client scripts on the forum for example this.
https://forum.logicmachine.net/showthrea...6#pid17126
------------------------------
Ctrl+F5
Reply
#32
(09.03.2020, 08:49)edgars Wrote: 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.

Hi ,

I am testing how MQTT works, I have updated the firmware of LM and activated the MQTT Broker app.

I have configured it for unsecured connections and created the example script as resident, but it does not work and I get this error all the time:

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

How can I fix it.

Thanks.
Reply
#33
If someone want to help set up all my Z-wave sensors to talk with LM, via ie MQTT and Smartthings hub, i would appreciate it. Can also pay some for the help.
Since the Z-wave module in LM is not working now, none of my sensors are online. Sad
Reply
#34
@Hyxion14
The script works for me correctly using the latest firmware. Can you post the whole script? Are you using RC3? You don't need to install any packages apart from the MQTT broker app.

@Bobby
Smartthings hubs now have Lua driver support for local network communication. Do you only need sensor data in LM or a two-way communication?
https://developer.samsung.com/smartthing...utomations
Reply
#35
(02.11.2021, 08:59)admin Wrote: @Hyxion14
The script works for me correctly using the latest firmware. Can you post the whole script? Are you using RC3? You don't need to install any packages apart from the MQTT broker app.

@Bobby
Smartthings hubs now have Lua driver support for local network communication. Do you only need sensor data in LM or a two-way communication?
https://developer.samsung.com/smartthing...utomations
Hi. I need 2way as i have a couple of relays as well...
Reply
#36
(02.11.2021, 08:59)admin Wrote: @Hyxion14
The script works for me correctly using the latest firmware. Can you post the whole script? Are you using RC3? You don't need to install any packages apart from the MQTT broker app.

@Bobby
Smartthings hubs now have Lua driver support for local network communication. Do you only need sensor data in LM or a two-way communication?
https://developer.samsung.com/smartthing...utomations

Is there a way to make this work on a SpaceLYnk?

BR
Lars Eirik
Reply
#37
SL has all the mqtt libs in, the only thing you miss is the broker app but you can also use an external one.
------------------------------
Ctrl+F5
Reply
#38
(03.01.2022, 08:28)Daniel Wrote: SL has all the mqtt libs in, the only thing you miss is the broker app but you can also use an external one.

Ok! I've set up SpaceLYnks as MQTT clients but not as a broker. Do you have any example scripts on how to enable the broker functionality?

BR

Lars Eirik
Reply
#39
So there is no way a SpaceLYnk can act as a broker?
Reply
#40
Use it on your own risk Wink
https://dl.openrb.com/pkg/mqtt-broker-20210104.ipk
------------------------------
Ctrl+F5
Reply


Forum Jump: