Differences between revisions 10 and 15 (spanning 5 versions)
Revision 10 as of 2007-03-24 08:48:10
Size: 7070
Editor: Epeli
Comment:
Revision 15 as of 2007-03-31 07:03:49
Size: 7175
Editor: Epeli
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:

Yhteys on mahdollista tehdä joko bluetoothin tai kännykän datakaapelin kautta. Omien testieni mukaan datakaapeli yhteys toimii huomattavasti ongelmattomammin lähinnä bluetoothparitus ongelmien takia joita (k)Ubuntussa näyttää olevan riittämiin.

=== Testatusti toimivat matkapuhelimet ===

 * Nokia N70, CA-53 datakaapeli (usb)




Yhteys on mahdollista tehdä joko bluetoothin tai kännykän datakaapelin kautta.

=== Testatut matkapuhelimet ===
 * Nokia N70, CA-53 datakaapeli (usb) & bluetooth
 * Nokia 6822, CA-42 datakaapeli (usb) (bluetooth:lla epäonnistui)
Line 14: Line 8:
Jos olet onnistunut tekemään toimivan parituksen matkapuhelimen ja koneen kanssa niin voit koittaa yhteyttä bluetoothin kautta seuraavasti.

Ensiksi pitää selvittää mikä on matkapuhelimesi mac-osoite.
Parita ensin puhelin tietokoneen kanssa. (Nokia N70: yhdeydet –> bluetooth –> laiteparit –> lisää uusi laite). Parituksen epäonnistuminen saattaa johtua ISCAN:n puuttumisesta. Homman voi tarvittaessa korjata näillä komennoilla:

{{{
$ sudo hciconfig hci0 down
$ sudo hciconfig hci0 up PISCAN
}}}
Ja sitten asiaan.

Ensiksi pitää selvittää mikä matkapuhelimen mac-osoite.
Line 21: Line 22:
Line 24: Line 26:
Ota siis 00:15:A0:7A:1D:5A osoite ylös.   Ota siis 00:15:A0:7A:1D:5A osoite ylös.
Line 28: Line 29:
Line 32: Line 34:
Line 51: Line 54:

Line 54: Line 55:
Line 56: Line 56:
Line 72: Line 73:
{{{
$ sudo /etc/init.d/bluetooth restart 
}}}


{{{
$ sudo /etc/init.d/bluetooth restart
}}}
Line 78: Line 78:
Line 82: Line 81:
Line 86: Line 86:
Line 90: Line 89:
Line 94: Line 92:
Line 97: Line 94:
Line 101: Line 97:
Line 105: Line 100:
Line 107: Line 101:
Line 111: Line 104:


Line 117: Line 107:
Line 122: Line 111:
Line 125: Line 113:
Line 132: Line 119:
Line 135: Line 121:
Line 138: Line 123:
Line 141: Line 125:
Line 156: Line 139:
Line 159: Line 141:
Line 167: Line 148:
Line 171: Line 151:
Line 174: Line 153:


Line 178: Line 154:
Line 196: Line 173:

}}}

Ja vastaavasti scripti jolla yhteys katkaistaa tiedostoon '''/etc/ppp/3g-disconnect-chat''' ja sinne tulee seuraavaa:
}}}
Ja vastaavasti scripti jolla yhteys katkaistaa tiedostoon '''/etc/ppp/saunalahti-disconnect-chat''' ja sinne tulee seuraavaa:
Line 209: Line 185:
Line 212: Line 187:
{{{
$ sudo chmod +x /etc/ppp/3g-*
}}}

{{{
$ sudo chmod +x /etc/ppp/saunalahti-*
}}}

=== Muut operaattorit ===
 * [:Matkapuhelin_modeemina_dna:dna]
Line 219: Line 197:
{{{
$ pon 3g
}}}

{{{
$ pon saunalahti
}}}

Matkapuhelin modeemina

Yhteys on mahdollista tehdä joko bluetoothin tai kännykän datakaapelin kautta.

Testatut matkapuhelimet

  • Nokia N70, CA-53 datakaapeli (usb) & bluetooth

  • Nokia 6822, CA-42 datakaapeli (usb) (bluetooth:lla epäonnistui)

Bluetooth

Parita ensin puhelin tietokoneen kanssa. (Nokia N70: yhdeydet –> bluetooth –> laiteparit –> lisää uusi laite). Parituksen epäonnistuminen saattaa johtua ISCAN:n puuttumisesta. Homman voi tarvittaessa korjata näillä komennoilla:

$ sudo hciconfig hci0 down
$ sudo hciconfig hci0 up PISCAN

Ja sitten asiaan.

Ensiksi pitää selvittää mikä matkapuhelimen mac-osoite.

$ hcitool scan

Tulostuu esimerkiksi seuraavaa:

00:15:A0:7A:1D:5A       Epelin N70

Ota siis 00:15:A0:7A:1D:5A osoite ylös.

Sitten pitää selvittää mitä kanvaaa kännykän modeemi(RFCOMM) käyttää.

$ sdptool browse 00:15:A0:7A:1D:5A

Komento tulostaa listan eri ominaisuuksista joita puhelimessa on. Etsi kohta Dial-Up Networking.

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

Tässä tapauksessa kanava on siis kolme.

Bluetooth asetukset

