Simple server that captures raw keyboard inputs and broadcasts them via socket and OSC.
Made for my Raspberry PI zero W
, the peripheral's name is configured here.
Also, the binary data from my periphal may not be the same as yours, i'm using the REiiE Mini H9+ bluetooth keyboard.
Once server is running (read everything bellow first) it provides a webpage that should log keyboard events at this url :
http://IP_OF_YOUR_RASPBERRY_PI:3013
> npm install
Install PM2 globally (will run the script as a service) :
> npm i -g pm2
> npm run front/serve
> npm run front/build
> npm run server/watch
> npm run server/build
> npm run dev
Starts front and server with hot reload.
Node process has to be started manually. See Starting services section.
> npm run build
Execute this inside project folder's root
> pm2 start bootstrap-pm2.json
To view process logs via PM2, execute :
> pm2 logs --raw StreamDeck
First start the client as explained above.
Then execute these commands:
> pm2 save
> pm2 startup
Now, the service should automatically start on boot
The keyboard's name and path is configured there.
Yours might be different. Plug your keyboard an list the available devices with this command :
> ls -la /dev/input/by-id/
The keyboard device might endup with "kbd".
Not sure it's necessary but you may want to give access to that device to the user pi
:
> sudo setfacl -m u:pi:r /dev/input/by-id/usb-0513_0318-event-kbd
(replace the device's name by yours)
Build the project via :
> npm run build
Put the files from the server/
folder anywhere you like on your raspberry.
Put the package.json
file next to these files and run this to install dependencies:
> npm install
Create a public/
folder in the same place and put the content of the dist/
folder inside it.
Create an env.conf
file still in the same place and just write prod
inside it.
Run the server either manually or via PM2 (see above):
> node bootstrap.js
Open this URL on your browser and if everything's ok you should see keyboard events live like bellow:
http://RASPBERRY_PI_IP:3013