Categories
Science

OpenBCI Python code running on Virtual Machine: first data!

For the purpose of developing the Python code, I’ve installed Virtual Box, on which I installed CentOS 6.6. I had an impossible time getting the Guest Additions installed, which are needed to be able to map USB ports, until I found a site with Virtual Box images with Guest Additions pre-installed. I then downloaded the OpenBCI python code.

Trying to run user.py, we found we needed to install some libraries, which was easy enough:

easy_install argparse
easy_install serial
easy_install -U pyserial
pip install -e "git+https://github.com/tibonihoo/yapsy.git#egg=yapsy&subdirectory=package"

We then tried to run the user interface. But we had no idea what port the OpenBCI dongle was attached to. Or rather, it did not show up in the /dev directory. We used lsusb and dmesg to figure out that the USB dongle device was identified with the following ID: ftdi_sio vendor=0x0403 product=0x6015

Thanks to Robert’s memory of this Linux hacking days, we found that the kernel was not loading the ftdi module – somewhat equivalent to a USB driver – properly. It needed to be removed and reloaded with the proper ID:

modprobe -r ftdi_sio
modprobe ftdi_sio vendor=0x0403 product=0x6015

Using lsmod we then saw it did now do so properly and we found it in /dev/ttyUSB0. Finally we could run the OpenBCI python user interface:

python user.py -p /dev/ttyUSB0

No data is shown, however. For this we added a ‘plugin’ that records data to a tab-delimited file:

python user.py -p /dev/ttyUSB0 --add csv_collect record.csv

In the interface you can then start recording using the command /start. And yes, we finally recorded our first data!

Leave a Reply

Your email address will not be published. Required fields are marked *