Bluetooth & D-Bus, January 08

Core libraries and systems
Message
Author
Caneri
Posts: 1513
Joined: Tue 04 Sep 2007, 13:23
Location: Canada

#41 Post by Caneri »

@steevieb and All,

Hey..big thanks for the link..it works now.

There was a command to use that finally did the trick....

modprobe bluetooth
modprobe l2cap
modprobe rfcomm
modprobe hci-usb

Then I ran hcitool scan in the console (I had to push the reset button on the mouse while the scan was working as the mouse is not seen without the reset mode flashing).

Then I used hidd --connect (and plugged in the hardware address)..hooray!

Now I just need to make it load automatically at boot and slow down the mouse a tad.

Thanks all for the info..great...I'm wireless..:-)

EDIT: I'm using Dingo Alpha 5 and the .pets from tempestuous from this thread.

Best,
Eric
[color=darkred][i]Be not afraid to grow slowly, only be afraid of standing still.[/i]
Chinese Proverb[/color]

Caneri
Posts: 1513
Joined: Tue 04 Sep 2007, 13:23
Location: Canada

#42 Post by Caneri »

Hi All,

I have made a few changes to get the Logitech bluetooth travel mouse to load automatically....it's not elegant but so far it works.

I seem to have to hit the reset button on the mouse for this to work however...I haven't figured that one out yet.

In /etc/rc.d/rc.local I put these lines...

modprobe bluetooth
modprobe hipd
modprobe l2cap
modprobe rfcomm
modprobe hci-usb
hciconfig hci0 up
#hidd --search
#hcitool inq
#hidd --connect "hardware address without the quotes"

This doesn't seem to work properly so I made a script that does work and I put it into /startup....so far so good.

I noticed the mouse dropped the connection after a time of inactivity and hitting the reset seemed to activate it again.

I am attaching the script from my /startup folder so if anyone has a way to activate the mouse without the reset button that would be great. Or any other directions are appreciated.

Thanks all for the howto,
Eric

EDIT: I am using Dingo alpha 5 on a core2 duo lappy and the bluetooth module loads without the modprobe bluetooth in the rc.local..I just had it there from other attempts.
Attachments
logitech-travel-mouse.tar.gz
(209 Bytes) Downloaded 936 times
[color=darkred][i]Be not afraid to grow slowly, only be afraid of standing still.[/i]
Chinese Proverb[/color]

chicks
Posts: 65
Joined: Mon 22 Oct 2007, 18:20

#43 Post by chicks »

So, I followed the instructions at the top of this thread, and got the A2DP profile working from my Puppy laptop to my SoundDock clone via an Insignia bluetooth adapter found on ebay. Great wireless sound!

Built a script and put it in Startup folder, works great. Now, would like to get it working when needed, that is when I plug in the USB Bluetooth dongle. Where would I need to put the scripts to get hotplug working?

User avatar
Chewi
Posts: 30
Joined: Sun 17 Aug 2008, 13:37
Location: Perth, Scotland

#44 Post by Chewi »

As you can see from my new signature, I now have a working Bluetooth mouse on my very special machine thanks to your efforts. I hope to add networking soon. I'm still getting to grips with Bluetooth in general but this helped me to understand it a bit better.

Even if Puppy doesn't officially embrace Bluetooth anytime soon, I highly recommend that it at least look at DBus. I think DBus is Linux's unsung hero of the moment. It's doing wonders for making the newest distros easier to use and I think its usage is only set to increase.
Running Puppy 4.00 on a [i]Toshiba Libretto 70CT[/i]. That's a [b]Pentium 120MMX[/b], [b]32MB RAM[/b] machine the size of a [b]VHS cassette[/b]! It works like a charm. I even have [b]wireless[/b] (WPA) and [b]Bluetooth[/b]. :D

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

#45 Post by Aitch »

Hi Chewi

Had to post this, as I just read it, then found your post, so...

http://www.puppylinux.org/community/blo ... of-concept

so if playdayz is right about slowdown, dbus may not be the answer, it appears

Aitch

User avatar
Chewi
Posts: 30
Joined: Sun 17 Aug 2008, 13:37
Location: Perth, Scotland

#46 Post by Chewi »

Ah well. I wouldn't have thought DBus was slow, all it does is pass messages around. Maybe it needs some optimising.

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

#47 Post by Aitch »

He He

I would have thought your Libretto to be the perfect testbox for that :wink:

Even beats my IBM 560 @ 223mhz/64mb ram, but makes up for the 'speed' by having no native floppy or CD - & wifi & bluetooth is just greedy :lol:

well done!

Aitch

User avatar
Chewi
Posts: 30
Joined: Sun 17 Aug 2008, 13:37
Location: Perth, Scotland

#48 Post by Chewi »

Thanks!

