Re: Shearwater Petrel Bluetooth connection on Fedora 20

2015-04-13 Thread Rick Walsh
On 13 April 2015 at 20:13, Rodrigo Severo  wrote:
> On Sun, Apr 12, 2015 at 8:23 PM, Rick Walsh  wrote:
>
>>
>> I made a quick attempt this morning, but ran out of time and needed to
>> go to work.  I'm not familiar with rfcomm or Bluetooth on Linux.
>> Please excuse my ignorance, but what is the correct command?
>
> Hi,
>
> I managed to get stable connections using the rfcomm "connect" command.
>
> Here is the script I use to connect the Petrel to my computer just
> before using downloading data on Subsurface:


> rfcomm connect /dev/rfcomm0 00:13:43:08:96:48

Yes thanks, this is the command I'm trying, but with '-i hci1' option.

> Unfortunately the comments are in portuguese but Google Translate is
> your friend...

I'm always impressed at just how good a friend Google Translate is
each time I use it.

> Rodrigo

I'm getting slightly closer, but only if I use the bluetooth dongle
(hci1), as opposed to the build-in controller (hci0), and manually
enabling auth, with 'sudo hciconfig hci1 auth'

[rick@localhost subsurface]$ hciconfig
hci1:   Type: BR/EDR  Bus: USB
BD Address: 00:15:83:3D:0A:57  ACL MTU: 310:10  SCO MTU: 64:8
UP RUNNING PSCAN AUTH
RX bytes:1956 acl:9 sco:0 events:105 errors:0
TX bytes:845 acl:9 sco:0 commands:70 errors:0

hci0:   Type: BR/EDR  Bus: USB
BD Address: 00:22:43:C3:EB:30  ACL MTU: 1021:8  SCO MTU: 64:1
UP RUNNING PSCAN AUTH
RX bytes:4840 acl:76 sco:0 events:193 errors:0
TX bytes:2641 acl:76 sco:0 commands:93 errors:0


[rick@localhost subsurface]$ rfcomm -i hci0 connect /dev/rfcomm0
00:13:43:0E:6B:D0
Can't connect RFCOMM socket: Connection refused

When I try connecting with hci0 (built-in), I get the error 'Can't
connect RFCOMM socket: Connection refused', and the 'Wait PC' timer on
the Petrel keeps ticking down as if nothing has happened.


[rick@localhost subsurface]$ rfcomm -i hci1 connect /dev/rfcomm0
00:13:43:0E:6B:D0
Can't connect RFCOMM socket: Invalid exchange

When I try connecting with hci1 (dongle), I get a different error,
'Can't connect RFCOMM socket: Invalid exchange', and the Petrel gives
me the error message 'BT INIT FAIL'.


Obviously, it still isn't working, but I feel at least they're trying
to talk to each other.  Surely that's a good start.  Anton, Rodrigo,
(and anyone else whose Petrel is connecting on Linux) what does
hciconfig show for you?  As enabling 'auth' made some difference, I'm
wondering if there's something else that's important.

Cheers,

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


Re: Shearwater Petrel Bluetooth connection on Fedora 20

2015-04-13 Thread Anton Lundin
On 13 April, 2015 - Rodrigo Severo wrote:

> On Sun, Apr 12, 2015 at 8:23 PM, Rick Walsh  wrote:
> 
> >
> > I made a quick attempt this morning, but ran out of time and needed to
> > go to work.  I'm not familiar with rfcomm or Bluetooth on Linux.
> > Please excuse my ignorance, but what is the correct command?
> 
> Hi,
> 
> I managed to get stable connections using the rfcomm "connect" command.
> 
> Here is the script I use to connect the Petrel to my computer just
> before using downloading data on Subsurface:
> 
...
> before using downloading data on Subsurface:
> 
> # Antigo Petrel com porta externa (vendido para o Cristofer)
> #rfcomm connect /dev/rfcomm0 00:13:43:04:F2:F1
> 
> # Novo Petrel controlador do O2Ptima
> rfcomm connect /dev/rfcomm0 00:13:43:08:96:48
> 
> # Novo Petrel sem porta externa
> #rfcomm connect /dev/rfcomm0 00:13:43:07:90:CD
> 
...

All of these uses the build in bluetooth dongle, hci0 by default.

Pass a -i hci1 to use your second blueooth dongle, eg:

rfcomm -i hci1 connect /dev/rfcomm0 aa:bb:cc:...



I like to use the connect keyword, because for me it might take 10-15
seconds sometime to connect a rfcomm channel. If you would have just use
bind and then open on the dev, it might behave badly and time out. This
might be your case.


//Anton


-- 
Anton Lundin+46702-161604
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Shearwater Petrel Bluetooth connection on Fedora 20

2015-04-13 Thread Rodrigo Severo
On Sun, Apr 12, 2015 at 8:23 PM, Rick Walsh  wrote:

>
> I made a quick attempt this morning, but ran out of time and needed to
> go to work.  I'm not familiar with rfcomm or Bluetooth on Linux.
> Please excuse my ignorance, but what is the correct command?

Hi,

I managed to get stable connections using the rfcomm "connect" command.

Here is the script I use to connect the Petrel to my computer just
before using downloading data on Subsurface:

# cat /usr/local/sbin/petrel_download
#!/bin/bash

read -p "Abra o Subsurface, abra o log de mergulho onde ficaram
guardados os mergulhos a serem baixados. Abra a opção Registros >>
Transferir do computador de mergulho. Verifique que a porta indicada
na janela de transferência é /dev/rfcomm0. Ligue o Petrel e ponha ele
no modo 'Upload log'. Tecle [Enter] quando estiver pronto."
hciconfig hci0 up

# Antigo Petrel com porta externa (vendido para o Cristofer)
#rfcomm connect /dev/rfcomm0 00:13:43:04:F2:F1

# Novo Petrel controlador do O2Ptima
rfcomm connect /dev/rfcomm0 00:13:43:08:96:48

# Novo Petrel sem porta externa
#rfcomm connect /dev/rfcomm0 00:13:43:07:90:CD

echo "Se não houve nenhum erro, só falta ir no Subsurface e mandar
baixar os mergulhos."
--

Unfortunately the comments are in portuguese but Google Translate is
your friend...

I have several "rfcomm connet" lines because I have/had more than one
Petrel. Leave only one of them uncommented.


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