Quickly setup your Raspberry Pi to be part of a synchronized cluster of video players.
- Image your SD cards.
script/image_cardhelps with this.
- Boot the new pis and go through initialization. Expand the filesystem, enable SSH, and optionally set the hostname to something unique.
Ensure ansible is installed (see Requirements, below).
Clone and setup the ansible script.
git clone https://github.com/heisters/node-omxplayer-sync-devops.git cd ansible-pi git checkout video-cluster cp hosts.example hosts
If you did not set the hostnames of the pis, you can use this script to find pis on the local network:
Put the pi hosts or IPs in
hosts under "players".
Optionally, copy your ssh id to the players:
which ssh-copy-id || brew install ssh-copy-id ssh-copy-id pi@XXX.XXX.X.XXX # password is 'raspberry'
To check that the players are properly configured:
Provision the players:
If you didn't copy your ssh id previously, you'll need to run the
provision command directly with
ansible-playbook provision.yml --ask-pass -i hosts
Provisioning will automatically deploy the application for you. However, once provisioning is done, you'll need copy your video file and any custom configuration to the pis:
script/copy <a video file> /home/pi/video.mov
or, if each pi gets a different video file:
scp <video file 1> firstname.lastname@example.org:~/video.mov scp <video file 2> email@example.com:~/video.mov # ...
Then, optionally, copy the configuration:
script/copy <path>/config.local.js /app/
See https://github.com/heisters/node-omxplayer-sync for more details on configuration.
Ansible is required.
pip install ansible
Run adhoc commands:
script/run 'ls /'
Same, but with sudo privileges:
Manage the system service for the video player:
Copy a local file to all players:
script/copy ../my-local-file.txt /app/
Check whether you can connect to all players: