Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
9a49828
Added core temp
theelims Jun 18, 2023
179250e
added mDNS service and recovery mode
theelims Jun 21, 2023
aea3e69
Final touch recovery mode incl. docs
theelims Jun 23, 2023
9b5c81f
Updated to Svelte 4
theelims Jun 23, 2023
b8f8a79
Revert back to Svelte 3, CHANGELOG and push notifications
theelims Jun 25, 2023
ce8e6f4
Fixed drawer issue introduced with DaisyUI 3.1.6
theelims Jun 25, 2023
69bb639
Added telemetry via SSE for RSSI
theelims Jun 26, 2023
67a2e49
FT_PROJECT feature flag removed
theelims Jun 26, 2023
e06d078
fimware version in factory_settings.ini and SystemStatus API
theelims Jun 27, 2023
1c5f726
Deep Sleep Service API
theelims Jun 29, 2023
bd5ebd4
Added battery indicator & service
theelims Jun 30, 2023
556e069
Restructured OTA
theelims Jul 1, 2023
849dcff
Improvements System Status
theelims Jul 1, 2023
ef3e0b5
WIP github update
theelims Jul 17, 2023
3eb297d
Github Release OTA
theelims Jul 20, 2023
b880930
Update documentation for github updates
theelims Jul 22, 2023
95f3af4
Refactor WebSocket Server Code
theelims Jul 23, 2023
a310461
Error messages for SSE and WS
theelims Jul 23, 2023
e2b30a4
Mark 53.33 degC als invalid
theelims Jul 23, 2023
223e3c8
Generate SSL Root CA Store
theelims Jul 23, 2023
271bcd9
build script for ssl certificate store
theelims Jul 25, 2023
0930134
different ssl build config
theelims Aug 3, 2023
b74bbbb
Version updates
theelims Aug 3, 2023
d631ead
default env S3
theelims Aug 3, 2023
04631ac
Update CHANGELOG.md
theelims Aug 3, 2023
94dc9ae
WebSocketClient Trials
theelims Aug 3, 2023
3325732
WebSocketTrials
theelims Aug 3, 2023
de2b083
Merge branch 'features' of https://github.com/theelims/ESP32-svelteki…
theelims Aug 3, 2023
fd70719
Learnings from other projects
theelims Sep 7, 2023
3ee4d42
Fixes for platformio issue
theelims Sep 7, 2023
7b3b700
fixes for Arduino 6.4.0
theelims Sep 11, 2023
ecc8094
updated docs
theelims Sep 17, 2023
4e853bc
hard fork ESPAsyncWebserver + System Metrics
theelims Sep 22, 2023
01508f9
Update docs
theelims Oct 8, 2023
c69ba2b
Merge branch 'main' into features
theelims Oct 8, 2023
e97fe95
Renamed pushEvents enum to avoid collisions
theelims Dec 25, 2023
89a5ab2
Merge branch 'features' of https://github.com/theelims/ESP32-svelteki…
theelims Dec 25, 2023
83f22de
Better route protection for user
theelims Jan 4, 2024
abb7e09
WWWData.h build script update (#15)
EvEggelen Jan 7, 2024
771e1b1
remove WWWData.h from gitignore
theelims Jan 7, 2024
7be1eb5
Removed ArduinoOTA and improved PIO build process
theelims Jan 7, 2024
48c5478
Serving www with PsychicHTTP
theelims Jan 9, 2024
51ce11b
Ported to PsychicHttp
theelims Jan 14, 2024
848c628
updated docs for migration
theelims Jan 14, 2024
0f820dd
More docs
theelims Jan 14, 2024
d0c9bad
minor fixes
theelims Jan 16, 2024
1592fc0
Fix scanning bug
theelims Jan 18, 2024
d3c2f21
Support for multiple wifi networks
theelims Jan 22, 2024
9d6f45e
fixed bugs for wifi multi cold start
theelims Jan 22, 2024
652fc72
updated gitignore
theelims Jan 22, 2024
e506d42
Adjusted wifi settings buffer and limit
theelims Jan 22, 2024
f7b8b52
Cleanup interface build script
theelims Jan 23, 2024
6cc7bb1
Patched PsychichHttp Branch
theelims Jan 23, 2024
41b1416
Github OTA with various build targets
theelims Jan 23, 2024
ae73fd8
WIP update
theelims Jan 24, 2024
65f2860
PsychicMqttClient finished
theelims Jan 26, 2024
c2c9ba3
CORS preflight and WS authentication
theelims Feb 3, 2024
0b4d618
ported MQTT Client to PsychicMqttClient
theelims Feb 3, 2024
5a35cbd
MD5 upload dialog
theelims Feb 4, 2024
13db3b0
Updated docs
theelims Feb 4, 2024
d3820a3
Update DOCs
theelims Feb 4, 2024
f468c34
docs updated
theelims Feb 4, 2024
020e7d4
docs
theelims Feb 5, 2024
f81f81e
Merge branch 'main' into psychichttp
theelims Feb 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
.gcc-flags.json
*Thumbs.db
/data/www
/lib/framework/WWWData.h
/interface/build
/interface/node_modules
/interface/.eslintcache
Expand All @@ -12,4 +11,8 @@ node_modules
/releases
/src/certs
/temp

/build/firmware
/lib/framework/WWWData.h
*WWWData.h
lib/framework/WWWData.h
ssl_certs/cacert.pem
111 changes: 109 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,114 @@

All notable changes to this project will be documented in this file.

## [0.2.2]
## [0.3.0] - 2023-02-05

> [!CAUTION]
> This update has breaking changes!

This is a major change getting rid of all ESPAsyncTCP and ESPAsyncWebserver dependencies. Despite their popularity they are plagued with countless bugs, since years unmaintained, not SSL capable and simply not suitable for a production build. Although several attempts exist to fix the most pressing bugs even these libraries lead to frequent crashes. This new version replaces them with ESP-IDF based components. [PsychicHttp](https://github.com/hoeken/PsychicHttp) and [PsychicMqttClient](https://github.com/theelims/PsychicMqttClient) both wrap the ESP-IDF components in a familiar wrapper for easy porting of the code base. However, this will break existing code and will require some effort on your codebase. In return the stability is improved greatly and the RAM usage more friendly. Now e.g. running Bluetooth in parallel becomes possible.

### Added

- Added postscript to platform.io build process to copy, rename and calculate MD5 checksum of \*.bin file. These files are ready for uploading to the Github Release page.
- Added more information to SystemStatus API
- Added generateToken API for security settings
- Added Multi-WiFi capability. Add up to five WiFi configurations and connect to either strongest network (default), or by priority.
- Added InfoDialog as a simpler version of the ConfirmDialog for a simple notification modal.
- Added Adafruit certificate repository as the default choice for the X509 certificate bundle.

### Changed

- Better route protection for user page with deep link.
- Changed build_interface.py script to check for modified files in the interface sources before re-building the interface. Saves some time on the compilation process.
- Upload firmware binary allows uploading of MD5 checksum file in advance to verify downloaded firmware package.
- GithubFirmwareManager checks against PIO build_target in filename to support Github OTA for binaries build for various targets. You should rename your old release \*.bin files on the Github release pages for backward compatibility.
- Changed MQTT Client to an ESP-IDF backed one which supports SSL/TLS X509 root CA bundles and transport over WS.
- Changed the `PROGMEM_WWW` flag to `EMBED_WWW` as there is technically speaking no PROGMEM on ESP32's.
- Updated dependencies to the latest version. Except SvelteKit.

### Fixed

- Fixed reactivity of System Status page.

### Removed

- Removed support for Arduino ESP OTA.
- HttpEndpoints and Websocket Server without a securityManager are no longer possible.

### Migrate from ESPAsyncWebServer to PsychicHttp

#### Migrate `main.cpp`

Change the server and ESPSvelteKit instances to PsychicHttpServer and give the ESP32SvelteKit constructor the number of http endpoints of your project.

```
PsychicHttpServer server;
ESP32SvelteKit esp32sveltekit(&server, 120);
```

Remove `server.begin();` in `void setup()`. This is handled by ESP32SvelteKit now.

#### Migrate `platformio.ini`

Remove the following `build_flags`:

```ini
; Increase queue size of SSE and WS
-D SSE_MAX_QUEUED_MESSAGES=64
-D WS_MAX_QUEUED_MESSAGES=64
-D CONFIG_ASYNC_TCP_RUNNING_CORE=0
-D NO_GLOBAL_ARDUINOOTA
-D PROGMEM_WWW
```

Add the following `build_flags` and adjust to your app, if needed:

```ini
-D BUILD_TARGET=\"$PIOENV\"
-D APP_NAME=\"ESP32-Sveltekit\" ; Must only contain characters from [a-zA-Z0-9-_] as this is converted into a filename
-D APP_VERSION=\"0.3.0\" ; semver compatible version string
-D EMBED_WWW
```

Remove the lib dependency `esphome/AsyncTCP-esphome @ ^2.0.0` and add `https://github.com/theelims/PsychicMqttClient.git`

Consider adjusting `board_ssl_cert_source = adafruit`, so that the new MQTT client has universal SSL/TLS support with a wide range of CA root certificates.

#### Migrate `factory_settings.ini`

The new MQTT client has slightly renamed factory settings:

```ini
; MQTT settings
-D FACTORY_MQTT_ENABLED=false
-D FACTORY_MQTT_URI=\"mqtts://mqtt.eclipseprojects.io:8883\"
-D FACTORY_MQTT_USERNAME=\"\" ; supports placeholders
-D FACTORY_MQTT_PASSWORD=\"\"
-D FACTORY_MQTT_CLIENT_ID=\"#{platform}-#{unique_id}\" ; supports placeholders
-D FACTORY_MQTT_KEEP_ALIVE=120
-D FACTORY_MQTT_CLEAN_SESSION=true
```

Max Topic Length is no longer needed.

#### Custom Stateful Services

Adapt the class constructor (`(PsychicHttpServer *server, ...`) to PsychicHttpServer.

Due to the loading sequence HttpEndoint and WebsocketServer both have gotten a `begin()` function to register their http endpoints with the server. This must be called in your stateful services' own `begin()` function:

```cpp
void LightStateService::begin()
{
_httpEndpoint.begin();
_webSocketServer.begin();
_state.ledOn = DEFAULT_LED_STATE;
onConfigUpdated();
}
```

## [0.2.2] - 2023-10-08

### Added

Expand Down Expand Up @@ -53,7 +160,7 @@ All notable changes to this project will be documented in this file.
- Compiler flag on which core ESP32-sveltekit tasks should run
- Renamed WebSocketRxTx.h to WebSocketServer.h to create a distinction between WS Client and WS Server interfaces
- Made code of LightStateExample slightly more verbose
- getServer() returning a pointer to the AsnycWebServer instance.
- getServer() returning a pointer to the AsyncWebServer instance.
- Updated frontend dependencies and packages to newest version.

### Depreciated
Expand Down
51 changes: 50 additions & 1 deletion ESP32-sveltekit.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,56 @@
"*.tcc": "cpp",
"algorithm": "cpp",
"esp32-hal-misc.c": "cpp",
"esp_crt_bundle.h": "c"
"esp_crt_bundle.h": "c",
"functional": "cpp",
"array": "cpp",
"atomic": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"list": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"iterator": "cpp",
"map": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"regex": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp",
"unordered_set": "cpp",
"iomanip": "cpp"
}
}
}
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ Manage different user of your app with two authorization levels. An administrato

