Itse olen kokeillut bluetooth + gprs -yhteyttä Debian Woodyssa halvimmalla mahdollisella sovittimella (n. 50 euroa) ja Ericssonin T68i puhelimella. Ohjeet ovat tässä vaiheessa puutteelliset ja vain suuntaa antavat ja niissä saattaa olla jopa virheitä, mutta uskoisin niistä kuitenkin olevan jo nyt hyötyä niille, jotka haluvat vaihtaa modeemiyhteyden bluetooth + gprs yhteyteen.
Itse asensin Bluez-paketeista Debianiin vain bluez-utils ja libbluetooth1 -ohjelmat. Käänsin myös uuden 2.4.20 kernelin usb ja bluetooth -tuella.
Otin koneesta, jolla aioin käyttää bluetoothia, kiintolevyn toiseen koneeseen, jossa on kiinteä nettiyhteys. Asensin levylle Debian Woodyn ja hain uusimman vakaan kernelin linux-2.4.20.tar.gz sivun http://www.kernel.org/ linkeistä. Sitten hain kerneliin bluetooth-päivityksen patch-2.4.20-mh5.gz sivulta http://www.holtmann.org/linux/kernel/. Sitten käänsin kernelin toiselle koneelle optimoiduksi (siis koneelle, jossa tulen bluetoothia käyttämään) usb- ja bluetooth-tuella.
Seuraavassa kääntämäni kernelin konfigurointitiedoston bluetooth- ja usb-sektiot:
# # USB support # CONFIG_USB=y # CONFIG_USB_DEBUG is not set # # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set CONFIG_USB_LONG_TIMEOUT=y # # USB Host Controller Drivers # # CONFIG_USB_EHCI_HCD is not set CONFIG_USB_UHCI_ALT=y # CONFIG_USB_OHCI is not set # # Bluetooth support # CONFIG_BLUEZ=m CONFIG_BLUEZ_L2CAP=m # CONFIG_BLUEZ_SCO is not set CONFIG_BLUEZ_RFCOMM=m CONFIG_BLUEZ_RFCOMM_TTY=y # CONFIG_BLUEZ_BNEP is not set # # Bluetooth device drivers # CONFIG_BLUEZ_HCIUSB=m CONFIG_BLUEZ_USB_ZERO_PACKET=y # CONFIG_BLUEZ_HCIUART is not set # CONFIG_BLUEZ_HCIVHCI is not set
Lisäksi hyvin tärkeä valinta kernelin käännössä on:
CONFIG_PPP_ASYNC=m
Tarvittavat ohjelmat löytyvät sivulta http://bluez.sourceforge.net/download/download.html sekä lähdekoodina että rpm- tai deb-paketteina.
Itse olin lisännyt Debianissa /etc/apt/sources.list-tiedostoon rivit
deb http://bluez.sourceforge.net/download/debian/woody/ ./ deb-src http://bluez.sourceforge.net/download/debian/woody/ ./
Sitten katsoin käskyllä apt-cache search bluez*, mitä ajan tasalla olevia bluetooth-paketteja on saatavilla. Seuraavaksi asensin käskyllä apt-get install bluez-utils tarvittavat paketit.
Lisäksi asensin sivulta http://kotinetti.suomi.net/mcfrisk/linux_gprs.html#id2428855 yhteys-skriptit gprs, gprs-connect-chat ja gprs-disconnect-chat.
Seuraavat tiedostot kaipaavat muokkausta (muutokset tehty):
#
# RFCOMM configuration file.
#
# $Id: rfcomm.conf,v 1.1 2002/10/07 05:58:18 maxk Exp $
#
rfcomm0 {
# Automatically bind the device at startup
bind yes;
# Bluetooth address of the device
device 00:80:37:55:B3:07;
# RFCOMM channel for the connection
channel 1;
# Description of the connection
comment "Ericsson T68i Bluetooth device";
}
Seuraavien tiedostojen 'provider' tilalla voit käyttää mitä tahansa nimeä, esim. dna, jos vaan pidät huolen tarvittavista viittauksista oikeisiin tiedostoihin. Muutokset voit tehdä myös pppconfig-ohjelmalla (toimii ainakin Debianissa).
# This is the chat script used to dial out to your default service provider. # Please customize the entries enclosed in parenthesis to match your setup. # Only the "provider" file will be handled by poff and pon (unless with # extra command line arguments). # # Remember to edit /etc/ppp/peers/provider accordingly. # # ATZW2 as a default init string # - On all hayes compatible modems, W2 will correctly report the connect # speed. # ABORT BUSY ABORT "NO CARRIER" ABORT VOICE ABORT "NO DIALTONE" "" AT+CGDCONT=1,"IP","internet" OK ATDT*99***1# # login (put login name here) # word \q(put password here)
# These are the options to dial out to your default service provider. # Please customize them correctly. Only the "provider" file will be # handled by poff and pon (unless with extra command line arguments). # You usually need this if there is no PAP authentication noauth # The chat script (be sure to edit that file, too!) connect "/usr/sbin/chat -v -f /etc/chatscripts/provider" # Set up routing to go through this PPP link defaultroute # Default modem (you better replace this with /dev/ttySx!) /dev/rfcomm0 115200 # Speed 115200 # Keep modem up even if connection fails persist local nocrtscts noipdefault usepeerdns
# lcp-echo-interval 30 # lcp-echo-failure 4
nameserver 217.78.192.78 nameserver 217.78.192.22
Nimipalvelimia ei tarvitse määritellä, jos puhelimesi tukee 'usepeerdns' optiota (/etc/ppp/peers/provider tai /etc/ppp/peers/gprs tiedostossa).
options ppp_async flag_time=0
Aja Debianissa update-modules, joka päivittää /etc/modules.conf-tiedoston (älä muokkaa tiedostoa suoraan!).
# BlueZ modules alias net-pf-31 hci_usb alias bt-proto-0 l2cap alias bt-proto-2 sco alias bt-proto-3 rfcomm alias bt-proto-4 bnep alias tty-ldisc-15 hci_uart alias char-major-10-250 hci_vhci
#!/bin/sh # # File: # chat-gprs-connect # The actual chat script: exec chat \ TIMEOUT 5 \ ECHO ON \ ABORT '\nBUSY\r' \ ABORT '\nERROR\r' \ ABORT '\nNO ANSWER\r' \ ABORT '\nNO CARRIER\r' \ ABORT '\nNO DIALTONE\r' \ ABORT '\nRINGING\r\n\r\nRINGING\r' \ '' \rAT \ TIMEOUT 12 \ SAY "Press CTRL-C to close the connection at any stage!" \ SAY "\ndefining PDP context...\n" \ OK ATH \ OK ATE1 \ OK 'AT+CGDCONT=1,"IP","internet"' \ OK ATD*99***1# \ TIMEOUT 22 \ SAY "\nwaiting for connect...\n" \ CONNECT "" \ SAY "\nConnected." \ SAY "\nIf the following ppp negotiations fail,\n" \ SAY "try restarting the phone.\n"
Kirjoita konsolissa superuserina (su) lsmod, nin näet ladatut moduulit:
l2cap 17408 1 (autoclean) bluez 35048 1 (autoclean) [l2cap] usbcore 76992 1
Koska tarvittavia bluetooth-ajureita ei tässä tapauksessa ollut ladattu, niin ne pitää ladata käsin:
# modprobe hci_usb # modprobe usb-uhci
BlueZ käynnistetään kirjoittamalla: /etc/init.d/bluez-utils start. Nyt pitäisi ruudulle ilmestyä teksti: Starting bluez-utils: hcid. Ohjelma lopetetaan käskyllä /etc/init.d/bluez-utils stop
Kokeile seuraavaksi, että bluetooth-sovitin toimii kirjoittamalla: hciconfig. Näytölle pitäisi tulla seuraavanlaista tekstiä:
# hciconfig
hci0: Type: USB
BD Address: 00:08:1B:00:1B:E7 ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:0 acl:0 sco:0 events:0 errors:0
TX bytes:0 acl:0 sco:0 commands:0 errors:0
Seuraavaksi skannataan yhteys puhelimen ja sovittimen välille kirjoittamalla hcitool scan (puhelin pitää olla haettavissa!):
# hcitool scan
Scanning ...
00:80:37:55:B3:07 T68i
Seuraavaksi sidotaan yhteys puhelimen ja sovittimen välille:
# rfcomm bind /dev/rfcomm0 00:80:37:55:B3:07
Sitten yriettään muodostaa yhteys gprs-ohjelmalla: pppd call gprs
# pppd call gprs Press CTRL-C to close the connection at any stage! defining PDP context... ~AT OK ATE1 OK AT+CGDCONT=1,"IP","internet" OK waiting for connect... ATD*99***1# CONNECT Connected. If the following ppp negotiations fail, try restarting the phone. Serial connection established. using channel 10 Using interface ppp0 # jne. jos yhteys ei katkennut...
Debianin mukana tulee valmiina helppokäyttöinen ohjelma, pon. Myös kppp on hyvä ohjelma yhteyden muodostamiseen.
Jos tarvittavat moduulit on ladattu /etc/modules.conf-tiedostossa (niitä ei enää tarvitse ladata erikseen käsin), niin ainoastaan seuraavat vaiheet tarvitaan yhteyden muodostamiseen:
# /etc/init.d/bluez-utils start
Starting bluez-utils: hcid
# hcitool scan
Scanning ...
00:80:37:55:B3:07 T68i
# rfcomm bind /dev/rfcomm0 00:80:37:55:B3:07 (tämän tilalle oman sovittimesi osoite)
# pppd call gprs Press CTRL-C to close the connection at any stage!
Yksityiskohtainen seloteko Bluetooth + GPRS -yhdistelmän asennuksesta Debianiin löytyy linkistä http://www.hut.fi/u/kehannin/bluetooth/bluetooth.html. Sivulla http://kotinetti.suomi.net/mcfrisk/linux_gprs.html on vielä sitäkin yksityiskohtaisempi ohje asennuksesta (gprs + Bluetooth, IrDA, sarjakaapeli).
Päivitetty viimeksi: 11.1.2005
Copyright © 2003 Tapani Räikkönen. All rights reserved.