This is python controller for bimatrix electrotactile-stimulation device described in more detail here. This has only been tested on Ubuntu 18.04. This should work on other linux systems. Other operating systems might work but could require extra steps. Check the device manual for guide using the device in other operating systems.
Tested with Python 3.8
Create new virtualenv
Run pip3 install -r requirements.txt
inside the virtual environment to install required packages
Guide is for linux only. The device should work out of the box in linux. If device is not detected check the device manual for additional drivers.
Connect the bimatrix device to the host computer with USB cable
Find the serial port name dmesg | grep tty
Look for name FTDI USB Serial Device converter
Check that serial port has proper permissions assigned if program is not working
Run the program with python3 main.py --device /dev/<serial_port>
Pair the bimatrix device.
Find the controller MAC-address (e.g. using bluetoothctl)
create serial channel between the host and the bimatrix device rfcomm bind 0 <device MAC-address> [channel]
Check that serial port has proper permissions assigned if program is not working
Run the program with python3 main.py --device /dev/rfcomm0
Release the serial binding with rfcomm release 0
The program is is executed from file main.py
. It initializes the device and launches a text interface for controlling
the device.
-d, --device
required, give the serial port of the device
-l, --logging_level
define logging level- default warning, see possible logging levels from logging
-f, --log_file
define log file for the program. Default none.
-c, --commands
define file for controller commands to be executed before launching the controller
interface.
commands1.txt
and commands2.txt
are example files for command files to be given with flag -c
example.py
includes example usage of the controller functions defined in the `controller.py