Zsun Wifi Card Reader Can Now Run OpenWrt

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.

Zsun_Wi-FI_Card_ReaderA 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:

  1. Solder on an Ethernet jack and flash from the original uboot (hard but safe)
  2. Reflash the bootloader from the original firmware to one that supports upload over serial (less soldering but fatal if you mess up)
  3. Reflash the firmware from the original firmware using mtd_write (easy but you have to do it right on the first try)
  4. 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):

  1. Download OpenWrt for Zsun binary images
  2. Start a TFTP server on your computer. If you use a Linux computer, you can use dnsmasq as follows:
  3. Login to the board, and download the necessary files to zsun’s /tmp directory:

    You may also want to copy /sbin/mtd_write to /tmp, and kill all unnecessary process to be extra safe.
  4. Now you can flash the firmware to “uImage” and “rootfs” partitions:

    Bus error” looks like an error, but in this case it just indicates flashing is complete.
  5. Restart the device, and after a longer than usual very first boot, you should have access to OpenWrt. Have fun 🙂

Zsun_WiFi_Card_Reader_Pin_DescriptionsSo 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.

Zsun WiFi card reader can be purchased for as low as $10.99 on Banggood, and can be found on others shops for $11+ to about $15 such as DealExtreme, GearBest or Aliexpress.

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

Radxa Orion O6 Armv9 mini-ITX motherboard
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
17 Comments
oldest
newest
zoobab
8 years ago

Will try that now. Nice to hear! Will test if the SOIC can behave as master+client mode at the time.

Peter
Peter
8 years ago

What is the transfer speed when reading/writing to SD card?

What I would like to make is a networked SD card writer with integrated SD card MUX – switching SD card to the reader or to the target device. Something like this: http://www.linuxinternals.org/blog/2014/06/04/a-microsd-card-remote-switcher/
I have this with USB based writer already.

zoobab
8 years ago

@Peter
If I understood correctly the circuit of the “MicroSD card switcher” you linked to, it is controlled via an FTDI cable. Maybe replacing the FTDI with an ESP8266 would make the job. Esp-link is supposed to replace the FTDI cable for AVR flashing, now I don’t know what the FTDI does in reality with that circuit, if it is a simple serial port console, then it is easy to replace with an ESP.

zoobab
8 years ago

@zoobab
The switch program seems to use Bitbanging, so it will be more complicated to replace with an ESP, but the code seems to be very trivial.

opex
opex
8 years ago

so it’s not possible to change the host/device mode using only software as i understand? In which mode is the device by default? I thought it should be in device mode, why are they talking about disabling host mode by desoldering a resistor?

anon
anon
8 years ago

The SoC USB port cannot be connected to the USB plug without resoldering the connections.

USB plug | SoC USB port
………..|………|
………..V………V
………USB switch
……………|
……………V
……..SD card reader

She SoC USB port is soldered for host mode, since it needs to control the SD card reader.

Peter
Peter
8 years ago

@zoobab
This circuit is just an example. I have prototype build with TS3A27518E mux/demux. And it it working fine with USB card reader with write speed around 17 MB/s. Not as fast as it should probably because of bad prototyping.
But would be great if I could made ethernet device.
I would say ESP8266 would be way to slow.

zoobab
8 years ago

@Peter
I meant replacing the FTDI with an ESP. I had a look at this solution to be able to reflash an SD card for a CI testbed for openwrt. The board was only booting from a flashed SD card.

Peter
Peter
8 years ago

@zoobab
Ok, I understand wrong then. You mean using ESP only to control switch.
Seems I’m using my prototype device in similar way as you. I have USB card reader, analog switches for SD card signals and one flat cable with SD card connector at the end. Something like this https://plus.google.com/+MichaelGebetsroither/posts/eS4VYkW7Jny?pid=5742485398778944786&oid=104422661029399872488
I’m using this design for devices which needs SD card to boot. It has external switch to control the flow (SD card to card reader or target device).

LAVA Validation Lab is using something similar but much more powerful (have the schematic from them).

rufik
rufik
8 years ago

@anon

So there is no way to control it by software? I can image this reader plugged into digital picture frame (has only USB input) serving photos. These photos can be “delivered” one per day from server, ex. openwrt’s cron on ZSun fires up the user script, switches card to wireless client (STA) and transfers pictures from server to sd card.

Nobody of Import
Nobody of Import
8 years ago

Zsun direct sells this through Amazon…

http://www.amazon.com/zsun%C2%AE-Memory-Reader-MicroSD-Flash/dp/B00UT1MC9W

Price is a bit higher, but if you’ve got Prime, it would be a good thing to add this to your list of suppliers since there’s no shipping costs involved.

AdamC
AdamC
8 years ago

@rufik

I would also like to do this. It must be possible for software to switch the card reader back and forth between the SoC and the USB plug, since the “Setcardworkmode” URL in the built-in firmware apparently does this, as described here: https://wiki.hackerspace.pl/projects:zsun-wifi-card-reader:factory-update

If someone could figure out how it does that, and port it to OpenWRT, I’d be happy.

(I don’t know if I’d actually use it with an always-on device like a digital picture frame, though, since it seems to get pretty warm when running.)

ABPer
ABPer
8 years ago

Nope, I don’t like ads. If you don’t either, you should stop plastering them all over your site. But, it doesn’t really matter. I choose to block ads, regardless of what you like.

By the way, I do not find this blog useful. But, since you asked about my preferences, I thought it was polite to answer your question.

Bye.

maurer
maurer
8 years ago


hi,
i had the same issue.
how did you recover the device?

thanks

Boardcon Rockchip RK3588S SBC with 8K, WiFI 6, 4G LTE, NVME SSD, HDMI 2.1...