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.genIn file, uncomment line #en_US.UTF-8
sudo locale-genSet locale:
sudo update-locale LANG=en_US.UTF-8Reboot
- Install necessary packages:
sudo apt-get updatesudo apt-get install gitgit clone https://github.com/PetoiCamp/OpenCat.gitgit clone https://github.com/gravesreid/autonomous-bittle.gitsudo apt-get install python3-opencv -ysudo apt-get install pipsudo apt-get install python3-tksudo apt install python3-serial- Edit bash path:
sudo apt-get install vim -y
vim ~/.bashrcat 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 hciuartsudo systemctl disable hciuartsudo rebootsudo apt-get install python3-virtualenvmkdir projectcd projectpython3 -m virtualenv envsource 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/serialMasterpython3 ardserial.pyNow 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.pyscp /path/to/local/file username@remotehost:/path/to/remote/directoryscp -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