config file setup for multiple mqtt subscribers or publishers

Started by jimh

jimh

Hi Alain,

A follow-up question on adding multiple mqtt subscribers or publishers. The documentation mentions this is possible but does not give a good example.

Is this correct method for .nocanc.conf?

auth-token = "test"
event-server = "10.1.1.65:4242"

[mqtt]
mqtt-server="mqtt://uuu:ppp@userver"
client-id="nocan1"

[[mqtt.subscribers]]
channel="led2"
topic="jimh/data"

[[mqtt.publishers]]
channel="led2"
topic="jimh/info"

[[mqtt.publishers]]
channel="log"
topic="jimh/log"

Or is there another method to use?

Best regards,

Jim

Alain

His Jim,

Your example is correct. I have added a small point about that in the docs.

Note that two 'publisher' entries should not share the same channel (only the last one is taken into account). Similarly, two 'subscriber' entries should not share the same topic. Your example does not do any of that, but I wanted to point it out for anybody else reading this thread.

Best regards,

Alain