-
Write the base Rasbian 32bit Desktop image to an SD card. The default user is
piand the password should be supplied. -
Enable SSH server
sudo raspi-config -> Interface Options -> SSH -> Yesif not already. -
Grab the IP address for the pi.
-
If you haven't installed Ansible already, please follow the instructions below. Make sure to install the collections needed for this playbook.
-
Run
step1.ymlwith the below command. When prompted enter password. PressENTERto accept the default become passwordansible-playbook --inventory [pi ip address], --user pi --ask-pass --ask-become-pass step1.yml
-
Check the IP address of the pi to ensure it hasn't changed. Run
step2.ymlwith the below command using the current IP.For English:
ansible-playbook --inventory [pi ip address], --user pi --ask-pass --ask-become-pass step2.yml
For Spanish:
ansible-playbook --extra-vars language=spanish --inventory [pi ip address], --user pi --ask-pass --ask-become-pass step2.yml
-
Copy the ssh public key to the bridgevm. SSH to pi and run the below command. The password for the bridgevm should be supplied.
ssh-copy-id cmesworldpi@40.71.203.3
-
Copy the ssh public key to the bridgevm. SSH to pi and run the below command. The password for the bridgevm should be supplied.
ssh-copy-id cmesworldpi@40.71.203.3
-
Run the following scripts to pull down the site.
- Version.sh
- GetLogs.sh
- UpdateVersion.sh
-
Test the site using the app or by connecting to the Pi's IP address over http.
-
If everything looks good. Shutdown the pi, remove the sd card and insert it your PC.
-
Write img file from sd card. You will need to find which device your sd card is labeled.
sudo dd if=/dev/mmcblk0 of=./cmes_pi_base_uncompressed.img status=progress
-
Use pishrink to shrink the uncompressed image.
pishrink.sh cmes_pi_base_uncompressed.img cmes_pi_base.img
If you have already connected to a pi with the same IP you may get an error when attempting to connect. You will need to run the below to remove the IP from your known_hosts file.
ssh-keygen -f ~/.ssh/known_hosts -R [pi ip address]You may also have to connect once prior to running Ansible to add or replace the ip in your known_hosts file
ssh pi@[pi ip address]Ansible should be installed through PyPi using the pip command. If you already use Python for other projects, you may want to create a virtual environment for your ansible install. An introduction to installing Ansible can be found here.
- Install
python3andpython3-pipvia apt or dnf. - Install the latest version of the ansible bundle with
pip3 install ansible.
Ansible can be installed via homebrew. Instructions can be found here. Not tested as of 9/10/23
Ansible can be installed on a Windows through WSL. Instructions can be found here. Not tested as of 9/10/23
Install the collections needed for this playbook with ansible-galaxy collection install -r ./collections/requirements.yml --force
Manual instructions for building a CMES pi can be found here
- If startup hangs on starting wlan when running Molecule try removing and reattaching the Wi-Fi card passthrough
- If using non-desktop figure out packages needed
- wpasupplicant
- rfkill
- Testing protocol
- Azure arm VM? Need to figure out how to emulate wlan0
- How can we test the pi changing networks?
- Are there any edge cases we should test for?
- What issues in the field can try to replicate during testing?