FreeBSD GPRS IrDA howto

Michal Varga varga at stonehenge.sk
Sat Jul 17 16:15:14 CEST 2004


Takze tady je ten /ne/slibeny postup, jak pod fbsd rozbehat GPRS pres
IrDA. Snad nekomu pomuze:


FreeBSD GPRS IrDA quick-and-dirty howto / Czech
-----------------------------------------------
verze: 0.0.0_0
autor: spaceman at stonehenge.sk
licence: public domain

Pro zacatek snad jedna dulezita informace - pouzity infraport musi
byt typu RS232 (tedy zavesen na klasickem "COM" portu), ruzne usb-
windows-only-software-only-irda-only-whatever-only-turbo-xp-dongle,
ktere pod MS Windows emuluji RS232 pres driver nebudou pod FreeBSD z
pochopitelnych duvodu bez prislusneho dodatecneho ovladace (ktery v
drvive vetsine pripadu neexistuje) pracovat. Bezny seriovy infraport
obsahuji prakticky vsechny notebooky, pri trose kreativity je mozne
jej taky vyrobit "na kolene" (Google) a soude dle jistych legend i
koupit.

Infraport muze bezet v IrDA, nebo FIR (Fast-Infra-Red) modu - v tom
druhem pripade bude IrDA emulovat, nebo se o to alespon pokusi. Pokud
se mu to nahodou nepovede, vetsina notebooku umoznuje v BIOSu
prepnout port do IrDA modu primo. Co se taky obcas nepovede. V tom
pripade ten Acer zahodte.

Postup je primo psany pro konfiguraci FIR + Nokia 6310 + Oskar GPRS +
FreeBSD 5.2.1-CURRENT, ale aplikovatelny je prakticky pro vsechny
ostatni konfigurace. Doufam.

A ted snad k samotnemu postupu, jak GPRS pres IrDA rozbehat:

1.0 - Nainstalujeme si port comms/birda

2.0 - Pripravime si config pro ppp, tedy '/etc/ppp/ppp.conf' s
      obsahem podobnym tomuto:

---tady strihej---
  default:
    set log local Chat tun command
    set device /dev/ttyqf
    set speed 115200
    set ctsrts off


    # neni dulezite, spis jenom autorova preference (man ppp):
    #
    #set ifqueue 50


    # (man ppp)
    #
    set accmap 000a0000


    # za jistych okolnosti muze vyresit problemy s latenci, za jinych
    # okolnosti pekne rozmrdat spojeni, zapnout na vlastni riziko:
    #
    #set mtu 296


    ident user-ppp VERSION (built COMPILATIONDATE)


    # Inicializacni AT+CGDCONT string se lisi provider od providera,
    # dulezite je zejmena nastaveni GPRS pristupoveho bodu - v nasem
    # pripade to bude Oskaruv pristup "ointernet":
    #
    set dial "TIMEOUT 30 \
    ABORT BUSY ABORT ERROR ABORT NO\\sANSWER ABORT NO\sCARRIER \
    ABORT NO\\sDIALTONE \
    \"\" AT OK \
    AT+CGDCONT=1,\\\"ip\\\",\\\"ointernet\\\" OK \
    ATDT*99# CONNECT"


    set timeout 0
    enable dns
    set authname gprs
    set authkey gprs
    set ifaddr 0 0 255.255.255.0
    add default HISADDR
---tady uz vic nestrihej---


3.0 - Pripravime si dve terminalove konzoly, do obou se nalogujeme
      jako root

3.1 - Na telefonu aktivujeme IrDA prenos (man telefon)

3.2 - Utilitou 'ircomm' z portu 'birda' navazeme spojeni s telefonem.
      V nasem pripade bude '/dev/cuaa0' seriovy infraport. V beznych
      konfiguracich bude infra spis na '/dev/cuaa1', pripadne uplne
      jinde (man pocitac). Parametr '-v2' nam zabezpeci hlubsi
      diagnostiku pripadneho problemu s navazanim spojeni a
      '/dev/ptyqf' je pseudoterminal, na ktery chceme datovy tok
      presmerovat (man ircomm):

      # ircomm -v2 -d /dev/cuaa0 -y /dev/ptyqf

