La Fonera

| コメント(0) | トラックバック(0)

シリアルポートの動作がどうも気に成って書店へ行った。1時間半くらいかけて関連する本を探し、やっと幾らか参考に成りそうなのを見つけて、ついでにPC関連の最近の動向はどう成っているのか、雑誌コーナーを覗いてみた。

日経Linux 2008/12 号で「2000円ルーターをサーバーに改造」が目に付いた。何かな~ って見たら無線LANのFONをいろいろいじって、サーバー的にしようという事らしいです。内部はLinuxマシンなので面白そう、とにかく安い。

興味が湧いて早速買ってみる、もうほとんど病気。

la-fonera.jpg

fon-wire.jpg

 

近くのPC専門店では何やらI-POD的なのとセットで2万で、しかもワンセットしかない、なんて田舎なんだなー。
仕方が無いので、ビックカメラに問い合わせたらさすがに有るという事で、翌日買いに行った。

FONルーター「La Fonera」で2100と2200が有るらしいが、いじるのには2100が良いらしい。例によってシリアル接続が出てきた。
携帯電話のアクセサリでデータをPCとやりとりするのが、値段的にも安いしその辺の電気店で手に入ると思っていたが、これが間違い。
まずはビックカメラに無い、他の家電量販店に行ってみたがここでも無い。どうもMOVAので、ほとんど何処でも無いらしい。
記事で取り上げている位だし、ネットでもそれらしいのを使っているけど無い物は無い。しょうが無いので千石電商オンラインショップで取り寄せにした。
ついでにFONと接続するのに必要なコネクタ付きの線「ピン配列変換・延長ケーブル 汎用版タイプ(6本入)」も頼んだ。
これが地元のパーツショップを何軒か探したが、取り扱っていない、田舎って困るな~

後から気が付いたが、SDカード・スロットも頼めば良かったと、多分SDカード用コネクタで良いと思うが、実際に工作を始めたらこんなの本体の中に上手く収められない。外付けで値段も高く成るが、基板式のをあとで頼もう。

本体の型番はFON2100E。シリアル接続用のPDC用データ通信ケーブルがKAIREN UP-12C、USBタイプで無いとPC側にシリアル・ポートが無いのでダメだ。あと、カモン ピン配列変換・延長ケーブル(6本入り)汎用タイプ H-AL。

UP-12C.jpg up12c-b.jpg千石電商にネット注文する時には、備考欄に「H-AL 1個」と書けば良いです、って電話で問い合わせた時に感じの良いおねーさんが言ってくれた。ネットで注文して、支払は代引きカード支払いにしておいて、来た時には現金払い、が一番良いパターンと思う。

注文したのが翌日来て、早速取りかかる。ゴム足はアンテナ側では無い方の2か所を外す、カバーはカパって取り外せる。データ通信ケーブルのコネクタ部分をバラして延長ケーブルを半田付する。

la-fonera-b.jpg la-fonera-c.jpg h-al.jpg up12c-c.jpg        

 

ハンダコテは前にも書いたが、懲りたので、グリップの所にスイッチが有って、それを押せば最大で100W越えて、普段は15W位に成る先端が細いのを買ってきた。これが超具合が良い、値段が高いがテンプラとかイモとか、半田付部分で余計な心配をしないで済むので良い。思う様に行かない場合に余計な心配をする必要が無いので、原因の要素を一つ減らせる。

ファームウェアを「OpenWrt」に入れ替えるのだが、これがつまづいた。

firmware.jpgいろいろ躓きながらしたので、細かい順番はハッキリ覚えていないが、自分のPCのIPアドレスを 192.168.1.2 255.255.255.0 に設定して、Poor TFTP を用意して、そこのフォルダに OpenWrt のイメージファイルを入れておく。


コマンドを実行すると何か反応が色々ある、ハングしたかなと思う位遅い時も有る。
途中からエラーで進まなく成ってしまって、ずーっと試行錯誤していたが、途中で RedBoot> fis list なんてしたら、進んだ。なんだか分からない、一つ事を進めるのに応答が遅いし、何かしてから十分時間を待ってやるとか、何回も試してみるとか、電源を一度全部落して再挑戦したりする、それが今回の教訓。