### :airplane: OTA Upgrade Service

The framework can provide three different channels for Over-the-Air updates. Either an ArduinoOTA port for updates directly from the IDE, by uploading a \*.bin file from the web interface. Or by pulling a firmware image from an update server. This is implemented with the github release page as an example.
The framework can provide two different channels for Over-the-Air updates. Either by uploading a \*.bin file from the web interface. Or by pulling a firmware image from an update server. This is implemented with the github release page as an example. It is even possible to have different build environments at the same time and the Github OTA process pulls the correct binary.

### :building_construction: Automated Build Chain

The automated build chain takes out the pain and tears of getting all the bits and pieces play nice together. The repository contains a PlatformIO project at its heart. A SvelteKit project for the frontend code and a mkdocs project for the documentation go alongside. The PlatformIO build tools not only build the SvelteKit frontend with Vite, but also ensure that the build results are gzipped and find their way into the flash memory of the ESP32. You have two choices to serve the frontend either from the flash partition, or embedded into the firmware binary from PROGMEM. The latter is much more friendly if your frontend code should be distributed OTA as well, leaving all configuration files intact.
The automated build chain takes out the pain and tears of getting all the bits and pieces play nice together. The repository contains a PlatformIO project at its heart. A SvelteKit project for the frontend code and a mkdocs project for the documentation go alongside. The PlatformIO build tools not only build the SvelteKit frontend with Vite, but also ensure that the build results are gzipped and find their way into the flash memory of the ESP32. You have two choices to serve the frontend either from the flash partition, or embedded into the firmware binary. The latter is much more friendly if your frontend code should be distributed OTA as well, leaving all configuration files intact.

### :icecream: Compatible with all ESP32 Flavours

Expand All @@ -57,9 +57,10 @@ The code runs on many variants of the ESP32 chip family. From the plain old ESP3
- [tabler ICONS](https://tabler-icons.io/)
- [unplugin-icons](https://github.com/antfu/unplugin-icons)
- [svelte-modals](https://svelte-modals.mattjennings.io/)
- [svelte-dnd-list](https://github.com/tarb/svelte-dnd-list)
- [ArduinoJson](https://github.com/bblanchon/ArduinoJson)
- [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer)
- [AsyncMqttClient](https://github.com/marvinroger/async-mqtt-client)
- [PsychicHttp](https://github.com/hoeken/PsychicHttp)
- [PsychicMqttClient](https://github.com/theelims/PsychicMqttClient)

## Licensing

Expand Down
Loading