Codesys help

Discussions about the MQTT server.
Post Reply
SaulTT
Posts: 2
Joined: Thu Sep 26, 2019 7:18 pm

Codesys help

Post by SaulTT » Fri Oct 04, 2019 7:00 pm

I'm working with Codesys with MQTT, it has a block for use it, but I can only put the username and password, so I think i can´t publish anything, is something I can do?

User avatar
admin
Site Admin
Posts: 1
Joined: Fri Jul 19, 2019 4:46 pm

Re: Codesys help

Post by admin » Sat Oct 05, 2019 10:57 am

SaulTT wrote:
Fri Oct 04, 2019 7:00 pm
I'm working with Codesys with MQTT, it has a block for use it, but I can only put the username and password, so I think i can´t publish anything, is something I can do?
There is no option to set the `clientId`?

SaulTT
Posts: 2
Joined: Thu Sep 26, 2019 7:18 pm

Re: Codesys help

Post by SaulTT » Mon Oct 07, 2019 1:23 pm

admin wrote:
Sat Oct 05, 2019 10:57 am
SaulTT wrote:
Fri Oct 04, 2019 7:00 pm
I'm working with Codesys with MQTT, it has a block for use it, but I can only put the username and password, so I think i can´t publish anything, is something I can do?
There is no option to set the `clientId`?
No :/

User avatar
auth.gabor
Posts: 4
Joined: Fri Jul 19, 2019 5:00 pm

Re: Codesys help

Post by auth.gabor » Mon Oct 07, 2019 7:09 pm

Hm... the `clientId` must be unique on the MQTT server, because of any new connection with the same `clientId` terminates the old connection based on the specification.

This uniqueness can be guaranteed by two path in our system:
a, the `clientId` is equals with the `deviceId` and one device can establish only one connection
b, the beginning of the `clientId` is the value of the `userId`, so that you cannot accidentally or intentionally disturb another user's connections.

If you not able to set the `clientId`, this uniqueness cannot be guaranteed... at the moment, I have no idea about the workaround. :?

Can you check what the Codesys client sending as `clientId`?

Post Reply