Zsun Wifi card reader is a tiny micro SD card reader with WiFi connectivity, and while people managed to access the device serial console a few months ago, the plan was to eventually run OpenWrt since it’s based on the popular Atheros AR9331 WiSoC combined with 64MB RAM and 16MB SPI Flash. It would also be one the smallest OpenWrt capable device with dimensions of 30 x 33 mm.
A team of Polish managed this feat, and have now posted instructions to install OpenWrt, as well as other documentation, for example a description of the board’s GPIOs.
There are four methods to flash OpenWrt:
- Solder on an Ethernet jack and flash from the original uboot (hard but safe)
- Reflash the bootloader from the original firmware to one that supports upload over serial (less soldering but fatal if you mess up)
- Reflash the firmware from the original firmware using mtd_write (easy but you have to do it right on the first try)
- Attach a programmer to the flash chip (impossible to mess up)
I’ll reproduce the method with mtd_write here, as although you may potentially brick your device, it’s the easiest (no hardware hack):
- Download OpenWrt for Zsun binary images
- Start a TFTP server on your computer. If you use a Linux computer, you can use dnsmasq as follows:
Shell12sudo dnsmasq -p0 --enable-tftp --tftp-root=`pwd` -d --user=`whoami`# serves files off your current directory, remember to chmod o+r files you'd like to use
- Login to the board, and download the necessary files to zsun’s /tmp directory:
Shell123456789$ socat - TCP4:10.168.168.1:11880(none) login: rootPassword: zsun1188[...]# 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
You may also want to copy /sbin/mtd_write to /tmp, and kill all unnecessary process to be extra safe.
- Now you can flash the firmware to “uImage” and “rootfs” partitions:
Shell123456789101112131415# cat /proc/mtddev: size erasesize namemtd0: 00010000 00010000 "u-boot"mtd1: 00010000 00010000 "u-boot-env"mtd2: 00e90000 00010000 "rootfs"mtd3: 00130000 00010000 "uImage"mtd4: 00010000 00010000 "NVRAM"mtd5: 00010000 00010000 "ART"# mtd_write write openwrt-ar71xx-generic-zsun-sdreader-kernel.bin /dev/mtd3Unlocking /dev/mtd3 ...Writing from openwrt-ar71xx-generic-zsun-sdreader-kernel.bin to /dev/mtd3 ... [w]# mtd_write write openwrt-ar71xx-generic-zsun-sdreader-rootfs-squashfs.bin /dev/mtd2Unlocking /dev/mtd2 ...Writing from openwrt-ar71xx-generic-zsun-sdreader-rootfs-squashfs.bin to /dev/mtd2 ... [w]Bus error
“Bus error” looks like an error, but in this case it just indicates flashing is complete.
- Restart the device, and after a longer than usual very first boot, you should have access to OpenWrt. Have fun 🙂
So once you’re done, what you can do with the device? Some ideas of the developers include just serving files over WiFi, using it as a WiFi AP/client/repeater, as the brain for an IoT project, mesh networking, PirateBox, mini Tor server, and more.