- A laptop (with ubuntu OS)
- A Raspberry Pi 3 Board with power cable
- A MicroSD card
- A MicroSD to USB converter
- A Camera with two Servos
- Motors with cable (x4)
and a working space with wifi access.
-
Run Command: on the laptop, turn on the terminal, and type, then type enter:
snap install rpi-imager
-
Plug In: plug in the MicroSD card to the laptop
# Action: plug-in: MicroSD -> Laptop # may need converter
-
Run Program:
# Action: Open the **Raspberry Pi imager** App. # Action: Select the proper settings on the UI. (trivial) # Action: Click run and wait it finished.
-
Run Command:
# navigate to the root of the MicroSD card cd /media/congyu/bootfs touch ssh nano wpa_supplicant.conf
-
Type In (Accordingly): type the following content according to your true information and save.
country=YOUR_CONTRY_CODE # eg. US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="your wifi ssid"
psk="your wifi password"
key_mgmt=WPA-PSK
}
- Plug In:
# Action: plug-out: MicroSD <- Laptop # Action: plug-in: MicroSD -> Raspberry Pi 3 Board # Action: plug-in: Power cable -> Raspberry Pi 3 Board # Action: wait ~10 minutes (for raspberry to setup automatically)
-
Run Command:
# locate the IP of the rasberry PI. run: ip route | grep default
-
Observe:
# Information: you will see something like default via 192.168.1.1 dev wlan0 proto dhcp metric 600. # Action: Figure out your router's IP address (e.g., 192.168.1.1)
-
Run Command (Accordingly):
# Modify the following IP based on your Router IP. (replace last .1 to .0) nmap -sn 192.168.1.0/24
-
Observe:
# Action: Figure out your Rasberry IP. (eg. 192.168.1.xxx)
-
Run Command (Accordingly):
ssh pi@192.168.1.xxx # for password, type in: raspberry
-
Run Command:
exit
-
Run Command (Accordingly):
ssh pi@192.168.1.xxx # for password, type in: raspberry
-
Run Command:
sudo apt install python3-venv python3 -m venv toy_car_controller source toy_car_controller/bin/activate
-
Run Command:
git clone <this git repository> cd ToyCarController sudo apt-get install portaudio19-dev pip3 install -r requirements.txt
-
Plug In:
# Action: plug-out: Power cable <- Raspberry Pi 3 Board # Action: plug-in: Adafruit Control Board (With Power) -> Raspberry Pi 3 Board # Action: plug-in: Camera -(Servo cable)-> Adafruit Control Board (With Power)) # Action: plug-in: Camera -(USB)-> Raspberry Pi 3 Board
-
Plug In:
# Action: plug-in: Motors x 4 -> Adafruit Control Board # Action: plug-in: Adafruit Control Board -(GPIO & Power)-> Adafruit Control Board (With Power)
-
Plug In:
# Action: plug-in: Power cable -> Adafruit Control Board (With Power) # Action: plug-in: Power cable -> Raspberry Pi 3 Board # Action: wait ~3 minutes (for raspberry to start)
-
Run Command (Accordingly):
# you might need to re-connect the resberry board ssh pi@192.168.1.xxx # for password, type in: raspberry
-
Run Command:
source toy_car_controller/bin/activate cd ToyCarController python control_server.py
-
Run Program:
# Action: open a **browser** (from any device under same wifi) # Action(accordingly): go to 'http://192.168.1.xxx:5000'