eclipse / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
8.89k stars 2.37k forks source link

How to connect private broker RUT240 in mosquitto mqtt service.? #2766

Open mintheinwin opened 1 year ago

mintheinwin commented 1 year ago

I have a RUT240 Wifi/4G Broker/Router.

The RUT240 Broker/Router have a MQTT Service.

The broker IP is 192.168.1.1

I want to connect to the private broker on the RUT240 to publish/subscribe to messages using mosquito mqtt service. Is it possible to connect this method? If possible how to configuration file in mosquito mqtt service to connect private broker RUT 240. I had test with this sample code from github code. I set up a bridge in the mosquitto.conf file as follows:

connection rtu240 address 192.168.1.1 topics # both I can't connect 192.168.1.1 from the client. Any have an idea? Please help.

ralight commented 1 year ago

If your RUT240 has IP 192.168.1.1 and your Mosquitto broker has IP 192.168.1.2, then you would use this config to create a connection from Mosquitto to your RUT240:

connection rtu240
address 192.168.1.1
topics # both

Your MQTT client would then connect to 192.168.1.2.

If your client cannot connect to 192.168.1.1, then it is unlikely that your broker would be able to either.