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
[lib/framework/](lib/framework) | C++ back end for the ESP8266/ESP32 device
46
45
[src/](src) | The main.cpp and demo project to get you started
@@ -83,23 +82,27 @@ The interface will be automatically built by PlatformIO before it builds the fir
83
82
84
83
#### Serving the interface from PROGMEM
85
84
86
-
By default, the project is configured to serve the interface from PROGMEM. This can be disabled by removing the -D PROGMEM_WWW build flag in ['platformio.ini'](platformio.ini) and re-building the firmware. If this your desired approach you must manually [upload the file system image](#uploading-the-file-system-image) to the device.
85
+
By default, the project is configured to serve the interface from PROGMEM.
86
+
87
+
> **Tip**: You do not need to upload a file system image unless you configure the framework to [serve the interface from SPIFFS](#serving-the-interface-from-spiffs).
87
88
88
89
The interface will consume ~150k of program space which can be problematic if you already have a large binary artefact or if you have added large dependencies to the interface. The ESP32 binaries are fairly large in there simplest form so the addition of the interface resources requires us to use special partitioning for the ESP32.
89
90
90
91
When building using the "node32s" profile, the project uses the custom [min_spiffs.csv](https://github.com/espressif/arduino-esp32/blob/master/tools/partitions/min_spiffs.csv) partitioning mode. You may want to disable this if you are manually uploading the file system image:
91
92
92
93
93
-
```yaml
94
+
```ini
94
95
[env:node32s]
95
96
board_build.partitions = min_spiffs.csv
96
97
platform = espressif32
97
98
board = node32s
98
99
```
99
100
100
-
#### Uploading the file system image
101
+
#### Serving the interface from SPIFFS
101
102
102
-
If service content from SPIFFS, disable the PROGMEM_WWW build flag and build the project. The compiled interface will be copied to [data/](data) by the build process and may now be uploaded to the device by pressing the "Upload File System image" button:
103
+
If you choose to serve the interface from SPIFFS you will need to change the default configuration and upload the file system image manually.
104
+
105
+
Disable `-D PROGMEM_WWW build` flag in ['platformio.ini'](platformio.ini) and re-build the firmware. The build process will now copy the compiled interface to the `data/` directory and it may be uploaded to the device by pressing the "Upload File System image" button:
The interface has a development environment which is enabled when running the development server using `npm start`. The environment file can be found in ['interface/.env.development'](interface/.env.development) and contains the HTTP root URL and the WebSocket root URL:
133
136
134
-
```properties
137
+
```ini
135
138
REACT_APP_HTTP_ROOT=http://192.168.0.99
136
139
REACT_APP_WEB_SOCKET_ROOT=ws://192.168.0.99
137
140
```
@@ -144,7 +147,7 @@ The `REACT_APP_HTTP_ROOT` and `REACT_APP_WEB_SOCKET_ROOT` properties can be modi
144
147
145
148
You can enable CORS on the back end by uncommenting the -D ENABLE_CORS build flag in ['platformio.ini'](platformio.ini) then re-building and uploading the firmware to the device. The default settings assume you will be accessing the development server on the default port on [http://localhost:3000](http://localhost:3000) this can also be changed if required:
146
149
147
-
```properties
150
+
```ini
148
151
-D ENABLE_CORS
149
152
-D CORS_ORIGIN=\"http://localhost:3000\"
150
153
```
@@ -204,7 +207,7 @@ The pre-configured environments are "esp12e" and "node32s". These are common ESP
204
207
205
208
The settings file ['platformio.ini'](platformio.ini) configures the supported environments. Modify these, or add new environments for the devides you need to support. The default environments are as follows:
206
209
207
-
```yaml
210
+
```ini
208
211
[env:esp12e]
209
212
platform = espressif8266
210
213
board = esp12e
@@ -217,7 +220,7 @@ board = node32s
217
220
218
221
If you want to build for a different device, all you need to do is re-configure ['platformio.ini'](platformio.ini) and select an alternative environment by modifying the default_envs variable. Building for the common esp32 "node32s" board for example:
219
222
220
-
```yaml
223
+
```ini
221
224
[platformio]
222
225
;default_envs = esp12e
223
226
default_envs = node32s
@@ -268,7 +271,7 @@ You can replace the app icon is located at ['interface/public/app/icon.png'](int
268
271
269
272
The app name displayed on the login page and on the menu bar can be modified by editing the REACT_APP_NAME property in ['interface/.env'](interface/.env)
0 commit comments