Installing Bpod
This section details installing the Bpod software on the governing computer, and the Bpod firmware on the Bpod device.
Windows 10 or 11
Requirements
- OS: Windows 10 or 11, professional edition
- CPU: intel corei5/i7 11th gen or newer recommended
- RAM: 16GB minimum
- HDD: Solid state hard drive strongly recommended
- MATLAB: r2013a or newer.
Download
If you do not want to use version control, you can download Bpod software as a .zip from here.
Bpod's MATLAB software is frequently updated with new features and improvements. To keep Bpod current for everyone, we use a version control system called Git.
- Install git (if not already installed)
- Navigate to the target folder on your system
- From the system command line, run:
git clone https://github.com/sanworks/Bpod_Gen2.git
- You can also use a GUI application to manage Git, like Github Desktop or Sourcetree.
If all went well, this should copy the latest Bpod software to your computer.
Install the MATLAB software
- Open MATLAB
- Set the Path
- In r2012a or later, choose "Set Path" from the "Environment" cluster in the "Home" tab. In r2011b or earlier, choose "File > Set path".
- For Bpod_Gen2
- Choose "Add" (NOT with subfolders)
- Select C:\Bpod_Gen2\ (or wherever your /Bpod_Gen2/ root folder is) and click "Add"
- For Legacy Bpod
- Choose "Add with subfolders"
- Select C:\Bpod\Bpod System Files\ and click "Add".
- Click "Save" at the bottom so MATLAB will know where Bpod is for all future sessions.
- To verify that you were successful, make sure Bpod is unplugged and type Bpod at the MATLAB command prompt.
- If all went well, Bpod will attempt to start and then fail with an error: "Bpod device not found". If something went wrong, you will get a different error.
- If the error says "Unidentified function or variable 'Bpod', you did not successfully add Bpod to the MATLAB path.
- For certain applications, install PsychToolbox:
- To use Bpod with MATLAB r2019a or older
- To use the PC to display video stimuli
- To use the PC sound card (Note: The Bpod HiFi Module is a more capable option for most applications)
- To exchange triggers with a separate process (e.g. a Python app) via TCP/IP
Warning
For Bpod r0.5 - 1 users: On first plugging in the state machine, if MATLAB is open you will see a message:
Arduino Due detected.
To use this device with MATLAB, install MATLAB Support Package for Arduino Hardware.
Ubuntu Linux
These are instructions for setting up Bpod on a computer running Ubuntu
We recommend at least a 11th generation Intel Corei5 processor and 16GB of RAM.
This tutorial assumes you have loaded Bpod's firmware if you self-assembled the state machine.
- Install Ubuntu (64bit) with >100GB partition
- Update Ubuntu to current version if necessary
- Install MATLAB.
- Run MATLAB. If using the default install location, from the terminal run: sudo /usr/local/MATLAB/RXXXX/bin/matlab
- Install PsychToolbox:
- Download PsychToolbox by following instructions for linux here. Use the SUBVERSION based installation.
- Allow all patches and use default settings when prompted.
- Copy Bpod files from here and add /Bpod_Gen2/Bpod System Files to MATLAB path
- Close MATLAB
- Open a terminal window and add yourself to the “dialout” group:
sudo usermod -a -G dialout kepecslab
(if kepecslab is your username)- Restart matlab as root (same as step 3)
- Run Bpod from the command prompt.
Note: Gnome ModemManager does not play well with Arduino; it discovers Arduino and probes it with bytes that interfere with communications, possibly leaving Bpod in a state where it expects bytes that will never arrive. If you experience issues starting Bpod and you're using Gnome, consider disabling the modem manager.
Note: A previous installation step was automated in the current version. If you are not using PsychToolbox, MATLAB needs to be instructed that ports of the form /dev/ttyACMx are valid serial ports. On first run, Bpod should automatically handle this, and then ask you to restart MATLAB. If it fails, do the following:
- from terminal, launch the editor as root. Run: sudo gedit
- Paste the following line into the text editor: -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyS1:/dev/USB0:/dev/ttyACM0
- Save the file as java.opts to the following location: /usr/local/MATLAB/R2011a/bin/glnxa64
-
State machines purchased from the Sanworks Assembly Surface come with firmware pre-installed ↩