This repository holds the code and configuration for the autonomous swarm robotics project in the CMU-MAIL lab
- Flash image using raspberry pi imager:
- raspberry pi OS (Legacy) Lite Bullseye
- On first Power up:
- Select Keyboard layout
- set pi as username, select password
- Log in
- Set up wifi:
sudo raspi-config
- Localisation Options
- Set Timezone and WLAN Country
- go to Advanced Options, set network config to use NetworkManager
- go to system settings, enter wifi ssid and password
- Set auto login:
-
- S5 Boot / Auto Login
-
- Set up interface options
- 3 Interface Options
- Enable Legacy Camera support
- Enable SSHago
- I6 Serial port: Disable Login Shell, Enable Serial port hardware
- Ensure one wire communication disabled
- Enable remote GPIO pins
- Reboot
- Fix locale issues:
sudo nano /etc/locale.gen
In file, uncomment line #en_US.UTF-8
sudo locale-gen
Set locale:
sudo update-locale LANG=en_US.UTF-8
Reboot
- Install necessary packages:
sudo apt-get update
sudo apt-get install git
git clone https://github.com/PetoiCamp/OpenCat.git
git clone https://github.com/gravesreid/autonomous-bittle.git
sudo apt-get install python3-opencv -y
sudo apt-get install pip
sudo apt-get install python3-tk
sudo apt install python3-serial
- Edit bash path:
sudo apt-get install vim -y
vim ~/.bashrc
at the end of the file add: export PATH=$PATH:/home/pi/.local/bin
sudo vim /boot/config.txt
- add: dtoverlay=disable-bt
- Enter to terminal:
sudo systemctl stop hciuart
sudo systemctl disable hciuart
sudo reboot
sudo apt-get install python3-virtualenv
mkdir project
cd project
python3 -m virtualenv env
source env/bin/activate
- Hook the pi up to a monitor and type:
ifconfig
- note the ip address for the pi
- On your desktop terminal type:
ssh pi@[pi_ip_address]
- You will be prompted for the password for the pi. You can now disconnect the monitor from the pi
ssh-keygen -f "/home/[your_username]/.ssh/known_hosts" -R [ip.address]
cd ~/Opencat/serialMaster
python3 ardserial.py
Now you can enter commands through the terminal
- run ifconfig on your desktop terminal
bash ifconfig
- enter the desktop ip address in both the sender.py and receiver.py scripts
- On the desktop, run
python3 receiver.py
- on the pi, run
python3 sender.py
scp /path/to/local/file username@remotehost:/path/to/remote/directory
scp -r /path/to/local/directory username@remotehost:/path/to/remote/directory
- Set up two terminals with ssh to pi
- Open one terminal in bittle python environment on desktop
- On first bittle terminal run
python3 ardSocket.py
- On desktop terminal run
python3 receiver.py
- On second bittle terminal run
python3 sender.py