Bluetooth fails on mobile

Dirk Hohndel dirk at
Thu Apr 12 08:01:10 PDT 2018

> On Apr 12, 2018, at 7:42 AM, Davide DB <dbdavide at> wrote:
> On 12 April 2018 at 16:14, Dirk Hohndel <dirk at> wrote:
>>> On Apr 12, 2018, at 7:09 AM, Davide DB <dbdavide at> wrote:
>>> I do not get you. I'm sorry.
>>> Anyway I miss form my logbook only the last newest dives. So I do not
>>> understand why it's not possible to save them to a temp location and
>>> then parsing what's good from the partial download.
>>> My download stops after the newest 10 dives and I need only the first three.
>> That's strange because Subsurface-mobile should already handle this correctly.
>> If the download fails, it SHOULD parse the dives downloaded up to that point.
>> Which version, which OS, do you have a log / libdivecomputer.log?
>> It sounds like you can reproduce the problem, so this should be something
>> that we can fix
> The latest Subsurface mobile (I'm a beta tester) on a nexus 7 (first
> version) tablet running Android 4.something.
> It's the only device I was able to successfully start the download
> from my BLE Petrel controller. On all my other Andorid devices I get a
> BT INIT FAIL when trying to download.

You must have a dual stack Petrel since the first Version Nexus 7
was BT only (no BLE support). Which points to one of my frustrations
with the current version of our code - we mess up when talking to dual
stack Petrels on dual stack devices - so if your Petrel supports BT
classic and BLE and your phone supports BT classic and BLE, we 
somehow manage to crash the BT/BLE stack on the Petrel.

> I'll try to resume everything here because IMHO there are two
> different problem mixing together: BLE download and UI loop.
> I pair the device. On Android BT UI I see something like LE:bt address

Oops. On the first version Nexus 7? That should be impossible.
I own several first version Nexus 7 and they didn't support BLE, I'm 
quite certain about that. <> <>
You will see that the 2012 version only support BT 3.0, it's the 2013
version that adds BT 4.0 (and therefore BLE).

> I start the download
> Subsurface start counting downloaded dives...
> On Petrel I see SENDING PACKET messages
> At some point on my Petrel I get ERROR SENDING PACKET and the Petrel UI quits.

OK so far.

> On Subsurface mobile the UI is stuck on something like downloading
> dive #[dive number]
> The UI loops indefinitely with this message. Whatever I do when I go
> back on the download from dive computer screen its' always in the
> download state. Buttons don't work.

It should time out.
Can you try this? After you've seen about 5 dives downloaded (why is it
re-downloading dives you already have? you said only 3 were missing)
please tap the Cancel button on the UI. That should cancel the BT download
and show you the partial download which you can then save.

> Looking to the app logs via developer's options I see something like
> this: (English translation between parenthesis are mine)
> "143.271: dive #18 dom 24 set 2017 11:29"
> "LocalDeviceBroadcastReceiver::onReceive() - event:
> andorid.bluetooth.device.action.ACL_DISCONNECTED"
> QMutex: destroying locked mutex
> Executing queued closeSocket()
> AppState changed to inactive with no save ongoing and unsaved changes
> "Save changes to local cache"
> Sincronizzazione dei dati in corso (ongoing data sinc)
> preparazione al salvataggio dei dati (preparing to save data)
> Inizio salvataggio dei dati (starting saving data)
> Inizio salvataggio delle immersioni (starting saving dives)
> AppState changed to active with save ongoing and unsaved changes
> AppState changed to suspended with save ongoing and unsaved changes
> Creazione della cache locale riuscita
> QEGLPlatformContext: eglSwapBuffers failed: 300d
> done saving to git local / remote
> I'm not a  developer but from logs I see that 18 dives where
> downloaded (I need only the newest three of them)
> it's like the downloading thread has successfully stopped and some of
> the dives are being saved
> somewhere... But even restarting Subsurface nothing has changed into
> my dive list.
> I attached a screenshot of the whole log.
> I know that I could get the log file connecting via USB but given that
> we already have a text canvas (or something like that) wich shows me
> the log why don't you enable the copy paste or use another kind of
> widget so a user can easily forward it directly from Subsurface UI?

That's a QML problem (the UI toolkit that we use). I need to ping
the QML developers to find out when that will be possible.

But if you have an email app on the Nexus 7, you should be able
to simply attach the subsurface.log from the root of your storage
device to an email...

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

More information about the subsurface mailing list