clickfree = 500gb piratebox (help needed)

Posted by Runaway_cat_tank 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
clickfree = 500gb piratebox (help needed)
March 30, 2011 12:57AM
I've just bought a clickfree wireless backup hdd intending to turn it into a piretbox. To my delight the the chipset is a Ralink RT3052 running *nix with access to a (somewhat crippled) busybox terminal .

Anyway I suck at everything, so if I ever attempt this myself I'll defiantly brick it. Can anyone help

Specs:
FLASH: 16MB
SDRAM: 64MB
sda: 500gb western digital
Rt3052 with ralink SoC
- DHCP
- 5 lan ports (lol wut? That's what it says)
BusyBox v1.12.1
commands: . : break cd chdir continue eval exec exit export false hash
help local pwd read readonly return set shift source times trap
true type ulimit umask unset wait

Several other commands like cp and ls also work. ls -R and uname doesn't work though
Re: clickfree = 500gb piratebox (help needed)
March 30, 2011 07:28AM
Hi,
I took a look at the homepage. This seems to be a great idea!

The chipset combiend with this amount of flash space seems supported by dd-wrt.
Maybe you need to use tftp for flashing the device.. Try to find an update instruction on the vendor page.

Have look an this page: [www.dd-wrt.com]
Find a box with nearly same hardware specs, maybe there is already an instruction

Matthias



Edited 1 time(s). Last edit at 03/30/2011 07:28AM by Matthias.
Re: clickfree = 500gb piratebox (help needed)
March 30, 2011 09:18AM
I don't really want to flash the drive for several reasons:
- the kernel has inbuilt features such as spinning down the HDD after 10 mins of inactivity
- Flashing = easiest way to kill devices
- there are some good features like FTP and SAMBA on the ralink SoC

Also the device has no accessible eth ports (despite what it says)

I was looking to set the routing tables to send all traffic to the devices 2nd DHCP address and hosting the webpage through that.

- Currently I'm trying to find out how to redirect that DHCP IP to a simple web page (index.htm)
- Install python
- Then install the piratebox
- then get the files to store on /media/sda1/store



Edited 1 time(s). Last edit at 03/30/2011 09:19AM by Runaway_cat_tank.
Re: clickfree = 500gb piratebox (help needed)
March 30, 2011 02:08PM
Did you already figure out you can use some kind of packet-management like ipkg ?

Do you want your "box" act like an apn?

You don't need to configure a routing or redirect. The piratebox-wlan is completly isolated.
You have to configure your dns-service to provide only the ip adress of your "box".

I created some scripts for debian and I'm currently working on a package with using lighttpd. These scripts are designed to work out of the box.
Try to find out which server-software is installed on your box ( Is it dnsmasq? )
Re: clickfree = 500gb piratebox (help needed)
March 31, 2011 09:14AM
yes, dnsmasq is present but there is no config file in /usr/sbin.

This thing has no eth ports visible I can't get in via ssh so wireless is my only connection point to the device. I have no experience with servers so I'm going to be as useful as a rock.
Re: clickfree = 500gb piratebox (help needed)
March 31, 2011 02:18PM
Well a rock is not very useful winking smiley

Can you describe, what happens if you connect the clickfree box the first time with your pc? It is connected like a normal USB drive or did it create something different like a new network interface card showed up at "network connection" ?
If the last thing happends, you have a possibility to enter the box from a different way... If not and you'll brick it, there is no way out.

Maybe ask the vendor or look at the page how to put a firmware update into.

Or maybe open up the box and hopefully find some serial port or whatever?
Re: clickfree = 500gb piratebox (help needed)
March 31, 2011 08:28PM
better, I performed a wireshark capture on the usb and also used lsusb to check out what's happening. The thing acts like a removable HDD and a generic cdrom. If you ask for the wireshark cap ill post it somewhere and link to it.

lsusb -v
Bus 001 Device 003: ID 1980:0808  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x1980 
  idProduct          0x0808 
  bcdDevice            0.67
  iManufacturer           1 Clikfree
  iProduct                2 Backup Drive    
  iSerial                 3 006710074014E0EF0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      2 SFF-8020i, MMC-2 (ATAPI)
      bInterfaceProtocol     80 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered
Re: clickfree = 500gb piratebox (help needed)
April 01, 2011 04:41AM
Please post a fdisk dump:
> fdisk -l /dev/sda


But I think, that updating via USB is not the correct way. In fact I think flashing somehow it may cause bricking it sad smiley
Re: clickfree = 500gb piratebox (help needed)
April 01, 2011 08:24AM
The Ralink Soc has a inbuilt flash option via the webUI.

sudo fdisk -l from my computer while the usb is pluged in reveals:
Disk /dev/sdd: 499.9 GB, 499877109760 bytes
255 heads, 63 sectors/track, 60773 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000001

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1       60773   488159091    7  HPFS/NTFS

The CD-ROM portion is mapped to /dev/sr1

fdisk -ul from device
Disk /dev/sda: 499.8 GB, 499877109760 bytes
255 heads, 63 sectors/track, 60773 cylinders, total 976322480 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/sda1              63   976318244   488159091   7 HPFS/NTFS

Information dump:
lsmod
Module                  Size  Used by
rt2860v2_ap           922208  1 
dwc_otg                82400  0 
lm                      2720  1 dwc_otg,[permanent]

/proc/cpuinfo
system type		: Ralink SoC
processor		: 0
cpu model		: MIPS 24K V4.12
BogoMIPS		: 255.48
wait instruction	: yes
microsecond timers	: yes
tlb_entries		: 32
extra interrupt vector	: yes
hardware watchpoint	: yes
ASEs implemented	: mips16 dsp
VCED exceptions		: not available
VCEI exceptions		: not available

/proc/version
Linux version 2.6.21 (root@LinuxTDE) (gcc version 3.4.2) #201
cat /proc/swaps


/proc/ioports
b0000500-b000051f : serial
b0000c00-b0000c1f : serial

ps
PID USER       VSZ STAT COMMAND
    1 clickfre  1756 S    init  
    2 clickfre     0 SWN  [ksoftirqd/0]
    3 clickfre     0 SW<  [events/0]
    4 clickfre     0 SW<  [khelper]
    5 clickfre     0 SW<  [kthread]
   30 clickfre     0 SW<  [kblockd/0]
   33 clickfre     0 SW<  [khubd]
   45 clickfre     0 SW<  [kswapd0]
   46 clickfre     0 SW   [pdflush]
   47 clickfre     0 SW   [pdflush]
   48 clickfre     0 SW<  [aio/0]
  662 clickfre     0 SW   [mtdblockd]
  686 clickfre  1360 S    nvram_daemon 
  687 clickfre  1360 S    malata 
  688 clickfre  1860 S    goahead 
  690 clickfre  1752 S    telnetd 
  704 clickfre  1760 S    /bin/sh 
  770 clickfre     0 SW<  [dwc_otg]
  801 clickfre     0 SW<  [scsi_eh_0]
  802 clickfre     0 SW<  [usb-storage]
  844 clickfre     0 SW   [RtmpCmdQTask]
  845 clickfre     0 SW   [RtmpWscTask]
  912 clickfre  2144 S <  ntfs-3g /dev/sda1 /media/sda1 -o force 
  972 clickfre  1752 S    udhcpc -i eth2.2 -s /sbin/udhcpc.sh -p /var/run/udhcp
 1235 clickfre  1756 S    udhcpd /etc/udhcpd.conf 
 1489 clickfre  1760 S    syslogd -C8 
 1492 clickfre  1752 S    klogd 
 1625 clickfre  1228 S    stupid-ftpd 
 1726 clickfre  4404 S    nmbd 
 1729 clickfre  5720 S    smbd 
 1788 clickfre  1752 S    sh -c ps 1>/var/system_command.log 2>&1 
 1789 clickfre  1756 R    ps
Re: clickfree = 500gb piratebox (help needed)
April 07, 2011 12:45PM
Making progress.

Inside is a set of connections but I can't identify how they work. Are they standard connections. WTF is with the the one labelled USB

There is also a three point UART connector

LAN
Pin         Pin
1 3.3v      5 GND
2 RX        6 TX
3 TXOP1     7 RXIP
4 TXOM1     8 RXIM1

USB
1 3.3v      6 GND
2 1.5v      7 3.5v
3 HW_Re     8 1.8v
4 GND       9 5.0v
5 12v       10 [no pin]
Re: clickfree = 500gb piratebox (help needed)
April 07, 2011 12:53PM
Can you solder? smoking smiley
Would be a nice idea to put a ethernet port on it smiling smiley (If it really works, I will buy one too smiling smiley )
Re: clickfree = 500gb piratebox (help needed)
April 07, 2011 10:58PM
I can solder. But It don't know what the hell they are to begin with. They are labelled with USB and LAN but both have weird values.

I'm pretty sure that the lan is a lan as it has TX/RX and it operates at 3.3v (allot of cards do).

Currently im busy trying to cross compile stuff to get on to this thing but without any success. I'm gonna try accessing the connectors on the inside in about a week so stay in touch.
Re: clickfree = 500gb piratebox (help needed)
April 10, 2011 07:23AM
Update:
Well it tuns out that the pins marked usb are... a usb connection. For some reason the voltages are written on the board instead of +D -D. Anyway this will be useful for later as I intend to create an external USB slot for automatically uploading from a usb stick. You can also access the storage part of the device via a already existing USB cord.

Surprise, the LAN pins are accessible from outside the case via some strategically placed holes in the case hidden behind a serial number sticker. I've not been able to interface with these yet but i hope to through the power of wireshark. Pins 1 and 6 have a positive charge.

I got my hands of a kernel command dump that that allows me to better work with the system. Everything is in there including the control of the indicator light.

Here's a scan of the board if anyone is interested in helping
chip - hosted on bayimg - fixed



Edited 1 time(s). Last edit at 04/11/2011 01:49AM by Runaway_cat_tank.
Re: clickfree = 500gb piratebox (help needed)
June 05, 2011 03:58AM
Almost done.

I'm using clickfree native goahead web server to run Matthias's cgi droopy and it's so far - so good.

To do:
1. link the ralink web front end to the droopy script to make a admin login option
2. Kill off several background processes currently running
3. Combined step 1 and 2 into a tutorial

Extras (I'll do it later)
4. Ralink SDK comes with a mips version of ctorrent. I'm going to see if i can use it to auto generate a .torrent file for new uploads.
5. make a usb port on the exterior for uploading via key

I'm not done yet but give me another month and we should have an off the shelf $130 pirate box with 500gb space.
Re: clickfree = 500gb piratebox (help needed)
June 05, 2011 10:11AM