十全十美(Perfect)-在 OpenSolaris 上使用 Huawei E220 HSDPA USB MODEM 透過 3.5G 連接上網 @ 太陽能(Solar Power) :: Xuite日誌
  • 恆易
  • ☯簡易、☯變易、☯不易
    想了解太陽能是什麼?
    請點選:版序
  • 關鍵字
  • 累積 | 今日
    loading......
  • 沒有新回應!
  • 有朋自遠方來
  • Locations of visitors to this page
    2009-10-10 10:10 十全十美(Perfect)-在 OpenSolaris 上使用 Huawei E220 HSDPA USB MODEM 透過 3.5G 連接上網
    平均分數:0 顆星    投票人數:0
    我要評分:

    OpenSolaris 是十全十美?沒有啦,今天是十月十日嘛!

    OpenSolaris is perfect (10 and 10)? No, Just because today is double ten, Republic of China (Taiwan)'s 98th National Day.

    『塞翁失馬,焉知非福』? 由於之前購買的 SAPIDO GR-1100 3.5G 超迷你易享機的插頭有問題必須送修,為了能續繼使用 3.5G 的網路只好想辦法讓 Huawei E220 HSDPA USB MODEM 能在 OpenSoalris 上使用。 經過將近兩天的搜尋及測試終於順利的將它安裝好了,以下是相關的設定程序及參考資料:

    When the old man from the frontier lost his horse, how could one have known that it would not be fortuitous? Because my SAPIDO GR-1100 3.5G Wireless Router is broken (power plug problem) and need to be repaired. In order to continue using 3.5G network, I need to have the Huawei E220 HSDPA USB MODEM working on OpenSoalris. After almost two days of searching and testing, it finally works, the following is the setup procedure and references:

    1. 關鍵問題
        在測試時發現會造成無法正常運作的兩個關鍵問題:
      1. 電力-我的『太陽能筆記型電腦』的USB連接埠供電不足,必須使用 E220 所附有兩個 USB 連接頭的連接線。
      2. 時間-將 E220 接到電腦的時機也很重要,因為系統有時會將 E220 誤認為是 storage ,而不是 device,必須使用 E220 所附有兩個 USB 連接頭的連接線來輔助。

    2. Critical Problems
        During the tests preformed, two critical problems have been found:
      1. Power - My "Powered by Sun Notebook"'s USB ports doesn't provide enough power to E220. Need to use the two ports USB cable that comes with E220.
      2. Time - The timing of connecting E220 to the computer is also very important. Because the system sometime recognized E220 as a storage, not a device. Need to use the two ports USB cable that comes with E220 to help.

    3. 系統設定
        重要的一個設定是告訴系統針對 E220 該使用那一個驅動程式。 在將 E220 連接到電腦後可以透過 dmesg 找到 product,vendor 的資訊。 然後就可以使用 update_drv 或 vi 指令,設定使用正確的驅動程式。

    4. System Settings
        One important setting is telling the system which device driver to use. After connecting E220 to the computer, use dmesg to find product,vendor information. Then use update_drv or vi to set correct device driver.
    5. root@X-Wing:/ # uname -a
      SunOS X-Wing 5.11 snv_124 i86pc i386 i86pc
      root@X-Wing:/ # psrinfo
      0	on-line   since 10/10/2009 08:36:29
      1	on-line   since 10/10/2009 08:36:36
      root@X-Wing:/ # dmesg
      ...
      Oct 10 09:55:45 X-Wing usba: [ID 912658 kern.info] USB 1.10 device (usb12d1,1003) operating at full speed (USB 1.x) on USB 1.10 root hub: device@1, usbsacm3 at bus address 2
      ...
      root@X-Wing:/ # update_drv -a -i 'usb12d1,1003' usbsacm
      
      root@X-Wing:/ # vi /etc/driver_aliases
      ...
      usbsacm "usb12d1,1003"
      ...
              
    6. 連接硬體
        這是最重要的部份,主要的目的就是透過適當的程序讓 OpenSolaris 使用正確的裝置檔案:
      1. 初始開機
      2. 在初始開機時,在電源打開時不要急著啟動 OpenSolaris。在 GRUB 的選單停留至少 15 秒,讓 E220 先有足夠的時間完成啟動程序。 會發現這個現象的原因是因為之前使用 -rv 的啟動參數,但是系統還是經常會誤認 E220 為 storage。 經過很多的測試發現這個現象與設定(如:/etc/path_to_inst, /etc/path_to_inst.old, /etc/system 中的參數)竟然都沒有關係。 後來想到試一試是否和時間有關係。結果發現只要延遲啟動 OpenSolaris,在未使用 -rv 的啟動參數之情形下仍可正常的偵測到 E220 為 device。
      3. 隨插即用
      4. 由於有上述的經驗,於是進一步的實驗發現:在 OpenSolaris 已啟動的情形下,第一次連接時會誤認為是 storage ,第二次連接時才會認為是 device。 因此訣竅就是使用有兩個 USB 連接埠的連接線,第一次連接後,只拔出主連接頭但是不要拔出作為 USB 供電用的連接頭,然後再接回主連接頭。 這時就會發現系統已正確的偵測到 E220 並使用正確的裝置檔案。

    7. Connecting Device
        This is the most important part, the primary goal is to have OpenSoalris use the correct device file via proper procedure performed -
      1. Initial Power-on
      2. At the initial power-on, after turned on the power switch, don't boot OpenSolaris right away. Wait at the GRUB menu for at lease 15 seconds, let E220 has enough time to complete its boot procedure. The reason that I found this is because most of the time even with -rv boot parameter specified, the system still recognized E220 as a storage. After many tests, have found this phenomenon has nothing to do with settings (i.e. parameters in /etc/path_to_inst, /etc/path_to_inst.old, /etc/system). So tests have been performed to see if it related to time. The result is if OpenSolaris boot is delayed, event without -rv boot parameter, the system can recognized E220 as a device.
      3. Plug and Play
      4. With the above experience and further experiments, have found - after OpenSolaris booted, at the first time attached the device, it will be recognized as a storage. At the second time attached the device, it will be recognized as a device. So the trick is using the two ports USB cable and connecting both USB connectors to the system. Then unplug the primary connector without unplugging the auxiliary connector that provides power. Connect the primary connector back. At the moment, the system will detect E220 correctly and use the correct device file.
    8. root@X-Wing:/ # more /rpool/boot/grub/menu.lst
      splashimage /boot/grub/splash.xpm.gz
      background 215ECA
      timeout 15
      root@X-Wing:/ # dmesg
      ...
      Oct 10 13:29:14 X-Wing usba: [ID 912658 kern.info] USB 1.10 device (usb12d1,1003) operating at full speed (USB 1.x) on USB 1.10 root hub: device@1, usbsacm0 at bus address 2
      Oct 10 13:29:14 X-Wing usba: [ID 349649 kern.info]      HUAWEI Technologies Mobile
      Oct 10 13:29:14 X-Wing genunix: [ID 936769 kern.info] usbsacm0 is /pci@0,0/pci1179,1@1d/device@1
      Oct 10 13:29:14 X-Wing genunix: [ID 408114 kern.info] /pci@0,0/pci1179,1@1d/device@1 (usbsacm0) online
      ...
              
      root@X-Wing:/ # more /earth/bin/ViewUSBEvents
      #!/bin/sh
      
      tail -f /var/adm/messages | grep usb
      
      root@X-Wing:/ # ViewUSBEvents
      ...
      Oct 10 09:55:14 X-Wing usba: [ID 912658 kern.info] USB 1.10 device (usb12d1,1003) operating at full speed (USB 1.x) on USB 1.10 root hub: storage@1, usbsacm2 at bus address 2
      Oct 10 09:55:14 X-Wing usba: [ID 349649 kern.info] 	HUAWEI Technologies Mobile
      Oct 10 09:55:14 X-Wing genunix: [ID 936769 kern.info] usbsacm2 is /pci@0,0/pci1179,1@1a/storage@1
      Oct 10 09:55:14 X-Wing genunix: [ID 408114 kern.info] /pci@0,0/pci1179,1@1a/storage@1 (usbsacm2) online
      Oct 10 09:55:28 X-Wing genunix: [ID 408114 kern.info] /pci@0,0/pci1179,1@1a/storage@1 (usbsacm2) offline
      Oct 10 09:55:45 X-Wing usba: [ID 912658 kern.info] USB 1.10 device (usb12d1,1003) operating at full speed (USB 1.x) on USB 1.10 root hub: device@1, usbsacm3 at bus address 2
      Oct 10 09:55:45 X-Wing usba: [ID 349649 kern.info] 	HUAWEI Technologies Mobile
      Oct 10 09:55:45 X-Wing genunix: [ID 936769 kern.info] usbsacm3 is /pci@0,0/pci1179,1@1a/device@1
      Oct 11 09:55:45 X-Wing genunix: [ID 408114 kern.info] /pci@0,0/pci1179,1@1a/device@1 (usbsacm3) online
      ...
              
    9. 撥接設定
        3.5G 上網是使用 PPP 的方式,因此只要設定好 PPP 所需的兩個設定檔案即可。在設定好後可以使用指令或 Inetmenu 即可撥接上網。補充說明的是:
      1. AT+CPIN=???? 中的 ???? 是您的 SIM 卡 PIN 碼
      2. AT+CSQ 的 AT 指令是用來檢查訊號強度
      3. AT+COPS? 的 AT 指令是用來了解是使用那家電信業者的服務
      4. 在 chat 的指令腳本會處理尚未輸入 SIM 卡 PIN 碼的情形

    10. Dial-up Settings
        To connect the 3.5G network, we need to use PPP. What we need is setting up two PPP configuration files. After completed, we can use command line or Inetmenu to dial-up to the network. Few things need to be added are -
      1. in "AT+CPIN=????", where ???? is the PIN of your SIM card
      2. the AT+CSQ AT command is used to check signal quality
      3. the AT+COPS? AT command is used to check current GSM/UMTS network operator
      4. the chat script will handle PIN of SIM card is not entered yet condition
    11. root@X-Wing:/ # ls -l /dev/term
      total 5
      lrwxrwxrwx   1 root     root          45 Oct 11 14:20 0 -> ../../devices/pci@0,0/pci1179,1@1a/device@1:0
      lrwxrwxrwx   1 root     root          45 Oct 11 14:20 1 -> ../../devices/pci@0,0/pci1179,1@1a/device@1:1
      lrwxrwxrwx   1 root     root          45 Oct 11 14:20 2 -> ../../devices/pci@0,0/pci1179,1@1a/device@1:2
      lrwxrwxrwx   1 root     root          40 Oct 10 11:54 a -> ../../devices/pci@0,0/isa@1f/asy@1,3f8:a
      lrwxrwxrwx   1 root     root          40 Sep 26 20:05 e -> ../../devices/pci@0,0/isa@1f/asy@1,3f8:a
      
      root@X-Wing:/ # more /etc/remote
      ...
      E220:\
          :dv=/dev/term/0:...
      
      root@X-Wing:/ # tip E220
      connected
      ATI
      Manufacturer: huawei
      Model: E220
      Revision: 11.116.04.01.00
      IMEI: 354136026302913
      +GCAP: +CGSM,+DS,+ES
      
      OK
      AT+CPIN=????
      OK
      AT+CPIN?
      +CPIN: READY
      
      OK
      AT+CSQ
      +CSQ: 9,99
      
      OK
      
      AT+COPS?
      +COPS: 0,0,"Chunghwa Telecom",2
      
      OK
      ~.
      
      root@X-Wing:/ # more /etc/ppp/CHT-3.5G-chat
      ABORT BUSY
      ABORT 'NO CARRIER'
      ABORT ERROR
      REPORT CONNECT
      '' 'AT+CPIN?'
      TIMEOUT 5
      READY-AT+CPIN=????-OK 'AT&F'
      OK 'ATZ Q0 V1 E1 S0=0 &C1 &D2 +FCLASS=0'
      OK 'AT+CGDCONT=1,"IP","internet"'
      SAY '\nCalling CHT'
      OK 'ATDT*99#'
      TIMEOUT 60
      CONNECT \n
      
      root@X-Wing:/ # more /etc/ppp/peers/CHT-3.5G
      term/0
      460800
      connect "/usr/bin/chat -V -t60 -f /etc/ppp/CHT-3.5G-chat"
      asyncmap 00000000
      crtscts
      defaultroute
      holdoff 1
      lcp-echo-interval 0
      noauth
      noccp
      novj
      passive
      updetach
      usepeerdns
      
      root@X-Wing:/ # pppd debug call CHT-3.5G
      serial speed set to 460800 bps
      connect option: '/usr/bin/chat -V -t60 -f /etc/ppp/CHT-3.5G-chat' started (pid 8976)
      AT+CPIN?
      +CPIN: READY
      
      OK
      AT&F
      OK
      Calling CHT
      AAT+CGDCONT=1,"IP","internet"
      OK
      ATDT*99#
      CONNECTchat:  Oct 10 15:07:15 CONNECT
      Serial connection established.
      serial speed set to 460800 bps
      Using interface sppp0
      Connect: sppp0 <--> /dev/term/0
      /etc/ppp/chap-secrets is apparently empty
      sent [LCP ConfReq id=0x98 <asyncmap 0x0> <magic 0x7c04f7c1> <pcomp> <accomp>]
      rcvd [LCP ConfReq id=0xc <asyncmap 0x0> <auth chap MD5> <magic 0xdf178a> <pcomp> <accomp>]
      sent [LCP Ident id=0x99 magic=0x0 "ppp-2.4.0b1 (Sun Microsystems, Inc.)"]
      sent [LCP ConfRej id=0xc <auth chap MD5>]
      rcvd [LCP ConfAck id=0x98 <asyncmap 0x0> <magic 0x7c04f7c1> <pcomp> <accomp>]
      rcvd [LCP ConfReq id=0xd <asyncmap 0x0> <magic 0xdf178a> <pcomp> <accomp>]
      sent [LCP ConfAck id=0xd <asyncmap 0x0> <magic 0xdf178a> <pcomp> <accomp>]
      sent [LCP Ident id=0x9a magic=0x7c04f7c1 "ppp-2.4.0b1 (Sun Microsystems, Inc.)"]
      sent [IPCP ConfReq id=0xbd <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
      rcvd [LCP DiscReq id=0xe magic=0xdf178a]
      rcvd [IPCP ConfNak id=0xbd <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14> <ms-wins1 10.11.12.13> <ms-wins2 10.11.12.14>]
      sent [IPCP ConfReq id=0xbe <addr 0.0.0.0> <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14>]
      rcvd [IPCP ConfReq id=0x8]
      sent [IPCP ConfNak id=0x8 <addr 0.0.0.0>]
      rcvd [IPCP ConfNak id=0xbe <addr 114.136.251.74> <ms-dns1 168.95.1.1> <ms-dns2 168.95.192.1>]
      sent [IPCP ConfReq id=0xbf <addr 114.136.251.74> <ms-dns1 168.95.1.1> <ms-dns2 168.95.192.1>]
      rcvd [IPCP ConfReq id=0x9]
      sent [IPCP ConfAck id=0x9]
      rcvd [IPCP ConfAck id=0xbf <addr 114.136.251.74> <ms-dns1 168.95.1.1> <ms-dns2 168.95.192.1>]
      Peer refused to provide his address; assuming 192.168.1.1
      local  IP address 114.136.251.74
      remote IP address 192.168.1.1
      primary   DNS address 168.95.1.1
      secondary DNS address 168.95.192.1
      
      root@X-Wing:/ # /etc/init.d/pppd stop
      Terminated
              

    以上是參考網際網路上的相關討論並經由測試所得到的結果,也在此利用此一機會謝謝他們的幫忙,並將相關的參考資料附在最後。

    The above test results are based on the information founded on the Inetnet, like to take this chance to say thanks to them. The related information are listed at the end.

    參考資料(References):

    1. blog.xuite.net > 3.5G 網卡 + 無線路由器 = Solaris 上自用、分享兩相宜的雙無線、雙有線連線方案
    2. www.opensolaris.org > Huawei E220 HSDPA USB Modem
    3. www.opensolaris.org > Huawei e220
    4. en.wikipedia.org > Huawei E220
    5. forum.huawei.com > Huawei E220 AT commands
    6. www.shapeshifter.se > List of AT commands
    7. www.forumosa.com > wireless internet via the cell phone system (even on Linux)
    8. virginmobile.custhelp.com > How do I connect my E220 USB Mobile Broadband Modem to my computer?
    9. speedtest.net
    10. opensolaris.org > Graphical Network Configuration Tool (inetmenu)
    恆易 / Xuite日誌 / 回應(2) / 引用(0) / 好文轉寄
  • 回應