Re: Bluetooth blues solved (sort of)

2015-10-29 Thread Ivan Wagner
>> The problem I encountered is OS-specific to the Ubuntu bluetooth
>> interface. After loading external software and not using the built-in
>> Ubuntu tool, I am able to download the Petrel reliably.

Dear Willem,

I'm facting similar issues. What external software are you actually
using at the moment? I'm on ubuntu LTS 14.04.

Thank you for the info,

ivan


On 10/28/2015 05:42 PM, Willem Ferguson wrote:
> On 23/10/2015 16:04, Rick Walsh wrote:
>>
>>
>> I have tested my petrel 2 with two laptop  onboard Bluetooth
>> controllers and 3 usb Bluetooth controllers.
>>
>> From memory, with one of the usb controllers, I needed to enter the
>> PIN  (using bluetoothctl or KDE's bluetooth ui) to pair.  With the
>> others I didn't need to enter a PIN.  I guess the PIN  was assumed
>> when pairing with the other controllers.
>>
>> R
>>
> The problem I encountered is OS-specific to the Ubuntu bluetooth
> interface. After loading external software and not using the built-in
> Ubuntu tool, I am able to download the Petrel reliably. Thank you very
> much for your time with this.
> Kind regards,
> willem
> 
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
> 
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Bluetooth blues solved (sort of)

2015-10-29 Thread Willem Ferguson

On 29/10/2015 09:19, Ivan Wagner wrote:

Dear Willem,

I'm facting similar issues. What external software are you actually
using at the moment? I'm on ubuntu LTS 14.04.

Thank you for the info,

ivan




The problem I encountered is OS-specific to the Ubuntu bluetooth
interface. After loading external software and not using the built-in
Ubuntu tool, I am able to download the Petrel reliably. Thank you very
much for your time with this.
Kind regards,
willem

___


Ivan,

I use Blueman (https://launchpad.net/blueman). As far as I can see 
Blueman is an independent Ubuntu-specific app. My version is 1.99alha, 
the last release before version 2. I see version 2 has now been released 
for some versions of Ubuntu. I first disabled the onboard Bluetooth of 
the Dell and used a dongle which bluez instantly recognised. Then I 
installed Blueman and accessed the dive computer through the dongle and 
Blueman without touching the Ubuntu standard interface. After successful 
transfers I tried with the dongle and with standard Ubuntu: still no 
action. Then I removed the dongle, activated the onboard bluetooth 
hardware, and tried with Blueman which worked flawlessly. Not knowing 
too much about this stuff (Claudiu on this list actually knows much 
better) I would make sure that I have a fairly recent version of bluez, 
install Blueman and see what happens. Blueman in itself is not an 
extremely intuitive interface, for instance with PIN codes, one of the 
options is "Do not pair". Looks like this actually means "Do not use a 
PIN code while pairing". But I finally got the hang of it and it is 
working ok now. The nice thing is that, once paring has been performed 
for the first time, subsequent connections are almost automatic and the 
PIN code issue usually disappears.

Kind regards,
willem

___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Bluetooth blues

2015-10-23 Thread Willem Ferguson

I try to download from a Petrel 2 using Bluetooth, but encounter problems.

I do:
Import from dive computer -> Choose Bluetooth download
scan
When I rightclick to pair I get error: local device error: Pairing error 
(see attached image)


Below is the terminal output.

willem~/src/subsurface/build$ ./subsurface
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No 
such file or directory

qt.bluetooth.bluez: Bluez 4 detected.
qt.bluetooth.bluez: void 
QBluetoothDeviceDiscoveryAgentPrivate::_q_propertyChanged(const 
QString&, const QDBusVariant&) "Discovering" QVariant(bool, true)
qt.bluetooth.bluez: Discovered:  "00:13:43:0D:21:0D" "Petrel" Num UUIDs 
1 total device 0 cached false RSSI -69

qt.bluetooth.bluez: Emit:  "00:13:43:0D:21:0D"
qt.bluetooth.bluez: OrgBluezDeviceInterface* getDevice(const 
QBluetoothAddress&, QBluetoothLocalDevicePrivate*) reply failed 
QDBusError("org.bluez.Error.DoesNotExist", "Does Not Exist")
qt.bluetooth.bluez: Discovered:  "00:13:43:0D:21:0D" "Petrel" Num UUIDs 
1 total device 1 cached false RSSI -67

qt.bluetooth.bluez: Duplicate:  "00:13:43:0D:21:0D"
qt.bluetooth.bluez: OrgBluezDeviceInterface* getDevice(const 
QBluetoothAddress&, QBluetoothLocalDevicePrivate*) reply failed 
QDBusError("org.bluez.Error.DoesNotExist", "Does Not Exist")
qt.bluetooth.bluez: OrgBluezDeviceInterface* getDevice(const 
QBluetoothAddress&, QBluetoothLocalDevicePrivate*) reply failed 
QDBusError("org.bluez.Error.DoesNotExist", "Does Not Exist")
qt.bluetooth.bluez: void 
QBluetoothDeviceDiscoveryAgentPrivate::_q_propertyChanged(const 
QString&, const QDBusVariant&) "Devices" QVariant(QDBusArgument, )
qt.bluetooth.bluez: void 
QBluetoothDeviceDiscoveryAgentPrivate::_q_propertyChanged(const 
QString&, const QDBusVariant&) "Discovering" QVariant(bool, false)
qt.bluetooth.bluez: Failed to create pairing 
"org.bluez.Error.AuthenticationFailed"

qt.bluetooth.bluez: void QBluetoothLocalDevicePrivate::Release()
qt.bluetooth.bluez: "Method "GetProperties" with signature "" on 
interface "org.bluez.Device" doesn't exist

"
willem~/src/subsurface/build$

Does anyone have any suggestions of what I do wrongly?

Kind regards,
Willem





___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Bluetooth blues

2015-10-23 Thread Miika Turkia
try pairing using OS tools if u need pin code, then dl should work

miika

> On 23 Oct 2015, at 11:57, Willem Ferguson  
> wrote:
> 
> I try to download from a Petrel 2 using Bluetooth, but encounter problems.
> 
> I do:
> Import from dive computer -> Choose Bluetooth download
> scan
> When I rightclick to pair I get error: local device error: Pairing error (see 
> attached image)
> 
> Below is the terminal output.
> 
> willem~/src/subsurface/build$ ./subsurface
> QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No such 
> file or directory
> qt.bluetooth.bluez: Bluez 4 detected.
> qt.bluetooth.bluez: void 
> QBluetoothDeviceDiscoveryAgentPrivate::_q_propertyChanged(const QString&, 
> const QDBusVariant&) "Discovering" QVariant(bool, true)
> qt.bluetooth.bluez: Discovered:  "00:13:43:0D:21:0D" "Petrel" Num UUIDs 1 
> total device 0 cached false RSSI -69
> qt.bluetooth.bluez: Emit:  "00:13:43:0D:21:0D"
> qt.bluetooth.bluez: OrgBluezDeviceInterface* getDevice(const 
> QBluetoothAddress&, QBluetoothLocalDevicePrivate*) reply failed 
> QDBusError("org.bluez.Error.DoesNotExist", "Does Not Exist")
> qt.bluetooth.bluez: Discovered:  "00:13:43:0D:21:0D" "Petrel" Num UUIDs 1 
> total device 1 cached false RSSI -67
> qt.bluetooth.bluez: Duplicate:  "00:13:43:0D:21:0D"
> qt.bluetooth.bluez: OrgBluezDeviceInterface* getDevice(const 
> QBluetoothAddress&, QBluetoothLocalDevicePrivate*) reply failed 
> QDBusError("org.bluez.Error.DoesNotExist", "Does Not Exist")
> qt.bluetooth.bluez: OrgBluezDeviceInterface* getDevice(const 
> QBluetoothAddress&, QBluetoothLocalDevicePrivate*) reply failed 
> QDBusError("org.bluez.Error.DoesNotExist", "Does Not Exist")
> qt.bluetooth.bluez: void 
> QBluetoothDeviceDiscoveryAgentPrivate::_q_propertyChanged(const QString&, 
> const QDBusVariant&) "Devices" QVariant(QDBusArgument, )
> qt.bluetooth.bluez: void 
> QBluetoothDeviceDiscoveryAgentPrivate::_q_propertyChanged(const QString&, 
> const QDBusVariant&) "Discovering" QVariant(bool, false)
> qt.bluetooth.bluez: Failed to create pairing 
> "org.bluez.Error.AuthenticationFailed"
> qt.bluetooth.bluez: void QBluetoothLocalDevicePrivate::Release()
> qt.bluetooth.bluez: "Method "GetProperties" with signature "" on interface 
> "org.bluez.Device" doesn't exist
> "
> willem~/src/subsurface/build$
> 
> Does anyone have any suggestions of what I do wrongly?
> 
> Kind regards,
> Willem
> 
> 
> 
> 
> 
> 
> ___
> subsurface mailing list
> subsurface@subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Bluetooth blues

2015-10-23 Thread Claudiu Olteanu
> I was under the impression that the Petrel 2 and the Uemis were your test
> devices when coding the Bluetooth interface and that access to the Petrel 2
> has more or less been sorted out?? Am I mistaken?

I have only two devices: OSTCs and OSTC 2. Rick helped me to test the
connectivity with a Petrel 2 device.

> Do you know whether the Petrel 2 definitely needs a pin number?
I have no idea. You can test it using the bluetoothctl tool. Here is an example:

$ bluetoothctl
[bluetooth]# agent KeyboardOnly
Agent registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# pair 00:13:43:0D:21:0D
Attempting to pair with 00:13:43:0D:21:0D
[CHG] Device 00:13:43:0D:21:0D Connected: yes
Request PIN code
[agent] Enter PIN code: 

If it doesn't need a PIN code, then the last part will be missing.
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Bluetooth blues

2015-10-23 Thread Rick Walsh
On 24 Oct 2015 00:51, "Claudiu Olteanu" 
wrote:
>
> > I was under the impression that the Petrel 2 and the Uemis were your
test
> > devices when coding the Bluetooth interface and that access to the
Petrel 2
> > has more or less been sorted out?? Am I mistaken?
>
> I have only two devices: OSTCs and OSTC 2. Rick helped me to test the
> connectivity with a Petrel 2 device.
>
> > Do you know whether the Petrel 2 definitely needs a pin number?
> I have no idea. You can test it using the bluetoothctl tool. Here is an
example:
>
> $ bluetoothctl
> [bluetooth]# agent KeyboardOnly
> Agent registered
> [bluetooth]# default-agent
> Default agent request successful
> [bluetooth]# pair 00:13:43:0D:21:0D
> Attempting to pair with 00:13:43:0D:21:0D
> [CHG] Device 00:13:43:0D:21:0D Connected: yes
> Request PIN code
> [agent] Enter PIN code: 
>
> If it doesn't need a PIN code, then the last part will be missing.

I have tested my petrel 2 with two laptop  onboard Bluetooth controllers
and 3 usb Bluetooth controllers.

>From memory, with one of the usb controllers, I needed to enter the PIN
 (using bluetoothctl or KDE's bluetooth ui) to pair.  With the others I
didn't need to enter a PIN.  I guess the PIN  was assumed when pairing
with the other controllers.

R
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Bluetooth blues

2015-10-23 Thread Anton Lundin
I took a look at qt parring interfaces, shouldn't there be a way to test a 
couple of standard parring codes?

//Anton

On October 23, 2015 12:02:19 PM GMT+02:00, Claudiu Olteanu 
 wrote:
>Hi there,
>
>If your remote device requests a custom PIN code for the pairing
>process, your should pair the devices using a different tool.
>Currently QtBluetooth doesn't have support for custom PIN codes.
>
>A workaround could be to use bluetoothctl, register an agent using the
>following commands, initiate the pairing process using our application
>and enter the pin code when it is requested:
>
>[bluetooth]# agent KeyboardOnly
>[bluetooth]# default-agent
>
>Claudiu
>___
>subsurface mailing list
>subsurface@subsurface-divelog.org
>http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Bluetooth blues

2015-10-23 Thread Claudiu Olteanu
Unfortunately the API doesn't allow you to specify a PIN code.

There is a bug [1] reported and also a partial implementation for an
agent[2] which could be used to pass the PIN code,

[1] - https://bugreports.qt.io/browse/QTBUG-42740
[2] - https://codereview.qt-project.org/#/c/85595/

On Fri, Oct 23, 2015 at 2:50 PM, Anton Lundin  wrote:
> I took a look at qt parring interfaces, shouldn't there be a way to test a 
> couple of standard parring codes?
>
> //Anton
>
> On October 23, 2015 12:02:19 PM GMT+02:00, Claudiu Olteanu 
>  wrote:
>>Hi there,
>>
>>If your remote device requests a custom PIN code for the pairing
>>process, your should pair the devices using a different tool.
>>Currently QtBluetooth doesn't have support for custom PIN codes.
>>
>>A workaround could be to use bluetoothctl, register an agent using the
>>following commands, initiate the pairing process using our application
>>and enter the pin code when it is requested:
>>
>>[bluetooth]# agent KeyboardOnly
>>[bluetooth]# default-agent
>>
>>Claudiu
>>___
>>subsurface mailing list
>>subsurface@subsurface-divelog.org
>>http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Bluetooth blues

2015-10-23 Thread Claudiu Olteanu
Hi there,

If your remote device requests a custom PIN code for the pairing
process, your should pair the devices using a different tool.
Currently QtBluetooth doesn't have support for custom PIN codes.

A workaround could be to use bluetoothctl, register an agent using the
following commands, initiate the pairing process using our application
and enter the pin code when it is requested:

[bluetooth]# agent KeyboardOnly
[bluetooth]# default-agent

Claudiu
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Bluetooth blues

2015-09-09 Thread Willem Ferguson
I was trying to document the Bluetooth interface using a Shearwater 
Petrel. Below is the console output of the three attempts. I had three 
sessions:


1) Ubuntu 15.04
2) Fedora 22
3) Fedora 22

