A "physical" command line interface using Amazon Dash buttons.
These instructions will get you a copy of the project up and running on your local linux machine. This program can run on any other machine that Node.js supports, and has the libpcap library installed.
You will need the following things properly installed on your computer.
- Git
- Node.js (with NPM)
- libcap-dev
git clone https://github.com/chancebrilz/dash-button-wireless-cli.git
cd dash-button-wireless-cli
npm install
apt-get install libpcap-dev
or using another installation method
$ sudo node index.js
Add your Dash Button by creating a new variable of DashDutton
type using it's MAC address.
var dash_B268 = DashButton('78:e1:03:92:b2:68')
You can then capture button press packets using the following code
dash_B268.on('detected', function() {
execute('./scripts/test.sh', 'Running test script...');
});
These instructions are for systemd. Upstart can also be used but only systemd is supported by default.
The program folder must live inside the /opt directory for the service to work. You may need to run these commands as sudo
if you are not the root user.
$ mv dash-button-wireless-cli /opt/dash-button-wireless-cli
$ ln -s /opt/dash-button-wireless-cli/services/dashbutton.service /etc/systemd/system/dashbutton.service
$ systemctl enable dashbutton
$ systemctl start dashbutton
This will start the service on reboot, and automatically reload the program if it crashes.
This project is licensed under the MIT License - see the LICENSE.md file for details
I would like to thank hortinstein for his node-dash-button project.