Bluetooth support in Puppy

Under development: PCMCIA, wireless, etc.
Message
Author
John Doe
Posts: 1681
Joined: Mon 01 Aug 2005, 04:46
Location: Michigan, US

Bluetooth support in Puppy

#1 Post by John Doe »

A couple of use have been working on bluetooth support (although none have bluetooth).

We need testers, packages are here:

http://www.murga-linux.com/puppy/viewto ... 474#115474

We're pretty sure you have to start dbus first with one of these:

Code: Select all

sh-3.00# dbus-daemon --system
sh-3.00# hcid
sh-3.00#

or:

sh-3.00# dbus-launch --exit-with-session
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-Ri4IJxUbkr,guid=2114154d3e6ee1760e981200462cf51b
DBUS_SESSION_BUS_PID=22649
sh-3.00# hcid
sh-3.00#
Then you run:

Code: Select all

modprobe rfcomm
Then you have to mess with hciconfig, maybe something like:

Code: Select all

hciconfig hci0 up
This is where it gets hazy...maybe hciconfig --help to figure it out.

If you have bluetooth, please give this a try and post back here. We'll try our best to help get it going for everyone.

User avatar
steevieb
Posts: 289
Joined: Sun 31 Dec 2006, 00:11
Location: Poole, Dorset. UK

#2 Post by steevieb »

downloaded
bluez-firmware-1.2.pet
bluez-libs-3.9.pet
bluez-utils-3.9.pet
dbus-1.0.2.pet

installed bluez-firmware-1.2.pet
installed dbus-1.0.2.pet
installed bluez-libs-3.9.pet
installed bluez-libs-3.9.pet
using petget, restarted X.

Entered following commands;
sh-3.00# dbus-daemon --system
sh-3.00# hcid

sh-3.00# modprobe rfcomm
sh-3.00# modprobe hci-usb #need this as I have a usb bluetooth adapter
sh-3.00# hciconfig hci0 up
sh-3.00# hciconfig

hci0: Type: USB
BD Address: 00:08:1B:C0:4F:8F ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING
RX bytes:71 acl:0 sco:0 events:8 errors:0
TX bytes:27 acl:0 sco:0 commands:7 errors:0

sh-3.00# hcitool scan
Scanning ...
00:60:57:D3:9C:24 Me 2 #Address and bluetooth name of phone

sh-3.00# hcitool info 00:60:57:D3:9C:24
Requesting information ...
BD Address: 00:60:57:D3:9C:24
Device Name: Me 2
LMP Version: 1.1 (0x1) LMP Subversion: 0x248
Manufacturer: Nokia Mobile Phones (1)
Features: 0xbf 0x28 0x21 0x00 0x00 0x00 0x00 0x00
<3-slot packets> <5-slot packets> <encryption> <slot offset>
<timing accuracy> <role switch> <sniff mode> <SCO link>
<HV3 packets> <CVSD>

sh-3.00# hcitool cc 00:60:57:D3:9C:24
sh-3.00#

But this is as far as I get, cannot pair with phone (Nokia 6600) or connect with it.
Using 2.15CE live cd

John Doe
Posts: 1681
Joined: Mon 01 Aug 2005, 04:46
Location: Michigan, US

#3 Post by John Doe »

Great feedback. Thanks.
steevieb wrote:But this is as far as I get, cannot pair with phone (Nokia 6600) or connect with it.
Using 2.15CE live cd
Check out the link here, this user connected to a Nokia 9950 with GPRS.

http://puppylinux.org/wikka/ExperimentalBT

You look like you are right at the part where you have to get and set the channel of the phone:

Key commands look like:

Code: Select all

sdptool browse 00:0E:ED:AE:D7:3B <-with your MAC

and

rfcomm bind /dev/rfcomm0 00:0E:ED:AE:D7:3B 2 <-your MAC and channel
(don't worry about mknod, that's node is added for you already)

Not sure about these two, they are listed there:

Code: Select all

modprobe bluetooth
modprobe l2cap
Then you just have to set up the ppp connection and fire it up.

User avatar
steevieb
Posts: 289
Joined: Sun 31 Dec 2006, 00:11
Location: Poole, Dorset. UK

