I want to use a Rio Karma for backing up some files but the software is not really friendly (at least to a CLI addict like me). The Karma comes with an ethernet dock. The device has an IP stack and configures itself with DHCP. Cool. The device also has a HTTP server. I haven't played with it yet but one of the response headers is "Server: Mercury-Content-Server/0.11". I think it is possible to stream music off of the device. Hmm, it also seems to broadcast UDP packets that contain "SERVER: Linux/2.4 UPnP/1.0 Pearl/1.0". Interesting.
The Karma does not work as a USB mass storage device, even though it has a USB2 connector. To use it as a general storage device, you need to use the Rio Taxi application. Using tcpdump and Ethereal, here is what I have learned about the protocol.
The protocol operates over TCP. The server port is 8302 (not sure if that's always true). The protocol seems to be organized into request and response messages. The client sends a request and the device responds with one or more than one response messages. Each message begins with a fixed string (52 69 c5 8d). The protocol seems be use mostly little-endian unsigned 32-bit integers. Following the fixed string (magic), is a u32 integer indicating the message type and optional message content (aligned to 32-bit boundaries?). I found a list of message types in the rmmlite.jar archive:
0=Get Version
1=NAK
2=Progress
3=Login Phase 1
4=Login Phase 2
5=Get Device Info
6=Get Storage Info
7=Get Device Settings
8=Change Device Settings
9=Lock
10=Unlock
11=Prepare
12=Write
13=Get All File Info
14=Get File Info
15=Change File Info
16=Read
17=Delete
18=Format
19=Device Operation
That little bit of information helps (although I had guess many of them before finding that file). After connecting there is a version handshake. The client sends a GET_VERSION message with
the content 02 00 00 00 00 00 00 00 (probably major version 2, minor 0) and the device responds with the same message. For some reason the client does the handshake two times, perhaps due to sloppy programming.
Next, the client tries to lock the device (message content
01 00 00 00). The device responds with 5d 00 04 80. I suspect that is some kind of error message. Login needs to occur first, I think.
Login is done in two phases. First the client sends a LOGIN1 message (no content). The device responds with a 16 byte string. The client then sends a LOGIN2 message with another 16 byte string as content. Both strings look pretty random. I guessed it was an MD5 challenge-response, which turned out to be correct. The challenge is probably a random 16 byte string. The response is md5(challenge + password).
I figured out lots more things but this log entry is getting too long. I'll write more later. If you have a Rio Karma and are interested in helping me, please send me email.