Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More protocol docs and adjust program according to specs #9

Merged
merged 4 commits into from
Sep 6, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
WIP: work on protocol docs
  • Loading branch information
eni committed Sep 5, 2019
commit 3ab75852ba86e61f171c820a2c2ce012c8bd9783
79 changes: 64 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 59,76 @@ muuvctl get --follow

## Serial protocol

The protocol is not fully known.
The protocol seemst to be called TiMOTION F-Bus.
fujexo marked this conversation as resolved.
Show resolved Hide resolved
Baudrate is: `9600`
The following is known (possibly not everything that the controller can do):

The table sends the following for its position:
### RX
The controller tin the table sends the following:
```c
uint8_t StartByte = 0x98;
uint8_t StartByte = 0x98;
uint8_t Param;
uint8_t Param;
uint8_t Data;
uint8_t Data;
```
b'\x98'
b'\x98'
b'\x03' <- can be b'\x00' as well
b'\x03' <- can be b'\x00' as well
b'O' <- position ord(pos)
b'O' <- position ord(pos)
`Param` is the following:
```c
STOPPED = 0x00;
SAVE_TRIGGED = 0x01;
MOVING = 0x03;
```
`Data` is normally the position of the table.

To move the table send the following:
### TX

You need to send the following struct to control it
```c
uint8_t StartByte = 0xD8;
uint8_t StartByte = 0xD8;
uint8_t Param;
uint8_t Command;
uint8_t Command;
```
b'f' > 102
b'\x00' > 0 (no move) 1 (up) 2(down)
b'\x00' > 0 (no move) 1 (up) 2(down)
b'\xd8' > 216
b'\xd8' > 216
Only known value for `Param` is `0x66` which is used in all commands.


`Command` is the following:
```c
STOP = 0x00;
DOWN = 0x01;
UP = 0x02;
RESET = 0x03;
POS1 = 0x04;
POS2 = 0x08;
POS3 = 0x10;
POS4 = 0x20;
SAVE = 0x40;
```
There is no known command yet to move the table to an specific position. You need to send up or down until the table reaches the desired position, then send stop.

#### TX Examples

* Move up: `0xD8, 0xD8, 0x66, 0x02, 0x02`
* Move down: `0xD8, 0xD8, 0x66, 0x01, 0x01`
* Stop: `0xD8, 0xD8, 0x66, 0x00, 0x00`
* Goto POS1: `0xD8, 0xD8, 0x66, 0x04, 0x04`
* Goto POS4: `0xD8, 0xD8, 0x66, 0x20, 0x20`
* Reset: `0xD8, 0xD8, 0x66, 0x03, 0x03`

##### Save
* Send min. 32x SAFE: `0xD8, 0xD8, 0x66, 0x40, 0x40`
* Optional: wait until table sends: `0x98, 0x98, 0x01, 0x01, POS, POS `
* Send 4x wanted POS, for POS1: `0xD8, 0xD8, 0x66, 0x04, 0x04`
* Send 1x STOP: `0xD8, 0xD8, 0x66, 0x00, 0x00`


#### Notes

There seems to be no way to move the table to an specific position. You need to send up or down until the table reaches the desired position, then send stop.




## Contributing

Expand Down