3.2.1 - Pokud vse probehlo v poradku, vystup z ircomm bude vypadat
        zhruba nasledovne:
  --
  discovered Nokia 6310, address=6420, hints=PnP, Modem, Fax,
  Telephony, IrCOMM, IrOBEX
  query completed
  115200 baud
  LAP connected
  comm connected
  --

3.3 - Ponechame ircomm bezet a prepneme se do druhe konzoly.

3.3.1 - Pro pripojeni na internet pouzijeme program 'ppp', ktery
        spustime bez parametru:

        # ppp

3.3.2 - Vystup z ppp by mohl vypadat treba nasledovne:

  --
  Working in interactive mode
  Using interface: tun0
  tun0: Command: default: set device /dev/ttyqf
  tun0: Command: default: set speed 115200
  tun0: Command: default: set ctsrts off
  tun0: Command: default: set accmap 000a0000
  tun0: Command: default: ident user-ppp VERSION (built 
  COMPILATIONDATE)
  tun0: Command: default: set dial TIMEOUT 30    ABORT BUSY ABORT
  ERROR ABORT NO\sANSWER ABORT NOsCARRIER ABORT NO\sDIALTONE    "" AT
  OK    AT+CGDCONT=1,\"ip\",\"ointernet\" OK    ATDT*99# CONNECT
  tun0: Command: default: set timeout 0
  tun0: Command: default: enable dns
  tun0: Command: default: set authname gprs
  tun0: Command: default: set authkey ********
  tun0: Command: default: set ifaddr 0 0 255.255.255.0
  tun0: Command: default: add default HISADDR
  ppp ON localhost>
  --

3.3.3 - Aktivujeme vytaceni prikazem 'dial':

  --
  ppp ON localhost> dial
  tun0: Command: /dev/ttyp0: dial
  tun0: Chat: deflink: Dial attempt 1 of 1
  ppp ON localhost> tun0: Chat: Send: AT
  tun0: Chat: Expect(30): OK
  tun0: Chat: Received: AT
  tun0: Chat: Received: OK
  tun0: Chat: Send: AT+CGDCONT=1,"ip","ointernet"
  tun0: Chat: Expect(30): OK
  tun0: Chat: Received: AT+CGDCONT=1,"ip","ointernet"
  tun0: Chat: Received: OK
  tun0: Chat: Send: ATDT*99#
  tun0: Chat: Expect(30): CONNECT
  tun0: Chat: Received: ATDT*99#
  tun0: Chat: Received: CONNECT
  --

3.3.4 - Chvili pockame az probehne autorizace a pripadny uspech
        uvidime na zmene command promptu 'ppp':

  --
  Ppp ON localhost>
  PPp ON localhost>
  PPP ON localhost>
  --

  Pokud se vsechny tri mala "p" zmeni na velka, jsme na internetu.
  Pokud ne, konzultujeme manual (man ppp).

3.4 - Ponechame ppp spusteny, nalogujeme se v dalsi konzole a
      otestujeme funkcnost internetu.

3.4.1 - Kdyz nas to prestane bavit, ppp vypneme prikazem 'quit'.
        Zruseni spojeni nam automaticky shodi i bezici ircomm a
        pokud nahodou ne, zrusime jej klavesovou kombinaci CTRL+C.

3.4.2 - Znovunavazani spojeni 'ircomm -> telefon' je mozne az po
        kratkem timeoutu (cca 15 sekund, zavisi pravdepodobne od
        modelu telefonu). Pokud ircomm spustime prilis brzo, bude se
        par vterin neuspesne snazit navazat spojeni a pak se ukonci.
        To prinasi nekolik zajimavych problemu v pripade, ze si 
        chceme cely postup 'ircomm -> telefon -> ppp -> dial'
        nascriptovat, ale reseni je jiz nad ramec tohoto navodu a
        neni zamerem autora jej rozepisovat.

4.0 - Konec.

-- 
Michal Varga <varga at stonehenge.sk>
Stonehenge




More information about the Users-l mailing list