とりあえず、telnet で接続出来て、SSH アクセスして ROOT でパスワード設定まで出来た。

まだまだ遊べそうだ、楽しみ~ (^_^)

参考サイト
UP-12Cを改造してLa Foneraに接続
fonを改造
La Fonera+ を買ってシリアル・ケーブルをつないでみた
「UP-12C」のインストール方法について
La Fonera OpenWrt化 まとめ
改造情報等


シリアル・ケーブルをPCのUSBに接続して、システムのプロパティ→ハードウェア→デバイスマネージャ
ポート(COM と LPT)で USB Serial Port で COM ポート名、COM6 とか成っている、何番なのか確認しておく。
プロパティを開き、下記の様に設定

ビット/秒:9600
データビット:8
パリティ:なし
ストップビット:1
フロー制御:なし

ターミナルソフトでも同様に設定、FONルーターの電源を入れ直すと、何か文字が出始める、すぐに Ctrl+c を押す。
RedBoot のプロンプトがダーっと出てくる。

以下の様にコマンドを実行する、各行では Enter キーを押すと何か反応が色々ある。

RedBoot> ip_address -l 192.168.1.1/24 -h 192.168.1.2
RedBoot> fis init
RedBoot> load -r -b 0x80041000 openwrt-atheros-2.6-root.squashfs
RedBoot> fis create -l 0x06F0000 rootfs
RedBoot> load -r -b 0x80041000 openwrt-atheros-2.6-vmlinux.lzma
RedBoot> fis create -r 0x80041000 -e 0x80041000 vmlinux.bin.l7
RedBoot> reset

途中でエラーが出たりして上手くいかない時に、RedBoot> fis list としてみて、再試行すると上手く行った。
あとコマンドからの反応が超遅い、処理に時間が掛ってハングしたかなと思う時も有る、じっくり待つ。
reset 後の反応は以下の様になる

 

RedBoot> reset
+PHY ID is 0022:5521
Ethernet eth0: MAC address 00:00:00:00:00:00
IP: 0.0.0.0/255.255.255.255, Gateway: 0.0.0.0
Default server: 0.0.0.0

RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug  7 2006

Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.

Board: ap51
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 1.000 seconds - enter ^C to abort
RedBoot> fis load -l vmlinux.bin.l7
Image loaded from 0x80041000-0x80290085
RedBoot> exec
Now booting linux kernel:
 Base address 0x80030000 Entry 0x80041000
 Cmdline :
Linux version 2.6.21.5 (nbd@ds10) (gcc version 4.1.2) #2 Sun Sep 30 20:16:16 CEST 2007
CPU revision is: 00019064
Determined physical RAM map:
 memory: 01000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Built 1 zonelists.  Total pages: 4064
