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: README.md
+34-2Lines changed: 34 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ The library is self-contained and just needs the Arduino and ESP32 system librar
20
20
21
21
Clone or download the content of this git repository into your Arduino/libraries folder and restart you IDE.
22
22
23
-
To run the examples, you need to execute the script extras/create_cert.sh first. This script will create a simple CA to sign certificates that are used with the examples. Some notes on the usage can be found in the extras/README.md file.
23
+
To run the examples (except for the _Self-Signed-Certificates_ example), you need to execute the script extras/create_cert.sh first. This script will create a simple CA to sign certificates that are used with the examples. Some notes on the usage can be found in the extras/README.md file.
24
24
25
25
You then should be able to add the library to your project if you selected the ESP32 as architecture.
26
26
@@ -37,6 +37,7 @@ You will find several examples showing how you can use the library:
37
37
-[Async-Server](examples/Async-Server/Async-Server.ino): Like the Static-Page example, but the server runs in a separate task on the ESP32, so you do not need to call the loop() function in your main sketch.
38
38
-[Websocket-Chat](examples/Websocket-Chat/Websocket-Chat.ino): Provides a browser-based chat built on top of websockets. **Note:** Websockets are still under development!
39
39
-[Parameter-Validation](examples/Parameter-Validation/Parameter-Validation.ino): Shows how you can integrate validator functions to do formal checks on parameters in your URL.
40
+
-[Self-Signed-Certificate](examples/Self-Signed/Self-Signed.ino): Shows how to generate a self-signed certificate on the fly on the ESP when the sketch starts. You do not need to run `create_cert.sh` to use this example.
40
41
41
42
If you encounter error messages that cert.h or private\_key.h are missing when running an example, make sure to run create\_cert.sh first (see Setup Instructions).
42
43
@@ -144,4 +145,35 @@ By default, you need to pass control to the server explicitly. This is done by c
144
145
145
146
If you want to have the server running in the background (and not calling `loop()` by yourself every few milliseconds), you can make use of the ESP32's task feature and put the whole server in a separate task.
146
147
147
-
See the Async-Server example to see how this can be done.
148
+
See the Async-Server example to see how this can be done.
149
+
150
+
## Advanced Configuration
151
+
152
+
This section covers some advanced configuration options that allow you e.g. to customize the build process, but which might require more advanced programming skills and a more sophisticated IDE that just the default Arduino IDE.
153
+
154
+
### Saving Space by Reducing Functionality
155
+
156
+
To save program space on the microcontroller, there are some parts of the library that can be disabled during compilation and will then not be a part of your program.
| HTTPS_DISABLE_SELFSIGNING | Removes the code for generating a self-signed certificate at runtime. You will need to provide certificate and private key data from another data source to use the `HTTPSServer`.
163
+
164
+
Setting these flags requires a build environment that gives you some control of the compiler, as libraries are usually compiled separately, so just doing a `#define HTTPS_SOMETHING` in your sketch will not work.
165
+
166
+
**Example: Configuration with Platform IO**
167
+
168
+
To set these flags in Platform IO, you can modify your `platformio.ini`. To disable for example the self-signed-certificates part of the library, the file could look like this:
169
+
170
+
```ini
171
+
[env:esp32dev]
172
+
platform = espressif32
173
+
board = esp32dev
174
+
framework = arduino
175
+
build_flags =
176
+
-DHTTPS_DISABLE_SELFSIGNING
177
+
```
178
+
179
+
Note the `-D` in front of the actual flag name, that passes this flag as a definition to the preprocessor. Multiple flags can be added one per line.
0 commit comments