Skip to content

Commit d68afe5

Browse files
authored
Update readme (rjwats#126)
* Be more explicit about optional FS upoad step in readme
1 parent bcb1098 commit d68afe5

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

README.md

+13-10
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ The project structure is as follows:
4040

4141
Resource | Description
4242
-------------------------------- | ----------------------------------------------------------------------
43-
[data/](data) | The file system image directory
4443
[interface/](interface) | React based front end
4544
[lib/framework/](lib/framework) | C++ back end for the ESP8266/ESP32 device
4645
[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
8382

8483
#### Serving the interface from PROGMEM
8584

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).
8788
8889
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.
8990

9091
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:
9192

9293

93-
```yaml
94+
```ini
9495
[env:node32s]
9596
board_build.partitions = min_spiffs.csv
9697
platform = espressif32
9798
board = node32s
9899
```
99100

100-
#### Uploading the file system image
101+
#### Serving the interface from SPIFFS
101102

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:
103106

104107
![uploadfs](/media/uploadfs.png?raw=true "uploadfs")
105108

@@ -131,7 +134,7 @@ npm start
131134

132135
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:
133136

134-
```properties
137+
```ini
135138
REACT_APP_HTTP_ROOT=http://192.168.0.99
136139
REACT_APP_WEB_SOCKET_ROOT=ws://192.168.0.99
137140
```
@@ -144,7 +147,7 @@ The `REACT_APP_HTTP_ROOT` and `REACT_APP_WEB_SOCKET_ROOT` properties can be modi
144147

145148
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:
146149

147-
```properties
150+
```ini
148151
-D ENABLE_CORS
149152
-D CORS_ORIGIN=\"http://localhost:3000\"
150153
```
@@ -204,7 +207,7 @@ The pre-configured environments are "esp12e" and "node32s". These are common ESP
204207

205208
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:
206209

207-
```yaml
210+
```ini
208211
[env:esp12e]
209212
platform = espressif8266
210213
board = esp12e
@@ -217,7 +220,7 @@ board = node32s
217220

218221
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:
219222

220-
```yaml
223+
```ini
221224
[platformio]
222225
;default_envs = esp12e
223226
default_envs = node32s
@@ -268,7 +271,7 @@ You can replace the app icon is located at ['interface/public/app/icon.png'](int
268271

269272
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)
270273

271-
```properties
274+
```ini
272275
REACT_APP_NAME=Funky IoT Project
273276
```
274277

0 commit comments

Comments
 (0)