Beta testers wanted: infrared-to-USB transceiver

257 views
Skip to first unread message

Daniel Samarin

unread,
Mar 5, 2024, 1:52:17 PMMar 5
to Subsurface Divelog
Hi all,

While this is not strictly Subsurface related, I wanted to reach out to this tech savvy group for interested beta testers for a device a coworker and I put together to support some older (but still capable!) dive computers that are quickly becoming obsoleted by their manufacturers. Obsolescence be damned!

usb-to-irda.png

I recently became certified in scuba and bought a very inexpensive Cressi Leonardo dive computer used on eBay. I couldn't find the USB dock for my Cressi for purchase anywhere, nor similar devices for an reasonable price. Discussed this with a few of you here (thanks!):

So, I came up with this simple concept (based on Chris Kuethe's initial guidance) and had one of my engineers complete and test the design as a training exercise. And it worked!

The end goal here is to open-source the design, once I confirm it works on more than a few dive computers, and sell kits/devices basically at-cost (NOT the 80-120 USD they want on eBay!).  So, I'm looking for a few people with IR-based dive computers to help us beta test. I'd send you the device at no charge, and ask you to sync with Subsurface to confirm it's working. If it doesn't work I'll ask for the log files.

I'm looking for a wide variety of dive computers as I can get, and a handful of operating systems: Win10, Win11, Linux (at least Ubuntu), and MacOS. If you also have a tablet to try on, perhaps we can try that as a bonus.

I understand these kinds of dive computers are more rare these days with many of them being direct-USB, and Bluetooth becoming less expensive to integrate, but with at least Cressi still pumping out Leonardos and similar watches, I suspect there will be some need for this device.

Thanks in advance!

--Daniel

Robert C. Helling

unread,
Mar 5, 2024, 2:32:55 PMMar 5
to Subsurface Divelog

This looks extremely cool. I am sorry I cannot help as I don’t have an irda drive computer. As far as software is concerned, IIRC macOS does not include an irda stack, windows dropped it and then later brought it back and also Linux dropped it at some point. That might be an additional challenge. Subsurface does not include one but some other die logs do. 

Best
Robert

Chris Kuethe

unread,
Mar 5, 2024, 3:48:31 PMMar 5
to subsurfac...@googlegroups.com
On Tue, Mar 5, 2024 at 11:33 AM 'Robert C. Helling' via Subsurface Divelog <subsurfac...@googlegroups.com> wrote:

This looks extremely cool. I am sorry I cannot help as I don’t have an irda drive computer. As far as software is concerned, IIRC macOS does not include an irda stack, windows dropped it and then later brought it back and also Linux dropped it at some point. That might be an additional challenge. Subsurface does not include one but some other die logs do. 

I don't think an IrDA stack is necessary since my Cressi dock just shows up like a tty (com port) and subsurface will happily talk to it - as far as I can tell, all the IrDA magic is done inside the transceiver chip inside the dock. If I plug my phone into the dock with the right combination of adapters, I can even download into subsurface on my phone, from the dive boat.

--
GDB has a 'break' feature; why doesn't it have 'fix' too?

Daniel Samarin

unread,
Mar 5, 2024, 4:11:25 PMMar 5
to Subsurface Divelog
I suspected this might be the case! I think this is really just normal serial data at the computer side, not specifically IRDA. That was the intent with the one-two punch "USB to serial chip" and "serial to IRDA chip" in the circuit design above.
If the assumption is right, then I wouldn't imagine any platform wouldn't have the right drivers by default, since so many everyday devices rely on USB-serial connections.

--Daniel

Linus Torvalds

unread,
Mar 5, 2024, 4:15:36 PMMar 5
to subsurfac...@googlegroups.com
On Tue, 5 Mar 2024 at 12:48, Chris Kuethe <chris....@gmail.com> wrote:
>
> I don't think an IrDA stack is necessary since my Cressi dock just shows up like a tty (com port) and subsurface will happily talk to it - as far as I can tell, all the IrDA magic is done inside the transceiver chip inside the dock

There are multiple "levels" of the IrDA stack, and I suspect your
Cressi simply only does the physical level (and probably only "SIR",
which is the simplest and most traditional one).

IrDA SIR is basically just "half duplex rs232 over infrared".

In fact, in many ways it's _simpler_ than rs232, because there's no
12V line, and there's none of that fancy DTR/CSR stuff or any question
about stop bits and parity. You do need to have a baud-rate, but
that's it.

Of course, modern rs232 is usually not the "real" traditional rs232
and is generally really just 5V anyway, and most USB serial devices
out there do *not* do any level shifting, and you'll find people who
complain about them not working with historical devices that really
did want the whole 12V thing...

So it sounds like the Cressi dock is really just IrDA SIR. Which is
the sane part of IrDA anyway.

The *whole* IrDA thing is a much more complex mess that tries to
support multiple concurrent devices, and is why Linux dropped support
for it - without any relevant devices to really test, all the crazy
extra complexity and odd socket-based interfaces were just completely
unmaintainable.

So there's the simple physical layer which is literally just that
"rs232 over infrared". Then there's "IrLAP" on top of that, which is a
device discovery, and connection establisment, and reliable data link
layer.

Then there's various protocols on top of _that_ that make IrDA look
like a centronics parallel port or implement teh flow control parts of
rs-232 etc.

And all of it is "IrDA", but most of it is _much_ too complicated for
simple devices that just wanted a serial line and do their own error
correction and re-sending anyway.

(I also suspect the Linux code was written based off a spec, rather
than a sane technical understanding of what the implementation was
meant to be. There's a disease in the CS community where people think
that protocols have to be described independently of their
implementation, and while the whole "OSI 7-layer model" is rightfully
ridiculed today, there's a lot of specs that really try to "layer" the
spec explanation so much that it's hard to understand what the reality
actually is supposed to look like, and then peopel who write software
based off the spec tend to create this layer mess where each
individual layer makes very little sense because it was basically
intentionally explained in a vacuum. That then made it hard to sanely
even just support the simple cases, because the kernel code was
literally written to be the most complex case possible)

Linus

Daniel Samarin

unread,
Mar 5, 2024, 5:45:40 PMMar 5
to Subsurface Divelog
Thanks Linus, that makes a lot of sense. I think, then, that we have semi-accidentally happened upon the easy way out of this, which is to just have the PC interface with a normal modern serial/COM port. I hope that the other dive computer mfgs have implemented it like Cressi has.

Still looking for beta testers!

--Daniel

Charles H

unread,
Mar 6, 2024, 9:41:30 PMMar 6
to Subsurface Divelog
I'm in Melbourne, Australia, but I have a Galileo Sol as my backup (it's more reliable than my G2), a Windows 11 desktop. a Windows 11 notebook and both a desktop and a notebook both running Linux Mint (Ubuntu base). Happy to assist if you don't have any closer takers, but I am not a computer whizz (unless you count 1980s MS-DOS Basic and Pascal, and OS2 experience :) ).Prepared to try with an Ubuntu installation if I can't get it to work with Mint.
Cheers,
Charles

