Installing Bpod
This section details installing the Bpod software on the governing computer, and the Bpod firmware on the Bpod device.
PC (Windows 10)
Requirements
- Windows 10
- 8GB+ RAM
- Preferably a 2.5GHz+ multi-core CPU (i.e. intel corei5/i7 series).
- MATLAB r2013a or newer.
Note
If you are using Windows 7 and State Machine r2, you need to install the Teensy serial port driver.
Clone the MATLAB software repository
Bpod's MATLAB software is frequently updated with new features and improvements. To keep Bpod current for everyone, we use a revision control system called Git.
Git's command line usage can be tricky, so instead, we recommend a simple and powerful user interface to Git called SourceTree.
- Download and install SourceTree. The default options during install are correct - and you can use the embedded git client when prompted, if you don't already have it.
- From SourceTree, clone the remote repository.
- If you are using Bpod 0.5 (legacy), use: https://github.com/sanworks/Bpod.git
- If you are using Bpod 0.7+ or want to use Bpod 0.5 with current features, use: https://github.com/sanworks/Bpod_Gen2.git
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.
- Install PsychToolbox
- If you build the state machine yourself, upload Bpod's firmware1
You should be able to run Bpod from that MATLAB prompt with Bpod
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
These are instructions for setting up Bpod on a computer running Ubuntu
We recommend at least an Intel Corei5 processor and 8GB 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.
- When prompted, check “install script”.
- Run MATLAB (if default install location, from terminal: 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 ↩