Автор Тема: Как да подкарам ma 620  (Прочетена 1269 пъти)

Vatman

  • Напреднали
  • *****
  • Публикации: 315
  • Distribution: openSuSE 11.3
  • Window Manager: KDE 4.4
    • Профил
    • WWW
Как да подкарам ma 620
« -: Apr 27, 2006, 15:31 »
Това е IrDA устройство, което се пъха в USB-то. Искам през комп-а да прехвърлям снимки на GSM-ма си.
Активен

Момчета, нищо не разбирам от компютри, научете ме да съм хакер.

hafte

  • Напреднали
  • *****
  • Публикации: 215
    • Профил
Как да подкарам ma 620
« Отговор #1 -: Apr 27, 2006, 16:10 »
И аз търся нещо подобно но май няма GUI за send file via infrared под линукс.
Под win  е лесно ама .... не може всички благини на едно място.
Активен

aaaaaa

  • Напреднали
  • *****
  • Публикации: 971
    • Профил
Как да подкарам ma 620
« Отговор #2 -: Apr 27, 2006, 17:03 »
Цитат
MA620 and Linux, or There and Back Again

Thanks to the the irda-users mailing list and frantic searching on Google, I managed to get the dongle working with Linux at 9600bps (bits per second) within a day or so. The various modules that you need to accomplish this are:

    * uhci_hcd
    * pl2303
    * irda
    * irtty-sir
    * ma600-sir
    * ircomm-tty

From what I understand, the -sir modules are the USB versions of the corresponding serial IR modules. My original script to enable the dongle was:

================================================================
#!/bin/sh
#
# Minimal stuff required to get the MA620 USB IRDA dongle recognised by
# the kernel.  Version 1 -- works with unpatched kernel, but only at
# 9600bps.

modprobe uhci_hcd
modprobe pl2303
modprobe irda
echo 9600 > /proc/sys/net/irda/max_baud_rate
modprobe irtty-sir
modprobe ma600-sir
modprobe ircomm-tty
irattach /dev/usb/ttyUSB0 -d ma600 -s

exit 0
================================================================

As you would guess, the echo 9600 line limits the rate of the IrDA dongle to 9600bps. This is because the MA620 driver is still being worked on and there's a small bug that causes problems at higher speeds.

On submitting this problem to the irda-users mailing list, Martin Diehl suggested a small change in the kernel. I quote him:

    Simply try editing the file linux/drivers/net/irda/ma600-sir.c. In line 197 (2.6.7-vanilla) change the "#if 1" to read "#if 0" and rebuild your module. By chance this will help you out because the speed chance was likely working, just the verification failed.

Being part of the ``Top 10 Clueless About Kernel List'', I blindly followed his suggestion and rebuilt the kernel, and lo and behold, suddenly I could use the dongle at higher speeds.

With Martin's change in place I've so far used the USB port at up to 115200bps without problems. The speed still kind of sucks when transferring MP3s to the phone (more about that later), but baby, let me tell you, it's definitely an improvement over 9600bps!

Here's the new script for enabling the MA620 USB IrDA dongle with a patched kernel 2.6.7:

================================================================
#!/bin/sh
#
# Minimal stuff required to get the MA620 USB IRDA dongle recognised by
# the kernel.  Version 2 -- works only with kernel patched with Martin
# Diehl's #if 0, at up to 115200bps.

modprobe uhci_hcd
modprobe pl2303
modprobe irda
modprobe irtty-sir
modprobe ma600-sir
modprobe ircomm-tty
irattach /dev/usb/ttyUSB0 -d ma600 -s

exit 0
================================================================

All that has happened is that the line limiting the IR rate to 9600bps before loading the remaining drivers has vanished. L33t, huh? '<img'>

After you start IrDA (and assuming everything works OK), you should see something like the following when you put the phone (with cover open) in front of the dongle and run irdadump(8):

================================================================
14:19:49.808390 xid:rsp 3f8d7c1b > e3afec86 S=6 s=3 mail hint=0400 [ Computer ] (20)
14:19:50.205921 xid:cmd ffffffff < e3afec86 S=6 s=* A760 hint=c124 [ PnP LAN Access IrCOMM IrOBEX ] (21)
================================================================

The files in /proc/net/irda have the following contents, which I cannot decipher but presumably someone can, otherwise they wouldn't be there:

================================================================
*** /proc/net/irda/discovery:
IrLMP: Discovery log:

nickname: A760, hint: 0xc124, saddr: 0x3f8d7c1b, daddr: 0xe9877945

*** /proc/net/irda/ircomm:

*** /proc/net/irda/irias:
LM-IAS Objects:
name: Device, id=0
 - Attribute name: "IrLMPSupport", value[IAS_OCT_SEQ]: octet sequence (3 bytes)

 - Attribute name: "DeviceName", value[IAS_STRING]: "mail"


*** /proc/net/irda/irlap:
irlap0 state: LAP_NDM
  device name: irda0, hardware name: ttyUSB0
  caddr: 0x20, saddr: 0x3f8d7c1b, daddr: 0x000000
  win size: 0, win: 0, line capacity: 0, bytes left: 0
  tx queue len: 0 win queue len: 0 rbusy: FALSE mbusy: FALSE
  retrans: 0 vs: 0 vr: 0 va: 0
  qos   bps     maxtt   dsize   winsize addbofs mintt   ldisc   comp
  tx    9600    0       64      1       12      0       0
  rx    9600    0       64      1       12      0       0

*** /proc/net/irda/irlmp:
Unconnected LSAPs:
lsap state: LSAP_DISCONNECTED, slsap_sel: 0x0, dlsap_sel: 0xff, (IrIAS srv)

Registered Link Layers:
lap state: LAP_STANDBY, saddr: 0x3f8d7c1b, daddr: 0xffffffff, num lsaps: 0

  Connected LSAPs:

*** /proc/net/irda/irttp:

Това, като че ли е най - доброто, което намерих. Спомням си, че преди време успях да го подкарам и дори свалях картинки от телефона на компютъра (снимка,), но неизвестно защото когато пробвах на следващият ден абсолютно същата процедура и не успях. От тогава не съм успявал да прехвърлям картинки между телефона и компютъра, а понеже не ми е особено важно не съм и опитвал много.
Активен

...to boldly go where no one has gone before...

Vatman

  • Напреднали
  • *****
  • Публикации: 315
  • Distribution: openSuSE 11.3
  • Window Manager: KDE 4.4
    • Профил
    • WWW
Как да подкарам ma 620
« Отговор #3 -: Apr 28, 2006, 09:24 »
А от къде да ги взема тези модули и как да ги заредя '<img'> ?
Активен

Момчета, нищо не разбирам от компютри, научете ме да съм хакер.

aaaaaa

  • Напреднали
  • *****
  • Публикации: 971
    • Профил
Как да подкарам ma 620
« Отговор #4 -: Apr 28, 2006, 09:42 »
То е написано как се зареждат.
Цитат
modprobe име на модула
Активен

...to boldly go where no one has gone before...