10 Using GNURadio
hut edited this page 5 months ago

Before using the GNU Radio Companion program with PsyLink, you need to go through the following initialization steps:

  1. Download the PsyLink source code repository to a folder on your hard drive
  2. Flash the appropriate PsyLink firmware onto your Arduino using the ArduinoIDE.
    • Install and start the Arduino IDE software
    • Open the firmware file. To know which one to use, go to the page of your prototype and find the "Firmware" link
    • Install the dependencies via the Arduino IDE. This should be documented at the very top of the firmware file in a comment.
    • Power on the PsyLink with the Arduino plugged in
    • Connect the PC running the Arduino IDE with the PsyLink via a MicroUSB cable
    • Click "Upload" and wait for the progress to finish. Do not turn off the PsyLink before this is done.
  3. Turn on your PsyLink and pair it with your PC's operating system via its bluetooth management software. The name of the Bluetooth device should be "PsyLink". Write down the MAC address of your Arduino, you will need it later.
  4. Find the appropriate GNURadio flowgraph for your prototype, e.g. by going to the page of your prototype and looking for a "GNURadio" link, and open it in the "GNURadio companion" program.
  5. Double-click on the "BLE Source" block in the GNURadio flowgraph
  6. Change the "Ble_Mac" address in the "BLE Source" block to the MAC address of the Arduino that's plugged in to your PsyLink. Note that there may need to be quotes ("") aroud the MAC address.
  7. Next to "Code", click on "Open in Editor". In the editor, change the line that starts with "libpath = " to the path to which you have installed PsyLink's python library
  8. Install the dependencies for PsyLink python library. The easiest way is to run the following command:
    • cd path/to/psylink/python; pip install -r requirements.txt
    • Make sure to change the path to where you have downloaded the PsyLink software to
    • Make sure to use python 3 (possibly you'll need to change pip to pip3.)
    • You may need the python3-pil.imagetk package (sudo apt-get install python3-pil.imagetk)
  9. Restart GNURadio and open the same flowgraph again
  10. In GNURadio, press F6 or click on "Run"->"Execute" in the menu bar to start visualizing the EMG signals. It should look something like this:

screenshot of GNURadio