Lely core libraries  1.9.2
doc/co/cocat.md
1 cocat/cocatd - CANopen cat tools
2 ================================
3 
4 Synopsis
5 --------
6 
7  cocat -h
8  cocat --help
9  cocat [-i ms | --inhibit=ms] [interface] [StdIn_COBID] [StdOut_COBID]
10  [StdErr_COBID]
11 
12  cocatd -h
13  cocatd --help
14  cocatd [-D | --no-daemon] [-f filenname | --file=filename]
15  [-n node-ID | --node=node-ID] [interface] [command]
16 
17 Description
18 -----------
19 
20 The CANopen cat tools provide netcat-like functionality over the CAN bus. Their
21 implementation is based on object 1026 (OS prompt), which provides SDO and
22 (event-driven) PDO access to the `stdin`, `stdout` and `stderr` streams on a
23 CANopen device.
24 
25 ### cocat
26 
27 `cocat` is the client program. It reads bytes from `stdin` and writes them as
28 single-byte PDOs to the CAN bus, provided the second argument is a valid PDO
29 COB-ID. If the third and fourth arguments are valid COB-IDs, bytes received from
30 PDOs with those COB-IDs are written to `stdout` and `stderr`, respectively.
31 
32 The options are as follows:
33 
34  -h, --help Display help.
35  -i <ms>, --inhibit=<ms>
36  Wait at least <ms> milliseconds between PDOs
37  (default: 1).
38 
39 ### cocatd
40 
41 `cocatd` is the server program, and by default runs as a daemon. It executes the
42 provided command in a child process, and connects the `stdin`, `stdout` and
43 `stderr` streams of that process to sub-objects 1026:01, 1026:02 and 1026:03 in
44 its object dictionary, respectively. The default configuration enables PDO
45 access to each of these sub-objects. Regardless of the configuration, `cocatd`
46 expects RPDO1 to map to 1026:01 (StdIn), and TPDO1 and TPDO2 to map to 1026:02
47 (StdOut) and 1026:03 (StdErr), respectively.
48 
49 The options are as follows:
50 
51  -D, --no-daemon Do not run as daemon.
52  -f <filename>, --file=<filename>
53  Use <filename> as the EDS/DCF file instead of using
54  the default configuration.
55  -h, --help Display help.
56  -n <node-ID> --node=<node-ID>
57  Use <node-ID> as the CANopen node-ID.
58 
59 Example
60 -------
61 
62 The CANopen cat tools can be used to provide shell access over the CAN bus. To
63 setup such a configuration, run
64 
65  cocatd can0 -n 1 /bin/sh
66 
67 on the server, and
68 
69  cocat can0 0x201 0x181 0x281
70 
71 on the client. Any commands typed at the client side are executed on the server,
72 and the response is printed by the client.
73