You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: can-bus/README.md
+21-7Lines changed: 21 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,30 +6,44 @@ This example implements a simple echo client and server that uses TLS over a CAN
6
6
7
7
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.
8
8
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.
10
24
11
25
## Setting Up
12
26
13
27
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:
14
28
15
29
```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
19
33
```
20
34
21
35
## Running
22
36
23
37
On one console run the server, this should be executed first or the handshake will fail. This is executed using:
24
38
25
39
```sh
26
-
server vcan0
40
+
$ server vcan0
27
41
```
28
42
29
43
Then in another terminal run the client:
30
44
31
45
```sh
32
-
server vcan0
46
+
$ client vcan0
33
47
```
34
48
35
49
On both ends you will see:
@@ -60,6 +74,6 @@ Got message: Hello world! This is a CAN bus test!
60
74
If you wish to disable the virtual CAN bus you can turn it off by doing:
0 commit comments