Kernel command line: console=ttyS0,9600 rootfstype=squashfs,jffs2 init=/etc/preinit
Primary instruction cache 16kB, physically tagged, 4-way, linesize 16 bytes.
Primary data cache 16kB, 4-way, linesize 16 bytes.
Synthesized TLB refill handler (20 instructions).
Synthesized TLB load handler fastpath (32 instructions).
Synthesized TLB store handler fastpath (32 instructions).
Synthesized TLB modify handler fastpath (31 instructions).
PID hash table entries: 64 (order: 6, 256 bytes)
Using 92.000 MHz high precision timer.
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 13504k/16384k available (1955k kernel code, 2880k reserved, 292k data, 116k init, 0k highmem)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
Radio config found at offset 0xf8(0x1f8)
Time: MIPS clocksource has been installed.
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
squashfs: version 3.0 (2006/03/15) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver $Revision: 1.90 $ 1 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0xb1100003 (irq = 37) is a 16550A
eth0: Dropping NETIF_F_SG since no checksum feature.
eth0: Atheros AR231x: 00:18:84:29:fd:80, irq 4
cmdlinepart partition parsing not available
Searching for RedBoot partition table in spiflash at offset 0x7d0000
Searching for RedBoot partition table in spiflash at offset 0x7e0000
5 RedBoot partitions found on MTD device spiflash
Creating 5 MTD partitions on "spiflash":
0x00000000-0x00030000 : "RedBoot"
0x00030000-0x00720000 : "rootfs"
0x00130000-0x00720000 : "rootfs_data"
0x00720000-0x007e0000 : "vmlinux.bin.l7"
0x007e0000-0x007ef000 : "FIS directory"
0x007ef000-0x007f0000 : "RedBoot config"
nf_conntrack version 0.5.0 (128 buckets, 1024 max)
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP vegas registered
NET: Registered protocol family 1
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (squashfs filesystem) readonly.
Freeing unused kernel memory: 116k freed
eth0: Configuring MAC for full duplex
Warning: unable to open an initial console.
Algorithmics/MIPS FPU Emulator v1.5
- preinit -
jffs2 not ready yet; using ramdisk
mini_fo: using base directory: /
mini_fo: using storage directory: /tmp/root
- init -
init started:  BusyBox v1.4.2 (2007-09-29 07:21:40 CEST) multi-call binary

Please press Enter to activate this console. device eth0 entered promiscuous mode
br-lan: port 1(eth0) entering learning state
br-lan: topology change detected, propagating
br-lan: port 1(eth0) entering forwarding state
PPP generic driver version 2.4.2
wlan: 0.8.4.2 (svn r2568)
ath_hal: module license 'Proprietary' taints kernel.
ath_hal: 0.9.30.13 (AR5212, AR5312, RF2316, TX_DESC_SWAP)
ath_rate_minstrel: Minstrel automatic rate control algorithm 1.2 (svn r2568)
ath_rate_minstrel: look around rate set to 10%
ath_rate_minstrel: EWMA rolloff level set to 75%
ath_rate_minstrel: max segment size in the mrr set to 6000 us
wlan: mac acl policy registered
ath_ahb: 0.9.4.5 (svn r2568)
ath_pci: switching rfkill capability off
ath_pci: switching per-packet transmit power control off
wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: H/W encryption support: WEP AES AES_CCM TKIP
wifi0: mac 11.0 phy 4.8 radio 7.0
wifi0: Use hw queue 1 for WME_AC_BE traffic
wifi0: Use hw queue 0 for WME_AC_BK traffic
wifi0: Use hw queue 2 for WME_AC_VI traffic
wifi0: Use hw queue 3 for WME_AC_VO traffic
wifi0: Use hw queue 8 for CAB traffic
wifi0: Use hw queue 9 for beacons
wifi0: Atheros 2315 WiSoC: mem=0xb0000000, irq=3
jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
jffs2_build_filesystem(): unlocking the mtd device... done.
jffs2_build_filesystem(): erasing all blocks after the end marker... done.
mini_fo: using base directory: /
mini_fo: using storage directory: /jffs

 

ここまで来たら、telnet 接続する、IPアドレスは 192.168.1.1 で OpenWrt にログイン出来る。


 === IMPORTANT ============================
  Use 'passwd' to set your login password
  this will disable telnet and enable SSH
 ------------------------------------------


BusyBox v1.4.2 (2007-09-29 07:21:40 CEST) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

  ________                                     _________            __
 |              | .------.--------.--------.|    |   |   |.-----. |    |_
 |      --     | |   _   |    --_ |         ||    |   |   ||    _| |     _|
 |________| |    __|_____|__|__||________||__|   |____|
                   |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (7.09) -----------------------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
root@OpenWrt:/#


すぐに root でパスワードを設定、切断して root でSSHログインする。

トラックバック(0)

トラックバックURL: http://midforce.net/mt/mt-tb.cgi/89

コメントする

ランダムな画像

Now loading... Now loading...

このブログ記事について

このページは、allerが2008年12月 2日 02:21に書いたブログ記事です。

ひとつ前のブログ記事は「PCの電源スイッチ」です。

次のブログ記事は「BlognPlus」です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。