Muokkaa tiedosto /etc/bluetooth/rfcomm.conf vastaavaksi tämän kanssa.

rfcomm0 {
# Automatically bind the device at startup
bind yes;
#
# # Puhelimen mac-osoite tähän
device 00:15:A0:7A:1D:5A;
#
# # RFCOMM:n kanava tähän.
channel 3;
#
# # Description of the connection
comment "Nokia N70";
}

Tämän jälkeen käynnistä bluetooth-palvelu uudestaan.

$ sudo /etc/init.d/bluetooth restart

Yhteysasetukset

Tässä tehdään asetukset vain Saunalahtea varten. Voit yrittää kysellä operaattoriltasi omia asetuksiasi. Katso myös tähän ohjeeseen liittyvä [http://forum.ubuntu-fi.org/index.php?topic=9055.0 viestiketju].

Yhteysasetukset tulevat hakemistoon /etc/ppp/peers/ eli luo esimerkiksi tiedosto /etc/ppp/peers/saunalahti ja laita sinne seuraavat asetukset (Saunalahti). Käy tiedosto läpi ja muuta sinne tarvittavat kohdat itsellesi sopiviksi.

# Most GPRS phones don't reply to LCP echo's
lcp-echo-failure 0
lcp-echo-interval 0
# Keep pppd attached to the terminal:
# Comment this to get daemon mode pppd
nodetach
# Debug info from pppd:
# Comment this off, if you don't need more info
debug
# Show password in debug messages
show-password
# Connect script:
# scripts to initialize the GPRS modem and start the connection,
connect /etc/ppp/saunalahti-connect-chat
# Disconnect script:
# AT commands used to 'hangup' the GPRS connection.
disconnect /etc/ppp/saunalahti-disconnect-chat
# Serial device to which the GPRS phone is connected:
# HUOM! Ota komentti pois sen kohdalta kumpaa yhteystapaa haluat käyttää.
#/dev/ttyACM0    # Datakaapeliyhteys
#/dev/rfcomm0      # Bluetoothyhteys
# Serial port line speed
115200  # fast enough
#57600
# Hardware flow control:
# Use hardware flow control with cable, Bluetooth and USB but not with IrDA.
crtscts  # serial cable, Bluetooth and USB, on some occations with IrDA too
#nocrtscts # IrDA
# Ignore carrier detect signal from the modem:
local
# IP addresses:
# - accept peers idea of our local address and set address peer as 10.0.0.1
# (any address would do, since IPCP gives 0.0.0.0 to it)
# - if you use the 10. network at home or something and pppd rejects it,
# change the address to something else
0.0.0.0:0.0.0.0
# pppd must not propose any IP address to the peer!
noipdefault
# Accept peers idea of our local address
ipcp-accept-local
# Add the ppp interface as default route to the IP routing table
defaultroute
# DNS servers from the phone:
# some phones support this, some don't.
usepeerdns
# ppp compression:
# ppp compression may be used between the phone and the pppd, but the
# serial connection is usually not the bottleneck in GPRS, so the
# compression is useless (and with some phones need to disabled before
# the LCP negotiations succeed).
novj
nobsdcomp
novjccomp
nopcomp
noaccomp
noccp
# The phone is not required to authenticate:
noauth
# Username and password:
# If username and password are required by the APN, put here the username
# and put the username-password combination to the secrets file:
# /etc/ppp/pap-secrets for PAP and /etc/ppp/chap-secrets for CHAP
# authentication. See pppd man pages for details.
user "none"
password 12346
#
mtu 1500
mru 1500
asyncmap 0xa0000

Luodaan seuraavaksi scripti joka luo yhteyden. Varmistu että yhteysasetus -tiedostossa on oikeat polut tähän. Luo tiedosto /etc/ppp/saunalahti-connect-chat seuraavalla sisällöllä:

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'    \
        ''              AT                              \
        OK              ATH                             \
        OK              ATE1                            \
        OK              'AT+CGDCONT=1,"IP","internet.saunalahti","0.0.0.0",0,0' \
        OK              ATD*99#                         \
        TIMEOUT         22                              \
        CONNECT         ""

Ja vastaavasti scripti jolla yhteys katkaistaa tiedostoon /etc/ppp/saunalahti-disconnect-chat ja sinne tulee seuraavaa:

exec /usr/sbin/chat -V -s -S \
ABORT "BUSY" \
ABORT "ERROR" \
ABORT "NO DIALTONE" \
SAY "\nSending break to the modem\n" \
"" "K" "" "K" "" "K" "" \
"+++ATH" "" "+++ATH" "" "+++ATH"

Annetaan niille suoritusoikeudet.

$ sudo chmod +x /etc/ppp/saunalahti-*

Muut operaattorit

  • [:Matkapuhelin_modeemina_dna:dna]

Yhdistäminen

Lopuksi yhteyden voi sitten luoda komennolla:

$ pon saunalahti

Ja sitten surffaamaan

Ctrl+C:llä voi katkaista yhteyden. Kännykän (ainakin Nokia N70) Connection mangerilla voi seurata yhteyden käyttöä. Näyttää mm. sen hetkiset down/up nopeudet ja siirretyn datamäärän.

[http://forum.ubuntu-fi.org/index.php?topic=9055.0 Keskustelua aiheesta foorumilla]

Linkkejä (lähteet)