Difference between revisions of "Project:RELaserSoftware/USB protocol"

From London Hackspace Wiki
Jump to navigation Jump to search
(Added basic command format)
(Added know (and mostly verified) commands)
Line 32: Line 32:
 
All USB command follow the same format:
 
All USB command follow the same format:
 
<pre>
 
<pre>
host  01 05: sending 1 byte: are you there?
+
host  01 05:     sending 1 byte: are you there?
laser 04: yes I am here
+
laser 04:     yes I am here
host  05 01 01 10 06 e8: sending 5 bytes, 1 byte payload, always 1, 10 is the command, 06 is the payload, e8 is the checksum
+
host  05 01 01 10 06 e8:     sending 5 bytes, 1 byte payload, always 1, 10 is the command, 06 is the payload, e8 is the checksum
laser 06: OK, I received and understood (ACK)
+
laser 06:     OK, I received and understood (ACK)
laser 05: host, are you there?
+
laser 05:     host, are you there?
host  01 04: sending 1 byte, yes i am here
+
host  01 04:     sending 1 byte, yes i am here
laser 00 01 10 00 ef: 0 bytes payload, always 1, repeating the command sent, payload would be here, 00 is OK (81 is checksum error), checksum
+
laser 00 01 10 00 ef:     0 bytes payload, always 1, repeating the command sent, payload would be here, 00 is OK (81 is checksum error), checksum
host  01 06: sending 1 byte, OK (ACK)
+
host  01 06:     sending 1 byte, OK (ACK)
 
</pre>
 
</pre>
 +
 +
known command are
 +
* 10 04: start moving back, must be followed by 0e
 +
* 10 05: start moving forward, must be followed by 0e
 +
* 10 06: start moving left, must be followed by 0e to stop the motion
 +
* 10 07: start moving right, must be followed by 0e
 +
* 10 0e: stop motion triggered by 04, 05, 06, 07, 11, 12
 +
* 10 0f: move X and Y home
 +
* 10 11: start moving up (Z), must be followed by 0e
 +
* 10 12: start moving down (Z), must be followed by 0e
 +
* 10 13: move Z home
 +
* 80 nnnnnnnn eee ssss: send file, n is name, e is extension (MOL), s is length of file in bytes, followed by MOL file in 512 bytes blocks
 +
* 81: error?
 +
* 82: download complete?
 +
* 83 n: get filename and length at index n
 +
* 85 cccc: send file checksum after download?
 +
* 87 n: delete file at index n
 +
* 88: start?
 +
* 89: return number of files

Revision as of 20:22, 8 July 2011

Vendor: 0548 Product: 1005

The protocol seems to be fairly simple. I have a capture of some file downloads and deleting a file.

looks like:

commands are sent to endpoint 0x04 and read form 0x88, sent commands are (byte)length and then length bytes

commands 5 and 6 seem to be start and end

example command block:

>w04 0002     00000000: 01 05
*r88 0001     00000000: 04
>w04 0006     00000000: 05 01 01 83 01 7a
*r88 0001     00000000: 06
*r88 0001     00000000: 05
>w04 0002     00000000: 01 04
*r88 0014     00000000: 0f 01 83 53 51 55 41 52 45 20 20 4d 4f 4c 00 0e
    00000010: 00 00 00 66
>w04 0002     00000000: 01 06

That last reply packet includes the ascii for 'SQUARE MOL' with two spaces in the middle to pad it to 11 characters. This must be a file name in DOS 8.3 format with the . implied between the 8th and 9th characters.

This presumably maps directly to a FAT16 entry, so don't let it be null or begin with a dot!

It isn't, the protocol dosn't seem to be doing any block level management at all, looks like the controller is nice enough to do that for us JasperWallace 01:11, 28 November 2010 (UTC)

All USB command follow the same format:

host  01 05:     sending 1 byte: are you there?
laser 04:     yes I am here
host  05 01 01 10 06 e8:     sending 5 bytes, 1 byte payload, always 1, 10 is the command, 06 is the payload, e8 is the checksum
laser 06:     OK, I received and understood (ACK)
laser 05:     host, are you there?
host  01 04:     sending 1 byte, yes i am here
laser 00 01 10 00 ef:     0 bytes payload, always 1, repeating the command sent, payload would be here, 00 is OK (81 is checksum error), checksum
host  01 06:     sending 1 byte, OK (ACK)

known command are

  • 10 04: start moving back, must be followed by 0e
  • 10 05: start moving forward, must be followed by 0e
  • 10 06: start moving left, must be followed by 0e to stop the motion
  • 10 07: start moving right, must be followed by 0e
  • 10 0e: stop motion triggered by 04, 05, 06, 07, 11, 12
  • 10 0f: move X and Y home
  • 10 11: start moving up (Z), must be followed by 0e
  • 10 12: start moving down (Z), must be followed by 0e
  • 10 13: move Z home
  • 80 nnnnnnnn eee ssss: send file, n is name, e is extension (MOL), s is length of file in bytes, followed by MOL file in 512 bytes blocks
  • 81: error?
  • 82: download complete?
  • 83 n: get filename and length at index n
  • 85 cccc: send file checksum after download?
  • 87 n: delete file at index n
  • 88: start?
  • 89: return number of files