Difference between revisions of "LeapFrog Pollux Platform: DFTPdevice"

From eLinux.org
Jump to: navigation, search
(DFTP Command List)
Line 31: Line 31:
  
 
'''GETS MFG_LOCALE'''
 
'''GETS MFG_LOCALE'''
Returns: MFG_LOCALE=""
+
Returns:
 +
 
 +
MFG_LOCALE=""
  
 
'''SETS MOUNTPATIENT=2 or 0'''
 
'''SETS MOUNTPATIENT=2 or 0'''
Returns:200 OK
+
Returns:
 +
 
 +
200 OK
 +
 
 
Action: 2 mounts patient-rfs 0 ?
 
Action: 2 mounts patient-rfs 0 ?
  
  
 
'''GETS METAINFS'''
 
'''GETS METAINFS'''
Returns: METAINFS=/tmp/metainfs
+
Returns:
 +
 
 +
METAINFS=/tmp/metainfs
  
  
Line 46: Line 53:
  
 
'''ETH <host ip> 1383'''
 
'''ETH <host ip> 1383'''
 +
 
Action: Something with establishing a connection.
 
Action: Something with establishing a connection.
 +
 
must be sent before opening the second port.
 
must be sent before opening the second port.
  
 
'''LIST /path/to'''
 
'''LIST /path/to'''
Returns: <directory path> list 200 OK
+
Returns:
 +
 
 +
<directory path> list 200 OK
  
  
 
'''STAT /path/to'''
 
'''STAT /path/to'''
Returns: ex. D 00000000 755 root:root 200 OK
+
Returns:  
 +
 
 +
D 00000000 755 root:root
 +
 
 +
200 OK
 +
 
 
Notes: Seems to not always work as expected.
 
Notes: Seems to not always work as expected.
  
Line 60: Line 76:
 
'''INFO'''
 
'''INFO'''
 
Returns:
 
Returns:
 +
 
PACKETSIZE=131072
 
PACKETSIZE=131072
 +
 
VERSION=1.12
 
VERSION=1.12
 +
 
200 OK
 
200 OK
  
  
 
'''GETS BATTERYLEVEL'''
 
'''GETS BATTERYLEVEL'''
Returns: BATTERYLEVEL=<number> 200 OK
+
Returns:
 +
 
 +
BATTERYLEVEL=<number>
 +
 
 +
200 OK
  
  
 
'''GETS BATTERYSTATUS'''
 
'''GETS BATTERYSTATUS'''
Returns: BATTERYSTATUS=1 200 OK
+
Returns:
 +
 
 +
BATTERYSTATUS=1
 +
 
 +
200 OK
  
  
Line 79: Line 106:
  
 
'''101 EOF'''
 
'''101 EOF'''
 +
Returns:
 +
 +
200 OK
 +
 
Action: Ends STOR data transfer
 
Action: Ends STOR data transfer
 +
 
Notes:Must flush recv buffer first
 
Notes:Must flush recv buffer first
Returns: 200 OK
 
  
  
 
'''RETR /path/to'''
 
'''RETR /path/to'''
 +
 
Action: Downloads file.
 
Action: Downloads file.
Next: Read socket buffer for data
+
 
and send back 100 ACK: <number> (Seems to be last amount of len(data) received.)
+
Next: Read socket buffer for data and send back 100 ACK: <number> (Seems to be last amount of len(data) received.)
 +
 
 
Ends: When 101 EOF is received.
 
Ends: When 101 EOF is received.
  
  
 
'''RM /path/to'''
 
'''RM /path/to'''
 +
Returns:
 +
 +
200 OK
 +
 
Action: Removes file
 
Action: Removes file
Returns: 200 OK
 
  
  
 
'''RMD <path>'''
 
'''RMD <path>'''
 +
Returns:
 +
 +
200 OK
 +
 
Action:Removes directory
 
Action:Removes directory
Returns:  200 OK
 
  
  
 
'''IPKG'''
 
'''IPKG'''
 
Action:?
 
Action:?
 +
 
Notes:Found listed in source code, does something with firmware.
 
Notes:Found listed in source code, does something with firmware.
  
  
'''SIZE /path/to'''
+
'''SIZE /path/to''' Returns:
Returns a number, that doesn't seem to make sense
+
 
 +
a number, that doesn't seem to make sense
  
  
 
'''SETS DATETIME=20120126083030'''
 
'''SETS DATETIME=20120126083030'''
 +
Returns:
 +
 +
200 OK
 +
 
Action: Sets time.
 
Action: Sets time.
Returns: 200 OK
+
 
  
  
 
'''GETS DATETIME'''
 
'''GETS DATETIME'''
Returns: DATETIME=20120126083014'''  200 OK
+
Returns:
 +
 
 +
DATETIME=20120126083014'''  200 OK
  
  
 
'''GETS TOTALSPACE'''
 
'''GETS TOTALSPACE'''
Returns: TOTALSPACE=397307904 200 OK
+
Returns:
 +
 
 +