Did a search for "dbus slow" out of interest and got this. It was a while ago though.
Most of the time in FOSS, people try to make the theory work before improving. That's why DBus is still unoptimised and really slow. It's slower than ORBit2/Bonobo !!
I also found this PDF, which does a benchmark. It says DBus is probably slower because it uses text rather than pointers. I knew that but like the author, I didn't expect it to be THAT much slower.
Running Puppy 4.00 on a [i]Toshiba Libretto 70CT[/i]. That's a [b]Pentium 120MMX[/b], [b]32MB RAM[/b] machine the size of a [b]VHS cassette[/b]! It works like a charm. I even have [b]wireless[/b] (WPA) and [b]Bluetooth[/b]. :D

tommy
Posts: 133
Joined: Tue 04 Oct 2005, 20:21
Location: Italy

Bluetooth in Puppy 4.00

#49 Post by tommy »

Hi everybody, I just want to write about my bluetooth experience in Puppy 4.00. Well, I don't need bluetooth at all, but I have an unused TRENDnet bluetooth usb dongle and I wanted to play with it to see the capabilities of tempestuous packages...
I installed the Dbus, the BlueZ, the Obex dotpet packages I found in page 1 of this thread, I edited the passkey in /etc/bluetooth/hcid.conf (and I found security user was already there instead of security auto), I modprobed all the necessary modules. Then I registered on my phone my bluetooth dongle ( this is the moment where your phone asks you the passkey you wrote in hcid.conf file).
Then I mounted the phone in /mnt/bluetooth with obexfs : this gave me this message:
shell-init: error retrieving current directory: getcwd: cannot access parent directory: No such file or device.

However I could browse my phone directories with Rox and transfer files from the phone to my PuppyPC. I tried to transfer a jpg file from my Pc to my Phone, and Rox gave me an error about something not implemented - failed. The file was successfully transferred to the phone, though!

So what can I say? Bluetooth file transfer in Puppy 4.00 was for me quite easy, and I'm not an expert linux user. But the transfer speed is very slow, I think it's about 10 kB/sec. (will there be a Rutilt-like app (or should I say Pwireless-like?) to see the signal strenght and max speed of bluetooth connections?).

Well, if you need to copy your pictures / videos from the phone to your PC and vice-versa, tempestuous' tutorial and Dotpet packages can help you a lot. Good work! :wink:

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

Re: Bluetooth in Puppy 4.00

#50 Post by John Doe »

tommy wrote:But the transfer speed is very slow, I think it's about 10 kB/sec.
perhaps the difference between 1.x vs 2.x?

great report, thanks for sharing.

paulski
Posts: 130
Joined: Fri 06 Oct 2006, 15:30
Location: Cologne, Germany &/or Perth, Australia

Script toolbox for 2 Nokia phones on bluetooth

#51 Post by paulski »

Thanks to the excellent work done in this thread I created a few scripts with an xdialog as a kind of script tool box allowing me to connect two different Nokia phone models (6230i and 7310) over a USB bluetooth device. Its still developmental but it may provide a start for others to make more intelligent scripts or at least a few ideas.
It should make the process a little easier for beginners.

So far it allows:
1- Basic USB HCI startup, Dbus and password agent
2- Scan for phones (hcitool scan)
3- Obex connections for the two phones with auto Rox filer opening
4- rfcomm ports for the phones allowing contacts, sms, calendar data to be used by either xgnokii or wammu with auto copying of the configuration scripts for these phones
5 Disconnect scripts for the phones

Unfortunately to get it up and running you need to modify details (phone model numbers and MAC addresses in filenames and scripts).

Have a look - try it, modify it break it- whatever.
If someone can find out how to parse MAC addresses from hcitool scan to other scripts and functions then it could easily be much more powerful.

EDIT: Found a way to parse it.!!
Now have a simplified Xdialog script (the toolbox4 nokia ....2a version) that autodetects the MAC of only one phone and allows you to connect it rfcomm or Obex.
No support for wammu or gammu in this one.
Should get some starters off the ground. May even work for a few non Nokia bluetooth phones.

For specific Nokia with Puppy issues see this thread:
http://www.murga-linux.com/puppy/viewtopic.php?t=35321

Try to keep this bluetooth thread strictly bluetooth.
Attachments
toolbox4nokia-bluetooth-2a.tar.gz
(1.42 KiB) Downloaded 914 times
toolbox4nokia-bluetooth.tar.gz
(3.85 KiB) Downloaded 877 times
Last edited by paulski on Sat 15 Nov 2008, 16:46, edited 1 time in total.

Boneo
Posts: 44
Joined: Thu 06 Jul 2006, 23:48
Location: UK

#52 Post by Boneo »

I've just surprised myself and got my Microsoft 5000v1.0 bluetooth mouse working with my Acer Aspire One netbook, This is really a big step forward because I don't like the track pad. It's working well but unfortunately I suspect my mouse wont work after a reboot but at least this is a start.

Thanks to tempestuous (again) I followed most of things in his first post, There's no passkey with my mouse so in etc/bluetooth/hcid.conf file the default passkey is changed from "BlueZ" to being empty "" and so also in the entry passkey-agent --default &
I didn't need a channel number.
Moving on to advice from Caneri (thanks) I used hcitool scan whilst pressing the scan button on the mouse thus finding the MAC followed then by hidd -connect hardware address. I did earlier download the DBus packages but I'm not sure if these were necessary.

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