#4 Post by steevieb »

sh-3.00# sdptool browse 00:60:57:D3:9C:24
Browsing 00:60:57:D3:9C:24 ...
Service Name: Fax
Service RecHandle: 0x10000
Service Class ID List:
"Fax" (0x1111)
"Generic Telephony" (0x1204)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Fax" (0x1111)
Version: 0x0100

Service Name: Dial-up Networking
Service RecHandle: 0x10001
Service Class ID List:
"Dialup Networking" (0x1103)
"Generic Networking" (0x1201)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100

Service Name: Bluetooth Serial Port
Service Description: Bluetooth Serial Port
Service Provider: Symbian Ltd.
Service RecHandle: 0x10002
Service Class ID List:
"Serial Port" (0x1101)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 2
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100

Service Name: OBEX File Transfer
Service RecHandle: 0x10003
Service Class ID List:
"OBEX File Transfer" (0x1106)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 10
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"OBEX File Transfer" (0x1106)
Version: 0x0100

Service Name: OBEX Object Push
Service RecHandle: 0x10004
Service Class ID List:
"OBEX Object Push" (0x1105)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 9
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"OBEX Object Push" (0x1105)
Version: 0x0100

Service Name: Handsfree Audio Gateway
Service RecHandle: 0x10005
Service Class ID List:
"Handfree Audio Gateway" (0x111f)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 3
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Handsfree" (0x111e)
Version: 0x0101
Sdptool browse gives above result then
sh-3.00#modprobe bluetooth
sh-3.00#modprobe l2cap

sh-3.00# modprobe obex
FATAL: Module obex not found.

sh-3.00# rfcomm bind /dev/rfcomm0 00:60:57:D3:9C:24 2
sh-3.00#

sh-3.00# rfcomm connect rfcomm0 00:60:57:D3:9C:24 2 #Asks for a password on the phone for Bluez(0)
Can't connect RFCOMM socket: Connection refused
sh-3.00#



Do I need Obex? The serial port I think might work if I knew the password in Bluez. Tried 12345 and 00000 and 123 and 88888.
I am more interested in getting the serial port/file transfer working than GPRS, as I have Mobi Reader, an e-book reader on my phone, which I use a lot. And it seems a bit silly using GPRS through a server on a broadband connection :)

John Doe
Posts: 1681
Joined: Mon 01 Aug 2005, 04:46
Location: Michigan, US

#5 Post by John Doe »

steevieb wrote: Sdptool browse gives above result then
sh-3.00#modprobe bluetooth
sh-3.00#modprobe l2cap
Once we get it going, it would be neat to go back and test without these also. Since you got the list above, it seems the bluetooth stack hci layer must be inplace already, see here (real good graphic at bottom of middle content):
http://www.developers.net/external/1084

Although those are probably needed to navigate further protocols.
steevieb wrote: sh-3.00# rfcomm connect rfcomm0 00:60:57:D3:9C:24 2 #Asks for a password on the phone for Bluez(0)
Can't connect RFCOMM socket: Connection refused
sh-3.00#
Thanks for noting that. I'll remember when looking up info.
steevieb wrote: Do I need Obex? The serial port I think might work if I knew the password in Bluez....
Here is a great article on obex "CLI Magic: Access your Bluetooth phone via the command line"
http://enterprise.linux.com/article.pl? ... 3&from=rss

Leads to this utility at the end for using obex to send files to the phone:
http://www.bindshell.net/tools/obexsend
steevieb wrote:I am more interested in getting the serial port/file transfer working than GPRS...it seems a bit silly using GPRS through a server on a broadband connection :)
Understood. I just assumed a modem was what the phones where used for, file transer didn't even cross my mind as I've never gone through this (and don't have that phone).

YES, GPRS would be silly with a broadband connection around :-)

Yet might be a good second excercise. We had a really bad ice storm here last year and it knocked out the power, phones and internet for three days but my cell phone still worked. I hooked it up with my laptop and a generator and got online to pass some time.

User avatar
steevieb
Posts: 289
Joined: Sun 31 Dec 2006, 00:11
Location: Poole, Dorset. UK

