WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: bluetooth  (Read 6734 times)

Offline eclectic-os

  • Newbie
  • *
  • Posts: 18
bluetooth
« on: April 10, 2009, 12:25:07 PM »
Installed bluez-tce, pair-icon is visible, but what's next?

Expected clicking on icon would start a window to enter pincode, to search for devices etc.? But nothing shows up  :-\

(Have no problem with phone connecting to same box using windows, once spent a  lot of time in connecting bluetooth-phone to another linux, but can't recall steps undertaken).

Who is willing to help me get connected?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: bluetooth
« Reply #1 on: April 10, 2009, 01:35:58 PM »
As per the bt.tcel.info file:
Code: [Select]
Requires bluetooth-2.6.26.tcem, usb-utils.tcel, dbus_glib.tcel
                and glib2.tcel
                Optionally can use alsa.tcel, obex.tcel and fuse.tcel
                ----------
                Howto:
                load the appropriate bt modules for your hardware, then
                $ sudo mkdir -p /var/lib/dbus
                $ sudo dbus-uuidgen --ensure
                $ sudo mkdir /var/run/dbus
                $ sudo dbus-daemon --system
                $ sudo mkdir /etc/dbus-1/session.d
                $ sudo bluetoothd

..and as per bluez-gnome.tcel.info:
Code: [Select]
Requires bt-4.17.tcel, dbus_glib.tcel and gtk+-2.12.11.tcel..so i need to update the .info file, but the .dep file is OK.

In my case "load the appropriate bt modules for your hardware" means:
Code: [Select]
$ sudo modprobe bluetooth
$ sudo modprobe hci_usb
$ sudo modprobe l2cap 
$ sudo modprobe rfcomm
$ sudo modprobe bnep 
$ sudo modprobe sco

If you downloaded bt.tcel and bluez-gnome.tcel via the appbrowser then you will have all the neccessary extensions loaded.

Does this make things a little clearer?

Offline eclectic-os

  • Newbie
  • *
  • Posts: 18
Re: bluetooth
« Reply #2 on: April 11, 2009, 11:26:50 AM »
Thanks for reply, clicking on bt-icon shows a window. Now I'm stuck because my phone doesn't show up (yet)  :(

I'm having some questions though. As I wrote in my first line, thought I installed bluez.tce. But of course, that was wrong, I installed bluez-gnome.tcel, a library. Bluez-gnome loads bt.tcel, but as a user I won't read the bt.tcel info, so I will not be aware of issuing commands (because I'm spoiled  ;), I don't even expect to issue a command, especially because I use TCL without any persistency)?

What I expected, is an install like the other exensions, for example 'bluetooth.tce' which gets everything done in one 'user-step'. Don't know if that's possible, or someone can make this happen?



 


Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: bluetooth
« Reply #3 on: April 11, 2009, 01:34:24 PM »
I thought about making a script for this, but the problem is that it is (probably) not possible to know what modules a user would need for his/her bluetooth hardware in advance.

If the bluez-gnome window is blank, then I would guess that either your machines bluetooth is not activated, or your phone is not "discoverable".

Once you know which modules work for your hardware, it is not too difficult to make a bluetooth start-up script (this is what I do).

What bluetooth hardware do you have?

Offline eclectic-os

  • Newbie
  • *
  • Posts: 18
Re: bluetooth
« Reply #4 on: April 11, 2009, 06:30:48 PM »
If the bluez-gnome window is blank, then I would guess that either your machines bluetooth is not activated, or your phone is not "discoverable".
My machines bluetooth is no activated because I didn't load modules yet.

Quote
What bluetooth hardware do you have?
Don't know, remember there was a command to find out ....

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: bluetooth
« Reply #5 on: April 11, 2009, 11:41:09 PM »
With your bluetooth device plugged-in and/or enabled, one of these two commands should help identify it:
Code: [Select]
$ lspci
$ lsusb

Note that for "lsusb" to work, you will need to load the usb-utils extension.

As an example, on my laptop:
Code: [Select]
$ lsusb
...
Bus 002 Device 004: ID 413c:8140 Dell Computer Corp. Wireless 360 Bluetooth

Offline eclectic-os

  • Newbie
  • *
  • Posts: 18
Re: bluetooth
« Reply #6 on: April 12, 2009, 06:01:18 AM »
lsusb shows a Cambridge Silicon Radio bluetooth dongle (HCI mode).

(Just for curiousity, why not integrate in cpanel?)


Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: bluetooth
« Reply #7 on: April 12, 2009, 06:48:09 AM »
I'd hazard a guess that your bluetooth dongle would work with the same modules as mine, but you might also need hci_vhci.ko.gz and/or hci_uart.ko.gz and/or led-class.ko.gz

You could give this a go:

First use the appbrowser or load the extensions manually (bluetooth-2.6.26.tcem, usb-utils.tcel, dbus_glib.tcel, glib2.tcel, bt.tcel, gtk2.tcel, atk.tcel, cairo.tcel, pango.tcel, pixman.tcel, expat2.tcel, graphics-libs-1.tcel, libxml2.tcel, fontconfig.tcel, ttf-bitstream-vera.tce)

Then try this:
Code: [Select]
$ sudo modprobe bluetooth
$ sudo modprobe hci_usb
$ sudo modprobe l2cap 
$ sudo modprobe rfcomm
$ sudo modprobe bnep 
$ sudo modprobe sco
$ sudo mkdir -p /var/lib/dbus
$ sudo dbus-uuidgen --ensure
$ sudo mkdir /var/run/dbus
$ sudo dbus-daemon --system
$ sudo mkdir /etc/dbus-1/session.d
$ sudo bluetoothd

Then see if you see anything in the bluez-gnome window. If it works then great, if it doesn't work, it would be useful if you could paste any error messages and the results of "dmesg | tail -25" here for troubleshooting purposes.

Offline eclectic-os

  • Newbie
  • *
  • Posts: 18
Re: bluetooth
« Reply #8 on: April 15, 2009, 02:04:18 AM »
Thank you, phone gets connected  ;D

Remember I used some gui to transfer files, can't remember it's name now, browsing the extensions doesn't give me a hint. Is there a gui available?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: bluetooth
« Reply #9 on: April 15, 2009, 02:22:53 AM »
Quote
Remember I used some gui to transfer files, can't remember it's name now, browsing the extensions doesn't give me a hint. Is there a gui available?

That depends  :)

You can use the obex and fuse extensions to transfer files to/from a phone/pda/etc from a terminal window. In some cases you can "mount" your phone/pda file system in tinycore and then use the emelfm/emelfm2 extensions as a gui to transfer files.

With my old se p900 I used to be able to mount its file system, but with my new se p1i, I cannot - this is apparently due to the way obex is implemented on the p1i.

With the obex and fuse extensions loaded in addition to all of the bt/bluez-gnome extensions, something like this might work:
Code: [Select]
$ sudo mkdir /mnt/pda
$ sudo obexfs -b 00:1E:45:8B:2A:33 /mnt/pda
$ ls /mnt/pda                     
External D  Internal
$ ls /mnt/pda/Internal
Music     Picture   Video     document  other
..where 00:1E:45:8B:2A:33 is the bt address of your phone/pda

Once the mount point /mnt/pda is established, you can use emelfm to transfer files.

Offline Roberto A. Foglietta

  • Full Member
  • ***
  • Posts: 212
    • personal home page
Re: bluetooth
« Reply #10 on: April 17, 2009, 06:37:46 AM »
Tinycore 1.2 shows this issue, I do not tested later versions:

Code: [Select]
root@box:/opt# mkdir -p /mnt/roblue
root@box:/opt# obexfs -b 00:21:AB:A1:85:6F /mnt/roblue
root@box:/opt# dmesg | tail -n1
obexfs[7776]: segfault at 8491000 ip b7de1f77 sp b752b0a0 error 6 in libc-2.3.6.so[b7d7c000+10a000]

Please insert this to bt.tc* as /etc/init.d/bluez:

Code: [Select]
#!/bin/sh

start() {
if [ ! -e /var/lib/dbus/machine-id ]; then
mkdir -p /var/lib/dbus
dbus-uuidgen --ensure
fi
if ! pidof dbus-daemon >/dev/null; then
mkdir -p /var/run/dbus
dbus-daemon --system
fi
if ! pidof bluetoothd >/dev/null; then
mkdir -p /etc/dbus-1/session.d
bluetoothd
fi
}

stop() {
killall bluetoothd 2>/dev/null
}

status() {
if pidof bluetoothd >/dev/null; then
echo -e "\nbluetoothd is running.\n"
else
echo -e "\nbluetoothd is not running.\n"
fi
}

case $1 in
start) start
;;
stop) stop
;;
status) status
;;
restart) stop; start
;;
*) echo -e "\n$0 [start|stop|restart|status]\n"
;;
esac

