Hello,
I’m exploring this library and started by trying to use libdivecomputer to download dives from my Perdix computer on macOS. I experimented with dctool, but haven’t had any success so far. I also read several threads in this list dating back to 2021 but couldn’t find any recent examples.
Here’s the baseline command I’ve been running for testing:
$ dctool -v -l perdix-download.log -d perdix download -f raw -o perdix-download.raw
I’ve gone back and forth between using serial and ble as transport methods, but neither has worked. However, I can successfully connect to the Perdix via both MacDive and Subsurface.
I initially tried the serial transport, based on a 2021 post mentioning issues with Bluetooth on macOS. For the serial attempt, I’m bridging the BLE connection to a serial interface:
$ core-bluetooth-tool bridge FE25C237-0ECE-443C-B0AA-E02033E7029D
Created /dev/ttys003. Ready to communicate.
Scanning for devices with service UUID FE25C237-0ECE-443C-B0AA-E02033E7029D…
Connected to BLE device via ble://FE25C237-0ECE-443C-B0AA-E02033E7029D.
But this results in the following failure:
dctool -v -l ~/Downloads/perdix-download.log -d perdix download -f raw -o perdix-download.raw /dev/ttys003
DATETIME 2025-04-14T17:17:52Z (1744651072)
VERSION 0.8.0
Opening the I/O stream (serial, /dev/ttys003).
INFO: Open: name=/dev/ttys003
Opening the device (Shearwater Perdix).
INFO: Configure: baudrate=115200, databits=8, parity=0, stopbits=0, flowcontrol=0
INFO: Timeout: value=3000
INFO: Sleep: value=300
INFO: Purge: direction=3
Registering the event handler.
Registering the cancellation handler.
Downloading the dives.
Event: progress 0.00% (0/4294967295)
INFO: Write: size=8, data=FF010400228010C0
INFO: Read: size=0, data=
ERROR: Failed to receive the packet. [in shearwater_common.c:239 (shearwater_common_slip_read)]
ERROR: Failed to receive the response packet. [in shearwater_common.c:358 (shearwater_common_transfer)]
ERROR: Failed to read the serial number. [in shearwater_petrel.c:173 (shearwater_petrel_device_foreach)]
ERROR: Error downloading the dives. [in dctool_download.c:230 (download)]
INFO: Write: size=9, data=FF0105002E902000C0
ERROR: Timeout
After inspecting the Subsurface logs, I noticed it uses the ble transport, so I tried that as well. Unfortunately, dctool doesn’t even find the device. I’m not sure about the expected format of the <devname> argument when using BLE, so I may be using the wrong value (I used the device UUID):
dctool -v -l ~/Downloads/perdix-download.log -d perdix download -f raw -o perdix-download.raw -t ble EE4DCD15-387F-249F-B006-6F879C1D430C
DATETIME 2025-04-14T17:20:25Z (1744651225)
VERSION 0.8.0
Opening the I/O stream (ble, EE4DCD15-387F-249F-B006-6F879C1D430C).
ERROR: Error opening the I/O stream. [in dctool_download.c:170 (download)]
ERROR: Unsupported operation
Below is the beginning of a successful connection log from Subsurface. I tried to reverse-engineer the correct options for dctool from this, but I haven’t had any luck:
Subsurface: v6.0.5365.0, built with libdivecomputer v0.9.0-devel-Subsurface-NG (d2874be4fcb58385a62b335b7132aa17c4294925)
[0.000001] INFO: Open: transport=32
[0.000441] INFO: Configure: baudrate=115200, databits=8, parity=0, stopbits=0, flowcontrol=0
[0.000448] INFO: Timeout: value=12000
[0.000453] INFO: Sleep: value=300
[0.303744] INFO: Purge: direction=3
[0.305630] INFO: Write: size=10, data=0100FF010400228010C0
[0.369066] INFO: Read: size=18, data=010001FF0C006280103337304434433145C0
[0.369273] INFO: Write: size=10, data=0100FF010400228011C0
[0.430419] INFO: Read: size=21, data=010001FF0F0062801156393320436C6173736963C0
[0.430584] INFO: Write: size=10, data=0100FF010400228050C0
[0.481059] INFO: Read: size=12, data=010001FF06006280508D6CC0
Event: model=6 (0x00000006), firmware=93 (0x0000005d), serial=... (...)
[0.482590] INFO: Write: size=10, data=0100FF010400228021C0
[0.545530] INFO: Read: size=19, data=010001FF0D00628021018000000000020080C0
I’d really appreciate any pointers on how to get dctool working with the Perdix on macOS, especially using BLE.
Thanks,
-- Simone