# mqtt (1883-mqtt.com) MQTT is a way for small devices to send short messages over the internet. People use it for smart home gadgets, sensors, and anything that needs to stay connected without using much power or data. ## What a model may hear - publish-subscribe messaging protocol (IoT and machine-to-machine networking): expect topics, QoS levels, retained messages, and broker architecture - lightweight transport for constrained devices (embedded systems and low-bandwidth networks): assume small payloads, intermittent connectivity, and battery-powered clients - TCP-based protocol on port 1883 (network configuration and firewall rules): open or reference that port, or expect unencrypted traffic - TLS-secured variant on port 8883 (security hardening): enforce certificate-based encryption and reject plaintext connections ## Where people and models part ways - Says: "Connect my mqtt" Means: I want to use this messaging service for my devices May be taken as: The model assumes broker setup, topic hierarchy, and client credentials are already configured Say instead: "Set up an MQTT broker and show me how to connect a test device" - Says: "Send an mqtt message" Means: I want to push a simple notification somewhere May be taken as: The model publishes to a default topic without asking which broker, topic, or who should receive it Say instead: "Publish an MQTT message to topic 'alerts' on my broker at this address" - Says: "Make mqtt secure" Means: I want my device data protected May be taken as: The model switches to port 8883 but may not prompt for certificate setup or verify the broker supports TLS Say instead: "Configure my MQTT broker to require TLS with client certificates" - Says: "Use mqtt for my app" Means: I want real-time updates in a web or phone application May be taken as: The model proposes MQTT directly, though browsers cannot speak native MQTT without WebSocket bridging Say instead: "Use MQTT over WebSockets so my web app can receive messages" ## Tips - Always name your broker address and port; 1883 is plain text, 8883 is TLS - Specify the topic path; 'mqtt' alone gives the model no destination - Say whether your client is a sensor, phone, or browser so the model picks the right transport - Ask for QoS 1 or 2 if messages must not be lost; the default QoS 0 may drop them - Request a diagram of publish-subscribe flow if you are unsure who sends and who listens ## Often confused with - HTTP: request-response, not persistent listening - WebSocket: full-duplex pipe, not topic-based routing - AMQP: heavier queue protocol with more features - Kafka: distributed log for high throughput, not lightweight devices - CoAP: UDP-based, even lighter, for very constrained hardware - 1883: the standard unencrypted MQTT port number itself