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
Allow features to be disabled at build time (#143)
* Add framework for built-time feature selection
* Allow MQTT, NTP, OTA features to be disabled at build time
* Allow Project screens to be disabled at build time
* Allow security features to be disabled at build time
* Switch to std::function for StatefulService function aliases for greater flexibility
* Bump various UI lib versions
* Update docs
A simple, secure and extensible framework for IoT projects built on ESP8266/ESP32 platforms with responsive React front-end.
5
+
A simple, secure and extensible framework for IoT projects built on ESP8266/ESP32 platforms with responsive [React](https://reactjs.org/) front-end built with [Material-UI](https://material-ui.com/).
6
6
7
7
Designed to work with the PlatformIO IDE with [limited setup](#getting-started). Please read below for setup, build and upload instructions.
8
8
@@ -19,9 +19,7 @@ Provides many of the features required for IoT projects:
19
19
* Remote Firmware Updates - Enable secured OTA updates
20
20
* Security - Protected RESTful endpoints and a secured user interface
21
21
22
-
The back end is provided by a set of RESTful endpoints and the responsive React based front end is built using [Material-UI](https://material-ui.com/).
23
-
24
-
The front end has the prerequisite manifest file and icon, so it can be added to the home screen of a mobile device if required.
22
+
Features may be [enabled or disabled](#selecting-features) as required at compile time.
The `REACT_APP_HTTP_ROOT` and `REACT_APP_WEB_SOCKET_ROOT` properties can be modified to point a ESP device running the back end firmware.
140
+
The `REACT_APP_HTTP_ROOT` and `REACT_APP_WEB_SOCKET_ROOT` properties can be modified to point a ESP device running the back end.
143
141
144
142
> **Tip**: You must restart the development server for changes to the environment file to come into effect.
145
143
@@ -152,9 +150,31 @@ You can enable CORS on the back end by uncommenting the -D ENABLE_CORS build fla
152
150
-D CORS_ORIGIN=\"http://localhost:3000\"
153
151
```
154
152
153
+
## Selecting features
154
+
155
+
Many of the framework's built in features may be enabled or disabled as required at compile time. This can help save sketch space and memory if your project does not require the full suite of features. The access point and WiFi management features are "core features" and are always enabled. Feature selection may be controlled with the build flags defined in [features.ini](features.ini).
156
+
157
+
Customize the settings as you see fit. A value of 0 will disable the specified feature:
FT_PROJECT | Controls whether the "project" section of the UI is enabled. Disable this if you don't intend to have your own screens in the UI.
170
+
FT_SECURITY | Controls whether the [security features](#security-features) are enabled. Disabling this means you won't need to authenticate to access the device and all authentication predicates will be bypassed.
171
+
FT_MQTT | Controls whether the MQTT features are enabled. Disable this if your project does not require MQTT support.
172
+
FT_NTP | Controls whether network time protocol synchronization features are enabled. Disable this if your project does not require accurate time.
173
+
FT_OTA | Controls whether OTA update support is enabled. Disable this if you won't be using the remote update feature.
174
+
155
175
## Factory settings
156
176
157
-
The firmware has built-in factory settings which act as default values for the various configurable services where settings are not saved on the file system. These settings can be overridden using the build flags defined in [factory_settings.ini](factory_settings.ini).
177
+
The framework has built-in factory settings which act as default values for the various configurable services where settings are not saved on the file system. These settings can be overridden using the build flags defined in [factory_settings.ini](factory_settings.ini).
158
178
159
179
Customize the settings as you see fit, for example you might configure your home WiFi network as the factory default:
160
180
@@ -193,7 +213,7 @@ Changing factory time zone setting is a common requirement. This requires a litt
193
213
194
214
### Device ID factory defaults
195
215
196
-
If not overridden with a build flag, the firmware will use the device ID to generate factory defaults for settings such as the JWT secret and MQTT client ID.
216
+
If not overridden with a build flag, the framework will use the device ID to generate factory defaults for settings such as the JWT secret and MQTT client ID.
197
217
198
218
> **Tip**: Random values are generally better defaults for these settings, so it is recommended you leave these flags undefined.
199
219
@@ -481,7 +501,7 @@ class LightStateService : public StatefulService<LightState> {
481
501
};
482
502
```
483
503
484
-
Endpoint security is provided by authentication predicates which are [documented below](#security-features). The SecurityManager and authentication predicate may be provided if a secure endpoint is required. The demo project shows how endpoints can be secured.
504
+
Endpoint security is provided by authentication predicates which are [documented below](#security-features). The SecurityManager and authentication predicate may be provided if a secure endpoint is required. The placeholder project shows how endpoints can be secured.
485
505
486
506
#### Persistence
487
507
@@ -519,7 +539,7 @@ class LightStateService : public StatefulService<LightState> {
519
539
};
520
540
```
521
541
522
-
WebSocket security is provided by authentication predicates which are [documented below](#security-features). The SecurityManager and authentication predicate may be provided if a secure WebSocket is required. The demo project shows how WebSockets can be secured.
542
+
WebSocket security is provided by authentication predicates which are [documented below](#security-features). The SecurityManager and authentication predicate may be provided if a secure WebSocket is required. The placeholder project shows how WebSockets can be secured.
0 commit comments