Expand description
Web UI and REST API server using picoserve.
ยงConfiguration
WEB_TASK_POOL_SIZE sets the number of concurrent web task. Greatly increased RAM usage with each task.
TCP_BUFFER_SIZE sets the size of the TCP buffer for each connection.
HTTP_BUFFER_SIZE sets the size of the HTTP buffer. This greatly impact the upload speed of assets and files.
ยงRouted Endpoints
| Route | Method | Backing handler or asset |
|---|---|---|
/get_store_items | GET | get_store_items |
/install_widget | POST | post_install_widget |
/wifi_mode | GET | get_wifi_mode |
/wifi_credentials | POST | post_wifi_credentials |
/system_config | GET | get_system_config |
/system_config | POST | post_system_config |
/deinstall_widget/<widget_name> | GET | deinstall_widget |
/config_schema/<widget_name> | GET | get_config_schema |
/widget_config/<widget_name> | POST | post_widget_config |
/widget_configuration/<widget_name> | GET | [get_widget_config] |
/ | GET | frontend::INDEX_HTML |
/frontend.js | GET | frontend::FRONTEND_JS |
/frontend_bg.wasm | GET | frontend::FRONTEND_WASM_GZ |
/output.css | GET | frontend::OUTPUT_CSS |
/assets/logo.png | GET | frontend::LOGO_PNG |
/assets/css/bootstrap.css | GET | frontend::BOOTSTRAP_CSS |
/assets/js/jquery.min.js | GET | frontend::JQUERY_JS |
/assets/js/underscore.js | GET | frontend::UNDERSCORE_JS |
/assets/js/jsonform.js | GET | frontend::JSONFORM_JS |
/assets/js/jsonform-defaults.js | GET | frontend::JSONFORM_DEFAULTS_JS |
/assets/js/jsonform-split.js | GET | frontend::JSONFORM_SPLIT_JS |
/assets/html/widget_config.html | GET | frontend::WIDGET_CONFIG_HTML |
/assets/fonts/glyphicons-halflings-regular.eot | GET | frontend::FONT_GLYPHS_EOT |
/assets/fonts/glyphicons-halflings-regular.svg | GET | frontend::FONT_GLYPHS_SVG |
/assets/fonts/glyphicons-halflings-regular.ttf | GET | frontend::FONT_GLYPHS_TTF |
/assets/fonts/glyphicons-halflings-regular.woff | GET | frontend::FONT_GLYPHS_WOFF |
/assets/fonts/glyphicons-halflings-regular.woff2 | GET | frontend::FONT_GLYPHS_WOFF2 |
Modulesยง
- custom_
types ๐ - Types used by
http_serverhandlers to serve different types of content and errors - frontend ๐
- List of static frontend assets that are embedded into the compiled binary.
Structsยง
Constantsยง
- ASSET_
HEADER ๐ - Asset http headers
- HTTP_
BUFFER_ ๐SIZE - INDEX_
CACHE_ ๐HEADER - TCP_
BUFFER_ ๐SIZE - WEB_
TASK_ POOL_ SIZE
Functionsยง
- deinstall_
widget ๐ - Remove widget from system config and storage
- get_
config_ ๐schema - gets the JSON config schema for a given widget
- get_
store_ ๐items - gets and returns all widget store items as JSON.
- get_
system_ ๐config - gets and returns the currently stored system config, create a new default config if none is present (first boot)
- get_
wifi_ ๐mode - gets the current wifi mode (AP or Station) to let the frontend decide which components to show
- post_
install_ ๐widget - Installs a widget from a given URL or from the widget store, determined by the
InstallActionpayload. - post_
system_ ๐config - receives an updated system configuration from the frontend and saves it to NVS. The config is only saved if there are changes to avoid flash wear.
- post_
widget_ ๐config - update the JSON config for a given widget
- post_
wifi_ ๐credentials - receives wifi credentials from the frontend, saves them to storage and reboots
- start
- web_
task