xda-developers.com
forum.xda-developers.com
device database
wiki.xda-developers.com Wiki HomePage
FAQ | Xanadux

RecentChanges | FindPage | | LikePages | BackLinks

bluetoothnetworking

Connecting your MDA II/XDA II to the network via your Linux machine!
  by henk
  Last updated: Mon April 8th 2004



Aim
        1. Have a portable internet browser in and around the house.
        2. Other really cool stuff requiring an internet connection.

Hardware
        - MDA II (pocket pc & phone) with built in Bluetooth adapter.
        - MSI MS-6967 Bluetooth key

Required Software
        Bluetooth Stuff:
        - linux 2.6.4 kernel (enable your bluetooth options, at least:
        driver, l2cap proto, rfcomm proto (with tty support))
        - bluez stuff, lib-2.6, bnep-1.1 and utils-2.6. See http://bluez.sf.net for the latest.
        - pppd


Installation

        1. Perform the standard bluez installation
          This is mostly standard stuff I won't elaborate too much.

          - Configure your kernel and setup the bluez stuff. I had some problems with 2.4.24
          kernel, upgrading to 2.6.4 kernel with the latest bluez stuff seemed to do the trick.

          - Configure Networking (firewall, NAT ect...).

          - Setup your /etc/modules.conf script.
            # bluetooth stuff
            alias net-pf-31 bluez
            alias bt-proto-0 l2cap
            alias bt-proto-2 sco
            alias bt-proto-3 rfcomm

          - configure the hcid.conf script. These options are known to work:
                lm accept;
                auth enable;
                encrypt enable;
          - configure pincode and pinhelper script.

        2. Configure the /etc/ppp/peers/dun script for pppd:
                115200
                local
                noipdefault
                connect "/etc/ppp/at-cmd.pl -v"
                noauth
                nodefaultroute
                10.10.10.10:10.10.10.11
                ms-dns 10.10.10.1

        3. Install the /etc/ppp/at-cmd.pl script, see  http://wiki.xda-developers.com/uploads/at-cmd.pl

           It is possible to do this with a regular chat script, once you've
           figured out what to expect ;).

        4. Startup deamons

           hcid
           sdpd
           dund --listen call dun
           sdptool add DUN

        5. Configure MDA

           - Pair your device
           - Setup a bluetooth connection profile
                settings->connections->connections
                ...


Testing

After the initialization you would see something like this in the logs:

Apr  4 21:57:14 systol hcid?5633: link_key_request (sba=XX:XX:XX:XX:XX:XX, dba=XX:XX:XX:XX:XX:XX)
Apr  4 21:57:15 systol dund?13797: New connection from XX:XX:XX:XX:XX:XX
Apr  4 21:57:15 systol pppd?13802: pppd 2.4.1 started by root, uid 0
Apr  4 21:57:16 systol /etc/ppp/at-cmd.pl?13806: got: ATZ
Apr  4 21:57:16 systol /etc/ppp/at-cmd.pl?13806: send: OK
Apr  4 21:57:16 systol /etc/ppp/at-cmd.pl?13806: got: AT
Apr  4 21:57:16 systol /etc/ppp/at-cmd.pl?13806: send: OK
Apr  4 21:57:17 systol /etc/ppp/at-cmd.pl?13806: got: ATE0V1&C1&D2
Apr  4 21:57:17 systol /etc/ppp/at-cmd.pl?13806: send: OK
Apr  4 21:57:17 systol /etc/ppp/at-cmd.pl?13806: got: ATS7=120
Apr  4 21:57:17 systol /etc/ppp/at-cmd.pl?13806: send: OK
Apr  4 21:57:18 systol /etc/ppp/at-cmd.pl?13806: got: ATZ
Apr  4 21:57:18 systol /etc/ppp/at-cmd.pl?13806: send: OK
Apr  4 21:57:19 systol /etc/ppp/at-cmd.pl?13806: got: AT
Apr  4 21:57:19 systol /etc/ppp/at-cmd.pl?13806: send: OK
Apr  4 21:57:19 systol /etc/ppp/at-cmd.pl?13806: got: ATE0V1&C1&D2
Apr  4 21:57:19 systol /etc/ppp/at-cmd.pl?13806: send: OK
Apr  4 21:57:19 systol /etc/ppp/at-cmd.pl?13806: got: ATS7=120
Apr  4 21:57:19 systol /etc/ppp/at-cmd.pl?13806: send: OK
Apr  4 21:57:20 systol /etc/ppp/at-cmd.pl?13806: got: ATX4
Apr  4 21:57:20 systol /etc/ppp/at-cmd.pl?13806: send: OK
Apr  4 21:57:20 systol /etc/ppp/at-cmd.pl?13806: got: ATDT123456789
Apr  4 21:57:20 systol /etc/ppp/at-cmd.pl?13806: send: CONNECT
Apr  4 21:57:20 systol pppd?13802: Serial connection established.
Apr  4 21:57:20 systol pppd?13802: Using interface ppp0
Apr  4 21:57:20 systol pppd?13802: Connect: ppp0 <--> /dev/rfcomm1
Apr  4 21:57:21 systol pppd?13802: local  IP address xxx.xxx.xxx.xxx
Apr  4 21:57:21 systol pppd?13802: remote IP address xxx.xxx.xxx.xxx

Have fun
Hi,

this is not a good way. Use this one:

# on master side
modprobe bnep
pand --listen --master --role=NAP
ifconfig bnep0 192.168.1.1 netmask 255.255.255.0
use some kind of NAT for example

#on slave
modprobe bnep
pand -c <bt_addr_of_master>
ifconfig bnep0 192.168.1.2 netmask 255.255.255.0
route add default gw 192.168.1.1

And that is it :)

CIJOML

....
You're absolutely right. Unfortunately my MDA does not support the NAP profile "out-of-the-box"....
(If it did this page would not have existed)
Henk


Hi I tried both methods with my xda-mini (qtek s100) and it doesn't work, I see very few logs in dmesg..

usb 1-1: new full speed USB device using uhci_hcd and address 3
Bluetooth: Core ver 2.7
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
hci_usb: Unknown symbol hci_free_dev
hci_usb: Unknown symbol hci_alloc_dev
hci_usb: Unknown symbol hci_unregister_dev
hci_usb: Unknown symbol hci_register_dev
hci_usb: Unknown symbol hci_free_dev
hci_usb: Unknown symbol hci_alloc_dev
hci_usb: Unknown symbol hci_unregister_dev
hci_usb: Unknown symbol hci_register_dev
Bluetooth: HCI socket layer initialized
Bluetooth: HCI USB driver ver 2.7
usbcore: registered new driver hci_usb
Bluetooth: L2CAP ver 2.6
Bluetooth: L2CAP socket layer initialized
Bluetooth: RFCOMM ver 1.3
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM TTY layer initialized


Your bluetooth kernel modules seem to be built for the wrong kernel. Check that you get the correct ones. How to do this depends on your distro.

Last edited on September 28, 2005 4:36 pm.


Edit | PageHistory | Diff | PageInfo
Login
User Name: Password:
Remember Me?