I was one of the guys that got the Zsun fever 🙂
I’m not going to get into details. For those you can check the Warsaw Hackerspace’s website. Those guys did an awesome job compiling information related to this tiny yet powerful device.
Originally it comes with a custom firmware that provides you with an access point that can be used to share files ( it has a microsd slot ). By flashing OpenWRT it allows you to unleash all it power and use it to several different things (access point, range extender, file server using different protocols, IoT, Tor server, you name it), but since you can only access it via wifi ( there’s a physical ethernet port that you can use if you don’t mind tearing apart the case and solder an ethernet jack) it can be very easy to lose access to the devices.
I’ve seen some people talking about a trick using the sd card slot during boot to force a software reset but it didn’t work for me, so I just decided to do something different.
The approach is easy. Create a script that is loaded on boot and checks for a file on the memory card. If it’s there, then it issues a firstboot command to reset everything. This is similar to the update process of several gadgets and it’s easy to implement.
1º Flash the OpenWRT firmware ( check the hackerspace link )
2º Open the web interface. Enable the SD card automount feature and mount it on /mnt/sda1 (this should be the default). Enable enable SSH.
3º Log on using SSH. Create a file called restore inside /etc/init.d/ and dump the following contents there:
# Copyright (C) 2009-2012 OpenWrt.org
if [ -f "/mnt/sda1/restore" ]
echo "y" | /sbin/firstboot
echo "Rebooting to apply changes"
echo "Stop action not used."
echo "Reload action not used."
echo "Shutdown action not used."
4º Save the file and change the permissions to 755 ( chmod 0755 /etc/init.d/restore )
5º Enable the script on boot. To do so execute the following command: /etc/init.d/restore enable
And that’s it. If for any reason you mess up the wireless interface and lose access to the device, all you have to do is create a blank file inside the SD card called restore and the next time you boot the device it will detect this and force the reset.
Warsaw Hackerspace: https://wiki.hackerspace.pl/projects:zsun-wifi-card-reader