11### wolfSSL with Arduino
22
3+ Many of the supported devices are natively built-in to the [ Arduino IDE Board Manager] ( https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-board-manager/ )
4+ and by adding [ additional cores] ( https://docs.arduino.cc/learn/starting-guide/cores/ ) as needed.
5+
6+ STM32 Support can be added by including this link in the "Additional Boards Managers URLs" field:
7+
8+ https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
9+
10+ from [ stm32duino/Arduino_Core_STM32] ( https://github.com/stm32duino/Arduino_Core_STM32?tab=readme-ov-file#getting-started ) .
11+
12+
13+
314##### Reformatting wolfSSL as a compatible Arduino Library
415This is a shell script that will re-organize the wolfSSL library to be
516compatible with Arduino projects that use Arduino IDE 1.5.0 or newer.
@@ -8,23 +19,42 @@ directory with a header file in the name of the library. This script moves all
819src/ files to the ` IDE/ARDUINO/wolfSSL/src ` directory and creates a stub header
920file called ` wolfssl.h ` inside that directory.
1021
11- Step 1: To configure wolfSSL with Arduino, enter the following from within the
12- wolfssl/IDE/ARDUINO directory:
22+ Step 1: To configure wolfSSL with Arduino, enter one of the following commands
23+ from within the ` wolfssl/IDE/ARDUINO ` directory:
1324
14- `./wolfssl-arduino.sh`
25+ 1 . ` ./wolfssl-arduino.sh `
26+ - Creates an Arduino Library in ` wolfSSL ` directory
27+ 2 ` ./wolfssl-arduino.sh INSTALL `
28+ - Creates an Arduino Library in ` wolfSSL ` directory
29+ - Moves that directory to the Arduino library directory:
30+ - ` $HOME/Arduino/libraries ` for most bash environments
31+ - ` /mnt/c/Users/$USER/Documents/Arduino/libraries ` (for WSL)
32+ 3 . ` ./wolfssl-arduino.sh INSTALL /path/to/repository `
33+ - Creates an Arduino Library in ` wolfSSL ` directory
34+ - Copies that directory contents to the specified ` /path/to/repository `
35+ 4 . ` ./wolfssl-arduino.sh INSTALL /path/to/any/other/directory `
36+ - Creates an Arduino Library in ` wolfSSL ` directory
37+ - Copies that directory contents to the specified ` /path/to/repository `
1538
16- Step 2: Copy the directory wolfSSL that was just created to:
17- ` ~/Documents/Arduino/libraries/ ` directory so the Arduino IDE can find it.
18-
19- Step 3: Edit ` <arduino-libraries>/wolfSSL/src/user_settings.h `
39+ Step 2: Edit ` <arduino-libraries>/wolfSSL/src/user_settings.h `
2040If building for Intel Galileo platform add: ` #define INTEL_GALILEO ` .
2141Add any other custom settings, for a good start see the examples in wolfssl root
2242"/examples/configs/user_settings_ * .h"
2343
24- Step 4 : If you experience any issues with custom user_settings.h see the wolfssl
44+ Step 3 : If you experience any issues with custom user_settings.h see the wolfssl
2545porting guide here for more assistance: https://www.wolfssl.com/docs/porting-guide/
2646
27- Step 5: If you still have any issues contact support@wolfssl.com for more help.
47+ If you have any issues contact support@wolfssl.com for help.
48+
49+ ##### Including wolfSSL in Arduino Libraries (for Arduino version 2.0 or greater)
50+
51+ 1 . In the Arduino IDE:
52+
53+ The wolfSSL library should automatically be detected when found in the ` libraries `
54+ directory.
55+
56+ - In `Sketch -> Include Library` choose wolfSSL for new sketches.
57+
2858
2959##### Including wolfSSL in Arduino Libraries (for Arduino version 1.6.6)
3060
@@ -33,6 +63,72 @@ Step 5: If you still have any issues contact support@wolfssl.com for more help.
3363 ` IDE/ARDUNIO/wolfSSL ` folder.
3464 - In ` Sketch -> Include Library ` choose wolfSSL.
3565
36- 2 . Open an example Arduino sketch for wolfSSL:
66+ ##### wolfSSL Examples
67+
68+ Open an example Arduino sketch for wolfSSL:
69+
3770 - wolfSSL Client INO sketch: `sketches/wolfssl_client/wolfssl_client.ino`
71+
3872 - wolfSSL Server INO sketch: `sketches/wolfssl_server/wolfssl_server.ino`
73+
74+ #### Script Examples
75+
76+ Publish wolfSSL from WSL to a repository.
77+
78+ ``` bash
79+ rm -rf /mnt/c/Users/$USER /Documents/Arduino/libraries/wolfSSL
80+ rm -rf /mnt/c/workspace/wolfssl-$USER /IDE/ARDUINO/wolfSSL
81+ ./wolfssl-arduino.sh INSTALL /mnt/c/workspace/Arduino-wolfSSL-$USER /
82+ ```
83+
84+ Publish wolfSSL from WSL to default Windows local library.
85+
86+ ``` bash
87+ rm -rf /mnt/c/Users/$USER /Documents/Arduino/libraries/wolfSSL
88+ rm -rf /mnt/c/workspace/wolfssl-arduino/IDE/ARDUINO/wolfSSL
89+ ./wolfssl-arduino.sh INSTALL
90+ ```
91+
92+ Test the TLS server by running a local command-line client.
93+
94+ ``` bash
95+ cd /mnt/c/workspace/wolfssl-$USER
96+ ./examples/client/client -h 192.168.1.43 -p 11111 -v 3
97+ ```
98+
99+ Build wolfSSL to include wolfSSH support, but to an alternate development directory.
100+
101+ ``` bash
102+ cd /mnt/c/workspace/wolfssl-$USER
103+ ./configure --prefix=/mnt/c/workspace/wolfssh-$USER /wolfssl_install --enable-ssh
104+ make
105+ make install
106+ ```
107+
108+ Build wolfSSH with wolfSSL not installed to default directory.
109+
110+ ``` bash
111+ cd /mnt/c/workspace/wolfssh-$USER
112+ ./configure --with-wolfssl=/mnt/c/workspace/wolfssh-$USER /wolfssl_install
113+ make
114+ ./examples/client/client -u jill -h 192.168.1.34 -p 22222 -P upthehill
115+ ```
116+
117+ Test the current wolfSSL.
118+
119+ ``` bash
120+ cd /mnt/c/workspace/wolfssl-arduino
121+ git status
122+ ./autogen.sh
123+ ./configure --enable-all
124+ make clean
125+ make && make test
126+ ```
127+
128+ Build and run ` testwolfcrypt `
129+
130+ ``` bash
131+ ./autogen.sh
132+ ./configure --enable-all
133+ make clean && make && ./wolfcrypt/test/testwolfcrypt
134+ ```
0 commit comments