On Ubuntu, the first four of 37 dives were downloaded. On Fedora it 
resulted in a segfault both times without any upload. I hope the text 
below helps to find the problem. My procedure: Download -> from Dive 
computer; set DC type to Shearwater Petrel;  Check Bluetooth checkbox; 
internal computer (Dell M4700) Bluetooth interface is seen and displayed 
on right hand side of dialogue showing internal Bluetooth is switched 
on; Scan for Bluetooth devices; Petrel shows on list; right-click on 
Petrel line and select 'Pair';  Select 'save';  On download panel select 
Download.



UBUNTU:

qt.bluetooth.bluez: void QBluetoothSocketPrivate::_q_readNotify() 25 
error: -1 "Resource temporarily unavailable"

Connection on channel 1 failed. Trying on channel number 5.
Failed to connect to device  00:13:43:0D:1E:F5 . Device state 
QBluetoothSocket::UnconnectedState . Error: 
QBluetoothSocket::UnknownSocketError
[4.829207] ERROR: No such file or directory (2) [in serial_posix.c:159 
(serial_open)]
[4.829225] ERROR: Failed to open the serial port. [in custom_serial.c:69 
(dc_serial_native_open)]
[4.829235] ERROR: Failed to open the serial port. [in 
shearwater_common.c:47 (shearwater_common_open)]

