Ansible scripts to setup a Raspberry Pi for boat use, providing access to various data sources on board both via wired and wireless connections. Features include:
Install Ansible on your computer and verify that it works
Install Raspberry OS Lite on an SD-card with your local computer.
diskutil list
diskutil unmountDisk /dev/<disk#>
sudo dd bs=1m if=<your image file>.img of=/dev/<disk#>
Enable remote access while the SD-Card is still in the computer.
ssh
on the SD-card (which now has the volume label 'boot)touch /Volumes/bootfs/ssh
Optionally, configure the Raspberry Pi to connect to your Wifi network (otherwise you have to connect through Ethernet)
wpa_supplicants.conf
on the SD-card with the following content:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<Insert 2 letter ISO 3166-1 country code here>
network={
ssid="
Insert SD-card in the Raspberry Pi and test the network connection.
ssh <ip> -l pi
Clone this git repository on your computer
Run ./firstrun.sh
from your computer, for the initial setup of your Raspberry Pi.
pi
(which is raspberry
)raspberrypi.local
. If you want to use its IP address, or another hostname use: ./firstrun.sh <ip-of-your-raspi>
(find out the IP address).Create a copy of playbooks/example-boat.yml
and edit the settings to match your environment such as the hostname, wifi and hotspot settings, etc.
Run ./provision.sh <ip-of-your-raspi> playbooks/example-boat.yml
to provision the software & configurations for the roles in example-boat.yml.
pi
and password password
).
When you are done with the configuration save .signalk/defaults.json, security.json and settings.json. You can use these in a next provisioning process.You define what features you want to provision by adding roles to your playbook.
Installs the Signal K Node server. Uses node
and node-app
roles to install Node.js and run under systemd.
Installs and configures the software needed for the Pi to act as a wifi hotspot. Override variables:
hotspot_ssid: MarinePi
hotspot_channel: 11
hotspot_passphrase: NavigareNecesseEst
hotspot_interface: wlan0
Installs canboat utilities to interface with the NMEA 2000 network.
Installs a cron script that periodically checks your external IP address and updates Amazon's Route 53 name server information to act as dynamic DNS setup. Installs Amazon's command line tools as a dependency.
For minimal priviledges you should create a limited AWS identity for use with this profile and attach the policy AmazonRoute53FullAccess
. In your own playbook define variables
aws_access_key_id: 'YOUR_ACCESS_KEY_ID'
aws_secret_access_key: 'YOUR_SECRET_ACCESS_KEY'
with the information for this limited identity.
Installs and configures the software the Pi needs to act as a wifi client. Override variables:
wificlient_interface: wlan1
wificlient_networks:
- ssid: defaultssid
psk: defaultpassphrase
priority: 1
scan_ssid: 0
You can add multiple networks by repeating the last four lines, if needed.
Installs the pysk console client on the Pi. See: https://github.com/ph1l/pysk
Installs grafana. Override variables:
grafana_admin_password: admin
grafana_secret: SW2YcwTIb9zpOOhoPsMm
grafana_port: 3000
Fork of original project with the intention of continuing work in this repo.