This module is used to remotely operate the Pupil Labs Neon eye-tracking glasses and record data on multiple devices along with offsets for time-synchronisation. The module provides a Terminal User Interface for easy interaction.
- Connect all NEON eye-trackers to the same local network as the server. Ensure that Neon Companion app is running on all devices.
To gain access to all status metrics in the TUI, you'll need to install ADB on the server and setup a WiFi ADB pairing of the server with each device.
Please find detailed instructions about ADB on the official documentation.
To summarize the important steps:
-
Install ADB
- Windows: Install ADB on Windows (download and extract the ADB platform tools).
- macOS: Install ADB on macOS using Homebrew (run
brew install android-platform-toolsin Terminal). - Linux: Install ADB on Linux (run
sudo apt install android-tools-adbon Ubuntu/Debian or use your package manager for other distributions).
-
Initialize ADB TCP/IP Connection on each device
-
Connect the device via USB (make sure USB debugging is enabled on the device).
-
Open the terminal or command prompt and run:
``` adb -d tcpip 5555 adb connect <device_ip>:5555 ```Replace <device_ip> with the IP address of your device. You can find the device's IP address in the device's Wi-Fi settings.
-
Disconnect the device and verify the connection by running:
adb devices
-
-
Install the requirements with
pip install -r requirements.txt -
Check the network config parameters in
config.jsonso the devices could be found on network. -
Configure other parameters in
config.json. See the next section for parameter descriptions. -
Run the module with
python3 main.pyto start a new session.
The following parameters should be set in config.json before starting a recording session with this module:
- By default, SocialEyes will look for a range of IP addresses provided using the following config parameters:
```
{
"network_id": "192.168.50", // The base IP address for the network. This defines the subnet in which devices will be located.
"host_id": {
"start": 101, // The starting host ID for devices on this network. This will be appended to the network ID to form the complete IP address (e.g., 192.168.50.101).
"end": 129 // The ending host ID for devices on this network. This defines the range of IP addresses available (e.g., from 192.168.50.101 to 192.168.50.129).
}
}
```
Alternatively, you can specify individual device IP addresses using the `ip_list` parameter. This is helpful when you have less number of devices and/or non-sequential IP addresses. Remember to set `"network_id"` to an empty string (`""`) in this case:
```
{
"ip_list": [
"192.168.50.101",
"192.168.50.105",
"192.168.50.110"
]
}
```
- The `"logs"` section lets you set:
- `"path"`: Directory where log files will be stored.
- `"level"`: Logging verbosity (e.g., `"INFO"`, `"DEBUG"`).
- `"interval"`: Time interval (in seconds) for periodic logging or updates.
- `"TUI_messages_len"`: The maximum number of recent logs displayed in the TUI. Only the last `TUI_messages_len` messages will be shown at any time.
- The `"single_session_mode"` option controls whether the recording session will involve a single recording start (and stop) for all releavant devices (`true`) OR it requires multiple concurrent recording starts with different batches of devices (`false`).
- The `"update_times"` section allows you to specify custom update intervals for different batches of device metrics.
```
**Batch 1 Metrics**
PING (Device network latency)
WIFI (WiFi networks)
ADB (ADB connection status)
USB (USB connections)
RED_INDICATOR (Red light indicator events)
Storage (Free disk space)
Battery (Battery level)
App (Active app status)
**Batch 2 Metrics**
API (App API status)
RTSP (RTSP streaming status)
PL_Rec (Recording state)
PL_Rec_ID (Recording ID)
PL_Rec_Duration (Recording duration)
Device (App device name/identifier)
```
- The module interface is a TUI that lists of all eye-tracking devices on the local network
- Use Arrow up/down or mouse click to highlight a device
- Colour-coded status metrics are shown for each device (battery/storage level, network ping, ADB server status, recording status, etc.)
- Multiple devices can be selected from this list to perform a desirable action
- Highlight a device and press
spacebarto select. - Multiple devices can be selected/de-selected using Shift + arrow up/down.
- To select all devices at once use Ctrl+A
- Highlight a device and press
- A list of possible actions is displayed at the bottom of the TUI. Press the key corresponding to an action to run the action on all selected devices.
- Note: If the ADB value for a device is False and ADB connection was initialised before running this module then use the "Reconnect adb" action.
- Each time an action is triggered, a message is logged under the devices list. Only the last 3 logs are displayed on the TUI at any point.
- Events can be created during a TUI session by pressing
Tab. The event tag field will be active where a short event descriptor can be added. Press Enter to record the event andTabagain to go back to the device list.
- A new logs directory is created for each recording session--everytime the TUI is started.
- Within this directory, a separate directory is created for each device that was used to record data during the session.
- Offsets from this device will be stored in the child csv.
- An events.json file is created if events were created during the session. This file contains event descriptors and corresponding timestamps.
- Run the following command to start the application in development mode:
textual run --dev main.py - In a separate terminal, run
textual console -x WORKER -x EVENT -x SYSTEM. The -x tags are used to decrease verbosity by excluding log messages to specific groups (SYSTEM, PRINT, ERROR, WARNING, EVENT, DEBUG, INFO, LOGGING, and WORKER). Use the tags as needed.