#6 Post by steevieb »

These commands are the same for different types of connection, apart from the channel no at the end.
ie; 2 is serial port, 1 is Dial up networking, 9 is obex, etc. http://wiki.bluez.org/wiki/Serial

sh-3.00# rfcomm bind /dev/rfcomm0 00:60:57:D3:9C:24 2
sh-3.00# rfcomm connect rfcomm0 00:60:57:D3:9C:24 2

http://wiki.bluez.org/wiki/Serial
http://wiki.bluez.org/wiki/HOWTO/SerialConnections

The openobex link is a .bz2 file - is this ok? Will try to install tommorow - late here now

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#7 Post by tempestuous »

EDIT: Attachment deleted.
Last edited by tempestuous on Sat 19 May 2007, 09:38, edited 1 time in total.

flappers
Posts: 1
Joined: Fri 18 May 2007, 15:58
Location: Cape Town

#8 Post by flappers »

Hi

I have downloaded the bluez pets and stuff and hope to connect a P2-450MHZ with 256mb ram and voodo3 16mb agp with Puppy2.16 to my Nokia N80 via BAFO bluetooth usb dongle.

Aim to try obex 1st as its less complicated I think.

This is an excellent thread to find! Was starting to lose hope in respect of bluetooth and Puppy.

Must dash!

flappers

User avatar
steevieb
Posts: 289
Joined: Sun 31 Dec 2006, 00:11
Location: Poole, Dorset. UK

#9 Post by steevieb »

This page seems to have lot of useful info
http://mazzanet.id.au/bluetooth.php

tempestuous, do you have the openobex apps as well?

