SymbianOS.pl
Home Artykuły Porady Przesyłanie plików z i do Nokii pod Linuksem

Przesyłanie plików z i do Nokii pod Linuksem

Instrukcja dotyczy dystrybucji Linuksa Ubuntu 6.10 Edgy Eft (możliwe także, że zadziała pod Debianem lub Ubuntu 6.06 Dapper Drake).

Zaczynamy od instalacji libopenobex1 i obexftp:

Wchodzimy w konsolę i wpisujemy:
    $ sudo apt-get install libopenobex1 obexftp
Podpinamy telefon do kabla USB i wpisujemy w konsoli:
    $ obex_test -u
Jeśli wszystko jest OK powinniśmy dostać komunikat podobny do tego:
    Using USB transport, querying available interfaces
    Interface 0: Nokia Nokia 6630 SYNCML-SYNC
    Interface 1: Nokia Nokia 6630 PC Suite Services
    Use '~/usbobex/bin/obex_test -u interface_number' to run interactive OBEX test client
Jeśli natomiast pojawi się informacja o braku zezwoleń i/lub przy napisie Interface 0 i 1 nie będzie nazwy telefonu w konsoli wpisujemy:
    $ lsusb
Otrzymamy wtedy Vendor ID i Product ID, czyli, np.
    Bus 001 Device 006: ID 0421:0410 Nokia Mobile Phones 6630 Imaging Smartphone
Edytujemy wtedy wpis w pliku /etc/udev/rules.d/020_permissions.rules:
    $ sudo gedit /etc/udev/rules.d/020_permissions.rules
i jako treść umieszczamy to:
    BUS=="usb", SYSFS{idVendor}=="0421", SYSFS{idProduct}=="0410", GROUP="grupa", USER="użytkownik"
W miejsce 0421 wpisujemy nasz Vendor ID, zamiast 0410 nasz Product ID, a zamiast grupa i użytkownik, naszą grupę i użytkownika. Zapisujemy i zamykamy plik.

Restatrujemy udev i sprawdzamy połączenie z telefonem:
    $ sudo /etc/init.d/udev restart
    $ obexftp -u 1 -c C:/ -l


Jeśli uzyskamy wynik podobny do tego:
    Superuser privileges are required to access USB. Connecting...done Sending "C:"... done Receiving "(null)"... ]> done Disconnecting...done


oznacza to, że wszystko działa.

Jednak korzystanie z tego w trybie tekstowym jest niezbyt wygodne, więc zainstalujemy program ObexTOOL.

Ściągamy ObexTOOL i TableList 4.5 do katalogu ~/usbobex.
    $ tar -zxvf ~/tablelist4.5.tar.gz
    $ sudo mv tablelist4.5 /usr/lib
    $ tar -zxvf ~/obextool-0.33.tar.gz
    $ cd obextool-0.33
    $ gedit etc/obexwrap.sh
W tym pliku podmieniamy linię:
    obexftp -t /dev/modem "$@"
na:
    $HOME/usbobex/bin/obexftp -u 1 "$@"
i zapisujemy.

Teraz w konsoli wpisujemy:
    $ gedit obextool.tk
i podmieniamy linię:
    exec wish "$0" ${1+"$@"}
na:
    TCLLIBPATH=/usr/lib/tablelist4.5/ exec wish "$0" ${1+"$@"}
i zapisujemy.
    $ gedit etc/obextool.cfg