TOTALSPACE=397307904
 +
 
 +
200 OK
  
  
 
'''GETS FREESPACE'''
 
'''GETS FREESPACE'''
Returns: FREESPACE=265678848
+
Returns:
 +
 
 +
FREESPACE=265678848
  
 
'''GETS SERIAL'''
 
'''GETS SERIAL'''
Returns: SERIAL="XXXXXXXXXXXXXXXXXXXXX"
+
Returns:
 +
 
 +
SERIAL="XXXXXXXXXXXXXXXXXXXXX"
  
 
Untested
 
Untested
  
 
'''RUN'''
 
'''RUN'''
 +
 
Action: Runs shell script
 
Action: Runs shell script
 +
 
Next: Send data then 101 EOF
 
Next: Send data then 101 EOF
 +
 +
Note: Make sure to remove any \r line ends will cause an error otherwise.
 +
  
 
'''GETS SCRIPT_RUNNING'''
 
'''GETS SCRIPT_RUNNING'''
 +
Returns:
 +
 +
SCRIPT_RUNNING=0
 +
 +
200 OK
 +
 +
Note: seems to return nothing just after script is ran
 +
  
 
=== Reboot Sequences ===
 
=== Reboot Sequences ===
Line 156: Line 224:
  
 
'''Reboot to usb mode'''
 
'''Reboot to usb mode'''
 +
 
UPD8
 
UPD8
  

Revision as of 20:00, 26 January 2012

Work in progress, just jotting down notes currently.

DFTPdevice is an FTP like server that runs on both the Explorer and LeapPad. For these devices, this is what OpenLFConnect connects to them with.

DFTP Device

Connecting.

Open port 5000 send ETH command Open port 5001

When device starts up port 5000 is open, once you make a connection, you need to send the ETH command. Then port 5001 opens up.

5000 is the port you send commands to.

5001 is the port you read the responses from.

DFTP Command List

The command list is fairly undocumented, there is a few listed in the sources, but most will be discovered by other means, like using Wireshark. This is the list so far.

All commands must have a trailing 0x00 attached. In python it would look something like.

socket.send('LIST /path/to\x00')

In OpenLFConnect there is a special command send. It allows you to send any command you like, the 0x00 is appended for you, otherwise its all raw read/write. Obviously STOR and RETR won't work with it, but the rest you can play around with.

remote>send LIST /path/to

Some commands are Surgeon only.

Surgeon Only DFTP Version 1.12

GETS MFG_LOCALE Returns:

MFG_LOCALE=""

SETS MOUNTPATIENT=2 or 0 Returns:

200 OK

Action: 2 mounts patient-rfs 0 ?


GETS METAINFS Returns:

METAINFS=/tmp/metainfs


Universal

ETH <host ip> 1383

Action: Something with establishing a connection.

must be sent before opening the second port.

LIST /path/to Returns:

<directory path> list 200 OK


STAT /path/to Returns:

D 00000000 755 root:root

200 OK

Notes: Seems to not always work as expected.


INFO Returns:

PACKETSIZE=131072

VERSION=1.12

200 OK


GETS BATTERYLEVEL Returns:

BATTERYLEVEL=<number>

200 OK


GETS BATTERYSTATUS Returns:

BATTERYSTATUS=1

200 OK


STOR /path/to Action: Initiate file upload. Next: Send file data till EOF then send 101 EOF. Device responds with a lot of 100 ACK: <number> (Seems to be last amount of len(data) received.)

101 EOF Returns:

200 OK

Action: Ends STOR data transfer

Notes:Must flush recv buffer first


RETR /path/to

Action: Downloads file.

Next: Read socket buffer for data and send back 100 ACK: <number> (Seems to be last amount of len(data) received.)

Ends: When 101 EOF is received.


RM /path/to Returns:

200 OK

Action: Removes file


RMD <path> Returns:

200 OK

Action:Removes directory


IPKG Action:?

Notes:Found listed in source code, does something with firmware.


SIZE /path/to Returns:

a number, that doesn't seem to make sense


SETS DATETIME=20120126083030 Returns:

200 OK

Action: Sets time.


GETS DATETIME Returns:

DATETIME=20120126083014 200 OK


GETS TOTALSPACE Returns:

TOTALSPACE=397307904

200 OK


GETS FREESPACE Returns:

FREESPACE=265678848

GETS SERIAL Returns:

SERIAL="XXXXXXXXXXXXXXXXXXXXX"

Untested

RUN

Action: Runs shell script

Next: Send data then 101 EOF

Note: Make sure to remove any \r line ends will cause an error otherwise.


GETS SCRIPT_RUNNING Returns:

SCRIPT_RUNNING=0

200 OK

Note: seems to return nothing just after script is ran


Reboot Sequences

Disconnect sequence

NOOP

DCON


Reboot after update or in general

RSET

NOOP

DCON


Reboot to usb mode

UPD8

NOOP

DCON