# Feature request: Otii TCP API

**URL:** <https://forum.qoitech.com/t/feature-request-otii-tcp-api/525>\
**Category:** Support\
**Created:** [February 4, 2025, 9:58am UTC](https://forum.qoitech.com/t/feature-request-otii-tcp-api/525 "2025-02-04T09:58:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jarne.piessens](https://avatars.discourse-cdn.com/v4/letter/j/9d8465/32.png) [@jarne.piessens](https://forum.qoitech.com/u/jarne.piessens)\
**Post date:** [February 4, 2025, 9:58am UTC](https://forum.qoitech.com/t/feature-request-otii-tcp-api/525/1 "2025-02-04T09:58:33Z")

</div>

I would like to see which channels are enabled in the recording.

`enabled_channels = recording.get_enabled_channels(device.id)`

I try to see which channels have data using this code.

```auto
# Define all possible Otii channels manually
available_channels = [
              "mc", "mp", "mv", # Main channels
              "ac", "ap", "av", # ADC channels
              "sp", "sn", # Sense+ / Sense-
              "vb", "vj", # Voltage channels
              "tp", # Temperature
              "rx", # UART logs
              "i1", "i2" # Digital inputs
          ]
for channel_name in available_channels:
    try:
        info = recording.get_channel_info(device.id, channel_name)
        if not info:
            print(f"Warning: No info found for channel {channel_name}. Skipping...")
            continue
    except Exception as e:
        print(f"Error retrieving channel info for '{channel_name}': {e}")
        continue

```

But i get broken pipe errors.

```auto
channel mc
/snapshot/client/common/lib/model/recordingRequests.js:534
        const [measurementData] = recording.measurements.filter(m => m.id === measurement.id);
                                                                                          ^

TypeError: Cannot read properties of undefined (reading 'id')
    at /snapshot/client/common/lib/model/recordingRequests.js:534:91
    at Array.filter (<anonymous>)
    at RecordingRequests.getChannelInfo (/snapshot/client/common/lib/model/recordingRequests.js:534:58)
    at TcpServer._TcpServer_handleRequest (/snapshot/client/common/lib/model/tcpserver.js:723:85)
    at TcpServer.onData (/snapshot/client/common/lib/model/tcpserver.js:192:95)
    at Object.onClientData (/snapshot/client/common/lib/model/tcpserver.js:181:22)
    at Socket.<anonymous> (/snapshot/client/common/lib/model/createServer.js:19:21)
    at Socket.emit (node:events:537:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)

Node.js v18.5.0
the recording in device service is <otii_tcp_client.recording.Recording object at 0x7f8de33680>
Returning license and logging out...
An error occurred while returning license and logging out: [Errno 32] Broken pipe

```

In this example channel “ap” and “av” where enabled, but it would be nice if I don’t have to store this for every recording.

---

<div class="post-metadata">

**Author:** ![andreasolausson](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@andreasolausson](https://forum.qoitech.com/u/andreasolausson)\
**Post date:** [February 5, 2025, 1:16pm UTC](https://forum.qoitech.com/t/feature-request-otii-tcp-api/525/2 "2025-02-05T13:16:43Z")

</div>

Hi Jarne,

Welcome to the forum.

The broken pipe is caused by a bug in the tcp api error handling.  
We will fix this in the next Otii release.

Adding a get\_enabled\_channels() api to the recording is a very good idea and we will add it to our list of future features.

Best regards,  
Andreas
