/DashBtnLauncher

Execute external command when Dash button is pushed

Primary LanguageJavaScriptApache License 2.0Apache-2.0

DashBtnLauncher

Execute external command when Dash button is pushed.

Dependency

$ sudo apt-get install libpcap-dev
$ sudo npm install dash-button

How to use?

$ sudo node DashBtnLauncher.js -b XX:XX:XX:XX:XX:XX -e echo hoge

How to execute as service using systemd on Ubuntu?

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
  1. Enable the service
$ sudo systemctl enable dashbtnlauncher.service
$ sudo systemctl start dashbtnlauncher.service
$ sudo systemctl status dashbtnlauncher.service