Set the current dive site: 0
qt.bluetooth.bluez: void QBluetoothSocketPrivate::_q_readNotify() 26 
error: -1 "Resource temporarily unavailable"

Connection on channel 1 failed. Trying on channel number 5.
Failed to connect to device  00:13:43:0D:1E:F5 . Device state 
QBluetoothSocket::UnconnectedState . Error: 
QBluetoothSocket::UnknownSocketError
[5.347340] ERROR: No such file or directory (2) [in serial_posix.c:159 
(serial_open)]
[5.347363] ERROR: Failed to open the serial port. [in custom_serial.c:69 
(dc_serial_native_open)]
[5.347381] ERROR: Failed to open the serial port. [in 
shearwater_common.c:47 (shearwater_common_open)]

Set the current dive site: 0
The connection on RFCOMM channel number 1 took more than expected. Wait 
another 15 seconds.
qt.bluetooth.bluez: void QBluetoothSocketPrivate::_q_readNotify() 27 
error: -1 "Resource temporarily unavailable"
Failed to connect to device  00:13:43:0D:1E:F5 . Device state 
QBluetoothSocket::UnconnectedState . Error: 
QBluetoothSocket::UnknownSocketError
[7.030518] ERROR: No such file or directory (2) [in serial_posix.c:159 
(serial_open)]
[7.030530] ERROR: Failed to open the serial port. [in custom_serial.c:69 
(dc_serial_native_open)]
[7.030537] ERROR: Failed to open the serial port. [in 
shearwater_common.c:47 (shearwater_common_open)]

