Results 1 to 7 of 7

Thread: myCellPhone, bluetooth, bluez, dbus, messagebus, passkey-agent and etc.

  1. #1
    Just burned his ISO
    Join Date
    Jul 2007
    Posts
    19

    Default myCellPhone, bluetooth, bluez, dbus, messagebus, passkey-agent and etc.

    Hi all,

    Yea for BT2. It's slick. I did the hdinstall, and have been using it more than my old pal knoppix. I am a BT2 newbie for sure. I wouldn't know the first thing about breaking into a network. (Well I did manage to crack my own soho's wep key using aircrack, and 2 pc's.) But I love this distro. Totally slick. Not too much stuff on it, that I will never use, and looks like tons of stuff I would be glad if I knew how to use.

    I tried to get a file from my cell phone. I found old style bluez config files in /usr/etc/bluetooth/hcid.conf which used a pin_helper setting. This doesn't work in bluez 3.x stacks. It uses dbus. Which btw, also needs a new user "messagebus" on the system. So....... because I could not find any definitive answers when I Googled around, I naturally want to let others know how I solved this problem.

    Once I plugged in my bluetooth usb transmitter, which says Microsoft on it, I got a strange error when I ran Startmenu -> Internet-> Bluetooth Server. It said something about my device class being set to 0x0, and that I should change it in /etc/bluetooth/hcid.config, which is wrong with bluez, it is /usr/etc/bluetooth/hcid.conf and second, device class 0x0 really means something is really not right! My journey begins here I guess. Too much to tell, but the fix is not so bad when I look back. I suspect I will want to change this post later... but I wanted to share it while I can remember my steps. I am not allowed to post url's, so I used _DOT_ where needed.

    First...

    The command:
    useradd messagebus
    added the user without asking a bunch of questions about home direcories etc. I wondered if it needed to be added to the wheel group, but didn't bother. I tried adduser messagebus, and got those qwestions. useradd is enough.

    Next, I went and got the 3.12 bluez-utils, to get a file passkey-agent.c. I compiled that against the 3.9 bluez, and though it seemed to run... it didn't work in negotiating a link with my cellphone. I got a confusing set of error msgs, and after learning a bunch of stuff... decided to move to bluez 3.12.
    while crossing my fingers that I would be okay with the bluez kernel modules already there from BT2. (I doubt I can get _all_ the right sources all together, where I would feel comfortable trying to compile a kernel, and new modules... so I try and avoid it like the plague.)

    Next I get the bluez libs and utils... bluez_DOT_org and straight to the download page. Extract to Desktop/bluez..., Done!

    Then I get this patch for passkey-agent.c from:
    www_DOT_kmobiletools_DOT_org /files/bluez-pin-exec-patch-r3.diff.bz2
    and put it in the daemon folder:
    bluez-utils-3.12/daemon/bluez-pin-exec-patch-r3.diff
    and issue the command:
    patch -i bluez-pin-exec-patch-r3.diff

    This allows the kbluepin to be executed when a pin request is asked. My goal was to be able to browse my phone in KDE's Konqueror, with bluetooth:/ as the starting point, as I had done once but couldn't do again with bluez-3.9 for some reason. (I still do not know what I did right then)

    Now I am ready to build and install bluez-3.12.

    for the libs:
    ./configure --prefix=/usr
    make && make install

    and for the utils:
    ./configure --prefix=/usr --enable-apps
    make && make install

    Then I decided to remove any info from previous connection attempts:
    rm -r /usr/var/lib/bluetooth/*

    change to the hcid.conf in /usr/etc/bluetooth,
    remove a default alphanumeric passkey... don't we just want to send numbers? Put a # in front of what is there for passkey.

    # Default PIN code for incoming connections
    # passkey "BlueZ";

    Changes to my /etc/rc.d/rc.local file:
    Code:
    #!/bin/sh
    #
    modprobe psmouse
    
    # dbus-daemon must learn to cleanup stale PID files
    if [ -f /usr/var/run/dbus/pid ]; then
       rm /usr/var/run/dbus/*;
    fi
    /usr/bin/dbus-daemon --system --print-address
    #Here... Do not use dbus-launch here!!!!!!
    
    modprobe l2cap
    modprobe rfcomm
    modprobe sco
    sdpd -d
    hcid -d
    passkey-agent --default /opt/kde/lib/kdebluetooth/kbluepin &
    I would recommend putting a comment # in front of the passkey-agent line until you are sure it is working. You can run the same thing a console window and get some verification it is working. It will tell you when it works.
    Once you are sure it is working okay, remove the #.

    When debugging this problem I used a few commands in seperate consoles I will incllude.

    tail -f /var/log/messages
    tail -f /var/log/syslog
    tail -f /var/log/debug

    To look at the key exchanging, and generally to make sure hcid and sdpd are okay... kill the running ones, then in a console use the -nd parameter like so hcid -nd and sdpd -nd. If you cannot get on Dbus, you'll see it here.

    I killed the sdpd, and hcid, then ran hcid -nds ( konqueror complains that sdpd is not available here, which is okay for debugging these layers. That tells the hcid to just run in a console session, and also to provide sdp services, and will provide useful debug messages. These can be found in the file /var/log/debug.

    I will include some errors from those files so people can find them.

    Jun 30 23:38:59 (none) hcid[9182]: call_passkey_agent(): no agent available
    Jun 30 21:14:07 (none) hcid[31589]: Unknown option 'pin_helper' line 26
    Jun 30 21:14:07 (none) hcid[31589]: syntax error line 26
    Jun 30 21:14:07 (none) hcid[31589]: Can't connect to system message bus: Failed to connect to socket /usr/var/run/dbus/system_bus_socket: No such file or directory
    Jun 30 21:14:07 (none) hcid[31589]: Unable to get on D-Bus
    Jul 1 21:05:43 (none) hcid[10970]: Can't connect to system message bus: Failed to connect to socket /usr/var/run/dbus/system_bus_socket: Connection refused

    And from KDE on starting the Bluetooth Server:
    "To use the kbtobexsrv service, some other devices might require a modified class number for your bluetooth adapter in /etc/bluetooth/hcid.conf. Currently the class is set to 0x0. We suggest you change this to something like 0x100000 instead and restart BlueZ's hcid. The service will be activated anyway."

    It is supposed to read /usr/etc/bluetooth/hcid.conf because the one in etc is ignored by bluez.

    Here is one that should be there when passkey-agent is working.
    Jul 3 19:25:19 (none) hcid[3189]: /org/bluez: org.bluez.Security.RegisterDefaultPasskeyAgent()
    Jul 3 19:25:19 (none) hcid[3189]: name_listener_add(:1.1)

    Yup... 3 days... from newbie to knowing something.
    I hope this helps someone. I don't know enough about slapt-get, and would rather not know I could have done a slapt-get bluez-libs and everything would have been fixed. I already sent a paypal donation so... I do look forward to another edition. Final sounds so forever!

    regards,
    john

    edit Dec 16, 2007: Man, am I glad I wrote this down somewhere. New BT3 beta just out, just got a Logitech Bluetooth kb & mouse... anxious to see if this was even read. I seem to recall somewhere I noticed later on there are compile directives to control where etc/ files are kept. I think my wife got the laptop(the best one) I did this on, so I didn't just drop the ball... she stole it!

  2. #2
    Senior Member shamanvirtuel's Avatar
    Join Date
    Mar 2010
    Location
    Somewhere in the "Ex" human right country
    Posts
    2,988

    Default

    useful...thx for sharing and.......

    welcome aboard..........

    you'll be happy....we are waiting for a bugfixes reliz anounced by bt crew

    and

    BT3 core coding process have begin to.....

    have phun and ask if you are stuck somewhere with some tools...
    Watch your back, your packetz will belong to me soon... xD

    BackTrack :
    Giving Machine Guns to Monkeys since 2006

  3. #3
    Just burned his ISO
    Join Date
    Jul 2007
    Posts
    19

    Default Thanks and some...

    Quote Originally Posted by shamanvirtuel View Post
    useful...thx for sharing and.......

    welcome aboard..........

    you'll be happy....we are waiting for a bugfixes reliz anounced by bt crew
    Thanks... I would welcome a bugfix edition... they have the sources used to make this... just an error fix release. I would have felt alot more comfortable with real kernel modules and all the other things like a current enough Dbus. Otoh, it sure feels good knowing I can just access my phones files in Konqueror.

    BT3 core coding process have begin to.....
    Well I would like to help out them testing wise. Just bought a 500GB firewire/usb drive, so I can ghost my stuff onto that. Sure beats the pants off of trying to backup to DVD! What I love about this BT2 final is it is so solid, no broken links in the menus etc... after I installed to hd. Knoppix always changed when installed to the hd, so much so it was hardly knoppix anymore.

    As an aside, I have been using Grub4dos, to manage my Os'es. I really feel for people who can't get the OS blind(real) grub working right. Grub4dos just works using the MS bootmenu(xp win98 whatever.) Just copy 3 files
    grldr + menu.lst (which is it's grub.conf equivalent) + grub.exe to the C drive(mine is still win98, as XP uses C to boot to G) and make a small change to c:\boot.ini like this...
    [operating systems]
    multi(0)disk(0)rdisk(0)partition(7)\WINDOWS="Micro soft Windows XP Professional" /noexecute=optin /fastdetect /noexecute=alwaysoff
    C:\GRLDR="Linux"
    C:\ = "Microsoft Windows 98se"

    and boot away without modifying the critical boot drive structures!

    Regards,
    John

  4. #4
    Senior Member shamanvirtuel's Avatar
    Join Date
    Mar 2010
    Location
    Somewhere in the "Ex" human right country
    Posts
    2,988

    Default

    you can contact Muts if you want help...

    for your procedure with grub4dos....it saves my life 2 times

    BUT

    it's a pity to use M$ bootloader....to run linux....just my ethical $ 0.02

    but you're right, it works.........
    Watch your back, your packetz will belong to me soon... xD

    BackTrack :
    Giving Machine Guns to Monkeys since 2006

  5. #5
    Just burned his ISO
    Join Date
    Jul 2007
    Posts
    19

    Default

    Did you mean I should contact Muts if I want to help with the beta?, or just help in general...

    It feels pretty darn good to use their bootloader, to boot linux. They didn't anticipate grub4dos coming along. The M$ bootloader... is only supposed to be able to allow enough flexibility to boot different versions of windows. Vista having the ability to grow and shrink partitions... almost signals a relaxation of their previous bad attitudes on the surface. Makes me wonder what's up with that?

    Another aside: I have been noticing some in the Windows Powershell camp... and it's poo pooing the GUI, and championing what a good shell can do, and even giving credence to the Linux admins who laugh at the struggles of the windows admins... as/with justification for the Powershell.

    KDE should really be paying attention to what the advanced crew on M$ side is admitting lately. The GUI can only do what the GUI writers have labored to allow users to do.

  6. #6
    Developer balding_parrot's Avatar
    Join Date
    May 2007
    Posts
    3,399

    Default

    No he meant if you want to help like you were offering to

  7. #7
    Just burned his ISO
    Join Date
    Jul 2007
    Posts
    19

    Default

    Ok... it could be read either way. I'll contact Mutt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •