- Installation
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install mosquitto
- Auto Start/Stop Mosquitto
brew services start mosquitto
brew services stop mosquitto
- Remove Background service
mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf
- In one console
npm install mqtt -g
mqtt sub -t 'temperature' -h 'test.mosquitto.org' -v
mqtt sub -t 'temperature' -h 'localhost' -v
- In another console
mqtt pub -t 'temperature' -h 'test.mosquitto.org' -m 'HOT - 100C'
mqtt pub -t 'temperature' -h 'localhost' -m 'HOT - 100C'
NOTE: We can find all of these tests in Mosquitto 🦟
npm install coap-cli -g
echo -n 'hello world' | coap post coap://localhost/message