Problems with gases on Shearwater

Long, Martin martin at
Thu Dec 6 06:50:55 PST 2018

Thanks for getting back to me Linus.

By the way, my BLE and BT (I have to use legacy BT for the Petrel
controller), have both been working very well for me lately. It used to be
a struggle every time, but recently it's worked first time every time.

On Wed, 5 Dec 2018 at 17:38, Linus Torvalds <torvalds at>

> On Wed, Dec 5, 2018 at 8:18 AM Long, Martin <martin at> wrote:
> >
> > 1) I just imported 4 dives from last weekend, all CCR. The first 3
> >    were on 13/60 diluent and the last one on 15/57. However, it put
> >    all of the divers in as 15/57, which seems to just be the last
> >    diluent set. The Shearwater cloud software does identify the
> >    correct gas used at the start of the dive.
> Hmm. We clearly do something wrong, presumably in libdivecomputer
> (although it could be some gas mixup in subsurface too, but unlikely).
> Just to clarify: did you have both 13/60 and 15/57 _programmed_ on the
> Shearwater for all four dives, but you then activate one of the two
> before the dive?

No. The 13/16 was what I had in when I arrived on site (a rubbish, but
usable blend). After day 2 needed a fill, asked for 15/55, got 15/57. So I
simply updated the 13/60 to 15/57. Just checked again, and there is only
the 15/57 in there now. Same on both computers.

> The way this all works in libdivecomputer:
>  - the shearwater never really gives us a set of cylinders at all.
>  - instead, each sample contains "current gas mix"
>  - as the current gas changes, we look it up in the previously seen
> gas mixes, and if not seen we give it a new cylinder number
> In other words, the first gas mentioned in the log always ends up
> being gas 0, then the next one is gas 1 etc.
> But what we don't have is any knowledge of what gas the *shearwater*
> considers gas 0/1/2.. and in particular we don't know how it
> associates gases with transmitters.

The shearwater doesn't associate gasses with transmitters. They're
completely separate things. T1 and T2, and Gas1, Gas2, Gas3 etc. Only the
diver makes the association.

> I don't see how/why we'd get the gas mix wrong for your four dives, though.
> Anyway, we do have some documentation from Shearwater, and I think it
> should be possible to get the proper "these are the cylinders".
> I'll just have to read it and understand it. Dirk, who actually did
> the new Shearwater format (and thus probably knows it better) is off
> gallivanting with real work in Asia right now, so he probably won't be
> able to do much, even though he's probably a better person for it.
> > 2) I'm using two transmitters on a Perdix AI. Transmitter 1 is on my
> >    diluent, and transmitter 2 on my oxygen. On import it seems to
> >    correctly associate my transmitter one with the diluent (apart from
> >    the error in 1 above). Now, providing I don't do any gas switches
> >    (e.g. a bailout) then transmitter 2 I can simply set up as 100% O2.
> >    However, if I do a gas switch, the software automatically assigns
> >    this gas switch to cyl 2, and so it becomes associated with the
> >    transmitter data.
> This is how the libdivecomputer cylinder pressure parsing works, but
> we didn't know any better. The Shearwater gives us two pressures, and
> we assume that the first pressure is for tank 0, and the second
> pressure is for tank 1.
> We have no logic to associate pressures with any other cylinders, and
> I don't really know what the logic would be. But see above. Getting
> the cylinder index right would probably fix things properly.
> So I will look into it.
> > I now have 2 choices... Either I can enter a new gas of 100% and
> > manually type the start and end pressure - however I cannot remote it
> > from cyl 2. Or, I can set cyl 2 as 100%, and add a new one for my
> > baiout gas. However this then means the cylinder swtich then points at
> > the wrong gas, and will say I switched to 100% on my bailout!
> Right. These problems are related. You can't remove the second gas,
> because it's mentioned as a gas switch target. And when you add the
> new gas, it doesn't fix the gas switch target.
> What you can do - and which will fix both issues - is to simply edit
> the gas switch. You can do it either the hacky way (just edit in the
> xml file or in the git repository by hand), or you can do it in the
> GUI on desktop by adding a new gas switch and then removing the old
> one.
> But there's a downside: playing games with gas switches can also
> confuse subsurface in what the pressure data is. So you may lose the
> pressure data unless you are very careful (again, doing this by hand
> if you know exactly what you're doing is possible, but it's all kinds
> of crazy so I can't really recommend it).

I suspect I could do this, as log as I don't remove the two cylinders which
show the pressure data. I could add a third with the gas I switched to and
replace the gas switch to point to that.

> > I don't have a solution to this. As the import process has no manual
> > intervention, it would be tricky to have a solution which works. My
> > suggestion would be to treat transmitters and gas swtiches as
> > completely separate cylinders, and then allow the user to "merge" them
> > later. The current assumption that transmitter 1 will be the first
> > gas, and transmitter 2 will be the next one is incorrect.
> Well, we should just get the mapping right and not have this problem,
> but neither I nor Dirk has ever really used the Perdix AI with
> multiple cylinders.

Getting the mapping right is problematic, because as I mention above,
Shearwater have no association between gases and transmitters (like the EON
does, I think). The association is in the divers head. So while I have T1
and T2 for Dil and O2 respectively, my buddy might have them the other way
around. Another friend on OC might have one on his back gas and one on deco
gas whereas his buddy might have one on his travel gas and one on back gas.

Thanks for looking at thins.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the subsurface mailing list