Blindly capture keyboard input and send it to your email.
- https://www.raspberrypi.com/software/
- (Other -> Pi OS Lite)
- Pre-configure SSH access, and WiFi setup if you can.
sudo apt update
sudo apt install git nodejs npm
git clone https://github.com/arfct/mizaru.git
Install dependencies:
cd mizaru; npm install
Make sure it works:
node mizaru.js
- Add a gmail and password to
config.js
- You can get a password from https://myaccount.google.com/apppasswords if you have 2factor on.
test
- Open a terminal window on your Raspberry Pi.
- Type
bluetoothctl
and press Enter to start the Bluetooth control utility. - Type
power on
to turn on the Bluetooth adapter. - Type
agent on
to enable the agent that will handle the pairing process. - Type
scan on
to start scanning for Bluetooth devices. - Put your keyboard in pairing mode by pressing the pairing button or following the manufacturer’s instructions.
- Wait for your keyboard to appear in the list of available devices. Once it appears, note its MAC address.
- Type
pair MAC_ADDRESS
(replace MAC_ADDRESS with the actual MAC address of your keyboard) to initiate the pairing process. - Follow the on-screen instructions to complete the pairing process.
- Type
trust MAC_ADDRESS
to mark the keyboard as a trusted device. - Type
connect MAC_ADDRESS
to connect to the keyboard.
To have your Raspberry Pi automatically login a user on boot, you can modify the getty service configuration. Here are the steps:
- Open a terminal window on your Raspberry Pi.
- Edit the getty service configuration file by running the command
sudo nano /etc/systemd/system/[email protected]/autologin.conf
- Add the following lines to the file:
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin USERNAME --noclear %I $TERM
- Save the file by pressing Ctrl+X, then Y, then Enter.
- Reload the systemd daemon by running the command
sudo systemctl daemon-reload
. - Enable the getty service by running the command
sudo systemctl enable [email protected]
. Now when your Raspberry Pi boots up, it will automatically login the specified user. Note that this will bypass the login prompt, so use with caution and only on trusted devices.
- Open a terminal window on your Raspberry Pi.
- Edit the .bashrc file for the user you want to automatically start the program for by running the command
nano ~/.bashrc
- Scroll to the bottom of the file and add the command to start the program
node ~/mizaru/mizaru.js
- Save the file by pressing Ctrl+X, then Y, then Enter.
- Restart your Raspberry Pi to apply the changes.