- Raspberry Pi 3 Model B
- MCP3008 wired to hardware SPI
- Download Raspbian Stretch Lite and unzip
- Insert SD card into host computer (note for 30GB+ cards)
- Format SD card to FAT32 using native tool or official tool
- Local
diskutil list
to find the SD volume - Local
diskutil unmountdisk /dev/disk2
with the actual path from previous step - Local
sudo dd if=raspbian.img of=/dev/disk2 bs=2m
with actual paths - Wait for quite some time...
- Local
diskutil mountdisk /dev/disk2
to mount the disk - Local
cd /Volumes/boot
- Touch
/ssh
on the boot partition somehow to enable SSH - Insert SD card, plug in ethernet, then plug in power... booted!
- SSH using default credentials pi:raspberry and IP discovered via router tool
sudo apt-get install vim
- Uncomment
duid
in/etc/dhcpcd.conf
on the boot partition to fix IPv6 - Run
sudo raspi-config
- Select '1 Change User Password' to change default password
- Select '2 Network Options' then 'N2 Wi-fi' to connect to Wi-fi
- Select '4 Localisation Options' then 'I2 Change Timezone' to update clock
- Select '5 Interfacing Options' then 'P4 SPI' to enable SPI
- Select '7 Advanced Settings' then 'A1 Expand Filesystem' to expand
- Run
cd ~ && install -d -m 700 ~/.ssh
to initialize the SSH directory - On the host, run
cat ~/.ssh/id_rsa.pub | ssh {user}@{host} 'cat >> .ssh/authorized_keys'
to copy local keys to Pi - Run
sudo reboot
and cross fingers - Wait for Pi to reboot, then SSH back in... (reboot again if SSH wont work)
- We expect
lsmod
to indicate the SPI Linux Kernel module is loaded$ lsmod | grep spi_
- We expect an interface to be mounted
$ ls -l /dev/spi
- TODO: Compile and test logger program