Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 21 Oct 2014, 22:08
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » System
Bluetooth & D-Bus, January 08
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 2 of 7 Posts_count   Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
Author Message
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Thu 07 Feb 2008, 15:31    Post_subject:  

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:
# dbus-uuidgen --ensure
#
is working.
But:
Code:
# 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).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send_private_message 
shenen

Joined: 03 Dec 2006
Posts: 39

PostPosted: Thu 07 Feb 2008, 17:33    Post_subject:  

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?an=1&subarticlenbr=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.
Back to top
View user's profile Send_private_message 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Thu 07 Feb 2008, 18:05    Post_subject:  

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).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send_private_message 
tempestuous

Joined: 10 Jun 2005
Posts: 5271
Location: Australia

PostPosted: Thu 07 Feb 2008, 18:30    Post_subject:  

Béèm wrote:
Code:
# 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/viewtopic.php?p=155653#155653
http://www.murga-linux.com/puppy/viewtopic.php?p=162941#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.
Back to top
View user's profile Send_private_message 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Thu 07 Feb 2008, 20:51    Post_subject:  

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:
# 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).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send_private_message 
tempestuous

Joined: 10 Jun 2005
Posts: 5271
Location: Australia

PostPosted: Thu 07 Feb 2008, 22:57    Post_subject:  

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/viewtopic.php?p=115474#115474
I have just edited my first post to emphasize the importance of using my latest DBus/Bluetooth dotpets.

Béèm wrote:
Code:
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:
mkdir /var/run/dbus

EDIT Feb 21 2008
DBus-1.0.2.pet repackaged to include the necessary directory: /var/run/dbus

Edited_time_total
Back to top
View user's profile Send_private_message 
John Doe

Joined: 01 Aug 2005
Posts: 1689
Location: Michigan, US

PostPosted: Fri 08 Feb 2008, 04:26    Post_subject:  

wrote:
...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.
Back to top
View user's profile Send_private_message 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Fri 08 Feb 2008, 06:16    Post_subject:  

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:
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).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send_private_message 
tempestuous

Joined: 10 Jun 2005
Posts: 5271
Location: Australia

PostPosted: Fri 08 Feb 2008, 07:55    Post_subject:  

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/viewtopic.php?p=155653#155653
These commands are particularly interesting -
Code:
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/viewtopic.php?p=139534#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:
passkey-agent --default <mypinnumber>

or 3. Create a file /etc/bluetooth/pin which contains just your pin number. (??)
Back to top
View user's profile Send_private_message 
mbutts


Joined: 11 Nov 2006
Posts: 231
Location: sitn on an iceburg waiting for my next meal to swim by.

PostPosted: Fri 08 Feb 2008, 10:24    Post_subject:  

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. Smile
Oh btw, thx tempestuous, Beem, and all the rest of the members for all your posts on these topics.

_________________
Penguin, the OTHER white meat.

Back to top
View user's profile Send_private_message 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Fri 08 Feb 2008, 14:10    Post_subject:
Sub_title: Pin number
 

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:
# 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).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send_private_message 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Fri 08 Feb 2008, 19:50    Post_subject:  

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).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send_private_message 
tempestuous

Joined: 10 Jun 2005
Posts: 5271
Location: Australia

PostPosted: Mon 11 Feb 2008, 02:27    Post_subject:  

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/viewtopic.php?p=173442#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:
rfcomm connect 0 ...

Maybe this RFCOMM connection is necessary to copy files from phone?
Back to top
View user's profile Send_private_message 
Whitesnow


Joined: 20 Nov 2007
Posts: 103
Location: Italy

PostPosted: Wed 12 Mar 2008, 10:15    Post_subject:  BT password problem SOLVED
Sub_title: How to pair BT devices
 

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:
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:
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:
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:
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! Very Happy

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:
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. Smile

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. Question
Tempestous wrote:
Code:
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:
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. Very Happy

_________________
*.* Snow *.* Wink
My repo: http://qualapinna.dyndns.org/repo
My blog: http://qualapinna.dyndns.org
Back to top
View user's profile Send_private_message Visit_website 
tempestuous

Joined: 10 Jun 2005
Posts: 5271
Location: Australia

PostPosted: Mon 07 Apr 2008, 11:20    Post_subject:  

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/viewtopic.php?p=173442#173442
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 2 of 7 Posts_count   Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » System
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1221s ][ Queries: 12 (0.0039s) ][ GZIP on ]