#53 Post by tempestuous »

Boneo wrote:I did earlier download the DBus packages but I'm not sure if these were necessary.
Unless there's something special about a bluetooth mouse, then D-Bus is absolutely essential. Without it the Bluetooth Host Controller Interface daemon (hcid) will fail to start.

Boneo
Posts: 44
Joined: Thu 06 Jul 2006, 23:48
Location: UK

MS Bluetooth Mouse 5000v1.0 working on an Acer Aspire One

#54 Post by Boneo »

Thanks folks, I've got my mouse working at bootup on my AA0 after getting eth0 and ath0 configured I moved onto bluetooth. I downloaded the 5 D-bus related packages from page one of this thread.

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

I got an error message which I interpreted as needing to install libxcb-1.0 I did but I'm not sure if this was necessary.

In /etc/rc.d/rc.local the first two lines at the beginning are for the AA0's wifi LEDs. Here's the whole file contents. The MAC address is for my mouse which I discovered by following the earlier instructions.

W#this file called from rc.sysinit
#you can edit this file
#When firewall is installed, will append lines to this file...
modprobe evdev
sysctl -w dev.wifi0.ledpin=3
sysctl -w dev.wifi0.softled=1

rm -f /var/run/dbus/*
dbus-uuidgen --ensure
dbus-daemon --system
modprobe bluetooth
modprobe l2cap
modprobe rfcomm
modprobe hci-usb
hcid
sdpd
hciconfig hci0 class 0x3e0100
hcitool inq
passkey --default &
hcitool scan
hidd --connect "00:1B:D8:93:98:BD"

Hope this helps others.

Edit: For some reason sometimes the mouse isn't found at bootup and I'm having to run again in the console-
hidd --connect "00:1B:D8:93:98:BD"

Perhaps when the mouse is switched on is important.

2nd Edit: In the Startup directory I also created a file with the line
hidd --connect "00:1B:D8:93:98:BD"
This seems to increase the chance of connecting to the mouse. Typically at bootup I find there's a pause where it seems to me looking for the mouse then I press the scan button under the mouse.

testato
Posts: 1
Joined: Sun 23 Nov 2008, 20:02

#55 Post by testato »

Thanks for your work.
i have 2 problem:

- i found the phone end retrive the correctly the mac address but not found any service.

- If i try search puppy from the phone i not found the pc

ecke
Posts: 4
Joined: Wed 14 Jan 2009, 09:39

#56 Post by ecke »

Hello,

i had started the packages from tempestuous, but there i have the problem, that i get a message that the programm is installed, but there are many failure's.
So my question is, is it normal, that at the end of the installation the package-installer write so many failure's ???

Sorry, for my bad english!

Edwin

User avatar
Chewi
Posts: 30
Joined: Sun 17 Aug 2008, 13:37
Location: Perth, Scotland

#57 Post by Chewi »

I've just found out about an alternative bluetooth stack called Affix. I gather that it's a worthy alternative to Bluez though I haven't been able to find a single piece of information about why it was written or what makes it better than Bluez. I haven't tried it myself but I suspect it doesn't require HAL/DBus. Maybe it's worth a look?
Running Puppy 4.00 on a [i]Toshiba Libretto 70CT[/i]. That's a [b]Pentium 120MMX[/b], [b]32MB RAM[/b] machine the size of a [b]VHS cassette[/b]! It works like a charm. I even have [b]wireless[/b] (WPA) and [b]Bluetooth[/b]. :D

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

#58 Post by Aitch »

Hi Chewi

It seems to me that Bluez is currently well supported, whereas Affix documentation, at least, is 2001 Nokia copyright

There may be circumstances where affix can connect devices which fail with Bluez - like you, untested [good find, btw]

I don't know if Béèm ever got his bluetooth problem sorted, it was a while ago......?

Aitch :)

User avatar
Chewi
Posts: 30
Joined: Sun 17 Aug 2008, 13:37
Location: Perth, Scotland

#59 Post by Chewi »

Hmm I hadn't noticed that it hasn't been update since 2005. Oh well.
Running Puppy 4.00 on a [i]Toshiba Libretto 70CT[/i]. That's a [b]Pentium 120MMX[/b], [b]32MB RAM[/b] machine the size of a [b]VHS cassette[/b]! It works like a charm. I even have [b]wireless[/b] (WPA) and [b]Bluetooth[/b]. :D

User avatar
gary101
Posts: 555
Joined: Sun 08 Oct 2006, 09:51
Location: Boston, Lincs. UK

#60 Post by gary101 »

Hi

I am just taking my first steps into bluetooth, the ultimate aim for me is being able to use a bluetooth headset with skype.

I have installed all the pets I need from this thread apart from one that gives an error message about expanding into its own directory in .packages.

The problem pet is Bluetooth-alsa-sbc+plugz.pet and I am running 4.12

I have downloaded several times in case of a corrupt download and cleaned up .packages on each failed install.

When downloaded the file is named with a % instead of a + and I have renamed before install with no success.

I am wondering if this problem is just with 4.12. can anyone give me any pointers to getting this package installed?

All the best

Gary

Post Reply