These instructions are a work in progress
- flash SD card with raspberry pi OS using Raspberry PI Imager application
- can now use the set-up features to:
- set the host-name (swallow-016, eg)
- enter wifi credentials for a local wifi network.
- enable SSH
- set username ("pi" is good) and password (ask a lab member)
-
enable ssh: run "touch ssh" in root of boot drive, if not enabled during imaging
-
find IP address:
for a local wifi router network:
arp -na | grep -i dc:a6:32
(for Pi 4, or b8:27:eb
for pi <4 )
if you directly connect ethernet to the Pi:
ping raspberrypi.local
and check the IP address
-
SSH into the pi:
ssh pi@[ip address]
, password: raspberry (unless you set it during imaging) -
Get MAC address: from Pi's command line interface, run
ip link show | grep ether
- write IP and MAC address in internal Google Drive swallow spreadsheet
- Also add serial number to internal Google Drive swallow spreadsheet
cat /proc/cpuinfo | grep Serial
-
if not set above, change the password:
passwd
-> raspberry -> [device password] -
Change hostname of device to swallow's ID, if not done during Imaging. E.g.:
sudo raspi-config > system > hostname > swallow-022
- Expand file system to use entire SD card
sudo raspi-config > advanced > expand filesystem
- add exfat file system support
sudo apt update
sudo apt upgrade
sudo apt install exfat-fuse
sudo apt install exfatprogs
- reboot
sudo reboot -h now
- SSH into the pi again, using the new password
- clone picopy from github:
git clone https://github.com/sammlapp/picopy.git
- make executable
sudo chmod +x ~/picopy/picopy.py
- run at bootup: modify rc.local using
sudo vi /etc/rc.local
, add these lines just above the "exit 0" line:
echo Running picopy from /etc/rc.local
sudo python3 -u /home/pi/picopy/picopy.py > /home/pi/picopy.log 2>&1 &
- run test script on pi:
python3 /home/pi/picopy/test_leds_buttons.py
- all leds will light up if they are working properly
- Check the power button last - it will turn the pi off
- check that all buttons work by pushing each button (should see text logged in console for each button)
- Reboot using power button and test that it starts picopy (flashes green light 'ready' status) and recognizes an external exFat drive (source/dest drive LED lights up)
Easy power-button setup:
git clone https://github.com/sammlapp/pi-power-button.git
./pi-power-button/script/install
Follow instructions from picopy