User Tools

Site Tools


projects:zsun-wifi-card-reader

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
projects:zsun-wifi-card-reader [2016/03/14 19:38] emerythprojects:zsun-wifi-card-reader [2020/02/12 16:14] (current) emeryth
Line 1: Line 1:
 +{{template>:template:project
 + | name=zsun-wifi-card-reader
 + | status=abandoned
 + | founder=[[user>emeryth]]
 + | repo=[[github>emeryth/source]] [[github>emeryth/openwrt-zsun]]
 +}}
 +
 ====== Hacking the Zsun WiFi SD Card Reader ====== ====== Hacking the Zsun WiFi SD Card Reader ======
 {{:projects:banner.jpg?nolink&700|}} {{:projects:banner.jpg?nolink&700|}}
Line 4: Line 11:
 The goal of this project is to learn as much as possible about the Zsun WiFi card reader and run OpenWrt on it to turn it into an awesome wifi device. The goal of this project is to learn as much as possible about the Zsun WiFi card reader and run OpenWrt on it to turn it into an awesome wifi device.
  
-**UPDATE 2016-03-12** We now know that there are at least two different PCB versions of the reader! **Please do not flash if you have the one with bigger passives while we investigate** \\+**UPDATE 2017-09-12** Info about LEDE and USB gadget working \\ 
 +**UPDATE 2016-11-28** Adding some more info about the new PCB revision, thanks to Erik Dorner, who sent me his analysis a long time ago \\ 
 +**UPDATE 2016-04-23** The new PCB is missing a jumper on the RX serial line, see serial port section \\ 
 +**UPDATE 2016-03-16** The second PCB revision has identical software and hardware (apart from optimized minor component layout), flashing works the same \\ 
 +**UPDATE 2016-03-12** We now know that there are at least two different PCB versions of the reader!  \\
 **UPDATE 2016-02-21** github mirror at https://github.com/Emeryth/openwrt-zsun \\ **UPDATE 2016-02-21** github mirror at https://github.com/Emeryth/openwrt-zsun \\
 **UPDATE 2016-01-27** informatic seems to have figured out how to use the original firmware's update function: [[projects:zsun-wifi-card-reader:factory-update|Zsun Card Reader Firmware Update Format]] **UPDATE 2016-01-27** informatic seems to have figured out how to use the original firmware's update function: [[projects:zsun-wifi-card-reader:factory-update|Zsun Card Reader Firmware Update Format]]
Line 41: Line 52:
 \\ \\
 The device consists of two PCBs sandwiched together and connected via 8 pins.\\ The device consists of two PCBs sandwiched together and connected via 8 pins.\\
 +**WARNING** There are at least 2 PCB revisions, our original research was on the "old" revision, the "new" revision appeared in early 2016.
 +The new revision has optimized layout with some minor changes, software is identical. 
 +
 The bottom PCB contains only the SD card reader chip and SD slot, it can be safely removed without affecting operation. The bottom PCB contains only the SD card reader chip and SD slot, it can be safely removed without affecting operation.
 +**This is only true for the old PCB revision!** The new revision moved the 3.3V regulator to the PCB with the card reader.
 +
  
 === Serial Port === === Serial Port ===
Line 48: Line 64:
 Bitrate is 115200. Bitrate is 115200.
  
-Original firmware root password is "zsun1188"+Original firmware root password is "zsun1188" \\ 
 + 
 +The new PCB has a missing jumper that connects the serial RX testpad to the SoC. Short it or solder directly to the lower pad of the jumper to use serial. 
 +(The second missing resistor is a pull up/down, I guess) 
 + 
 +{{:projects:rx_jumper.jpg?direct&600|}} 
 + 
 +Thanks to Andreas H. for the clear picture of the new PCB.
  
 === Ethernet Port === === Ethernet Port ===
