Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
linbus:multicontroller_websockets [2021/03/05 10:26] superuser created |
linbus:multicontroller_websockets [2021/04/07 06:46] (current) superuser |
||
|---|---|---|---|
| Line 2: | Line 2: | ||
| The interaction with server is done trough web sockets | The interaction with server is done trough web sockets | ||
| - | |||
| - | ===== Movement commands ===== | ||
| To connect use this URL: | To connect use this URL: | ||
| Line 10: | Line 8: | ||
| ws://127.0.0.1:4444/linbus | ws://127.0.0.1:4444/linbus | ||
| </code> | </code> | ||
| + | |||
| + | ===== Current height ===== | ||
| + | |||
| + | On connection server starts to send current height for each motor | ||
| + | |||
| + | <code> | ||
| + | {"name":"test1", "value":68} | ||
| + | {"name":"test2", "value":82} | ||
| + | </code> | ||
| + | |||
| + | ===== Movement commands ===== | ||
| Send next commands to perform actions | Send next commands to perform actions | ||
| Line 28: | Line 37: | ||
| </code> | </code> | ||
| + | ===== Position commands ===== | ||
| + | To connect use this URL: | ||
| + | <code> | ||
| + | ws://127.0.0.1:4444/position | ||
| + | </code> | ||
| + | |||
| + | Send desired position(in cm) in this format: | ||
| + | |||
| + | <code> | ||
| + | {"name":"test1", "position":100} | ||
| + | </code> | ||
| + | |||
| + | ===== Settings commands === | ||
| + | |||
| + | To connect use this URL: | ||
| + | |||
| + | <code> | ||
| + | ws://127.0.0.1:4444/settings | ||
| + | </code> | ||
| + | |||
| + | Get settings: | ||
| + | <code> | ||
| + | {"name":"test1", "action":"get"} | ||
| + | </code> | ||
| + | |||
| + | Set settings: | ||
| + | <code> | ||
| + | {"name":"test1", "action":"set", "min":0, "max":40, "displayName":"Motor1"} | ||
| + | </code> | ||
| + | |||
| + | ===== Memory commands ===== | ||
| + | To connect use this URL: | ||
| + | |||
| + | <code> | ||
| + | ws://127.0.0.1:4444/memory | ||
| + | </code> | ||
| + | |||
| + | Get stored positions: | ||
| + | <code> | ||
| + | {"name":"test1", "action":"get"} | ||
| + | </code> | ||
| + | |||
| + | Set stored positions: | ||
| + | <code> | ||
| + | {"name":"test1", "action":"set", "positions":[100]} | ||
| + | </code> | ||