eclipse / mosquitto

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

MQTT bridge appears to be working, but not sending topics to AWS #2490

Open ghost opened 2 years ago

ghost commented 2 years ago

I have been attempting to resolve an issue with what should be simple: I've a collection of Zigbee sensors that are correctly showing up on a Raspberry Pi (Debian-based OS) via Zigbee2MQTT, and the MQTT Mosquitto broker is version 2.0.11 (most recent version available) but on working through the detailed instructions to on-forward the topic detail to AWS (https://aws.amazon.com/blogs/iot/how-to-bridge-mosquitto-mqtt-broker-to-aws-iot/), it is not appearing on the AWS MQTT test page. I have all certificates working, and everything is correct as all logging and command line replies are consistent showing what is submitted, and no errors. I believed there was something incorrect in AWS, so raised a case with them after working through it several times, and seeking help from those who know a lot more about AWS than I do. After spending weeks going around in circles (as I was learning, still am) AWS Support now believe it is either an edge case compatibility issue with the software/version of Mosquitto and the specific Raspberry Pi model, so suggest downgrading to a different version, or switching to a real/different computer. I can, however, get to AWS from the Raspberry Pi using the Python SDK examples to post MQTT topics so know it is possible. I've also pored over innumerable notes others have published with similar issues, but no one seems to have come across something quite like this before. Happy to provide any more details, though am still learning all of this myself so may need targeted shot instruction to get details or share info.

ghost commented 2 years ago

OK, more details on my Pi: Raspberry Pi 3 Model B Rev 1.2, running Bullseye Debian

ghost commented 2 years ago

Accidentally closed it. I have fully update the the Pi since, but nothing has changed.

ptjm commented 2 years ago

It would help if you posted your bridge configuration and some verbose log output. e.g., start mosquitto like this

mosquitto -v -c mosquitto.conf

then publish something on a topic that's being forward to the aws service

mosquitto_pub -t sensor/1 -m 'test 1'

you should get something on the terminal running mosquitto, like

1648173698: Bridge pi.aws doing local SUBSCRIBE on topic sensor/# 1648173698: Connecting bridge aws (localhost:1884) 1648173698: Bridge aws.pi sending CONNECT 1648173698: mosquitto version 2.0.14 running 1648173698: Received CONNACK on connection pi.aws [...] 1648173720: New connection from 127.0.0.1:65266 on port 1883. 1648173720: New client connected from 127.0.0.1:65266 as auto-C14996AA-1841-0EE6-3E2D-C7CD0AADB80C (p2, c1, k60). 1648173720: No will message specified. 1648173720: Sending CONNACK to auto-C14996AA-1841-0EE6-3E2D-C7CD0AADB80C (0, 0) 1648173720: Received PUBLISH from auto-C14996AA-1841-0EE6-3E2D-C7CD0AADB80C (d0, q0, r0, m0, 'sensor/1', ... (6 bytes)) 1648173720: Sending PUBLISH to this.that (d0, q0, r0, m0, 'sensor/1', ... (6 bytes)) 1648173720: Received DISCONNECT from auto-C14996AA-1841-0EE6-3E2D-C7CD0AADB80C 1648173720: Client auto-C14996AA-1841-0EE6-3E2D-C7CD0AADB80C disconnected.

If things aren't working, this is likely to tell you what's going wrong.