Adam's "Blog"

That's all, really.

Installing OpenWRT on the Zsun Wifi Card Reader (From Windows)

When I saw an article on Slashdot the other day about a small, cheap OpenWRT device, I had to give it a try. The zsun Wifi Card Reader is roughly an inch square and a half-inch thick. It has a MicroSD card slot and a USB plug. If you’re into hardware hacking, you can even solder on an Ethernet jack and make it more useful. But I was content to keep it simple and non-useful.

Everything you need to know about hacking it is on this Warsaw Hackerspace page.

I followed the easy-but-risky method listed there. I plugged the reader in to a USB port, then connected to its wifi network. I got the address 10.168.168.100, and the reader was 10.168.168.1.

I didn’t have a tftp server handy, so I downloaded one from Solarwinds. I downloaded the kernel and rootfs files from the Hackerspace page, and put them in the tftp server’s directory.

I then telnetted into the card reader by running putty.exe -raw 10.168.168.1 -P 11880, and ran the commands from the Hackerspace page:

# cd /tmp
# tftp -g 10.168.168.100 -r openwrt-ar71xx-generic-zsun-sdreader-kernel.bin
# tftp -g 10.168.168.100 -r openwrt-ar71xx-generic-zsun-sdreader-rootfs-squashfs.bin
# mtd_write write openwrt-ar71xx-generic-zsun-sdreader-kernel.bin /dev/mtd3
# mtd_write write openwrt-ar71xx-generic-zsun-sdreader-rootfs-squashfs.bin /dev/mtd2

The first tftp command timed out. Good old Windows Firewall was blocking the tftp attempt. I fired up Windows Firewall with Advanced Security, went to Inbound Rules, and added a new rule to allow connections to UDP port 67 from all networks. I retried the tftp, and it succeeded.

The mtd_write commands finished with “Bus error” as expected. I power-cycled and waited, and at last an “OpenWRT” wireless network appeared. I connected up and telnetted in (you have to telnet in the first time; when you run passwd to set your password, it enables ssh) to look around.

I edited /etc/config/network to change the network from 192.168.1.* to a less common one; edited /etc/config/system to change the hostname; edited /etc/config/wireless to change the SSID. I created /etc/dropbear/authorized_keys to make ssh'ing in easier.

Next, I followed instructions from the OpenWRT wiki to make the wifi operate in AP and STA mode (that is, as an access point for its own wireless network, plus a client on my existing wireless network). I also added a couple rules to /etc/config/firewall so that I could hit ssh and the web interface on its client IP address:

config rule
        option src wan
        option dest_port 22
        option target ACCEPT
        option proto tcp

config rule
        option src wan
        option dest_port 443
        option target ACCEPT
        option proto tcp

And now (after a reboot) it was online, so I could opkg update and install some packages. Fun!

I also tried mounting an SD card. I ran block info to list the block devices, and ran mount /dev/sda1 /mnt to mount the SD card in /mnt.

I still don’t know if it’s good for anything, but I’m always up for an easy OpenWRT install on an exciting new platform.