Hello
I have been trying to use wiser for KNX to connect to an MQTT broker (mosquitto) but am getting nothing.
The broker is running on my PC, I check the topics and they work, in the script I put the ip address of the pc where the broker runs and I have the addresses defined in the objects tab, but without result.
I don't know if wiser have what it takes to connect or if it is necessary to install libmosquitto.ipk, luamosquitto.ipk and luasockets.ipk as it comes in the Gbridge.io guide that I found in the forum.
Would someone be so kind as to tell me how to proceed?
Thank you.
a greeting
20.05.2020, 13:55 (This post was last modified: 20.05.2020, 14:04 by JRP.)
(20.05.2020, 12:40)Daniel. Wrote: First we have to see your script. What fw do you use?
Have you seen this thread?
Hi Daniel thanks for replying.
Wiser has the fw 2.4.0 as you can see in the following image.
I use the script that I publish Admin in this thread https://forum.logicmachine.net/showthrea...light=mqtt
I have created the resident script at interval 0 and changed the IP address to the address of the pc where the mosquitto broker runs.
The object mapping I have used the same as a test.
Putting the log lines suggested in that same post, this is the result.
MQTT 20.05.2020 16:03:19
Resident script:130: bad argument #2 to 'selectfds' (number expected, got nil)
stack traceback:
[C]: in function 'selectfds'
Is it necessary to install a library or package?
The topics are published and the broker subscribed to them.
Thank you.
a greeting
Hello
Thank you for responding.
In the broker I have not activated any user or password, as it is only a test for now.
I'm still wondering if it's necessary to install some library in wiser.
Greetings and thanks for helping
There is already a lib in the Wiser 2.4 firmware however i don't think it's the most recent version as 2.4 is out for quite a while.
I'm currently testing on FW 2.5 that will be released (don't pinpoint me on it) somewhere around this summer, and all features that are in Daniels latest script work on FW 2.5 including the broker app.
21.05.2020, 10:40 (This post was last modified: 21.05.2020, 10:42 by JRP.)
(20.05.2020, 18:58)Erwin van der Zwart Wrote: Hi,
There is already a lib in the Wiser 2.4 firmware however i don't think it's the most recent version as 2.4 is out for quite a while.
I'm currently testing on FW 2.5 that will be released (don't pinpoint me on it) somewhere around this summer, and all features that are in Daniels latest script work on FW 2.5 including the broker app.
Hello
Thanks Erwin for the information on the fw update. While the update arrives I will do some more tests.
Hellol Daniel.
Thanks for answering.
I have activated user and password in the mosquito broker, I have copied the script that you indicate and changed ip, user, password and port (1883 is where mosquitto runs on my PC).
I use the MQTT.fx client and post both topic in / topic1 and out / topic1.
I subscribe with the same MQTT.fx and with mosquitto_sub and it works perfectly, but I don't see any changes in the wiser.
In the register tab I see that it does not connect to the broker, put this.
* string: mqtt connect failed Operation timed out
This is the script (I remove the password).
(21.05.2020, 11:22)Daniel. Wrote: This work with my broker so your issue is somewhere there. Can you connect to your broker by using MQTT Explorer client but from another machine?
Hello
I have tried with Mqtt explorer and MQtt.fx and neither of them connects from another pc. I put the IP of the pc where I have mosquitto installed and the username and password and nothing.
Surely the problem comes from here.
I have all the computers on the same network, I ping and they all respond.
If in MQtt.fx installed on the same pc as the broker, I put instead of address 127 ......., the ip address of the same pc 192.168.012. It connects and on netstat I see the connection to port 1883.
Will I be the router that blocks traffic? It is what occurs to me.
Thanks for the help.
a greeting
(21.05.2020, 11:50)Daniel. Wrote: It is most likely your PC firewall.
Hello
Eureka!
Effectively it is the w10 firewall that was blocking traffic, I have opened port 1883 and it has connected and worked the first time.
After writing the last message it occurred to me that it could be the firewall, but until you told me to try from another PC, the light bulb did not light up.
Thank you very much Daniel for your interest and your reconmedances.
a greeting
I have a SpaceLynk (V1.3 FW 2.7.0) that I would like to use as MQTT client and publish data to a cloud platform here in Belgium "Eniris". This device will serve only the purpose of MQTT client.
Could you or anyone assist me with the MQTT client script to be able to publish data in a certain json structured format?
The format should be like mentioned in the link below:
Topic = 'standart1/rp_one_m/T/userid/' and then in the data packet the following
Code:
123456789
{
"time" : 1661506491 , --In Unix format"extraTags" : {
"subId" : "T19"
},
"fields" : {
"temperature_degC" : 16.76--this must be the value of the KNX object as a float datatype towards the broker)
}
}
I have tested the MQTT client script below and the connection with the broker is ok. And data is being published but not in the certain format sctructure their platform is expecting it.
Thank you for the quick reply.
Unfortunately I will have to publish around 200 objects and its not that they come in the bus very frequently.
Is there and option to publish data every one minute? Like adding a resident script with sleep internal of 1min?
Are all 200 objects temperature sensors or are there different values that affect the JSON message format? Is extraTags = { subId = 'T19' } common for all messages or not?
(26.08.2022, 11:06)admin Wrote: Are all 200 objects temperature sensors or are there different values that affect the JSON message format? Is extraTags = { subId = 'T19' } common for all messages or not?
You can create a scheduled script that runs every minute and publishes all values. Each message has to specified manually due to a variable format. Add as many addmessage calls as needed and change grp.getvalue addresses. The script will automatically disconnect once all messages are published.