Differences between revisions 1 and 14 (spanning 13 versions)
Revision 1 as of 2007-03-19 13:56:51
Size: 4661
Editor: Epeli
Comment:
Revision 14 as of 2007-03-31 02:00:25
Size: 7106
Editor: samiojanen
Comment: Kannattaisiko mainita, että CA-42 datakaapeli sopii Nokian malleille 3100, 3120, 3220, 5100, 5140, 5140i, 6020, 6021,6070, 6100, 6101, 6103, 6220, 6610, 6610i, 6800 jne. Lähde kaapelin ostopakkaus
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
Hyvin keskeneräinen ohje. Toimii aluksi itselleni muistilistana. Kun saan homman toimimaan kunnolla teen kunnollisen ohjeen. Näillä asetuksilla olen saanut Kubuntu Edgyn nettiin käytteän Nokia N70:tä Saunalahden liittymällä.

 * Parita ensin laite koneen kanssa
Mac osoite
{{{
hcitool scan
}}}

RFCOMM:n kanava (channel)
{{{
sdptool browse 00:15:A0:7A:1D:5A
}}}




'''/etc/bluetooth/rfcomm.conf'''
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.
Line 24: Line 62:
# # Bluetooth address of the device # # Puhelimen mac-osoite tähän
Line 27: Line 65:
# # RFCOMM channel for the connection # # RFCOMM:n kanava tähän.
Line 34: Line 72:
{{{
sudo /etc/init.d/bluetooth restart
}}}

== Soittoasetukset ==

'''/etc/ppp/peers/3g''' (Saunalahti)
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.
Line 45: Line 86:
Line 49: Line 89:
Line 53: Line 92:
Line 56: Line 94:
Line 59: Line 96:
connect /etc/ppp/3g-connect-chat
connect /etc/ppp/saunalahti-connect-chat
Line 63: Line 99:
disconnect /etc/ppp/3g-disconnect-chat
disconnect /etc/ppp/saunalahti-disconnect-chat
Line 66: Line 101:
#/dev/ttyACM0 # Data cable device file
/dev/rfcomm0 # Bluetooth device file


# HUOM! Ota komentti pois sen kohdalta kumpaa yhteystapaa haluat käyttää.
#/dev/ttyACM0 # Datakaapeliyhteys
#/dev/rfcomm0 # Bluetoothyhteys
Line 74: Line 107:
Line 79: Line 111:
Line 82: Line 113:
Line 89: Line 119:
Line 92: Line 121:
Line 95: Line 123:
Line 98: Line 125:
Line 113: Line 139:
Line 116: Line 141:
Line 124: Line 148:
Line 128: Line 151:
Line 131: Line 153:

'''/etc/ppp/3g-connect-chat'''
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ä:
Line 151: Line 173:

}}}

'''/etc/ppp/3g-disconnect-chat'''
}}}
Ja vastaavasti scripti jolla yhteys katkaistaa tiedostoon '''/etc/ppp/saunalahti-disconnect-chat''' ja sinne tulee seuraavaa:
Line 164: Line 185:

}}}
{{{
sudo chmod +x /etc/ppp/3g-* 
}}}

}}}
Annetaan niille suoritusoikeudet.

{{{
$ sudo chmod +x /etc/ppp/saunalahti-*
}}}
Line 172: Line 192:
{{{
sudo pon 3g
}}}


== Linkkejä ==
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) ==
Line 180: Line 206:
 * http://www.lynchconsulting.com.au/blog/index.cfm/2006/12/11/Nokia-N73-Bluetooth-modem-with-Ubuntu-Linux-Howto

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-*

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)