Skip to content

Commit 9688f1b

Browse files
authored
Merge pull request #380 from tim-weller-wolfssl/can-bus-readme-update
ZD15937 - Add more detail on configuring wolfSSL for CAN-bus example in README
2 parents 539a282 + c628d83 commit 9688f1b

1 file changed

Lines changed: 21 additions & 7 deletions

File tree

can-bus/README.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,44 @@ This example implements a simple echo client and server that uses TLS over a CAN
66

77
You need to have wolfSSL installed on your computer prior to building, this will need to be built with `WOLFSSL_ISOTP` defined to provide ISO-TP functionality.
88

9-
To generate the required SSL certificates use `./generate_ssl.sh`.
9+
In the `wolfssl` directory:
10+
```sh
11+
$ ./autogen.sh (this step might not be required if the configure script already exists)
12+
$ ./configure CFLAGS="-DWOLFSSL_ISOTP"
13+
$ make all
14+
$ sudo make install
15+
```
16+
17+
Then in the `wolfssl-examples/can-bus` directory:
18+
```sh
19+
$ ./generate_ssl.sh
20+
$ make
21+
```
22+
23+
The `client` and 'server` applications will be available in the `wolfssl-examples/can-bus' directory, as well as the required SSL certificates.
1024
1125
## Setting Up
1226
1327
If you do not have a physical CAN bus between too machines you can use the virtual CAN bus which is a Linux kernel module. This behaves just like a real CAN bus with a similar bandwidth. To enable this run the following commands:
1428
1529
```sh
16-
sudo modprobe vcan
17-
sudo ip link add dev vcan0 type vcan
18-
sudo ip link set vcan0 up
30+
$ sudo modprobe vcan
31+
$ sudo ip link add dev vcan0 type vcan
32+
$ sudo ip link set vcan0 up
1933
```
2034
2135
## Running
2236
2337
On one console run the server, this should be executed first or the handshake will fail. This is executed using:
2438
2539
```sh
26-
server vcan0
40+
$ server vcan0
2741
```
2842
2943
Then in another terminal run the client:
3044
3145
```sh
32-
server vcan0
46+
$ client vcan0
3347
```
3448
3549
On both ends you will see:
@@ -60,6 +74,6 @@ Got message: Hello world! This is a CAN bus test!
6074
If you wish to disable the virtual CAN bus you can turn it off by doing:
6175
6276
```sh
63-
sudo ip link set vcan0 down
77+
$ sudo ip link set vcan0 down
6478
```
6579

0 commit comments

Comments
 (0)