Bluetooth & D-Bus, January 08

Core libraries and systems
Message
Author
User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#16 Post by Béèm »

OK, back to square one then.
I un-installed the Bluez 3.9 libs and utils.
Rebooted
Installed the 3.24 ones
Rebooted
Now the command:

Code: Select all

# dbus-uuidgen --ensure
# 
is working.
But:

Code: Select all

# dbus-daemon --system
Failed to start message bus: Failed to read directory "/usr/etc/dbus-1/system.d": No such file or directory
So no joy for me to work with Bluetooth, as I understand that the dbus daemon is prerequisite.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

shenen
Posts: 37
Joined: Sun 03 Dec 2006, 18:19

#17 Post by shenen »

Thanks for the tips tempestuous,
the problem goes away when I restored hcid.conf.

Beem, like you I am also trying to get bluetooth to work, but following the steps prescribed by tempestuous,, I don't have those error message.
Assume it's puppy 3.01.

I also tried x option, and it doesn't work for me, either.

the thing is you don't find too much documentation on how this thing work so you can go after the source, because it is not free.

OBEX (Object Exchange) Protocol:
http://www.irda.org/displaycommon.cfm?a ... ticlenbr=7

I also tried kmobotools:

http://www.kmobiletools.org/node/319
there is a live cd version, and run right out of the box.
However, for me, I can do address book, SMS, but obexftp still doesn't work.

Every time when PC sends the request wants to pair, and I enter the same passcode for both the mobile and PC, it still shows fail to pair.

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#18 Post by Béèm »

shenen, I am trying in alpha 6.
With the Bluez 3.9 libs and utils, I had more success.
As Tempestuous told me I should use the 3.24 I did so, but now I even can't get the dbus daemon started.
At least with the 3.9 it started.
Don't know quite well what to do next.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

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

#19 Post by tempestuous »

Béèm wrote:

Code: Select all

# dbus-daemon --system
Failed to start message bus: Failed to read directory "/usr/etc/dbus-1/system.d": No such file or directory
Ah, you still have some other version of DBus installed on your system ... maybe the version that came standard with Puppy3/4?

It's VERY IMPORTANT to install all of the dotpets in my 2nd post, not only the Bluetooth dotpets, but also the DBus dotpets.
I was very careful to compile all of these packages with the correct configuration locations.

My version of DBus will definitely reference /etc/dbus-1/system.d which is correct, not /usr/etc/dbus-1/system.d

Regarding obex, and the correct process for copying files from one bluetooth device to another, I have no direct knowledge.
But forum member giac_fab reported success here -
http://www.murga-linux.com/puppy/viewto ... 653#155653
http://www.murga-linux.com/puppy/viewto ... 941#162941

... notice that giac_fab edited his post to say that it only worked under XFCE, that's what made me realise that DBus is so important.
(The XFCE4.4.2 dotpet has its own version of DBus).

So now that the bluetooth and DBus components in my dotpets are playing nicely together, it should be possible (in theory) to reproduce giac_fab's success.
Again, make sure you use my dotpets of Openobex/Obexftp, not some other versions.

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#20 Post by Béèm »

May I make a remark first.
I don't think it's very logic that a created pet package like dbus-1.0.2.pet has the same sw level, but different sizes.
I don't know if it is made by the same person or two different persons.
But both versions are available in this forum.
It's frustrating, time consuming and creates confusion.
Hope this won't happen again.

Having said that I downloaded again the two dbus pets, the 4 Bluez pets and the two obex pets referenced by Tempestuous.
I un-installed those I had before.
Rebooted
Then installed the 8 pets and rebooted again.

Now comes the truth.

Code: Select all

# dbus-uuidgen --ensure
# dbus-daemon --system
Failed to start message bus: Failed to bind socket "/var/run/dbus/system_bus_socket": No such file or directory
# 
So this is where I stand now.
Still no joy to start the daemon.
In fact I don't have this /var/run/dbus directory.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

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

#21 Post by tempestuous »

Beem, don't be too disheartened. You are a pioneer in the area of bluetooth in Puppy. The road is likely to be bumpy!

When I compiled the DBus dotpets, I didn't realise that John Doe had already provided a dotpet with the same name (dbus-1.0.2.pet) -
http://www.murga-linux.com/puppy/viewto ... 474#115474
I have just edited my first post to emphasize the importance of using my latest DBus/Bluetooth dotpets.
Béèm wrote:

Code: Select all

