I am new to Mosquitto and need some help with the subscriber setup please.
My publisher seems to be working ok with the broker but when I run the subscriber it does nothing.
Here is the log from my broker showing sucessful connection to the publisher device & reciving data from the device:
03-11-2023 T14:54:12: mosquitto version 2.0.18 starting
03-11-2023 T14:54:12: Config loaded from mosquitto.conf.
03-11-2023 T14:54:12: Opening ipv6 listen socket on port 8888.
03-11-2023 T14:54:12: Opening ipv4 listen socket on port 8888.
03-11-2023 T14:54:12: mosquitto version 2.0.18 running
03-11-2023 T14:54:13: New connection from
192.168.2.2:12163 on port 8888.
03-11-2023 T14:54:13: New client connected from
192.168.2.2:12163 as BCS2 (p2, c1, k60, u'admin').
03-11-2023 T14:54:13: No will message specified.
03-11-2023 T14:54:13: Sending CONNACK to BCS2 (0, 0)
03-11-2023 T14:54:13: Received SUBSCRIBE from BCS2
03-11-2023 T14:54:13:
BCS2/sub (QoS 0)
03-11-2023 T14:54:13: BCS2 0 BCS2/sub
03-11-2023 T14:54:13: Sending SUBACK to BCS2
03-11-2023 T14:54:13: Received PINGREQ from BCS2
03-11-2023 T14:54:13: Sending PINGRESP to BCS2
03-11-2023 T14:55:15: Received PINGREQ from BCS2
03-11-2023 T14:55:15: Sending PINGRESP to BCS2
03-11-2023 T14:55:15: Received PINGREQ from BCS2
03-11-2023 T14:55:15: Sending PINGRESP to BCS2
03-11-2023 T14:56:00: Received PUBLISH from BCS2 (d0, q0, r0, m0, 'BCS2/pub', ... (7 bytes))
03-11-2023 T14:56:15: Received PINGREQ from BCS2
03-11-2023 T14:56:15: Sending PINGRESP to BCS2
You can see above the puiblisher has sent some data.
I try to run the mosquitto subsriber (on windows, broker is on same PC) it runs but shows nothing after the command has run:
I have played around with the above command with different quotes etc, made no difference.. Also tried the topic as BCS2/sub. Tried using username/password of the publisher device as parameters.