This is a repository for a custom workshop that utilizes an Education Kit 3 from Cambridge Raspberry Jam.
There are X steps to setup the workshop
- Get all the parts for the robot as seen in robotparts
- Setup the two Raspberry Pis, one with OS Lite to run the robot and one regular to run the desktop environment.
- Print out the instructions to assemble and/or code the robot.
We found it difficult for our workshop takers to plug in the robot to a screen every time they needed to change code. In addition to the hassle, the robot would still be on and the motors may still run, making the workshop takers to turn the batteries off and on every debug session. Not a good experience for our use case where the workshop takers are beginners to wiring and coding anything technical. Our solution, or comprimise, is to use two Raspberry Pis where one remote control the other through SSH.
Setting up the recieving Pi is quick and easy with the official Raspberry Pi Imager provided by the Raspberry Pi team.
- In the imager select the "Raspberry Pi OS (other)" and then the Lite version. Select a storage to write to and you'll recieve a pop-up to edit customizable settings.
- Select to edit them and set the hostname, username and password to pi1. This is the only variable that will change depending on however many teams will participate in the workshop, change the variable to pi2, pi3, etc. Password could optionally be safer, but this is a small workshop on a private network.
- Configure the wireless LAN and locale settings to match.
- Switch to the next tab and enable SSH and to use password authentication.
- Save the settings and flash the storage with the new image.
- When it is done plug the raspberry pi to a screen and log in (we had trouble setting it up with SSH without a first login)
- Bonus; run
hostname -I
in the terminal and write down the given ip adress, this will be used in DesktopPi. The RobotPi should all be setup for now :)
Setting up the sending Pi requires more steps. We use the same Raspberry Pi Imager as before, but this time we select the regular desktop OS instead of Lite.
- Select the default Raspberry OS (typically the top most one) and select a storage to flash to.
- In the customizable settings, remove the hostname and change the username/password to desktop1, desktop2, etc for each corresponding RobotPi.
- Configure wireless LAN and locale settings to be the same as the corresponding RobotPis.
- Disable the SSH setting in the other tab.
- Flash the storage and when it is done connect a screen and log in.
- Download or Transfer this git repository to the DesktopPi.
- Go into
setup
directory and runchmod +x desktop-setup.sh; ./desktop-setup.sh pi1
It will install VS Code and add a function to.bashrc
named "runonrobot" that will connect to pi1 and make it run the selected python file. - The script will ask you what ip address pi1 has, type in the answer recieved in step 7 of RobotPi above.
- As a backup, if SSH would fail for whatever reason, there will be a "runonboot" folder on the desktop that will open a terminal and execute any python file on boot. This is to ensure our workshop participants can still run code by just swapping the sd card between DesktopPi and RobotPi.
- The DesktopPi should open visual studio code on boot in the correct directory with all files.
- Update the command instruction on DesktopPi to type y and/or yes when it asks to, this is to make ssh easier