dbus-uuidgen --ensure
# dbus-daemon --system
Failed to start message bus: Failed to bind socket "/var/run/dbus/system_bus_socket": No such file or directory
OK, we should be able to fix that. I compiled these DBus/Bluetooth packages in Puppy 3, which already has /var/run/dbus
but apparently you are using Puppy4, which does not have this directory. So let's create it -

Code: Select all

mkdir /var/run/dbus
EDIT Feb 21 2008
DBus-1.0.2.pet repackaged to include the necessary directory: /var/run/dbus
Last edited by tempestuous on Thu 21 Feb 2008, 09:14, edited 1 time in total.

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

#22 Post by John Doe »

...John Doe...
i'm still out here and keep following this thread. perhaps i can contribute some thought at some point.

working on scripting the building of all my packages right now. it's a huge pain.

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#23 Post by Béèm »

Tempestuous wrote:OK, we should be able to fix that. I compiled these DBus/Bluetooth packages in Puppy 3, which already has /var/run/dbus
but apparently you are using Puppy4, which does not have this directory. So let's create it -
Code:

Code: Select all

mkdir /var/run/dbus
Now try again.
Tempestuous,
Sorry if I sounded a bit harsh, but I am glad I can pioneer a bit, with the extra 'burden' of Puppy 4. :wink:

Back to business.
Creating the directory did the trick.
I can use hcitool and sdptool commands.

But when I select on the phone (a Sony-Ericsson K700i) to scan for devices on bluetooth, a device Bluez (0) is found
Good sign probably.
But when I want to add this device to 'my devices' on the phone, I am asked for a, access code.
I give the one to start the phone, but that one isn't accepted.
So I have the feeling the Bluez support somewhere has an access code to be verified.
I tried 0000, 1234, 9999, 0 to no avail.
I don't know even how many positions it should have.
Do you know that one?

I then tried obexftp
But none of the commands execute.
I get the message:
Scanning...........
then after awhile:
Using 00:16:20:19:E8:89 K700i
Failed to connect to SDP server: File descriptor in bad shape.

I then tried obexftpd -b K700i
The message comes on the PC: Waiting for connection.....
When I try to initiate transfers from the phone to the PC, the phone finds the Bluez (0) device, wants to connect to it and asks again the access code.
As I don't have the correct one, I have to abandon.

But I am feeling, that if I had the correct code, I would be able to do much more.

So it is important to find that access code.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

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

#24 Post by tempestuous »

Béèm wrote:I can use hcitool and sdptool commands.
OK, at that point DBus and Bluetooth are up and running. Until I buy a new phone with bluetooth, that's as much as I know.
Béèm wrote:when I select on the phone (a Sony-Ericsson K700i) to scan for devices on bluetooth, a device Bluez (0) is found
Good, your phone can see the computer. "Bluez" is the device name specified in /etc/bluetooth/hcid.conf, and "0" is the device ID.
You can change that name if you wish.

Now some more pioneering is required to go further!

giac_fab gives instructions to copy files here -
http://www.murga-linux.com/puppy/viewto ... 653#155653
These commands are particularly interesting -

Code: Select all

dbus-send --system --dest=org.bluez /org/bluez/hci0 \ # this line make pc visibile
org.bluez.Adapter.SetMode string:discoverable # this line make pc visibile
sleep 3
hciconfig hci0 class 0x3e0100 # this line seems not be load automaticaly from hcid.conf
I think that at some stage a bluetooth PIN will be required. In an earlier post giac_fab talked about creating a script which echoes the PIN, then he specified this script as the "pin_helper" in the configuration file /etc/bluetooth/hcid.conf -
http://www.murga-linux.com/puppy/viewto ... 534#139534
... but I found a good HOWTO here
http://www.gentoo.org/doc/en/bluetooth-guide.xml
which explains that "pin_helper" is only used with older versions of bluetooth-utils.
So it seems that the correct way to set the bluetooth PIN is either;

1. change the "passkey" line in /etc/bluetooth/hcid.conf
Then modify /etc/bluetooth/hcid.conf to include "security auto" (not "security user")

or 2. Use the "passkey-agent" utility (which I included as part of bluez-utils) like this -

Code: Select all

passkey-agent --default <mypinnumber>
or 3. Create a file /etc/bluetooth/pin which contains just your pin number. (??)

User avatar
mbutts
Posts: 230
Joined: Sat 11 Nov 2006, 13:36
Location: sitn on an iceburg waiting for my next meal to swim by.

