1. Download the latest Raspbian Buster image from this link.

2. Run diskutil list on any terminal, get the disk number of the SD card from the output. In example below X will be 2. You can usually identify the SD card in the output by looking for "external, physical" in the disk description, and also matching the physical size of the disk with the size of the SD card being used. Once you have the disk number, proceed with the next step.



3. Unmount any partitions by running the following commands (replace X with your disk number):

    sudo diskutil unmountDisk /dev/rdiskX


4. Format and copy Raspbian image to SD card by running the following command (replace Y with the latest version number:

    sudo dd bs=1m if=~/Downloads/raspbian_buster_17-11-2022_updated_ssh_shrunk.img of=/dev/rdiskX

5. Eject SD card by running the following command (replace X with the disk number):
    sudo diskutil eject /dev/rdiskX

6. Insert SD card to Raspberry PI and turn it on.


7. Once the Pi has booted, SSH to the Pi by running:
ssh pi@ip_address


8. Expand the file system by running the following command:

sudo raspi-config --expand-rootfs


9. Reboot the Pi


10. Once the Pi has booted, SSH back into the Pi by running:
ssh pi@ip_address


11. Update the OS by running the following commands:

sudo apt-get update

sudo apt-get full-upgrade

sudo apt-get dist-upgrade

sudo PRUNE_MODULES=1 rpi-update


12. Reboot the Pi


13. Once the Pi has booted, SSH back into the Pi by running:
ssh pi@ip_address


14. Install the PiControl Wall Plate software by running the following commands:

sudo wget https://picontrol-updates.s3.us-east-2.amazonaws.com/picontrol_wp_2.0.7.zip -O /tmp/latest_update.zip

sudo mkdir /var/www

sudo mkdir /var/www/html

sudo mkdir /var/tmp/PiControl

sudo unzip -o /tmp/latest_update.zip -d /var/www/html

sudo rm /tmp/latest_update.zip

sudo /var/www/html/install.sh


15. Once the final command has complete, the Pi will shut down. At this point, capture the image by removing the SD card from the Pi and putting it into your computer and running the following commands:

sudo dd bs=1m if=/dev/rdisk0 of=~/Downloads/IMAGE_NAME.img


16. Once you have captured the image file, shrink it by following the solution below:

https://lindisfarne.freshservice.com/a/solutions/articles/10000075363?language=en