Mongoose-OS demo firmware for publishing pushbutton events as MQTT messages. This firmware uses zbutton, zbutton-gpio and zbutton-mqtt native libraries.
Build up your device in few minutes just downloading, compiling and flashing this demo.
Clone the repo:
$ git clone https://github.com/zendiy-mgos/zbutton-mqtt-demo my-zbutton-mqtt-demo
$ cd my-zbutton-mqtt-demo
Enable JavaScript demo (skip to continue with C/C++ demo) :
sources:
# - src
- src_js
libs:
- origin: https://github.com/mongoose-os-libs/mjs
- ...
Build the binary:
$ mos build --platform <device_platform>
Flash the firmware:
$ mos flash --port <port_name>
- Wemos D1 mini board
- Pushbutton
- 5V DC power supply (via min-USB cable or via external power supply)