Minjoo Cho ([email protected])
This is a MQTT.js example implemented for NextJs based on emqx MQTT example.
.
├── /arduino
├── /mosquitto
└── /next-app
This program requires docker-compose
command to run examples.
Please install docker-compose
from the official documentation.
Run the following command from the root of the directory
docker-compose up -d
# -d is needed to run docker in a detached mode
This command will run local MQTT broker on a port 1883
and 9001
(for websocket), and run NEXTJS app on a port `3000``
Open localhost:3000
to check the application.
- Click on the
MQTT Tools
to open the toolbox - Connect to the local MQTT broker
- Subscribe to the
canvas/cube/+
topic - Publish the color payload to
canvas/cube/color
topic to change the color of the cube.
I added a simplied arduino code example under /arduino
folder. With the code, you can control the rotation