October 2019
Intermediate to advanced
350 pages
9h 5m
English
Let's use the Mosquitto command-line tool to send the MQTT message to the MQTT server (shiftr.io), which will then forward it to our Arduino. Open a Terminal/PowerShell and run the following code:
mosquitto_pub -t "/tims-channel/feeder/feed" -m "Feeeed" -h broker.shiftr.io -u "try" -P "try"
We use the mosquitto_pub command to send the "Feeeed" message to the /tims-channel/feeder/feed channel using the broker.shiftr.io MQTT server with the try username and try password. At this point, we will ignore the message, in this case Feeeed, in our Arduino code and just check whether the topic matches /tims-channel/feeder/feed.
When you run the code, your feeder should open up and close again. Hooray!
Read now
Unlock full access