Installing Trodes
=================
The latest version of Trodes can be downloaded `here `_.
About Connecting to the MCU
---------------------------
The MCU connects to your computer via Trodes using either USB or ethernet. When using USB to connect the MCU and computer,
the data rate is typically limited to 28 - 30 MB/s. If recording bandwidth exceeds this range the number of dropped packets will increase.
For experiments requiring high channel count ethernet is recommended as it can handle > 100 MB/s when connected to a sufficiently powerful
computer with a good ethernet card.
For reference, the data throughput when recording 384 channels of data from 1 Neuropixels probe @ 30Khz is ~25 MB/s. This means USB is sufficient
for recording from one probe, but ethernet is required for multi-probe Neuropixels recordings.
We strongly recommend setting up both Ethernet and USB whenever possible, as some functions are connection type restricted and this also provides
flexibility and redundancy for situations where a change in connection type may be desirable or necessary.
**Connecting to the Logger Dock or Logger Dock 2**
Unlike the MCU, SpikeGadgets Docks are USB-only. This is because they are used exclusively for untethered recording, where neural data is recorded
to microSD storage on the headstage. Although the bandwidth concerns mentioned above are not relevant for Docks, USB driver installation is still required.
**Note:** MacOS is not supported for Trodes 2.2.3 or newer, and is currently restricted to Intel-based Apple Devices. We hope to resume MacOS/Apple support
in the future, but current builds of Trodes are based around x86 architecture. This is incompatible with the ARM architecture used in newer Apple devices.
Installing USB Drivers and Trodes
---------------------------------
To connect to your MCU via USB, you must first install the FTD2XX driver.
**Windows**
Step 1. Install the `FTDI D2XX
Driver `__. \* For easy Windows
installation, use the “setup executable” listed in the comments section of the page.
Step 2. Download the latest release of the Trodes software suite here:
https://bitbucket.org/mkarlsso/trodes/downloads/
Step 3. Uncompress the downloaded folder and copy to a desired location
on your machine.
Step 4. Run the included program vc_redist.x64.exe to install the required Microsoft plug-ins.
Step 5. Double-click on Trodes.exe to run.
**Linux (Ubuntu 24.04)**
Step 1. Install the `FTDI D2XX
Driver `__. \* Follow the
instructions in the first section of their
`README `__
\* Also follow the Ubuntu USB setup below
Step 2. Trodes requires your graphics card driver to support open GL. To install
the correct driver for your card, type 'sudo ubuntu-drivers autoinstall' in a terminal.
Step 3. Download the latest release of Trodes here:
https://bitbucket.org/mkarlsso/trodes/downloads/
Step 4. Uncompress the downloaded folder and copy to a desired location
on your machine.
Step 5. There may be additional libraries that you will need to install using sudo apt-get commands. One library that is commonly needed is libxcb:
sudo apt-get install -y libxcb-cursor0
Step 6. Make sure Trodes program has correct permissions. Right-click on
Trodes and select ‘Properties’ and navigate to the ‘Permissions’ tab.
Make sure that ‘Allow executing file as program’ is checked.
Step 7. Give DataLoggerGUI superuser permission. To do this, type:
sudo visudo
and enter your root password to open the file. Then, at the bottom of the file, add:
YOURNAME ALL = NOPASSWD: /full/path/to/trodes/DataLoggerGUI
replacing YOURNAME with you username, and the path to DataLoggerGUI being the actual one on your computer. Then press Ctrl+X to save and exit.
Step 8. Double-click on Trodes to run, or run from a terminal by typing ./Trodes from the install folder.
**MacOS**
**Note:** MacOS is not supported for Trodes 2.2.3 or newer, and is currently restricted to Intel-based Apple Devices. We hope to resume MacOS/Apple support
in the future, but current builds of Trodes are based around x86 architecture. This is incompatible with the ARM architecture used in newer Apple devices.
Step 1. Install the `FTDI D2XX
Driver `__. \* Run the
D2xxHelper program listed in the comments section to prevent OS X claiming the device as a serial port.
Step 2. Download the latest release of the Trodes software suite here:
https://bitbucket.org/mkarlsso/trodes/downloads/
Step 3. Uncompress the downloaded folder and copy to a desired location
on your machine.
Step 4. Because Trodes is not registered with Apple, you will need
to let the OS know that the programs contained in the suite are safe to run.
To do so, right-click on Trodes.app and select 'Open'. For MacOS 10.15 or later,
a warning dialog will appear saying that the program is not registered and it
can't be opened. Usually, the first time you do this, it does not even give you
an option to open the program anyway. But the second time you try it, there
should be a button that allows you to open it. When it opens, it will tell you
that Trodes needs access to the folder where you installed the program, and you
need to allow it. Once you do all this once, you do not need to do it again until
you update Trodes. Note, for earlier versions of MacOS, you could simply go to your
Settings, and change your security settings (“Allow apps downloaded from”) from “Mac
App Store and identified developers” to “Anywhere”.
Step 5. Do the same procedure described in step 4 for the following apps: cameraModule.app, DataLoggerGUI.app, stateScript.app, stateSCriptEditor.app, and trodesexport.app.
USB Setup
---------
**Windows**
On Windows USB connectivity works without any extra setup once the FTD2XX Driver has been installed.
**Linux (Ubuntu 24.04)**
On Ubuntu Linux, to connect to the MCU and ECU via USB, you must tell
your OS how to handle SpikeGadgets hardware when it is plugged in. You
only need to do this once. Run the following command (all on one line)
to copy the udev rules file to your machine:
::
sudo wget https://bitbucket.org/mkarlsso/trodes/downloads/spikegadgets.rules -O /etc/udev/rules.d/spikegadgets.rules
Rules will be applied the next time you connect the hardware. If already
connected, unplug and replug the USB cable. The .rules file is also
distributed with the precompiled binary, in Resources/SetupHelp, and in
the source repository, at Resources/Linux, so you can copy from there
instead of using ‘wget’ if you want.
**MacOS**
For MacOS, you may need to run the D2xxHelper program to prevent the OS from claiming the device as a serial port.
Ethernet Setup
---------------
When connecting to the MCU via Ethernet, a dedicated port of required. This port must be
independent from any Ethernet ports used to connect to local networks or the internet.
We recommend the `Intel Gigabit Network Adaptor `_.
Configure this port for IPv4 connection with the following address and
subnet:
::
Address: 192.168.0.2
Subnet: 255.255.255.0
Network Settings must also be updated to enable Jumbo Packets and increase the maximum transmission unit (MTU) to the largest size possible (~9000 bytes).
A guide explaining how to do this in Windows can be found `here `
In order to prevent excessive packet drops, you must maximize ethernet
performance by increasing the UDP buffers on the operating system. This process
is different for each OS.
**Windows**
For Windows, adjusting the size of receive buffers is done using a
different procedure. To set the default size, edit (or create) the
following DWORD registry keys (using ‘regedit’ program from the start
menu run box) and restart Windows:
::
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Afd\Parameters]
DefaultReceiveWindow (REG_DWORD) = 8384512 (decimal)
DefaultSendWindow (REG_DWORD) = 8384512 (decimal)
Ethernet performance on Windows is extremely sensitive to adapter options, so you'll need to dial in those settings as well. This is accessed in Settings, under Network & internet -> Advanced network settings. Go to your adapter, click edit next to "More adapter options", "Configure", then navigate to the Advanced tab. The optimal settings will depend on the specific card and your computer's specs, and below is a list of parameters that make a big difference and need to be optimised. We are also showing a good starting point (tested with an Intel CT adapter on Windows 11):
::
Interrupt Moderation = Enabled
Interrupt Moderation Rate = High
Jumbo Packet = 9014 Bytes
Receive Buffers = 2048 (as high as possible)
Speed & Duplex = 1.0 Gbps Full Duplex
UDP Checksum Offload (IPv4) = Rx and Tx Enabled
**Linux (Ubuntu 24.04)**
For Ubuntu Linux, edit /etc/sysctl.conf (as root) and add the following
lines:
::
net.core.rmem_max=8388607
net.core.rmem_default=8388607
net.core.wmem_max=8388607
net.core.wmem_default=8388607
**MacOS**
On MacOS, edit /etc/sysctl.conf (as root) and add the following
lines:
::
net.inet.udp.recvspace = 8388607
net.inet.udp.sendspace = 8388607
Troubleshooting & Firewall Settings
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If after following the instructions above you are encountering connection issues, please first
power cycling your computer and check the settings you have just updated. If any settings have
returned to default, please try updating the setting again. This is a not infrequent issue with
Windows computers.
If all settings above are as they should be, and you are still encountering connection
or streaming issue, an update to firewall settings may be required.
If your computer has a firewall set up (this is common for Windows), it may block
traffic between the computer and the MCU when you are using an ethernet connection
to the MCU.
To prevent this, the firewall can either be turned off, or updated to allow specific traffic through.
The firewall must allow public network access between your computer and Trodes. This can be done by
giving full permissions to the Trodes program. An alternate strategy is to allow traffic on specific
ports (Trodes uses ports 8100 and 8200).
For Windows, we recommend using the procedure outlined below.
**Windows firewall**
**Method 1:**
The Windows firewall can lead to lots of problems when trying to connect to the
MCU with an ethernet connection. We recommend first completely resetting your firewall
settings and then allowing Windows to automatically “Allow” Trodes access to the MCU
when you try to connect for the first time. Follow these steps (you only need to do
this once everytime you update Trodes):
First, open windows "Firewall & network protection". Click on "Restore firewall to
defaults". A message message will pop up-- click on "Restore defaults". A warning
will pop up. Click “Yes”. Then, run Trodes as Administrator, open a workspace, connect
to ethernet and make sure Status is "Connected to source". Is so, proceed to step 2.
Next, click on "Stream from source". Trodes will blink RED with the message "No data coming
from source" and a message will pop up saying that Windows Defender is blocking the
App. Make sure you check “public networks” (the ethernet adapter used for MCU will show
up as a public network). Click "Allow access".
**Method 2: **
Following the steps below will update your firewall settings to allow traffic from Trodes.
1. Open the Settings app and navigate to Network and internet.
2. Scroll to the bottom of the page and select Advanced Network Settings
3. Select Windows Firewall.
4. Select "Allow an app through firewall"
5. Click Change settings and scroll down until you see Trodes.exe
6. Check the Public and Private Checkboxes for all Trodes.exe entries in the list (there may be more than one), then save the changes.
Advanced
--------
**Enabling Core Dumps on Linux**
On Ubuntu, if the program crashes, it usually generates a file to be
used to debug if the settings are configured. This can’t be done after
the crash has already happened, so it is advised to enable it. In the
rare event a crash occurs, Spike Gadgets developers can debug the issue.
To enable:
Edit the file /etc/security/limits.conf (as root), to include the
following lines (NB: The line begins with an asterisk):
::
# (Trodes) Enable core dumps
* soft core unlimited
Edit /etc/sysctl.conf (as root) and add the following lines:
::
# (Trodes) Include process id (PID) in core dump file names
kernel.core_uses_pid=1
Log out and log back in for settings to take effect.