Still stuck at the password screen. :(

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#10 Post by tempestuous »

EDIT Jan 1st 2008 - openobex attachment deleted.
Revised bluetooth libaries and openobex here
http://www.murga-linux.com/puppy/viewtopic.php?t=25009
Last edited by tempestuous on Tue 01 Jan 2008, 01:18, edited 1 time in total.

User avatar
steevieb
Posts: 289
Joined: Sun 31 Dec 2006, 00:11
Location: Poole, Dorset. UK

#11 Post by steevieb »

Using Obex I get the following;
sh-3.00# obex_test -b 00:60:57:D3:9C:24 10
Using Bluetooth RFCOMM transport
OBEX Interactive test client/server.
> c
Transport connect error! (Bluetooth)
Using Rfcomm I get a brief connection;
sh-3.00# hcitool cc 00:60:57:D3:9C:24
sh-3.00# hcitool con
Connections:
< ACL 00:60:57:D3:9C:24 handle 42 state 1 lm MASTER
sh-3.00#
sh-3.00# hcitool lq 00:60:57:D3:9C:24
Link quality: 220

sh-3.00# hcitool rssi 00:60:57:D3:9C:24
RSSI return value: -3
sh-3.00#
Could not find bluez-pin so downloaded from
http://www.t2-project.org/packages/bluez-pin.html
It should put up a box to enter the same password as entered on the phone. Not sure it installed properly though.
Attachments
bluez-pin.png
(2.81 KiB) Downloaded 5997 times

John Doe
Posts: 1681
Joined: Mon 01 Aug 2005, 04:46
Location: Michigan, US

#12 Post by John Doe »

tempestuous wrote:I doubt that this is the case with John Doe's ClawsMail/JPilot package.
You are correct. I will fix this up for the next "release".

I'm going to drop those nodes in there also.

Little sister is back from school for the weekend, so it will be a day or two.

User avatar
steevieb
Posts: 289
Joined: Sun 31 Dec 2006, 00:11
Location: Poole, Dorset. UK

#13 Post by steevieb »

SUCCESS!
Read instructions from http://david.wragg.org/blog/ and realised I was using the wrong channel :oops: Needed to be Obex Object Push
sh-3.00# obex_test -b 00:60:57:D3:9C:24 9
Using Bluetooth RFCOMM transport
OBEX Interactive test client/server.
> c
Connect OK!
Version: 0x10. Flags: 0x00
> x /root/bluetooth2
PUSH filename> name=/root/bluetooth2, size=1685
Going to send /root/bluetooth2(bluetooth2), 1685 bytes
Filling stream!
Made some progress...
Filling stream!
PUT successful!
>
Although it is only from the computer to the phone there is no password involved
Thanks, tempestuous and John Doe for all your help, and sorry if some of my posts were a bit long. Hard to know what is important info. Let me know if you want me to try any thing else.

John Doe
Posts: 1681
Joined: Mon 01 Aug 2005, 04:46
Location: Michigan, US

#14 Post by John Doe »

steevieb wrote:...sorry if some of my posts were a bit long. Hard to know what is important info...
They were great.

Thanks for the help. You verifed the basic bluetooth and also raised the bar on the pack.

I'm going to tune up some packages and then appeal for some more help on getting info for a script together.

We've yet to cover bluetooth:

keyboards
mice
gps
palm
modem
etc...

User avatar
steevieb
Posts: 289
Joined: Sun 31 Dec 2006, 00:11
Location: Poole, Dorset. UK

#15 Post by steevieb »

GPS seem to work as well. Turned on the GPS then I entered these commands as before
sh-3.00# dbus-daemon --system
sh-3.00# hcid
sh-3.00# modprobe rfcomm
sh-3.00# modprobe hci-usb
sh-3.00# hciconfig hci0 up
sh-3.00# modprobe bluetooth
sh-3.00# modprobe l2cap
Scanning for devices gives
sh-3.00# hcitool scan
Scanning ...
00:02:C7:2A:4B:91 BlueGPS 2A4B91 #GPS receiver for (phone)sat nav
00:60:57:D3:9C:24 Me 2 #Nokia 6600 (phone)
sh-3.00# hcitool inq
Inquiring ...
00:60:57:D3:9C:24 clock offset: 0x60c1 class: 0x500204
00:02:C7:2A:4B:91 clock offset: 0x67f4 class: 0x001f00

sh-3.00# hcitool info 00:02:C7:2A:4B:91
Requesting information ...
BD Address: 00:02:C7:2A:4B:91
Device Name: BlueGPS 2A4B91
LMP Version: 1.1 (0x1) LMP Subversion: 0x291
Manufacturer: Cambridge Silicon Radio (10)
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
<3-slot packets> <5-slot packets> <encryption> <slot offset>
<timing accuracy> <role switch> <hold mode> <sniff mode>
<park state> <RSSI> <channel quality> <SCO link> <HV2 packets>
<HV3 packets> <u-law log> <A-law log> <CVSD> <paging scheme>
<power control> <transparent SCO>
Seems to connect OK with hcitool and rfcomm
sh-3.00# hcitool cc 00:02:C7:2A:4B:91
sh-3.00# hcitool con
Connections:
< ACL 00:02:C7:2A:4B:91 handle 42 state 1 lm MASTER

sh-3.00# rfcomm connect rfcomm0 00:02:C7:2A:4B:91
Connected /dev/rfcomm0 to 00:02:C7:2A:4B:91 on channel 1
Press CTRL-C for hangup

sh-3.00# l2ping 00:02:C7:2A:4B:91
Ping: 00:02:C7:2A:4B:91 from 00:08:1B:C0:4F:8F (data size 44) ...
44 bytes from 00:02:C7:2A:4B:91 id 0 time 37.83ms
44 bytes from 00:02:C7:2A:4B:91 id 1 time 39.91ms
44 bytes from 00:02:C7:2A:4B:91 id 2 time 29.81ms
44 bytes from 00:02:C7:2A:4B:91 id 3 time 42.72ms
44 bytes from 00:02:C7:2A:4B:91 id 4 time 44.62ms
5 sent, 5 received, 0% loss
GPS seems to connect the same as a phone but without a password, and on channel 1 which is DUN/general network on my phone.
I assume from the ping result it is a 2-way connection, but cannot test this as I do not have a sat nav/gps program on the computer. The GPS unit is paired with the phone.

User avatar
steevieb
Posts: 289
Joined: Sun 31 Dec 2006, 00:11
Location: Poole, Dorset. UK

#16 Post by steevieb »

Once we get it going, it would be neat to go back and test without these also
sh-3.00#modprobe bluetooth
sh-3.00#modprobe l2cap
These don't seem to make any difference to the basic connection
rfcomm bind /dev/rfcomm0 00:0E:ED:AE:D7:3B 2 <-your MAC and channel
This does not seem to be needed either, just put the channel number on the end when you start obex.
BTW, without -b option, obex_test defaults to infra-red.

sh-3.00# dbus-daemon --system
sh-3.00# hcid
sh-3.00# modprobe rfcomm
sh-3.00# modprobe hci-usb
sh-3.00# hciconfig hci0 up
sh-3.00# hcitool scan
Scanning ...
00:60:57:D3:9C:24 Me 2 #<-your MAC and Phone name

Then just enter
sh-3.00# sdptool browse 00:60:57:D3:9C:24 #<-(your MAC) to find the correct channel for Obex Object Push

sh-3.00# obex_test -b 00:60:57:D3:9C:24 9 #<-your MAC and channel

You should now have bluetooth working.
c to connect
x <filename> to push file to phone eg; > x /root/bluetooth2
q to quit

Has anyone else got bluetooth working?

John Doe
Posts: 1681
Joined: Mon 01 Aug 2005, 04:46
Location: Michigan, US

#17 Post by John Doe »

I sent a PM to edoc. Had been helping him with gps/bluetooth in the past with no luck.

Hopefully he can jump in also.

User avatar
edoc
Posts: 4729
Joined: Sun 07 Aug 2005, 20:16
Location: Southeast Georgia, USA
Contact:

#18 Post by edoc »

John Doe wrote:I sent a PM to edoc. Had been helping him with gps/bluetooth in the past with no luck.

Hopefully he can jump in also.
OK, just scanned through the thread.

I have my USB-Bluetooth adapter plugged in and my GPS-Bluetooth device
charging off another USB port.

Have company here at the moment so will try to get back to this later in the
evening.

Sure am happy to hear that we may have a solution in the making!
[b]Thanks! David[/b]
[i]Home page: [/i][url]http://nevils-station.com[/url]
[i]Don't google[/i] [b]Search![/b] [url]http://duckduckgo.com[/url]
TahrPup64 & Lighthouse64-b602 & JL64-603

User avatar
edoc
Posts: 4729
Joined: Sun 07 Aug 2005, 20:16
Location: Southeast Georgia, USA
Contact:

#19 Post by edoc »

steevieb wrote: sh-3.00# dbus-daemon --system
I am afraid that I didn even get past the first step:

sh-3.00# dbus-daemon --system
Failed to start message bus: Failed to bind socket "/usr/var/run/dbus/system_bus_socket": No such file or directory

So I tried the two steps that were suggested to be unnecessary ...
same error:

sh-3.00# modprobe bluetooth
sh-3.00# modprobe l2cap
sh-3.00# dbus-daemon --system
Failed to start message bus: Failed to bind socket "/usr/var/run/dbus/system_bus_socket": No such file or directory
[b]Thanks! David[/b]
[i]Home page: [/i][url]http://nevils-station.com[/url]
[i]Don't google[/i] [b]Search![/b] [url]http://duckduckgo.com[/url]
TahrPup64 & Lighthouse64-b602 & JL64-603

User avatar
steevieb
Posts: 289
Joined: Sun 31 Dec 2006, 00:11
Location: Poole, Dorset. UK

#20 Post by steevieb »

I do not have that folder either. My main folder seems to be /usr/include/dbus-1.0/dbus/


Did you download
bluez-firmware-1.2.pet
dbus-1.0.2.pet
bluez-libs-3.9.pet
bluez-utils-3.9.pet
from http://www.murga-linux.com/puppy/viewto ... 474#115474

I also downloaded & installed openobex-1.3+apps.pet from tempestuous, posted Sat May 19 in this thread (two thirds down 1st page)

I also downloaded bluez-gnome-0.7, bluez-pin-0.30 and afe, affix-3.2.0 but I cannot compile or install anything - I get an error as below;
configure: error: C preprocessor "/lib/cpp" fails sanity check
With afe I just get an error saying I have kernel headers but not full source code
http://affix.sourceforge.net/afe/

Post Reply