Set the current dive site: 0

FEDORA 22:
===
[willem@localhost build]$ ./subsurface
pci id for fd 10: 80ee:beef, driver (null)
libGL error: core dri or dri2 extension not found
libGL error: failed to load driver: vboxvideo
Map theme file does not exist: ""
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No 
such file or directory

QFSFileEngine::open: No file name specified
QFSFileEngine::open: No file name specified
QFSFileEngine::open: No file name specified
QFSFileEngine::open: No file name specified
QFSFileEngine::open: No file name specified
QFSFileEngine::open: No file name specified
QFSFileEngine::open: No file name specified
QFSFileEngine::open: No file name specified
QFSFileEngine::open: No file name specified
qt.bluetooth.bluez: Bluez 5 detected.
qt.bluetooth.bluez: Creating QtBluezDiscoveryManager
qt.bluetooth.bluez: Discovered:  "B8:D9:CE:F2:A0:63" "Willem Ferguson 
(GT-I9" Num UUIDs 13 total device 0 cached RSSI 0 Class 5898764
qt.bluetooth.bluez: Discovered:  "00:13:43:0D:1E:F5" "Petrel" Num UUIDs 
1 total device 1 cached RSSI -63 Class 0

qt.bluetooth.bluez: Initiating direct pair to "00:13:43:0D:1E:F5"
qt.bluetooth.bluez: Sending pairing request to "00:13:43:0D:1E:F5"
qt.bluetooth.bluez: void QBluetoothDeviceDiscoveryAgentPrivate::stop()
qt.bluetooth.bluez: void QBluetoothSocketPrivate::_q_readNotify() 11 
error: -1 "Resource temporarily unavailable"
qt.bluetooth.bluez: void QBluetoothSocketPrivate::_q_readNotify() 11 
error: -1 "Resource temporarily unavailable"
[10.261356] ERROR: No such file or directory (2) [in serial_posix.c:159 
(serial_open)]
[10.261365] ERROR: Failed to open the serial port. [in 
custom_serial.c:69 (dc_serial_native_open)]

Segmentation fault (core dumped)

FEDORA 22:
===
[willem@localhost build]$ ./subsurface
pci id for fd 10: 80ee:beef, driver (null)
libGL error: core dri or dri2 extension not found
libGL error: failed to load driver: vboxvideo
Map theme file does not exist: ""
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No 
such file or directory

QFSFileEngine::open: No file name specified
QFSFileEngine::open: No file name specified
QFSFileEngine::open: No file name specified
QFSFileEngine::open: No file name specified

Re: Bluetooth blues

2015-09-09 Thread Willem Ferguson

On 09/09/2015 16:56, Claudiu Olteanu wrote:

Hi there,

It seems that it doesn't use our custom implementation for the open 
method.

It should use *shearwater_common_custom_open *to open the device.
This means that your libdivecomputer version is incorrect or the
SSRF_CUSTOM_SERIAL wasn't cached correctly.

After commit [1] it shouldn't show the Bluetooth option if the 
SSRF_CUSTOM_SERIAL

macro is undefined.

Also the commit [2] should fix some problems with the Shearwater 
devices which lead to SEGV.


Let me know if you encounter the same problems using the latest 
versions of Subsurface and libdc.


Cheers,
Claudiu

[1] - 
https://github.com/torvalds/subsurface/commit/a0e33bec7116f6848c8fdc618ee1ef1e2641ecd9
[2] - 
http://git.subsurface-divelog.org/index.cgi?p=libdc.git;a=commit;h=8932b2a936a237284e0bffcea562c406551ab433


Claudio my SHA is pretty recent,  cb1aac0c4d9c, from this morning, it is 
the commit AFTER the commit of your patch a0e33be.
I will keep an eye on this. I am on my way to the USA right now, so I 
may possibly only get an opportunity to test again in a month's time. 
Sorry for that, but I will keep this pretty high on my priority list. I 
hope to be able to work with the latest daily builds while there.


Kind regards,
willem

___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface