Execute external command when Dash button is pushed.
$ sudo apt-get install libpcap-dev
$ sudo npm install dash-button
$ sudo node DashBtnLauncher.js -b XX:XX:XX:XX:XX:XX -e echo hoge
1.Modify dashbtnlauncher.service
[Unit]
Description = Ble Button Controller with Dash Button
[Service]
ExecStart = /usr/local/bin/node /opt/DashBtnLauncher/DashBtnLauncher.js -b XX:XX:XX:XX:XX:XX -e echo hoge
Restart = always
Type = simple
[Install]
WantedBy = multi-user.target
2.Copy the service file to /etc/systemd/system
$ sudo cp dashbtnlauncher.service /etc/systemd/system
- Enable the service
$ sudo systemctl enable dashbtnlauncher.service
$ sudo systemctl start dashbtnlauncher.service
$ sudo systemctl status dashbtnlauncher.service