Charles H

unread,
Mar 6, 2024, 9:54:19 PMMar 6
to Subsurface Divelog
By the way, in case its relevant,  I recently tried to interface with an FT232R via USB port , and had no luck at all under Mint, either with the presumed preinstalled driver or the one from FTDI, not even after disabling the Braille driver (don't ask!), but no problem under Windows 11.

On Wednesday, March 6, 2024 at 5:52:17 AM UTC+11 Daniel Samarin wrote:

Daniel Samarin

unread,
Mar 7, 2024, 7:00:41 PMMar 7
to Subsurface Divelog
Great, thanks Charles. Added you to the list of interested beta testers. Please send me an individual email so I can have yours and contact you when we are ready with our next batch.

It really surprises me that any modern linux distribution doesn't support FTDI, but that company has been weird about drivers and fake components in the past. Our USB-Serial chip is the MCP2221A, which I hope is better supported across operating systems.

--Daniel

Linus Torvalds

unread,
Mar 7, 2024, 7:21:02 PMMar 7
to subsurfac...@googlegroups.com
On Thu, 7 Mar 2024 at 16:00, Daniel Samarin <dsam...@gmail.com> wrote:
>
> It really surprises me that any modern linux distribution doesn't
> support FTDI, but that company has been weird about drivers and fake
> components in the past.

I would expect any general-purpose Linux distro to enable FTDI
support, and that should automatically include the FT232R chip.

But if there's a new chip out with a new version number, that could
certainly mean that the chip simply isn't _recognized_ as a FT232R.

Also, vendors can - and some do - take FTDI chips, and then set their
own vendor IDs etc on it, which again means that what may well be an
FTDI chip doesn't necessarily get recognized as such without some
added quirk.

> Our USB-Serial chip is the MCP2221A, which I hope is better supported
> across operating systems.

Hmm. The only MCP2221A chip I'm aware of is a USB to i2c thing? A form
of serial too, and presumably you then have a i2c irda chip?

Linus

Andrew Goldby

unread,
Mar 7, 2024, 10:55:53 PMMar 7
to subsurfac...@googlegroups.com
As an aside to this thread has anyone made a similar connector for the 2 metal pin computers eg mares watches?


From: subsurfac...@googlegroups.com <subsurfac...@googlegroups.com> on behalf of Daniel Samarin <dsam...@gmail.com>
Sent: Thursday, March 7, 2024 5:00:41 PM
To: Subsurface Divelog <subsurfac...@googlegroups.com>
Subject: Re: Beta testers wanted: infrared-to-USB transceiver
 
--
You received this message because you are subscribed to the Google Groups "Subsurface Divelog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to subsurface-dive...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/subsurface-divelog/9b5dbe53-8f94-4425-8e25-362f5e737e63n%40googlegroups.com.

chhackm

unread,
Mar 9, 2024, 6:43:23 AMMar 9
to subsurfac...@googlegroups.com
Hi Andrew!
Charles Hackman here.
I'm not sure if it's really a driver issue in linux Mint: it's the "don't have permission" message, which has also come up in ordinary USB connection with my G2. It hasn't been especially relevant until now.
Cheers,
Charles 



Sent from my Galaxy
You received this message because you are subscribed to a topic in the Google Groups "Subsurface Divelog" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/subsurface-divelog/ku56SSlCtZU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to subsurface-dive...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/subsurface-divelog/PAXP251MB0727797432124ED1004F6725FF272%40PAXP251MB0727.EURP251.PROD.OUTLOOK.COM.

Daniel Samarin

unread,
Mar 10, 2024, 8:42:38 PMMar 10
to Subsurface Divelog
On Thursday, March 7, 2024 at 4:21:02 PM UTC-8 Linus Torvalds wrote:
Hmm. The only MCP2221A chip I'm aware of is a USB to i2c thing? A form
of serial too, and presumably you then have a i2c irda chip? 

The MCP2221A enumerates as both a serial com port and an i2c device! Quoting the datasheet:
"The MCP2221A enumerates as a composite USB device after POR. The device enumerates as both a Human Interface Device (HID) for I2C, GPIO control, and as CDC for the USB-to-UART converter."

Aryel Sharon

unread,
Apr 24, 2024, 6:51:49 AMApr 24
to Subsurface Divelog
Hi, I'm in Maceió, Brazil, i have a Cressi Giotto as my main computer and my uncle have an Mares Genius(with genuine interface), a Windows 10 desktop but i can install whatever OS needed on an virtual machine or my laptop, i hope i can help the project, i'm not familiar with IRdA protocol but i have worked on some IR projects with Arduino IDE.
A hug from Brazilian divers 

poe...@xs4all.nl

unread,
Apr 30, 2024, 11:28:18 AMApr 30
to Subsurface Divelog
Hi,

Got my 2USBtoIRDA-Kit today. I'm using LinuxMint 21.3 and Subsurface 6.0.5144-CICD-release. Hooked up the device to my USB-Hub and linux registers the device:
[26675.717562] usb 3-4.1.2: new full-speed USB device number 9 using xhci_hcd
[26675.846151] usb 3-4.1.2: New USB device found, idVendor=04d8, idProduct=00dd, bcdDevice= 1.00
[26675.846154] usb 3-4.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[26675.846155] usb 3-4.1.2: Product: MCP2221 USB-I2C/UART Combo
[26675.846157] usb 3-4.1.2: Manufacturer: Microchip Technology Inc.
[26675.857743] cdc_acm 3-4.1.2:1.0: ttyACM0: USB ACM device
[26675.858658] mcp2221 0003:04D8:00DD.000B: USB HID v1.11 Device [Microchip Technology Inc. MCP2221 USB-I2C/UART Combo] on usb-0000:00:14.0-4.1.2/input2

Then i start Subsurface and i found out if i select 'Import from Divecomputer' there is no Divecomputer 'Galileo Sol' with either brand 'Uwatec' or 'Scubapro', although the Sol is supported. What is missing?

By the way: if i select something else i can choose /dev/ttyACM0, but then the infrared-icon on my Sol doesn' t show.

Regards, Robert

Op woensdag 24 april 2024 om 10:51:49 UTC schreef Aryel Sharon:

Daniel Samarin

unread,
May 2, 2024, 1:00:27 AMMay 2
to Subsurface Divelog
Hi Robert,

Thanks for your patience! There is something different or unique with how Subsurface handles the Galileo Sol. On my computer (Win10) it greys out the "Device or mount point" selection so I can't select anything. We're going to need to dig into the source code to understand why and that may take some time.

Fortunately, we know our device works with Cressi several dive computers as expected, across Linux/Windows/MacOS/Android/iOS, so now we just need to figure out what is special about Uwatec.

To Aryel, 
I am confident the device will work with the Giotto. As for the Genius, I believe that dive computer uses Bluetooth for data transfer, no?

--Daniel

Jef Driesen

unread,
May 2, 2024, 3:33:24 AMMay 2
to subsurfac...@googlegroups.com, Daniel Samarin
On 2024-05-02 07:00, Daniel Samarin wrote:
> Thanks for your patience! There is something different or unique with
> how Subsurface handles the Galileo Sol. On my computer (Win10) it greys
> out the "Device or mount point" selection so I can't select anything.
> We're going to need to dig into the source code to understand why and
> that may take some time.
>
> Fortunately, we know our device works with Cressi several dive
> computers as expected, across Linux/Windows/MacOS/Android/iOS, so now
> we just need to figure out what is special about Uwatec.

The explanation is easy. The Galileo and some of the other
Uwatec/Scubapro models are IrDA enabled dive computers, and are marked
as such in the source code:

https://github.com/libdivecomputer/libdivecomputer/blob/master/src/descriptor.c#L144

Thus when you select one of those models, subsurface will offer the
available IrDA devices that were found during the IrDA device discovery.
It won't offer any usb-serial devices, because normally the dive
computer doesn't support those, and it makes no sense to offer choices
to the user that are not going to work.

In theory you could add the DC_TRANSPORT_SERIAL transport (or just
select a model where this transport is already present like the Scubapro
Meridian), but I doubt that is going to work. That's because the framing
used in the serial communication is a bit different from the one used in
the IrDA communication:

https://github.com/libdivecomputer/libdivecomputer/blob/master/src/uwatec_smart.c#L500-L520

So if your device is simply passing through the data unchanged and just
translates between usb-serial and IrDA communication, then this won't
work. The easiest workaround is probably to use a custom transport that
is actually a serial transport, but disguises itself as an IrDA
transport. Something like this:

dc_custom_cbs_t callbacks = {
dc_iostream_set_timeout, /* set_timeout */
dc_iostream_set_break, /* set_break */
dc_iostream_set_dtr, /* set_dtr */
dc_iostream_set_rts, /* set_rts */
dc_iostream_get_lines, /* get_lines */
dc_iostream_get_available, /* get_available */
dc_iostream_configure, /* configure */
dc_iostream_poll, /* poll */
dc_iostream_read, /* read */
dc_iostream_write, /* write */
dc_iostream_ioctl, /* ioctl */
dc_iostream_flush, /* flush */
dc_iostream_purge, /* purge */
dc_iostream_sleep, /* sleep */
dc_iostream_close, /* close */
};

// Open the underlying serial transport.
dc_iostream_t *tmp = NULL;
status = dc_serial_open (&tmp, context, devname);

// Disguise it as an IrDA transport.
dc_iostream_t *iostream = NULL;
status = dc_custom_open (&iostream, NULL, DC_TRANSPORT_IRDA,
&callbacks, tmp);

> To Aryel,
> I am confident the device will work with the Giotto. As for the Genius,
> I believe that dive computer uses Bluetooth for data transfer, no?

The Genius supports both serial and BLE communication.

Jef

Aryel Sharon

unread,
May 8, 2024, 9:47:31 PMMay 8
to Subsurface Divelog
Nah, they use an serial port, i guess
mares png.PNG

Aryel Sharon

unread,
May 8, 2024, 9:48:45 PMMay 8
to Subsurface Divelog
>To Jef
oh, i never realized that genius have BT support, that mean i can use subsurface on my Android and sync my dives direct from the phone, right?

Aryel Sharon

unread,
May 8, 2024, 9:53:25 PMMay 8
to Subsurface Divelog
>to Daniel 
any news about when come for sale?i mean i just want to use with giotto, not with both genius and giotto

thx and great day for everyone
Em quinta-feira, 2 de maio de 2024 às 02:00:27 UTC-3, Daniel Samarin escreveu:

Yann Liebaert

unread,
Jul 17, 2024, 5:13:04 AM (10 days ago) Jul 17
to Subsurface Divelog
Is there any news on the progress? I'm about to buy a Donatello, but the only thing holding me back is the Cressi proprietary interface. This would definitely solve my issue ;-)

antonio ponte rey

unread,
Jul 19, 2024, 6:15:06 AM (8 days ago) Jul 19
to subsurfac...@googlegroups.com

Tengo un cressi Leonardo que aparece en la lista de compatibles pero le conecto la interface y Linux mint no lo reconoce


--
You received this message because you are subscribed to the Google Groups "Subsurface Divelog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to subsurface-dive...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages