PDA

Bekijk de volledige versie : WL-HDD + Bluetooth + GPRS



kpw
28-09-2008, 21:02
Witam,
po kilkudniowej walce z bluetoothem na USB i nokia 6630 udało się !!
Do tej pory łączyłem się kablem DKU-2, jednak z przyczyn technicznych
miałem potrzebę uwolnić Nokie...
Do mojego asusa zapuściłem sofcik z tej stronki:
http://koppel.cz/cdmawifi/download/170/
to firmware by Oleg z wszelkim wsparciem PPP/GPRS/CDMA ...

Zakładam, że osoby czytające umieją posługiwać sie konsolą i mają zamontowany dysk do routera.
Dodatkowe modły należy ściągnąć i wrzucić na dysk z'mount'owany na /opt.
http://koppel.cz/cdmawifi/download/170/modules-1.9.2.7-10-USB-1.70b1.tar.gz
podłączamy BT na USB restart routera włączamy BT w telefonie i logujemy się na konsoli.
Instalujemy komponenty BLUEZ, jednak robimy to ręcznie.


ipkg install http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/bluez-libs_2.25-1_mipsel.ipk
ipkg install http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/bluez-utils_2.25-1_mipsel.ipk
oraz
ipkg install dbus


teraz musimy wyedytować kilka plików:

w /opt/etc/bluetooth/hcid.conf


# PIN helper
# pin_helper /opt/bin/bluepin;
pin_helper /opt/sbin/sendpin;
# D-Bus PIN helper
#dbus_pin_helper;


w /opt/etc/dbus-1/system.conf


<!-- Run as special user -->
<user>admin</user>


zastępnie stworzyć plik który bedzie wysyłał hasło do parowania urządzeń
/opt/sbin/sendpin



#!/bin/sh
echo "PIN:123456"


RESTART

następnie odpalamy moduły:


insmod /opt/lib/modules/2.4.20/kernel/net/bluetooth/bluez.o
insmod /opt/lib/modules/2.4.20/kernel/net/bluetooth/l2cap.o
insmod /opt/lib/modules/2.4.20/kernel/net/bluetooth/sco.o
insmod /opt/lib/modules/2.4.20/kernel/net/bluetooth/bnep/bnep.o
insmod /opt/lib/modules/2.4.20/kernel/net/bluetooth/rfcomm/rfcomm.o
insmod /opt/lib/modules/2.4.20/kernel/drivers/bluetooth/hci_usb.o

/opt/sbin/hcid -f /opt/etc/bluetooth/hcid.conf
/opt/sbin/hciconfig hci0 up
/opt/sbin/sdpd


[admin@WL-HDD root]$ hciconfig -a
jeżeli wszystko jest OK to powinno się nam ukazać coś jak poniżej:


hci0: Type: USB
BD Address: 00:02:72:B0:00:26 ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:942025 acl:5000 sco:0 events:1459 errors:0
TX bytes:153709 acl:1752 sco:0 commands:26 errors:0
Features: 0xff 0xff 0x8f 0xf8 0x18 0x18 0x00 0x80
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: 'CSR - bc3'
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Ver: 1.1 (0x1) HCI Rev: 0x639 LMP Ver: 1.1 (0x1) LMP Subver: 0x639
Manufacturer: Cambridge Silicon Radio (10)


[admin@WL-HDD root]$ hcitool scan


Scanning ...
00:60:57:13:xx:xx k@P\^/
00:21:AA:66:xx:xx Nokia 6300
00:12:62:DB:AE:5A Nokia 6630
00:16:4E:79:xx:xx Nokia 6021


[admin@WL-HDD root]$ l2ping 00:12:62:DB:AE:5A
jak wszystko OK to telefon poprosi o kod (patrz sendpin)


Ping: 00:12:62:DB:AE:5A from 00:02:72:B0:00:26 (data size 44) ...
0 bytes from 00:12:62:DB:AE:5A id 0 time 37.97ms
0 bytes from 00:12:62:DB:AE:5A id 1 time 37.43ms
0 bytes from 00:12:62:DB:AE:5A id 2 time 41.07ms
0 bytes from 00:12:62:DB:AE:5A id 3 time 51.68ms


[admin@WL-HDD root]$ sdptool browse
ta komenda wywali na sporo informacji szukamy Dial-up i informacji Channel


Service Name: Dial-Up Networking
Service RecHandle: 0x10001
Service Class ID List:
"Dialup Networking" (0x1103)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100


teraz edytujemy plik /opt/etc/bluetooth/rfcomm.conf
zawartość ma wyglądać tak:



rfcomm0 {
# Automatically bind the device at startup
bind yes;

# Bluetooth address of the device
device 00:12:62:DB:AE:5A;

# RFCOMM channel for the connection
channel 1;

# Description of the connection
comment "Example Bluetooth device";
}


zwrócić uwagę na device i chanel (patrz wyżej)

tworzymy plik /opt/sbin/bluetooth


#!/bin/sh

# uncomment to disable
#exit 0

PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin
LOG="/usr/bin/logger -t bluetooth-hotplug"

if [ -z "$1" ] ; then
rc="usage"
else
rc="$1"
fi

case "$rc" in
start)
$LOG "starting modules"
insmod /opt/lib/modules/2.4.20/kernel/net/bluetooth/bluez.o
insmod /opt/lib/modules/2.4.20/kernel/net/bluetooth/l2cap.o
insmod /opt/lib/modules/2.4.20/kernel/net/bluetooth/sco.o
insmod /opt/lib/modules/2.4.20/kernel/net/bluetooth/bnep/bnep.o
insmod /opt/lib/modules/2.4.20/kernel/net/bluetooth/rfcomm/rfcomm.o
insmod /opt/lib/modules/2.4.20/kernel/drivers/bluetooth/hci_usb.o
sleep 1
$LOG "starting services"
/opt/sbin/hcid -f /opt/etc/bluetooth/hcid.conf 2>&1 |$LOG
/opt/sbin/hciconfig hci0 up 2>&1 |$LOG
/opt/sbin/sdpd 2>&1 |$LOG
/opt/bin/rfcomm -f /opt/etc/bluetooth/rfcomm.conf bind all 2>&1 |$LOG
;;
stop)
$LOG "stopping services"
killall sdpd
killall hcid
$LOG "stopping modiles"
/sbin/rmmod sco
/sbin/rmmod rfcomm
/sbin/rmmod l2cap
/sbin/rmmod hci_usb
/sbin/rmmod bluez
;;
*)
echo "Usage: -sh (start|stop|usage)"
;;
esac


edytujemy /tmp/local/sbin/post-boot i dodajemy linijkę:


/opt/sbin/bluetooth start


w załączniku plik do załadowania, pojawi się taka możliwość z WWW jak się wybierze
USB Connection -> Connection Mode -> User defined
w
User Dial-Up Config podajemy parametry połączenia.

jak coś będzie niejasne piszcie postaram się uzupełnić...

pozdrawiam i powodzenia.