Linux N95 Bluetooth Connection


Results 1 to 1 of 1

Thread: Linux N95 Bluetooth Connection

  1. #1
    Join Date
    Jul 2001
    Location
    Fife, Scotland
    Posts
    1,794

    Linux N95 Bluetooth Connection

    Hi Guys,

    I'm back and out of the dribble-factory but I've not been inactive. I've successfully managed to get my Nokia N95 talking to my laptop over Bluetooth and I can engage the modem remotely. It was a pain, but I am posting this back from such a link in a pub in Scotland, so that just shows you that it can be done.

    I'm posting this under "Networking" so that comments can be added onto this thread in order to fine-tune it.

    Basically, my biggest problem was creating the connection to the network over GPRS. Linking up to the phone was easy but the actual problem was the link to the phone over Bluetooth!

    Anyway, I am a contract subscriber to Vodafone in the UK and this is essentially how I managed it:

    1) Start Bluetooth management under Linux:

    Code:
    /etc/init.d/bluetooth start
    This initializes the Bluetooth subsystem and brings everything you need online. Personal configuration is up to you. This is how I managed to get it working, not how I get YOURS working!

    1) Pair the laptop to the phone.

    You MUST get this right. Under /etc/bluetooth is a file called "pin". Simply echo in the PIN that you want. This might get you going:

    Code:
    echo "1234" > /etc/bluetooth/pin
    Obviously change the PIN to something you can remember/use/pair a device with... You get the idea.

    I use KBluetooth to manage my Bluetooth systems since I've successfully connected my systems from the command prompt previously and I no longer wish to use it for "trivial" matters. From KBluetooth, it was dead easy to scan and connect to a remote device and simply enter the PIN on the phone to pair the two properly.

    2) Test the connection.

    If the previous stage has worked, then you should be able to browse your phone's directory system very easily. For me, all I have to do is fire up Konqueror and put "bluetooth:/" into the URL bar and it simply works. I can quite happily browse through my phone no problems.

    This is the Bluetooth link established. The next problem is finding the correct details that will work for your network... Shock, bloody horror. Still, We're Linux users so we'll get on with it. Under Windows, this is dead easy, but it's a nightmare under Linux. Well, it was for me. The following settings are for KPPP under Debian GNU/Linux with a Nokia N95 on UK Vodafone and the settings WORK.

    3) Fire up KPPP

    I am having to reverse-configure things here because I do not want to break my setup, so bear with me. When I start KPPP, I get the option to connect to Vodafone GPRS (my name for the account that I am using) but if you click on "Configure" and create a new acoount, you can quite happily create a new setup.

    3.1) Connection name: "Whatever you want"
    3.2) Dial: "*99#" - This may be different for various networks but works for me
    3.3) Authentication: "Script-based"
    3.4) Callback type: "None"
    3.5) Customize pppd arguments...

    OK. Step 3.5 requires a bit of attention. Apparently, you can use "noauth" here to stop the remote end being required to authenticate with an IP address back to you but this requires root privileges (which you won't have under KPPP) so it will fail. Leave this option blank and change /etc/ppp/options so that line 35 says "noauth" instead of "auth". The requirement for a remote system to authenticate itself to you is totally unnecessary on this link (IMHO).

    4) Back on the KPPP Configuration dialog box, click on Modems and create a new one. The options here are very simple. My modem is called "Nokia N95" and the modem device is /dev/rfcomm0 (more on this later). In short, here they are:

    Modem name: Nokia N95
    Modem device: /dev/rfcomm0
    Flow control: Hardware [CRTSCTS]
    Line termination: CR
    Connection speed: 115200
    Use lock file (checked)
    Modem timeout: 60 sec

    Under "Modem" I have unchecked "Wait for dial tone before dialling" (kinda obvious for those with a little nous, but still...) Busy wait is 0 sec, Modem volume is (apart from pointless) 50%.

    To get the correct commands for the modem, click on "Edit Modem Commands" and ensure that yours are the same as the following:

    Code:
    Pre-init delay (sec/100): 50
    Initialization string 1: ATZ
    Initialization string 2: AT+cgdcont=1,"IP","internet"
    Post-init delay (sec/100) 50
    Dialing speed (sec/100) 70
    Init response: OK
    No dial tone detection: ATX3
    Dial string: ATD
    Connect response: CONNECT
    Busy response: BUSY
    No carrier response: NO CARRIER
    Hangup string: +++ATH
    Hangup response: OK
    Answer string: ATA
    Ring response: RING
    Answer response: CONNECT
    DLP response: DIGITAL LINE DETECTED
    Escape string: +++
    Escape response: OK
    Guard time (sec/50): 50
    Volume off/low/high M0l0 M1L1 M1l3
    That should be all of them. I do not have to set any other options for UK Vodafone.

    The /dev/rfcomm0 device does require some extra attention, however. Basically, a Bluetooth device appears as a USB device (as far as the system and my research has shown) but must be established in advance. This isn't a problem as I will tell you how to do it now. I suppose it may be a problem if you do not read the entirety of a document before you start implementing it, though

    Edit /etc/bluetooth/rfcomm.conf to show the following:

    Code:
    rfcomm0 {
    bind yes;
    device UU:VV:WW:XX:YY:ZZ;
    channel 4;
    comment "Vodafone UK (GPRS)";
    }
    Obviously changing the MAC address to that of your phone instead of the algebraic junk I left above. If you are not sure how to get the MAC address of your phone then run the command:

    Code:
    hcitool inq
    in a quiet place (i.e. no other Bluetooth devices around). On the Nokia N95, you can also dial *#62209526# to get the MAC address. This code translates on the keypad to *#MAC_WLAN# in case you wondered...

    The bind option is also quite useful. If you don't want the /dev/rfcommX device to be created dynamically, then you can select "no" instead of "yes" but use the following commands:

    rfcomm bind rfcomm0
    rfcomm release rfcomm0

    To bind and release the device. It's up to you.

    Right, now I've documented all the settings on here so I've got my arse covered in case I need to set this stuff back up. Under Windows, it was easy, but there's no fun in "easy", is there???

    Comments appreciated,

    James
    Last edited by Satanic Atheist; 09-28-2009 at 11:59 AM. Reason: Cocked up the "code" segments.
    -----------------------------
    UseLinux.net
    -----------------------------

    perl -e 'use Math::Complex;$|=1;for$r(0..24){for$c (0..79){$C=cplx(($c/20.0)-3.0,-($r/12.0)+1.0);$Z= cplx(0,0);for($i=0;($i<80)&&(abs($Z)<2.0);$i++){$Z =$Z*$Z+$C;}print$i>=80?"*":" ";}print"\n";}'

Posting Permissions

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