Skip to content

Commit

Permalink
python: example: Update README.md with socat link option
Browse files Browse the repository at this point in the history
Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed Mar 21, 2024
1 parent d0da4f9 commit a1a81b5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions examples/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ To run the samples, you have to install the following python package:

```sh
python3 -m pip install pyserial
python3 -m pip install ../../python
```

Then you can run start the CP/PD service as,
Expand All @@ -21,10 +22,13 @@ ask socat to create a pair of psudo terminal devices that are connected to each
other. To do this run:

```sh
socat -d -d pty,raw,echo=0,nonblock pty,raw,echo=0,nonblock
socat pty,raw,echo=0,nonblock,link=/tmp/ttyS0 pty,raw,echo=0,nonblock,link=/tmp/ttyS1
```

The output of the above socat invocation should show two pts devices of the
format `/dev/pts/<N>`, where `N` is the number of the device. Then in two other
terminals, you can can start the CP and PD app as shown above but with the pts
devices produced by socat (the baudrate option can be omitted).
While the above command is running, you can use `/tmp/ttyS0` and `/tmp/ttyS1` to
start your CP and PD app as,

```
./cp_app.py /tmp/ttyS0
./pd_app.py /tmp/ttyS1
```

0 comments on commit a1a81b5

Please sign in to comment.