#25 Post by mbutts »

I've got a question concerning modprobe.

Load all necessary kernel modules -
Code:
modprobe rfcomm
modprobe hci-usb
modprobe bluetooth
modprobe l2cap

If you get bluetooth or any other device to work after doing modprobe and you shut down and save your work, will the device work the next time you reboot either if the device is plugged in during boot, or plug it in after the system has finished rebooting.
Can you think of modprobe as "loading a driver"?

I guess what I am asking is if you install all the librarys, and do a restart, will Linux modprobe and find all the modules automatically during boot or do you still need to type in modprobe from command prompt?

I'm still working on things like creating ACM0 and have had success from time to time with that and done the linking but am still not 100% clear in my mind what is going on. Hopefully at some point I will be able to finish adding hardware to my Puppy.
I have been working on a couple cell phones, Kyocera kx12 and Motorola Razr. I know some people have gotten Razrs to work in Linux but I'm not sure the kx12 will ever work. When I Look at USB devices with the Kyocera, it's always in red no matter what I try with modprobe even with vendor and device numbers after it. Today I am going to try to get the Razr to work, maybe with bluetooth. So far when using Puppy, I have been able to boot with the Razr plugged in and it starts charging through the USB cable. At least it has the second option of bluetooth connections.
One thing that I have noticed with cell phones is sometimes they get confused and you either have to shut them down or take the battery out to reset them.
I've been quietly reading threads on cell phones, bluetooth and file sharing between computer for quite some time and am slowly learning things.
I have IOgear gbu211 bluetooth dongles, and a Dlink dbt-120 that is supposed to be made for just Macs that I'm going to play with today with the Razr
I hope I haven't hijacked the thread, but when reading that it brought up a question I wanted to ask.
I see in another thread a newbie asked for a step by step on setting up bluetooth that keeps you from having 20 open tabs on your browser to see what everyone has said about it.
I'm not the brightest bulb on the tree most times, but I'm willing to keep trying till I get something working.
Thanks in advance for any comments on modprobe. :)
Oh btw, thx tempestuous, Beem, and all the rest of the members for all your posts on these topics.
Penguin, the OTHER white meat.
[url=http://www.puppyos.com][img]http://img293.imageshack.us/img293/5563/yxudnslbsx1jpglx3.png[/img][/url][img]http://i18.tinypic.com/2wd7o80.gif[/img]

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#26 Post by Béèm »

Tempestuous wrote:So it seems that the correct way to set the bluetooth PIN is either;

1. change the "passkey" line in /etc/bluetooth/hcid.conf
Then modify /etc/bluetooth/hcid.conf to include "security auto" (not "security user")

or 2. Use the "passkey-agent" utility (which I included as part of bluez-utils) like this -
Code:
passkey-agent --default <mypinnumber>

or 3. Create a file /etc/bluetooth/pin which contains just your pin number. (??)
For the moment I concentrate on the access code (pin number)
The passkey-agent doesn't seem to work, so I edited the referenced files by hand.
Don't know if I have to restart dbus, hcid etc..
Again the BlueZ (0) device is found and I try to pair giving the passkey I gave.
Still the same answer on my phone, 'access code doesn't match.
I launched hcidump so I see the activity.

Code: Select all

# hcidump
HCI sniffer - Bluetooth packet analyzer ver 1.40
device: hci0 snap_len: 1028 filter: 0xffffffff
> HCI Event: Connect Request (0x04) plen 10
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: PIN Code Request (0x16) plen 6
< HCI Command: PIN Code Request Reply (0x01|0x000d) plen 23
> HCI Event: Command Complete (0x0e) plen 10
< HCI Command: PIN Code Request Negative Reply (0x01|0x000e) plen 6
> HCI Event: Command Complete (0x0e) plen 10
> HCI Event: Connect Complete (0x03) plen 11
I suppose > is traffic from the phone.
I conclude that the pin code given by BlueZ (0) to the phone is wrong for some reason.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#27 Post by Béèm »

A supplementary question.
If the pin code is numeric does it has to be between double quotes in the hcid.conf and pin file?
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

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

#28 Post by tempestuous »

Béèm and shenen,
I just posted a HOWTO for making a bluetooth connection from Palm devices to J-Pilot in Puppy.
http://www.murga-linux.com/puppy/viewto ... 442#173442
This HOWTO is only theory, from various pieces of information on the web.
You will see that it's necessary to create an RFCOMM connection, using this command -

Code: Select all

rfcomm connect 0 ...
Maybe this RFCOMM connection is necessary to copy files from phone?

User avatar
Whitesnow
Posts: 118
Joined: Tue 20 Nov 2007, 19:18
Location: Italy

BT password problem SOLVED

#29 Post by Whitesnow »

Hi everybody (why don't we say hello each other in forums and newsgroups? :wink: ), I hope that helps:

1. open a terminal and write

Code: Select all

passkey-agent --default <password that you want to set> <MAC ADDRESS of your device>
. It seems that nothing happens, but don't close the terminal, leave it alone and open another one.
2. In the new terminal, write

Code: Select all

rfcomm connect /dev/rfcomm0 <MAC ADDRESS of your device> <channel of your device>
.
3. Put the password in your device to pair and look in your first terminal. It should show

Code: Select all

Passkey request for device <MAC ADDRESS of your device>
After pairing, you can close this terminal, if you want.
4. If all went well, now in the second terminal you can read

Code: Select all

Connected /dev/rfcomm0 to <MAC ADDRESS of your device> on channel <channel of your device>
Press CTRL-C for hangup
Now you have established the connection. Enjoy! :D

Please, NOTE:

If you don't know MAC ADDRESS of your device or channel of your device, before start from point 1, open a terminal and write

Code: Select all

sdptool search dun
and in the line after the word "Inquiring", you can find a code (numer and letter) that is your MAC ADDRESS.
To find your channel, look in the line that start with the word "Channel".

Tempestous, please read, maybe useful. :)

You can also not insert in pet bluetooth and l2cap modules. When you modprobe and try to use rfcomm and hci_usb modules, rfcomm auto-creates bluetooth and l2cap modules.

From the first page, now. This code can't work because "bluetooth" is a directory. In the original thread, there's another one thing written (~ not >!), but I can't understand how mounting device dirs to the directory bluetooth. :?:
Tempestous wrote:

Code: Select all

mkdir /mnt/bluetooth  ## this only needs to be done the first time 
obexfs -b <phone address> -B <bluetooth channel> /mnt/bluetooth
Last thing: when you start hcid it seems that you don't need to insert

Code: Select all

hciconfig hci0 up
because I found in my logs that it's alredy up in a step when I launch my Internet script (that uses hcid first and then rfcomm and pppd).

Bye and THANK YOU for your hard work on BT. :D
[b][i][color=darkred][size=134]*.* Snow *.*[/size][/color][/i][/b] :wink:

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

#30 Post by tempestuous »

I now have a Motorola K1 mobile phone with bluetooth, so I tested the bluetooth commands and updated the instructions in the first post.

I also updated "HowTo sychronise J-Pilot with a Palm device via bluetooth" here -
http://www.murga-linux.com/puppy/viewto ... 442#173442

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#31 Post by Aitch »

Beem
Rather than continue under the other thread,
I hope this may shed some further light for you

http://www.murga-linux.com/puppy/viewtopic.php?t=18109

as it seems steevieb, with help from John Doe, has got his phone/bluetooth/gprs working

You have come so far, I didn't mean to be rude or upset you, just trying to help

OK?

Aitch

Edit:

http://www.bluez.org/
03.04.2008
Release of bluez-libs-3.30 and bluez-utils-3.30
This release fixes a regression within the D-Bus API and converts all services into plugins now.
http://wiki.bluez.org/

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#32 Post by Béèm »

Aitch,
I don't feel treated rude or I am not upset.
Sorry if you got that impression, in fact I appreciate much your willingness to help.

I just downloaded beta 2 and once installed it could be that I take the matter up again.
As I still use Windows ( :oops: ) and as it works there the priority isn't at the highest point.

But it's still on my to do list. 8)
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#33 Post by Aitch »

OK, Cool

I had a bad experience with misunderstandings, & maybe felt a bit uncertain

May just be a language thing

Aitch :)

Cyberhythm
Posts: 2
Joined: Fri 02 May 2008, 21:10
Contact:

#34 Post by Cyberhythm »

Either there's a problem with the openobex .pet or I've got a sick puppy. The other packages install ok but that one comes up with an error message about a corrupted file or not expanding into its own directory.

Using puppy v4 beta 2 (for about a week now and most impressed with it's performance on this old Toshy sat pro 4600 with only 128mb).

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

#35 Post by tempestuous »

OpenOBEX package uploaded again, May 3rd 2008.

Post Reply