« Last Edit: April 17, 2009, 06:48:43 AM by robang »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: bluetooth
« Reply #11 on: April 17, 2009, 07:22:07 AM »
hey - thanks for the script, I'll look to upgrade bluez to the latest version and add a menu item/icon to launch the script.

I looked through my notes on obexfs and, whereas the "obex folks" thought the problem with mounting a file system over bt was with my se p1i, I found from the bt address that I had managed to mount it, but only when I'd compiled obex against libiconv by mistake.

'More investigation required methinks...

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: bluetooth
« Reply #12 on: April 18, 2009, 06:10:43 AM »
So I did some checking in my archives and, sure enough, the version of openobex compiled against libiconv mounts my se p1i - after starting dbus/bt with "/etc/init.d/bluez" (thanks)

I'll replace the current version of obex with the earlier version.

Code: [Select]
$ sudo mkdir /mnt/p1i
$ sudo obexfs -b 00:1E:45:8B:2A:33 /mnt/p1i
$ sudo ls /mnt/p1i
External D  Internal
$ sudo ls /mnt/p1i/Internal
Music     Picture   Video     document  other
$ sudo ls /mnt/p1i/Internal/Picture
Blue orbit.jpg     Clipart            Frames             Night flower.jpg   Skyline.jpg        Traffic.jpg
Bridge.jpg         Dotted line.jpg    Green light.jpg    Red line.jpg       Sony Ericsson.gif  dcim
Chip.jpg           Firefly.jpg        Horizon.jpg        Reflection.gif     Thread.jpg
..and you can navigate through the file structure quite effectively with emelfm started as root.

After unmounting the phone (or not mounting it in the first place), obexftp also works:
Code: [Select]
$ sudo obexftp -b 00:1E:45:8B:2A:33 -c Internal/Picture -l
Browsing 00:1E:45:8B:2A:33 ...
Connecting..\done
etc, etc
..so, probably easier with emelfm then...

[edited to remove very long line]
« Last Edit: April 19, 2009, 02:23:40 PM by Juanito »

Offline Roberto A. Foglietta

  • Full Member
  • ***
  • Posts: 212
    • personal home page
Re: bluetooth
« Reply #13 on: April 19, 2009, 01:36:09 PM »
your post into code section contains such a long line which makes this thread difficult to visualize and aswer,
Please edit your post and wrap the last code line, thanks.

Offline eclectic-os

  • Newbie
  • *
  • Posts: 18
Re: bluetooth
« Reply #14 on: April 26, 2009, 05:55:40 PM »
Found that gui again:

http://sourceforge.net/projects/obexftpfrontend/

But first will have to to use tcl in a persistent way to be able to use bluetooth  ::)
« Last Edit: April 26, 2009, 06:01:13 PM by eclectic-os »