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
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ You can configure the project to serve the interface from PROGMEM by uncommentin
98
98
99
99
Be aware that this will consume ~150k of program space which can be especially problematic if you already have a large build artefact or if you have added large javascript dependencies to the interface. The ESP32 binaries are large already, so this will be a problem if you are using one of these devices and require this type of setup.
100
100
101
-
A method for working around this issue can be to reduce the amount of space allocated to SPIFFS by configuring the device to use a differnt strategy partitioning. If you don't require SPIFFS other than for storing config one approach might be to configure a minimal SPIFFS partition.
101
+
A method for working around this issue can be to reduce the amount of space allocated to SPIFFS by configuring the device to use differnt partitioning. If you don't require SPIFFS other than for storing config one approach might be to configure a minimal SPIFFS partition.
102
102
103
103
For a ESP32 (4mb variant) there is a handy "min_spiffs.csv" partition table which can be enabled easily:
104
104
@@ -113,7 +113,7 @@ This is left as an exersise for the reader as everyone's requirements will vary.
113
113
114
114
### Running the interface locally
115
115
116
-
You can run a local development server to allow you preview changes to the front end without the need to upload a file system image to the device after each change.
116
+
You can run a local development server to allow you preview changes to the front end without the need to upload a file system image to the device after each change.
117
117
118
118
Change to the ['interface'](interface) directory with your bash shell (or Git Bash) and use the standard commands you would with any react app built with create-react-app:
119
119
@@ -132,12 +132,17 @@ npm start
132
132
133
133
#### Changing the endpoint root
134
134
135
-
The endpoint root path can be found in ['interface/.env.development'](interface/.env.development), defined as the environment variable 'REACT_APP_ENDPOINT_ROOT'. This needs to be the root URL of the device running the back end, for example:
135
+
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:
136
136
137
-
```js
138
-
REACT_APP_ENDPOINT_ROOT=http://192.168.0.6/rest/
137
+
```properties
138
+
REACT_APP_HTTP_ROOT=http://192.168.0.99
139
+
REACT_APP_WEB_SOCKET_ROOT=ws://192.168.0.99
139
140
```
140
141
142
+
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.
143
+
144
+
> **Note**: You must restart the development server for changes to the environment to become effective.
145
+
141
146
#### Enabling CORS
142
147
143
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:
@@ -254,7 +259,7 @@ You can replace the app icon is located at ['interface/public/app/icon.png'](int
254
259
255
260
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