Zmieniamy zawartość tego pliku na taką:
    ###
    ### Obex tool configuration file
    ###
    set ObexConfig(cfg_file,version) "0.33"

    ###
    ### Language setting - 2 characters or environment
    ### keywords LOCALE, LC_MESSAGES, LC_ALL and LANG
    ### LOCALE honours $LC_ALL, $LC_MESSAGES and
    ### $LANG in order
    ###
    # set ObexConfig(config,language) en
    # set ObexConfig(config,language) de
    # set ObexConfig(config,language) da
    set ObexConfig(config,language) LOCALE
    # set ObexConfig(config,language) LC_MESSAGES
    # set ObexConfig(config,language) LC_ALL
    # set ObexConfig(config,language) LANG

    ###
    ### Date format in the file listings
    ### Format descriptors:
    ### Y - 4 digit year
    ### Z - 2 digit year
    ### M - 2 digit month
    ### D - 2 digit day
    ### H - 2 digit hour
    ### N - 2 digit minute
    ### S - 2 digit seconds
    ### Note: detailed list view becomes sorted alphabetically!
    ###
    # set ObexConfig(file,datefmt) "D.M.Y H:M"
    set ObexConfig(file,datefmt) "Y-M-D H:M"

    ###
    ### Temporary file path and prefix
    ###
    set ObexConfig(temp,prefix) "/tmp/otmp"
    # set ObexConfig(temp,prefix) "~/otmp"

    ### if encoding is wanted...
    set ObexConfig(config,encoding) "utf-8"
    ### ... else activate next line ...
    # set ObexConfig(cfg,encoding) ""

    ### if html quoting is wanted...
    set ObexConfig(config,quote_map) {""" "'" "'" "'"}
    ### ... else activate next line ...
    # set ObexConfig(config,quote_map) ""

    ### Siemens S65V requires the trailing slash on obexftp ls
    set ObexConfig(config,add_lslash) "/"
    ### ... deactivate "feature" if not working for you
    # set ObexConfig(config,add_lslash) ""

    ### Nokia 6670 requires the trailing slash on all directory names
    set ObexConfig(config,dir_slash) 1
    #set ObexConfig(config,dir_slash) 0

    ###
    ### Enable memory status display - only works with Siemens :-(
    ###
    # set ObexConfig(config,memstatus) 1
    set ObexConfig(config,memstatus) 0

    ###
    ### Enable file move command - only works with Siemens :-(
    ###
    # set ObexConfig(config,filemove) 1
    set ObexConfig(config,filemove) 0

    ###
    ### Busy cursor
    ###
    set ObexConfig(gui,cursor) watch

    ###
    ### Baloon help options
    ###
    set ObexConfig(gui,help_options) {-bg #ffffc0 -font {Helvetica 10}}

    ###
    ### Memory status bar colors (red, green)
    ###
    set ObexConfig(gui,status_bg) #C00000
    set ObexConfig(gui,status_fg) #00C000

    ###
    ### Initial main window size on startup
    ###
    set ObexConfig(gui,initsize) "800x600"

    ###
    ### Global dialog fonts
    ###
    set ObexConfig(font,labels) {Helvetica 12 bold}
    set ObexConfig(font,entries) {Helvetica 12}
    set ObexConfig(font,buttons) {Helvetica 12}
    set ObexConfig(font,frames) {Helvetica 12 bold}

    ###
    ### File list line height and font (tree_mode)
    ###
    set ObexConfig(tree,font) {Helvetica 12}
    set ObexConfig(tree,height) 21

    ###
    ### File list line height and font (list_mode)
    ###
    set ObexConfig(list,font) {Helvetica 12}
    set ObexConfig(list,lineheight) 22

    ###
    ### Icon view text parameters (icon_mode)
    ###
    set ObexConfig(icon,font) {Helvetica 12}
    set ObexConfig(icon,txt_maxlen) 12
    set ObexConfig(icon,lineheight) 18
    ###
    ### Icon view position parameters
    ###
    set ObexConfig(icon,xstart) 50
    set ObexConfig(icon,ystart) 40
    set ObexConfig(icon,x_offs) 80
    set ObexConfig(icon,y_offs) 100

    ###
    ### Text window parameters (file viewer, file/memory info...)
    ###
    set ObexConfig(textwin,font) {fixed 12 bold}
    set ObexConfig(textwin,width) 60
    set ObexConfig(textwin,height) 20

    ###
    ### ObexFTP command options
    ### Have a look into the obexftp man page
    ###
    set ObexConfig(fileopt,get) "--get"
    set ObexConfig(fileopt,put) "--put"
    set ObexConfig(fileopt,list) "--list"
    set ObexConfig(fileopt,move) "--move"
    set ObexConfig(fileopt,info) "--info"
    set ObexConfig(fileopt,chdir) "--chdir"
    set ObexConfig(fileopt,delete) "--delete"
    set ObexConfig(fileopt,version) "--version"

    ###
    ### System command for obexftp wrapper
    ### Will be ignored if OBEXCMD is specified
    ###
    set ObexConfig(obexftp,command) "$OBEXCFG/obexwrap.sh"

    ###
    ### Initial mode of list window
    ###
    # set ObexConfig(list,initmode) detail
    set ObexConfig(list,initmode) listb
    # set ObexConfig(list,initmode) icons

    puts "Found configuration file [info script] version $ObexConfig(cfg_file,version) ..."
Teraz w konsoli wpisujemy:
    $ sudo mv obextool-0.33 /opt/obextool
Natomiast na pulpicie tworzymy sobie nowy aktywator klikając PPM i wybierając Utwórz aktywator. W polu Nazwa wpisujemy dowolnie wybraną nazwę dla naszego skrótu, natomiast w polu polecenie wpisujemy:
    /opt/obextool/obextool.tk
klikamy na OK i cieszymy się przesyłaniem plików z i do telefonu przez kabel DKU-2.

Zmieniony ( Środa, 27 Maj 2009 22:54 )  

Polecamy



PDA.pl



Skąpiec

RSS