This is the old SliTaz forum - Please use the main forum.slitaz.org

Slitaz & Bluetooth devices
  • inxeninxen November 2009
    Hi,

    anybody has reached to work fine with a bluetooth device in slitaz ?
    I has installed all packages necessary (like bluez and bluez-dev, linux-bluetooth, libusb...) but I cant detect it with HCI utilities.

    With 'lsusb' command I see my usb-bluetooth-device but it has not defined driver.
    Anybody know what I might do?

    Thanks
  • erniaernia March 2010
    these are the steps i've done to got my nokia n78 connected via bluetooth as a modem:
    root@slitaz:/home/tux# bluetoothd 
    root@slitaz:/home/tux# modprobe btusb
    root@slitaz:/home/tux# hcitool dev
    Devices:
    hci0 00:02:72:xx:xx:xx

    The command hcitool dev shows you that your usbdongle is up as hci0.
    To pair with the phone make your usbdongle discoverable:
    root@slitaz:/home/tux# hciconfig hci0 piscan

    then launch bluez-simple-agent
    root@slitaz:/home/tux# bluez-simple-agent 
    Agent registered

    if you don't get "Agent registered" but some complains about missing python libs install pygobject and dbus-python
    root@slitaz:/home/tux# tazpkg get-install pygobject
    root@slitaz:/home/tux# tazpkg get-install dbus-python

    now search your pc from the phone, you should find slitaz-0. When requested insert a pin code in the phone, you will be prompted for the same pin code by bluez-simple-agent in the terminal where you launched it. Insert the pin and the pairing is done. Put your pc undiscoverable again:
    root@slitaz:/home/tux# hciconfig hci0 pscan

    Find the bt address of the phone:
    root@slitaz:/home/tux# hcitool scan
    Scanning ...
    00:1F:DF:xx:xx:xx Nokia N78

    With
    root@slitaz:/home/tux# sdptool browse 00:1F:DF:xx:xx:xx

    you list the services of the bluetooth device, dialup networking is on channel 1 in my phone, so i've edited /etc/bluetooth/rfcomm :
    #
    # RFCOMM configuration file.
    #

    rfcomm0 {
    # # Automatically bind the device at startup
    bind yes;
    #
    # # Bluetooth address of the device
    device 00:1F:DF:xx:xx:xx;
    #
    # # RFCOMM channel for the connection
    channel 1;
    #
    # # Description of the connection
    # comment "Example Bluetooth device";
    }

    and then modprobe rfcomm and
    rfcomm -i hci0 -f /etc/bluetooth/rfcomm.conf bind all

    now i can wvdial using rfcomm0 as a modem
  • erniaernia March 2010
    if rfcomm give you this error "Can't get device list: Operation not supported"
    you must recompile the kernel module because it has been compiled without tty support which is required. you can check it with:
    root@slitaz:/home/tux# zcat /proc/config.gz | grep RFCOMM                    
    CONFIG_BT_RFCOMM=m
    # CONFIG_BT_RFCOMM_TTY is not set
    root@slitaz:/home/tux#

    i'll fill a bug in slitaz labs.
    if you need it working now you can install linux source, cd in /usr/src/linux-2.6.30.6-slitaz/ and give this command
    make CONFIG_BT_RFCOMM=m CONFIG_BT_RFCOMM_TTY=y M=net/bluetooth/rfcomm
    .
    This will build only the rfcomm module with tty support.
    You will find it in /usr/src/linux-2.6.30.6-slitaz/net/bluetooth/rfcomm/rfcomm.ko.
    Now you can delete the old rfcomm module and copy your module there
    rm /lib/modules/2.6.30.6-slitaz/kernel/net/bluetooth/rfcomm/rfcomm.ko.gz
    cp /usr/src/linux-2.6.30.6-slitaz/net/bluetooth/rfcomm/rfcomm.ko /lib/modules/2.6.30.6-slitaz/kernel/net/bluetooth/rfcomm/

    now it should works
  • jozeejozee March 2010
    ernia: you may like to add this bluetooth support guide to http://doc.slitaz.org/en:guides:start .

    ernia, inxen: Can you also test hwsetup package on lab? hwtestup (tazhw setup bluetooth) setups bluetooth. It automatically does all the initial steps that ernia has described above. After setting up, you can launch bluez-simple-agent
  • erniaernia March 2010
    i've tried hwsetup:
    root@slitaz:/home/tux# tazpkg list-files hwsetup

    Installed files with : hwsetup
    ================================================================================
    /sbin/hwsetup
    /sbin/tazhw
    ================================================================================
    2 files installed with hwsetup.

    root@slitaz:/home/tux# tazhw setup bluetooth
    COMMAND OPTIONS: bluetooth
    installing pkg: usbutils

    usbutils-0.84
    Connecting to mirror.slitaz.org (94.23.60.116:80)
    usbutils-0.84.tazpkg 100% |*******************************************************************************************************************************************************************| 155k 00:00:00 ETA

    Installation of : usbutils-0.84
    ================================================================================
    Copying usbutils-0.84... [ OK ]
    Extracting usbutils-0.84... 311 blocks
    Extracting the pseudo fs... (lzma) 415 blocks
    Installing usbutils... [ OK ]
    Removing all tmp files... [ OK ]
    ================================================================================
    usbutils (0.84) is installed.

    installing pkg: hal-info

    hal-info-20090414
    Connecting to mirror.slitaz.org (94.23.60.116:80)
    hal-info-20090414.ta 100% |*******************************************************************************************************************************************************************| 35256 00:00:00 ETA
    Tracking dependencies for : hal-info-20090414
    ================================================================================
    Missing : hal-extra
    ================================================================================
    1 missing package(s) to install.

    hal-extra-0.5.13
    Connecting to mirror.slitaz.org (94.23.60.116:80)
    hal-extra-0.5.13.taz 100% |*******************************************************************************************************************************************************************| 75252 --:--:-- ETA

    Installation of : hal-extra-0.5.13
    ================================================================================
    Copying hal-extra-0.5.13... [ OK ]
    Extracting hal-extra-0.5.13... 147 blocks
    Extracting the pseudo fs... (lzma) 553 blocks
    Installing hal-extra... [ OK ]
    Removing all tmp files... [ OK ]
    ================================================================================
    hal-extra (0.5.13) is installed.


    Installation of : hal-info-20090414
    ================================================================================
    Copying hal-info-20090414... [ OK ]
    Extracting hal-info-20090414... 69 blocks
    Extracting the pseudo fs... (lzma) 552 blocks
    Installing hal-info... [ OK ]
    Removing all tmp files... [ OK ]
    ================================================================================
    hal-info (20090414) is installed.

    adding tux to lp
    ==========================================================
    Due to a lack of compatible hardware for troubleshooting,
    this bluetooth device has not been properly tested. Please
    report any success, failure, bug to SliTaz Labs or Forums.
    ==========================================================

    Detected PCI devices Kernel modules
    ================================================================================
    > Module in use: nvidia
    * Loaded module: snd_hda_intel
    * Loaded module: k8temp
    ================================================================================


    Detected USB devices Kernel modules
    ================================================================================
    ================================================================================

    Do you want to see if the bluetooth is working (y/N) ? y

    ========================================
    Bluetooth interfaces

    Bus 002 Device 004: ID 0a5c:2101 Broadcom Corp. A-Link BlueUsbA2 Bluetooth
    hci0: Type: BR/EDR Bus: USB
    BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0
    DOWN
    RX bytes:0 acl:0 sco:0 events:0 errors:0
    TX bytes:0 acl:0 sco:0 commands:0 errors:0

    Devices:
    Device is not available: No such device
    ========================================
    Following Bluetooth commands may be of help

    modprobe btusb
    /usr/sbin/bluetoothd -nd #for starting bluetooth daemon
    hciconfig -a
    "hcitool dev" : checking local bluetooth devices...
    "hcitool scan" : scanning remote bluetooth devices...
    You can manually edit the configuration files in /etc/bluetooth if need be
    ========================================
    root@slitaz:/home/tux# hcitool dev
    Devices:
    root@slitaz:/home/tux#

    Unless i'm missing something it detect my usb bt dongle but does not get it up.
  • jozeejozee March 2010
    Yes, its strange. I think "modprobe btusb" didn't work. Upgrade bluez and linux-bluetooth packages.

    Maybe you read the hwsetup script. It does exactly what you have written in your earlier post. If you can debug, it would be useful.
  • erniaernia March 2010
    @jozee
    Real life has called me today, and now i'm migrating to an usb hard disk now because i want to keep only the liveusb on the key. hope to try to debug tomorrow, and note i've said try :)
    i'll put bluetooth on the doc as soon as possible
  • erniaernia March 2010
    @jozee
    tazhw detect_usb_devices does not find my device in modules.usbmap (how is this file created?) so when udev is called at line 598 of hwsetup btusb is not loaded then probably udev does not start bluetoothd.
    if i choose yes at the prompt "Do you want to see if the bluetooth is working (y/N) ? y" hwsetup loads btusb at line 603 but does not start bluetoothd thinking to have it already started by udev. Uncommenting line 612 make bluetoothd start and adding a "sleep 1" at line 613 let bluetoohd time to start before to give hci* commands.
    decide yourself how you better correct this, you are the developer :-).
    when i will have more time i will check if cdc-acm is not loaded by 3g-modem function for my nokia n78 plugged via usb for the same reason, the lack of my device in modules.usbmap.
  • jozeejozee March 2010
    @ernia: Please upgrade to 3.0 . We have tried to fix the problem with modules and depmod. Try again.

    About bluetoothd: nice suggestion. I will correct this.

    BTW, you are welcome to collaborate and edit the script.
  • erniaernia March 2010
    @jozee
    it seems hwsetup has the same behavior in 3.0

    i would be glad to collaborate but i think i'm not smart enough to do it, i got an headache to follow scripts :-)
  • jozeejozee March 2010
    @ernia:
    i would be glad to collaborate but i think i'm not smart enough to do it

    I have read some of your posts and I think you are smart enough :-)
  • erniaernia March 2010
    you overestimate me, but i'll give it a try, i'm a little busy this week :(
    is there a wiki howto somewhere? i would put bluetooth guide in but i'm scared to mess up everything.
    also, i've noted that tor guide leads to execute tor as root, which is not required by tor and could be unsafe in case of a tor bug.
    would it be ok if i change someone else wiki page?
    tor could be launched in /etc/local.sh but with
    su tux (or userid) -c tor
  • jozeejozee March 2010
    @ernia: You can use playground to learn wiki syntax http://doc.slitaz.org/wiki:syntax?s[]=playground (link is on the front page). For testing, there is another playground in guide section.
  • erniaernia April 2010
    @jozee
    sorry, i did not see the links.
    I've changed the bluetooth case at line 595 of hwsetup to this:

    bluetooth)
    #untested
    load_modules
    # sanity check: btusb is not loaded automagically for unknown reasons
    # probably no mod and prod of device in /lib/modules/`uname -r`/modules.usbmap
    # in tazhw detect_usb_devices()
    if ! lsmod | grep -q btusb ; then
    modprobe btusb
    fi
    # launch bluetoothd, not able to do it through udev, i did not find a udev rule about bluetooth
    # could it be the problem?
    bluetoothd
    sleep 1
    if hcitool dev | grep -q hci ; then
    echo `hcitool dev`
    echo ""
    echo "========================================"
    echo -e "Following \033[1m Bluetooth commands \033[0m may be of help "
    echo ""
    echo " hciconfig -a"
    echo " \"hcitool dev\" : checking local bluetooth devices..."
    echo " \"hcitool scan\" : scanning remote bluetooth devices..."
    echo " \"bluez-simple-agent\" : pairing with remote bluetooth devices..."
    echo -e " You can manually edit the configuration files in \033[1m /etc/bluetooth \033[0m if need be"
    echo "========================================"
    else
    echo "========================================"
    echo -e "Your device has not been detected, you should configure it by hands"
    echo -e "Following \033[1m Bluetooth commands \033[0m may be of help "
    echo ""
    echo " modprobe the module required by your device"
    echo " /usr/sbin/bluetoothd -nd #for starting bluetooth daemon"
    echo " hciconfig -a"
    echo " \"hcitool dev\" : checking local bluetooth devices..."
    echo " \"hcitool scan\" : scanning remote bluetooth devices..."
    echo " \"bluez-simple-agent\" : pairing with remote bluetooth devices..."
    echo -e " You can manually edit the configuration files in \033[1m /etc/bluetooth \033[0m if need be"
    echo "========================================"
    fi
    ;;

    it seems to work, check if you can approve it-
  • erniaernia April 2010
    thanks linea for your corrections, my english is really broken :-)
  • monzmonz April 2010
    OK, i've been playing around with bluetooth again, using some of the commands i see posted here. Now my computer sees my phone, and my phone sees my computer ... but i am still unable to transfer files from my cell-phone to my computer. That's all i really want to do with bluetooth.

    SliTaz does not have an obex package -- isn't that needed?

    Please help.
  • ms3811ms3811 April 2010
    I am able to see my phone from my computer and vice versa. I put the computer into discoverable mode using hciconfig hci0 piscan and then ran add device from the phone. the phone finds the computer, and then phone & bluez-simple-agent both then display a pin and ask for confirmation. but the moment I hit "Y" to confirm, the phone immediately says "Connection to computer-0 failed". what to do next?
  • erniaernia April 2010
    you should type a code on the phone and after that bluez-simple-agent should prompt you for the same code. does not it works this way?
  • ms3811ms3811 April 2010
    for some reason my phone simply picks a random code by itself, and then sends to bluez-simple-agent and both prompt to confirm the code at the same time. i.e. the same code is displayed on the screen of my phone as well as bluez-simple-agent. I have to click yes to confirm that they are the same. I think its because at some point either on the phone or on the computer I set an option somewhere that said the code will selected by the device randomly. unfortunately I cannot remember where i set that option. but regardless shouldnt it still work since both devices are showing the same pin, so that means they are talking to each other.
  • ms3811ms3811 April 2010
    update, so if I do the following I get one step further:

    - wait from prompt to confirm code on both devices
    - then type "yes" on bluez-simple-agent prompt (the prompt is Confirm passkey (yes/no):, however "y" does not work)
    - then click on yes on the phone

    at this point, the computer-0 shows up as in the list of devices on the phone, and the phone prompts "pairing complete. connect to computer-0?", yes/no. at the same time, bluez-simple-agent displays the prompt "Authorize connection? (yes/no):". but if I type yes on the computer, and click yes on the phone, the phone immediately says "connection to computer-0 failed" and disconnects. bluez-simple-agent then displays the word "Cancel" on the next line and goes back to waiting.

    at this point, even though the computer is in the list of devices on the phone, any attempts to connect to it simply says failed. :(

    any ideas please?
  • erniaernia April 2010
    try to start the pairing from the pc, it's explained in the guide http://doc.slitaz.org/en:guides:bluetooth
    this could avoid problems related to phone configurations

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

SliTaz Social