Environment:
Host: macOS Catalina
Raspberry Pi 2 Model B
Raspberry Pi USB WiFi Adapter (I have this one)
Raspberry Pi Camera Module V2
- Install Raspberry Pi OS image on an SD card: I used Raspberry Pi Imager rbi-imager for macOS, chose Raspberry Pi OS (32-bit) - https://www.raspberrypi.org/documentation/installation/installing-images/
- If you plan to use the WiFi Adapter and Camera, connect those.
- Connect camera module
- Boot into the Raspberry Pi and login
- Connect any peripherals (monitor, keyboard, mouse)
- Open terminal
- Confirm the OS version. Mine is "Raspbian GNU/Linux 10 (buster)"
- Update settings for US.
- On the Welcome to Raspberry Pi screen
- Click Next
- Country: Choose United States
- Language: American English
- Time Zone: New York
- Enable Use English language and Use US keyboard
- Click Next
- Enter password
- I skipped the WiFi configuration screen since my SSID is not broadcasting so need to configure it manually
- This is an alternative way to do it via the command line. Key thing is I needed for my keyboard to recognize the double-quote key
- Configure Raspberry Pi to connect to WiFi
Backup file and copy to your home foldersudo cp /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf.orig cp /etc/wpa_supplicant/wpa_supplicant.conf ~
Add below to the end of the file. I had to add scan_ssid=1 because my SSID is not broadcasting. NOTE: If you have special characters in your password, e.g. double quote I didn't have to escape it but I had to add in key_mgmt=WPA-PSK config attribute (with no quotes).
vi ~/wpa_supplicant.conf network={ ssid="<ssid>" psk="<secret password>" scan_ssid=1 }
Copy updated file backsudo cp ~/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf
Verify if the “inet addr” is available on wlan0ifconfig wlan0
If not, reboot to connectsudo reboot
On reboot, I can see it the IP address is XXX.XXX.XX.XXX”
To verify internet connectivity perform a wgetwget www.google.com
- Enable ssh on Raspberry Pi
sudo raspi-config Choose Interface Options Choose SSH => Yes [Didn’t need to reboot]
- Enable camera on Raspberry Pi
sudo raspi-config Choose Interface Options Choose Camera => Yes [Prompted to reboot] => Yes
- Connect to Raspberry Pi via ssh from localhost, update macOS hosts file with Raspberry Pi IP
sudo vi /private/etc/hosts
Added this to bottom of file# raspberry pi XXX.XXX.XX.XXXX csrp
ssh to the Raspberry Pi
ssh pi@csrp
- Verify camera works
- The Raspberry Pi captures video as raw H264 video stream
raspistill -o ~/image-small.jpg -w 640 -h 480 raspivid -o ~/video.h264
- secure copy to and open it in macOS
scp pi@csrp:/home/pi/image-small.jpg ~/Downloads scp pi@csrp:/home/pi/video.h264 ~/Downloads
- Shutdown the Raspberry Pi
sudo halt
cat /etc/os-release
sudo raspi-config
Choose Localisation Options
Choose Change Locale => en_US.UTF-8 UTF-8
Choose Change Keyboard Layout => Generic 101-key PC => Other => English (US) (Country of Origin) => English (US) (Keyboard layout) => The default for the keyboard layout => No compose key =>
Choose Change WLAN Country => US United States
sudo reboot
No comments:
Post a Comment
I appreciate your time in leaving a comment!