How to run SNN on TurboPi - GMU-ASRC/neuroswarm GitHub Wiki

How to run an SNN on a TurboPi

First, open the terminal in your pc and go to your chosen directory.

  1. Clone the repo and initialize and update the pi submodule via

    • clone the repo via ssh: git clone [email protected]:GMU-ASRC/turbopi.git
    • Check the current working directory: git status
    • Initialize the /pi submodule: git submodule init
    • Update the submodule: git submodule update --recursive
    • Enter /pi with cd pi
    • Make sure its on the main branch:git switch main
    • Make it up to date: git pull
    • Switch to the snn: git switch snn
    • Make it up to date: git pull
  2. Now that you have set up the turbopi and pi repositories, it is time to create your snn repository

    • Checkout/Create a branch for your snn: git checkout -b your-first-name/snn-milling
      • If you haven't made a branch beforehand this will create one with the name entered
    • Grab the best.json file and rename it to the network folder name (i.e. 250423-031032-connorsim_snn_eons-v01.json)
    • Copy this file and paste it inside turbopi/pi/networks/ folder
    • Next, edit snn_milling_controller.py file inside the turbopi/pi folder to have the same network file name (i.e. 250423-031032-connorsim_snn_eons-v01.json).
    • Add your changes: git add . (Be sure to be at your branch)
    • Commit your changes: git commit
    • push your changes: git push --set-upstream origin your-first-name/snn-milling

Uploading Process:

  1. Go to the lab computer (Or any computer connected to the lab router), the password is GMU123

    • Open the terminal and run the following: terminator -l defualt
    • Set the terminals in the same group
    • Some shortcuts that will come in handy:
      • ctrl+shift+b is broadcast off
      • ctrl+shift+alt+g is broadcast group
  2. Now we will connect to all the TurboPis:

    • Type the following: ssh pi@turbopi- then broadcast off (ctrl+shift+b) and type in the numbers for each turbopi individually
    • After that turn on broadcast group (ctrl+shift+alt+g) and hit ENTER
    • It will ask for a password which is raspberry
  3. Now that you are connected to the TurboPis and are broadcasting to all of them run the following commands:

    • git switch main
    • git pull (to get up to date)
    • git switch your-first-name/snn-milling (or whatever you named your snn branch)
    • git log -1 (to check the last commit in all terminal is the same)
    • batt -s or batt or batt --q (optional - to check battery level)
    • ncdu (press i to ignore) (optional - to check the total number of logs folder is not too big and total disk usage is less than 8 gigs)
  4. Finally set up the robots in a starting pattern and run sudo python snn_milling_controller.py

    After testing, you can run sudo rm -rf ~/logs/* (optional - to delete all the logs file after you are done)