Skip to content

v0.6.0 SvelteKit 2, Svelte 5, ESP-IDF 5 Migration

Latest

Choose a tag to compare

@theelims theelims released this 03 Nov 22:28
· 12 commits to main since this release

What's Changed

Caution

This update has breaking changes!

Added

  • Added GEMINI.md to store notes about the repository for the Gemini CLI. We are now using the Gemini CLI for development.
  • Added a build script to create a merged firmware file to use with ESP Web Tools
  • Added compatibility with ESP32-C6
  • Added getIP() function to WiFiSettingsService.
  • Added Arduino Log Colors
  • Possibility to add a loop callback to ESP32-Sveltekit to leverage its loop threat. Meant to include custom services so no separate task is needed for them.
  • Change wake-up pin in SleepService during runtime. It is also possible to use the internal pull-up or pull-down resistors now.
  • Get current connection status from ESP32-SvelteKit. Useful for status LED or displays.
  • Battery history graph to gauge battery consumption and device life.
  • Add a status topic (online or offline) to the MQTT client. It retains its message and sends offline as last will and testament, signalling all subscribers when it goes missing.
  • FeatureService sends updates through the event system.
  • WiFiSettingsService can set the WiFi station mode to offline, without deleting the list of networks.
  • Expands menu on selected subitem #77
  • Refactor System Status and Metrics, added PSRAM #79
  • Add /rest/coreDump endpoint #87 & #94
  • Rate limiting for MQTT publish messages. Can be configured as factory setting or at runtime. 0 will disable the rate limiting.
  • Added discord invite to readme.md and docs.
  • Created DraggableList component based on svelte-dnd-action (used in WiFi Settings) #100
  • Extended Collapsible and SettingsCard components to support a dirty status #100
  • Enhanced ConfirmDialog, InfoDialog and Toast components to support HTML content #100
  • Added connection check to WebSocket store (socket.ts) and allow secure WebSocket connections #100
  • Added a delayed reconnect function to WifiSettingsService.cpp to allow the last POST request from frontend (providing new network settings) to be properly responded to. In the previous implementation, the POST request was never responded to by the backend, as the connection was closed immediately upon receiving the request in the backend. This resulted in the user receiving no feedback about whether the settings update was successful, only a timeout that suggested something had gone wrong. #100
  • Added scripts/prebuild_utils.py that allows other build scripts to be executed depending on the type of the executed task (e.g. I don't want to have the interface built or the certificate bundle created on clean tasks) #100
  • Added build flag -D TELEPLOT_TASKS to plot task heap high water mark with teleplot. You can include this in your tasks as well:
#ifdef TELEPLOT_TASKS
        static int lastTime = 0;
        if (millis() - lastTime > 1000)
        {
            lastTime = millis();
            Serial.printf(">ESP32SveltekitTask:%i:%i\n", millis(), uxTaskGetStackHighWaterMark(NULL));
        }
#endif

Changed

  • Lightstate example uses simpler, less explicit constructor
  • MQTT library updated
  • Analytics task was refactored into a loop() function which is called by the ESP32-sveltekit main task.
  • Updated PsychicHttp to v1.2.1 incl. patches.
  • Updated to DaisyUI 5 and Tailwind CSS 4
  • Updated Svelte 5 --> see Svelte 5 Migration Guide
  • Changed platform to PIO Arduino using Arduino 3 Core. Also upgrades ESP-IDF to v5.
  • ESPD_LOGx: replace first argument with TAG and define TAG as 🐼 #85
  • Replace rtc_get_reset_reason(0) with esp_reset_reason() #86
  • Default build_interface.py script to npm, if no lock file is found.
  • Replaced svelte-dnd-list with svelte-dnd-action as svelte-dnd-list creates build warnings and appears to no longer be maintained, while svelte-dnd-action is under active community development. #100
  • Made Spinner component more flexible (to allow other texts than "Loading..." or no text at all) #100
  • Reworked WiFi Settings (Station) dialog: added edit dialog for networks, rearranged UI components, used new DraggableList component #100

Fixed

  • Ensure thread safety for client subscriptions #58
  • Deferred websocket event connection to after user validation & login #72
  • Wrong return type battery service
  • Wrong return types in various getService functions.
  • Add file.close in fileHandler handleRequest #73
  • Fixed bug in WiFiSettingsService preventing discovery of networks other than the first
  • Fixed mixup pull up and pull down when configuring wake up pin in SleepService.cpp
  • Wifi: Multiple edits bug resolved #79
  • Fixed broken link to Adafruit SSL Cert Store #93
  • Fixed JSON creation in WiFiSettingsService.h #91
  • Fixed preprocessor warning: usage of #ifdef with OR operator #100
  • Fixed preprocessor warning: redefinition of ESP_PLATFORM #100
  • Fixed deprecated usage of merge-bin and its parameters in scripts/merge_bin.py #100
  • Fixed Download OTA. Issues with certificate validation might remain, but build flag -D DOWNLOAD_OTA_SKIP_CERT_VERIFY allows to circumvent issue by sacrificing certificate validation.

Removed

  • Removed async workers in PsychicHttp, as these were not used, but caused linker errors.

Depreciate

  • Support for ESP Arduino 2 and ESP-IDF v4 will depreciate some time in the future. Try to migrate to the current Arduino 3 / ESP-IDF v5 based branch.

Migration Guide

PIO Arduino & ESP-IDF 5

The firmware is based on the community maintained fork PIO Arduino of Arduino 3 for ESP32. Which is based on ESP-IDF 5. Please make sure all your dependencies and application code is compatible with ESP-IDF 5.

Frontend

SvelteKit was updated to v2 and Svelte to v5. Please check the migration guides for SvelteKit 2 and the Svelte 5 Migration Guide for the changes required on your frontend code.

To migrate your frontend run

npm install --force
npx sv migrate svelte-5

Also DaisyUI and Tailwind CSS have been updated to their last major versions. Run the official Tailwind upgrade tool:

npx @tailwindcss/upgrade

This will migrate some of your svelte files to the new naming convention of Tailwind. For DaisyUI follow this guide. Likely you'll need to redo all forms, as the components behave differently. Forms will need the fieldset class. Inputs will need an additional w-full to have the same behavior as before. And labels have a different syntax, too.

The themes are to be found in app.css now. Add them back if they had been changed from the default.

Acknowledgment

Many thanks to @runeharlyk, @ewowi, @hmbacher, and @stamp who contributed significantly to this new release.

New Contributors

Full Changelog: v0.5.0...v0.6.0