Line 55: Line 78:
 Use a Magjack or similar connector with magnetics.\\ Use a Magjack or similar connector with magnetics.\\
 This port is required for uploading images to u-boot.\\ This port is required for uploading images to u-boot.\\
 +
 +Here's how to properly connect the ethernet port, thanks to **Erik Dorner**: \\
 +
 +The AR9331 uses a current-mode line driver, which, in practical terms, means that the center taps of the primary coils of the Ethernet transformer must be connected to the PHY power supply voltage (2.0V for the AR9331).\\
 +The SoC is capable of producing this voltage, but it needs some external components (a general purpose PNP transistor and some filter/buffer capacitors) to do so.\\
 +Fortunately, the relevant pins of the AR9331 are also broken out as test points.\\
 +
 +{{:projects:zsun_how_to_connect_eth_tranformer.jpg?direct&800|}}
 +
 +If you don't care that much, you can connect 3.3V to the center taps, it should work.
  
 === USB switch === === USB switch ===
Line 92: Line 125:
  
 AR9331 is capable of working as a usb device (gadget). AR9331 is capable of working as a usb device (gadget).
-Unfortunately the code for that exists only as a patch for an old version of OpenWrt: +<del>Unfortunately the code for that exists only as a patch for an old version of OpenWrt: 
-http://neykov.name/posts/ar933x-usb-device-driver/+http://neykov.name/posts/ar933x-usb-device-driver/ </del> 
 + 
 +**The USB device/gadget patch has been added to mainline LEDE!** 
 + 
 +(It's not in the 17.01 stable release, though)
  
 So if you want to use the zsun as a USB gadget you will need to: So if you want to use the zsun as a USB gadget you will need to:
-  - Port the code  +  - <del>Port the code</del> Compile LEDE from source, look for more info in the LEDE section of this page 
-  - Remove the bootstrap resistor setting USB to host mode +  - Remove the G13 bootstrap resistor setting USB to host mode 
-  - Remove the card reader PCB and rewire the the USB signal pins+  - <del>Remove the card reader PCB and</del> (the card reader PCB now contains the 3.3V regulator, so you can't just remove it) rewire the the USB signal pins (the ones on the bottom right in the pictures) to a USB plug 
 + 
 + 
 +Here's what it looks like on the old PCB with the pins connected to the original USB plug:
  
 +{{:projects:usb_gadget.jpg?direct&600|}}
 ==== Original firmware ==== ==== Original firmware ====
  
Line 148: Line 189:
  
 Compiled images and image builder: \\ Compiled images and image builder: \\
-https://owncloud.hackerspace.pl/index.php/s/7s5c5RDS7Njgwpv+<del>https://owncloud.hackerspace.pl/index.php/s/7s5c5RDS7Njgwpv</del> 
 +https://owncloud.hackerspace.pl/s/e4zWPZ8FqFMnrgk
  
 **You cannot use kernel modules from the official repository, use the image builder or compile them yourself if they're not included.** **You cannot use kernel modules from the official repository, use the image builder or compile them yourself if they're not included.**
Line 158: Line 200:
   * The SD card detect pin is registered as a button and will trigger failsafe when inserted/removed during boot   * The SD card detect pin is registered as a button and will trigger failsafe when inserted/removed during boot
   * The SD card reader is reset every time a card is inserted or removed   * The SD card reader is reset every time a card is inserted or removed
 +
 +
 +==== LEDE ====
 +
 +https://forum.lede-project.org/t/supporting-zsun-wifi-card-reader-16mb-flash-64mb-ram-ar9331/2142
 +
 +I've made a quick port of LEDE:
 +https://github.com/Emeryth/source/tree/zsun
 +
 +**good news:**
 +It has USB gadget
 +
 +**bad news:**
 +The standard LEDE kernel is too big to fit in the original kernel partition.
 +You need to either change the bootloader and flash layout, or decrease the kernel image size by disabling things like debug symbols.
  
  
Line 167: Line 224:
 You can backup the entire flash over telnet by using dd. You can backup the entire flash over telnet by using dd.
  
-<code>dd if=/dev/mtd0 of=/etc/disk/mtd0.bin</code>+<code>dd if=/dev/mtd0 of=/tmp/mtd0.bin</code>
  
 **Do this with all the mtd partitions (mtd0 to mtd5)** **Do this with all the mtd partitions (mtd0 to mtd5)**
  
-You can then download the files from the original web interface.+Then make a symlink to /tmp in /etc/disk so you can download the files via the web interface. 
  
 +<code> ln -s /tmp /etc/disk </code>
 ==== Flashing ==== ==== Flashing ====
  
projects/zsun-wifi-card-reader.1457984320.txt.gz · Last modified: 2016/03/14 19:38 by emeryth

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki