aliases | category | classification | date | date_modified | draft | id | image | links | local_archive_links | pinned | series | tags | title | type | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
mosquitto |
public |
2023-08-15 02:41:46 -0700 |
2023-08-15 02:41:46 -0700 |
false |
20230815094146 |
|
false |
false |
|
Mosquitto/MQTT Testing Cheatsheet |
tech-note |
# Create a topic called test:
docker run --network home-assistant-01 -it eclipse-mosquitto:latest mosquitto_sub -h <mosquitto-hostname> -t test
# Create a topic called test whilst providing credentials:
docker run --network home-assistant-01 -it eclipse-mosquitto:latest mosquitto_sub -h <mosquitto-hostname> -t test -u admin -P "<mosquitto-password>"
# Send a message to the test topic:
docker run --network home-assistant-01 -it eclipse-mosquitto:latest mosquitto_pub -h <mosquitto-hostname> -t test -m "hello"
# Send a message to the test topic with credentials:
docker run --network home-assistant-01 -it eclipse-mosquitto:latest mosquitto_pub -h <mosquitto-hostname> -t test -m "hello" -u admin -P "<mosquitto-password>"
# Add a password for a user to the passwd file:
docker exec -it ha_mosquitto-01 mosquitto_passwd -c /mosquitto/config/mosquitto.passwd admin