2021-04-06 16:41:49 +02:00
|
|
|
# blinky
|
|
|
|
|
2021-04-06 16:46:56 +02:00
|
|
|
control your blinkstick via http requests
|
2021-04-06 16:41:49 +02:00
|
|
|
|
|
|
|
## requirements
|
|
|
|
|
2022-02-21 11:56:49 +01:00
|
|
|
- nodejs
|
2021-04-07 12:06:32 +02:00
|
|
|
- yarn / npm
|
2022-02-21 11:56:49 +01:00
|
|
|
- [nvm](https://github.com/nvm-sh/nvm)
|
|
|
|
|
|
|
|
**the node-hid module is a bit picky about node.js's version - use node.js 8.x or 15.x**
|
|
|
|
|
|
|
|
## setup
|
|
|
|
|
2022-02-21 12:04:37 +01:00
|
|
|
- clone the project (to '/opt/blinky')
|
|
|
|
`git clone https://git.velvettear.de/velvettear/blinky.git /opt/blinky`
|
2022-02-21 11:56:49 +01:00
|
|
|
|
|
|
|
- enter the cloned directory
|
2022-02-21 12:04:37 +01:00
|
|
|
`cd /opt/blinky`
|
2022-02-21 11:56:49 +01:00
|
|
|
|
|
|
|
- install and switch to a supported node.js version (automatically done via .nvmrc file)
|
|
|
|
`nvm install`
|
|
|
|
|
|
|
|
- install the required modules
|
|
|
|
`npm install`
|
|
|
|
|
|
|
|
- switch back to your system's default node.js version
|
|
|
|
`nvm deactivate`
|
|
|
|
|
2022-02-21 12:04:37 +01:00
|
|
|
- execute blinky
|
2022-02-21 11:56:49 +01:00
|
|
|
`nvm run 15 blinky.js`
|
2021-04-06 16:46:56 +02:00
|
|
|
|
2022-02-21 12:04:37 +01:00
|
|
|
## systemd
|
|
|
|
|
|
|
|
**for security reasons it is highly recommended to not run blinky with root permissions!**
|
|
|
|
|
|
|
|
- create a new system user
|
|
|
|
`useradd -r -s /usr/bin/nologin blinky`
|
|
|
|
|
|
|
|
- symlink the provided systemd-service file and modify it according to your needs
|
|
|
|
`ln -s /opt/blinky/blinky.service /etc/systemd/system/blinky.service`
|
|
|
|
|
|
|
|
- reload systemd-services
|
|
|
|
`systemctl daemon-reload`
|
|
|
|
|
|
|
|
- enable and start blinky as a systemd-service
|
|
|
|
`systemctl enable --now blinky`
|
|
|
|
|
2021-04-06 16:46:56 +02:00
|
|
|
### scripts
|
|
|
|
|
|
|
|
- blinky-feed.sh
|
|
|
|
- gathers various system information (currently temperature only) then converts it to color values and sends it to blinky
|
|
|
|
- requirements: bash, bc
|