Steps below are minimum steps for simple setup, so you should harden the security when you've checked that everything works. The following assumes you're using default user name pi
, so replace it where needed
- Download Raspberry Pi Imager and install it (https://www.raspberrypi.com/software/)
- Start Raspberry Pi Imager
- Choose operating system (typically Raspberry Pi OS desktop or lite)
- Choose the drive where to flash the image
- Click the button with the cog to edit advanced settings. Enable SSH, choose preferred authentication method and configure the other settings (e.g. user name, host name, WLAN settings and locale) if needed
- Write the image
- Put the card to Raspberry Pi, connect it to LAN and power it on
- Connect to the PI using SSH (using authentication method, user name and host name) defined earlier
- Update the OS (
sudo apt update
andsudo apt upgrade
) - Check BlueZ version by running
bluetoothd -v
. It should output "5.50" or newer - Create new directory:
mkdir ~/vahti && cd ~/vahti
- Download Vahti.Server binaries:
wget https://github.com/ilpork/vahti/releases/latest/download/Vahti.Server-linux-arm.zip
- Extract the files:
unzip Vahti.Server-linux-arm.zip
- Copy config.template.json as config.json
cp config.template.json config.json
- Update user permission on
config.json
so that only user you've defined can read it:chmod 600 config.json
- Edit the configuration file:
nano config.json
. See Configuration for details on how to configure the app. - Add user to bluetooth group
sudo adduser pi bluetooth
(wherepi
is the user name you are using) - Reboot
sudo reboot now
- After Raspberry Pi is online again, connect to it again using SSH
- Now you can navigate to folder and start the app by executing
cd ~/vahti && ./Vahti.Server
How to make Vahti a service starting up on boot:
- Create service file
sudo nano /etc/systemd/system/vahti.service
with following content (remember to use correct user name instead ofpi
)
[Unit]
Description=Vahti
Requires=network.target network-online.target bluetooth.target
After=network.target network-online.target bluetooth.target
[Service]
ExecStart=/home/pi/vahti/Vahti.Server
WorkingDirectory=/home/pi/vahti
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=Vahti
Restart=always
User=pi
#RuntimeMaxSec=86400
[Install]
WantedBy=multi-user.target
Uncomment the RuntimeMaxSec=86400
line if you have stability issues with service/DBus. It restarts the service periodically (time in seconds). You can add similar line for bluetooth service (sudo nano /etc/systemd/system/bluetooth.target.wants/bluetooth.service
) to periodically restart Bluetooth service. If you edit the service files later, remember to reload the daemon (sudo systemctl daemon-reload
) or reboot.
-
Enable the service:
sudo systemctl enable vahti
-
Restart Raspberry Pi to check that service starts up correctly
sudo reboot now
-
Check that service has started:
systemctl status vahti
vahti.service - Vahti
Loaded: loaded (/etc/systemd/system/vahti.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2020-06-07 12:27:08 EEST; 35min ago
Main PID: 1210 (Vahti.Server)
Tasks: 17 (limit: 4915)
Memory: 27.9M
CGroup: /system.slice/vahti.service
└─1210 /home/pi/vahti/Vahti.Server
- Logs can be found from Syslog. Example:
sudo journalctl -u vahti