Various improvements (#614)
- Auto-select widgets in Launcher and apps with toolbars on devices without touch. - Improved USB HID input reliability, cleanup - Updated PSRAM settings to improve boot stability on supported devices. - Prevented duplicate Wi-Fi event subscriptions during screen rebuilds. - Updated docs - Fixes in WifiManage and WifiConnect - Reduced main task stack size - Moved USB HID stack size to PSRAM when available - app_manager_find_manifest() now returns a copy instead of a pointer
This commit is contained in:
committed by
GitHub
parent
cc8be3faef
commit
d6b1d15e56
@@ -1,164 +0,0 @@
|
||||
# README
|
||||
|
||||
## Project Overview
|
||||
|
||||
Tactility is an operating system for the ESP32 microcontroller family. It runs on 40+ supported devices (CYD boards, LilyGO, M5Stack, Elecrow, etc.) and includes a desktop simulator. Built with C++23, ESP-IDF, LVGL, and FreeRTOS.
|
||||
|
||||
## Building
|
||||
|
||||
### Git
|
||||
|
||||
The repository uses git submodules. Make sure to use `--recurse-submodules` on relevant git commands.
|
||||
|
||||
### Simulator (Linux/macOS, no ESP-IDF needed)
|
||||
|
||||
> [!IMPORTANT]
|
||||
> The simulator does **NOT** build or run on native Windows (Win32/PowerShell/cmd). This is
|
||||
> a hard platform limitation, not a missing tool or PATH issue — do not attempt `cmake -B
|
||||
> buildsim` on Windows, it will not work. WSL is a separate, Linux environment and is fine.
|
||||
|
||||
```bash
|
||||
cmake -B buildsim -G Ninja
|
||||
ninja -C buildsim # build firmware + tests
|
||||
./buildsim/Firmware/Tactility # run simulator
|
||||
```
|
||||
|
||||
### ESP32 firmware
|
||||
|
||||
```bash
|
||||
python device.py <device-id> # generate sdkconfig for device (e.g. lilygo-tdeck)
|
||||
python device.py <device-id> --dev # dev mode: force 4MB partition table
|
||||
idf.py build # build firmware
|
||||
idf.py flash monitor # flash and monitor
|
||||
```
|
||||
|
||||
Device IDs are the folder names under `Devices/` (e.g. `lilygo-tdeck`, `m5stack-cores3`, `cyd-2432s028r`).
|
||||
|
||||
#### Windows: activating the ESP-IDF environment
|
||||
|
||||
On native Windows, `idf.py` is not on PATH by default — it must be activated per-shell first.
|
||||
The install script places a PowerShell profile activator per IDF version at
|
||||
`%IDF_TOOL_PATH%\Microsoft.v<version>.PowerShell_profile.ps1` (path controlled by the
|
||||
`IDF_TOOL_PATH` environment variable, set to wherever ESP-IDF's tools were installed, e.g.
|
||||
`C:\Espressif\tools`). Source it before running any `idf.py` command:
|
||||
|
||||
```powershell
|
||||
. "$env:IDF_TOOL_PATH\Microsoft.v5.5.2.PowerShell_profile.ps1" # match the installed IDF version
|
||||
Set-Location "<repo-root>"
|
||||
idf.py build 2>&1 | Select-Object -Last 250
|
||||
```
|
||||
|
||||
This is Windows-specific setup (the main dev works on Linux, where `idf.py` is normally
|
||||
already on PATH via `export.sh`/`. ./export.sh` or a shell profile).
|
||||
|
||||
### Devicetree
|
||||
|
||||
A device implementation has a `.dts` file.
|
||||
The parser at `Buildscripts/DevicetreeCompiler/` converts DTS into C code.
|
||||
It's called from the `Firmware/` build process.
|
||||
|
||||
### Tests
|
||||
|
||||
Tests use Doctest and run on simulator (POSIX) target only:
|
||||
|
||||
```bash
|
||||
cmake -B buildsim -G Ninja
|
||||
ninja -C buildsim build-tests
|
||||
cd buildsim && ctest --test-dir Tests
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
### Layer Stack (bottom to top)
|
||||
|
||||
- **TactilityKernel** — C API kernel: device/driver/module lifecycle, concurrency primitives (thread, mutex, timer, dispatcher), filesystem, logging. Header convention: `<tactility/*.h>` (lowercase snake_case).
|
||||
- **TactilityFreeRtos** — Thin C++ wrappers around FreeRTOS primitives.
|
||||
- **Tactility** — Main OS layer: app framework, service framework, LVGL integration, networking and services (Wi-Fi, BLE, NTP, ESP-NOW), settings, i18n.
|
||||
- **TactilityC** — C bindings (`tt_*.h`) for Tactility, used by side-loaded ELF apps on ESP32. Deprecated, replaced by TactilityKernel.
|
||||
- **Firmware** — Entry point (`app_main`).
|
||||
|
||||
### Device/Driver/Module System (kernel layer, C API)
|
||||
|
||||
The kernel uses a Linux-inspired device model:
|
||||
|
||||
- **Module** (`struct Module`): loadable unit that registers drivers and hardware. Lifecycle: `module_construct` → `module_add` → `module_start`. Each device board and platform is a module.
|
||||
- **Driver** (`struct Driver`): binds to devices via `compatible` strings (like devicetree). Has `start_device`/`stop_device` callbacks and an `api` pointer for type-specific operations.
|
||||
- **Device** (`struct Device`): represents hardware. Lifecycle: `device_construct` → `device_add` → `device_start`. Has a parent-child tree, driver binding, and locking.
|
||||
- **DeviceType** (`struct DeviceType`): enables discovering devices by category (e.g. `DISPLAY_TYPE`, `TOUCH_TYPE`, `UART_CONTROLLER_TYPE`).
|
||||
|
||||
Devices are defined via **devicetree** `.dts` files in each `Devices/<id>/` folder. A custom devicetree compiler (`Buildscripts/DevicetreeCompiler/compile.py`) generates C code from these files. Each device folder also has a `devicetree.yaml` specifying dependencies and the `.dts` file.
|
||||
|
||||
### App Framework
|
||||
|
||||
Apps implement `tt::app::App` (or just provide callbacks). Each app has an `AppManifest` with `appId`, `appName`, `appCategory`, and a factory function `createApp`. Apps are registered at startup in `Tactility.cpp`. External apps can be loaded from SD card via `manifest.properties` files, or side-loaded as ELF binaries on ESP32.
|
||||
|
||||
### Service Framework
|
||||
|
||||
Services implement `tt::service::Service` with a `ServiceManifest`. Services are long-running background processes (GUI, Wi-Fi, loader, statusbar, GPS, etc.).
|
||||
|
||||
### Hardware Abstraction Layer
|
||||
|
||||
#### Driver
|
||||
|
||||
A driver generally consists of:
|
||||
- Registration of driver in parent module (optional, but desirable)
|
||||
- YAML bindings in the `bindings/` folder
|
||||
- An `#include` that is used in the `.dts` file. The include is in `[projectname]/bindings/[drivername].h`
|
||||
- The driver implementation: a `.cpp` and `.h` file. The implementation is C++, but the header exposes pure C functions. C implementations are allowed, but C++ is preferred.
|
||||
|
||||
Drivers are part of a kernel module.
|
||||
|
||||
Modules with drivers can be stored in:
|
||||
- TactilityKernel
|
||||
- A subproject in `Platforms` folder
|
||||
- A subproject in `Devices` folder
|
||||
- A subproject in `Drivers` folder
|
||||
|
||||
#### Kernel Modules
|
||||
|
||||
Kernel module names are lower case and postfixed with `-module`.
|
||||
|
||||
Projects that are kernel modules:
|
||||
|
||||
1. Declare a `struct Module`
|
||||
2. Contain a `devicetree.yaml` file that declares a list of dependencies (for parsing the devicetree) and specifies the bindings folder that contains the drivers' YAML definitions. For example:
|
||||
```yaml
|
||||
dependencies:
|
||||
- TactilityKernel
|
||||
bindings: bindings
|
||||
```
|
||||
|
||||
### Platform Abstraction
|
||||
|
||||
- `Platforms/platform-esp32/` — ESP-IDF specific implementations
|
||||
- `Platforms/platform-posix/` — POSIX simulator implementations (SDL for display)
|
||||
|
||||
### Build System
|
||||
|
||||
The `tactility_add_module()` CMake macro (in `Buildscripts/module.cmake`) wraps ESP-IDF's `idf_component_register` on ESP32 and standard `add_library` on POSIX, allowing the same source to build for both targets.
|
||||
|
||||
`device.py` reads `Devices/<id>/device.properties` and generates the `sdkconfig` file with all necessary ESP-IDF config (target chip, flash size, SPIRAM, LVGL fonts, Bluetooth, USB, etc.).
|
||||
|
||||
### LVGL
|
||||
|
||||
User interfaces should scale well for everything between very large (e.g. 1280x720) and small (e.g. 135x240) displays. Vertical and horizontal layouts are supported.
|
||||
|
||||
## Coding Style
|
||||
|
||||
Two conventions coexist; which one to use depends on the project layer:
|
||||
|
||||
- **C code** (TactilityKernel, drivers): `lower_snake_case` for files, functions, variables. `UpperCamelCase` for types. Files in `source/`, `include/`, `private/` directories.
|
||||
- **C++ code** (Tactility, apps, services): `UpperCamelCase` for files and types. `lowerCamelCase` for functions. Files in `Source/`, `Include/`, `Private/` directories.
|
||||
|
||||
Formatting is enforced by `.clang-format` (LLVM-based, 4-space indent, no column limit).
|
||||
Never throw exceptions — use return types for error handling. Use `enum class` over plain `enum`.
|
||||
Don't do null checks: caller is responsible for passing valid data.
|
||||
Pointers are expected to be non-null unless documented otherwise.
|
||||
|
||||
## Key Conventions
|
||||
|
||||
- `#ifdef ESP_PLATFORM` guards ESP32-specific code; the simulator uses POSIX equivalents.
|
||||
- The `Drivers/` directory contains hardware drivers (display controllers, touch controllers, PMICs, etc.) — each is its own CMake component.
|
||||
- `Modules/` contains cross-cutting modules. e.g.`lvgl-module` (LVGL task management).
|
||||
- `Data/system/` and `Data/data/` are flashed as FAT filesystem images on ESP32.
|
||||
- Translations are in `Translations/` as CSV files, generated via `generate.py`.
|
||||
@@ -1,192 +0,0 @@
|
||||
# Chat App
|
||||
|
||||
ESP-NOW-based chat application with channel-based messaging. Devices with the same encryption key can communicate in real-time without requiring a WiFi access point or internet connection.
|
||||
|
||||
## Features
|
||||
|
||||
- **Channel-based messaging**: Join named channels (e.g. `#general`, `#random`) to organize conversations
|
||||
- **Broadcast support**: Messages with empty target are visible in all channels
|
||||
- **Configurable nickname**: Identify yourself with a custom name (max 23 characters)
|
||||
- **Unique sender ID**: Each device gets a random 32-bit ID on first launch for future DM support
|
||||
- **Encryption key**: Optional shared key for private group communication
|
||||
- **Persistent settings**: Sender ID, nickname, key, and current chat channel are saved across reboots
|
||||
|
||||
## Requirements
|
||||
|
||||
- ESP32 with WiFi support (not available on ESP32-P4)
|
||||
- ESP-NOW service enabled
|
||||
|
||||
## UI Layout
|
||||
|
||||
```text
|
||||
+------------------------------------------+
|
||||
| [Back] Chat: #general [List] [Gear] |
|
||||
+------------------------------------------+
|
||||
| alice: hello everyone |
|
||||
| bob: hey alice! |
|
||||
| You: hi there |
|
||||
| (scrollable message list) |
|
||||
+------------------------------------------+
|
||||
| [____input textarea____] [Send] |
|
||||
+------------------------------------------+
|
||||
```
|
||||
|
||||
- **Toolbar title**: Shows `Chat: <channel>` with the current channel name
|
||||
- **List icon**: Opens channel selector to switch channels
|
||||
- **Gear icon**: Opens settings panel (nickname, encryption key)
|
||||
- **Message list**: Shows messages matching the current channel or broadcast messages
|
||||
- **Input bar**: Type and send messages to the current channel
|
||||
|
||||
## Channel Selector
|
||||
|
||||
Tap the list icon to change channels. Enter a channel name (e.g. `#general`, `#team1`) and press OK. The message list refreshes to show only messages matching the new channel.
|
||||
|
||||
Messages are sent with the current channel as the target. Only devices viewing the same channel will display the message. Broadcast messages (empty target) appear in all channels.
|
||||
|
||||
## First Launch
|
||||
|
||||
On first launch (when no settings file exists), the settings panel opens automatically so users can configure their nickname before chatting. A unique sender ID is also generated using the hardware RNG.
|
||||
|
||||
## Settings
|
||||
|
||||
Tap the gear icon to configure:
|
||||
|
||||
| Setting | Description | Default |
|
||||
|---------|-------------|---------|
|
||||
| Nickname | Your display name (max 23 chars) | `Device` |
|
||||
| Key | Encryption key as 32 hex characters (16 bytes) | All zeros (empty field) |
|
||||
|
||||
Settings are stored in `/data/settings/chat.properties`. The encryption key is stored encrypted using AES-256-CBC. The sender ID is stored as a decimal number.
|
||||
|
||||
When the key field is left empty, the default all-zeros key is used. All devices using the default key can communicate without configuration.
|
||||
|
||||
Changing the encryption key causes ESP-NOW to restart with the new configuration.
|
||||
|
||||
## Wire Protocol v2
|
||||
|
||||
Compact variable-length packets broadcast over ESP-NOW:
|
||||
|
||||
### Header (16 bytes)
|
||||
|
||||
```text
|
||||
Offset Size Field
|
||||
------ ---- -----
|
||||
0 4 magic (0x54435432 "TCT2")
|
||||
4 2 protocol_version (2)
|
||||
6 4 from (sender ID, random uint32)
|
||||
10 4 to (recipient ID, 0 = broadcast/channel)
|
||||
14 1 payload_type (1 = TextMessage)
|
||||
15 1 payload_size (length of payload)
|
||||
```
|
||||
|
||||
### Text Message Payload (variable)
|
||||
|
||||
```text
|
||||
[nickname\0][target\0][message bytes]
|
||||
```
|
||||
|
||||
- `nickname`: Null-terminated sender display name (2-23 chars + null; single-letter names rejected)
|
||||
- `target`: Null-terminated channel or empty for broadcast (0-23 chars + null)
|
||||
- Empty string (`\0`): broadcast to all channels
|
||||
- Channel name (e.g. `#general`): visible only when viewing that channel
|
||||
- `message`: Remaining bytes, NOT null-terminated, minimum 1 byte (length = `payload_size - strlen(nickname) - 1 - strlen(target) - 1`)
|
||||
|
||||
**Minimum packet size for TextMessage:** 16 (header) + 2 (min nickname) + 1 (null) + 0 (empty target) + 1 (null) + 1 (min message) = **21 bytes**
|
||||
|
||||
**Example calculation:** If nickname is "Alice" (5 chars) and target is "#general" (8 chars):
|
||||
- Overhead: 5 + 1 + 8 + 1 = 15 bytes
|
||||
- Max message: 255 - 15 = 240 bytes
|
||||
|
||||
### Example
|
||||
|
||||
"Alice" sends "Hi!" to #general:
|
||||
- Header: 16 bytes
|
||||
- Payload: `Alice\0#general\0Hi!` = 18 bytes
|
||||
- **Total: 34 bytes**
|
||||
|
||||
### Size Limits
|
||||
|
||||
| Constraint | Min | Max |
|
||||
|------------|-----|-----|
|
||||
| Header size | 16 bytes | 16 bytes |
|
||||
| Payload (uint8_t) | 5 bytes | 255 bytes |
|
||||
| Nickname | 2 characters | 23 characters |
|
||||
| Channel/target | 0 (broadcast) | 23 characters |
|
||||
| Message (wire) | 1 byte | up to 251 bytes (varies by overhead) |
|
||||
| Message (UI) | 1 character | 200 characters |
|
||||
| Total packet (TextMessage) | 21 bytes | 271 bytes |
|
||||
|
||||
### Payload Types
|
||||
|
||||
| Type | Value | Description |
|
||||
|------|-------|-------------|
|
||||
| TextMessage | 1 | Chat message with nickname, target, and text |
|
||||
| (reserved) | 2+ | Future: Position, Telemetry, etc. |
|
||||
|
||||
### Target Field Semantics
|
||||
|
||||
| `to` Value | `target` Field | Meaning |
|
||||
|------------|----------------|---------|
|
||||
| 0 | `""` (empty) | Broadcast - visible in all channels |
|
||||
| 0 | `#channel` | Channel message - visible only when viewing that channel |
|
||||
| non-zero | `nickname` | Direct message (future - requires address discovery protocol) |
|
||||
|
||||
Messages with incorrect magic/version or invalid payload are silently discarded.
|
||||
|
||||
> **Note:** Direct messaging (non-zero `to`) will require an address discovery mechanism, such as periodic broadcasts announcing nickname→sender_id mappings, before devices can address each other directly.
|
||||
|
||||
## Architecture
|
||||
|
||||
```text
|
||||
ChatApp - App lifecycle, ESP-NOW send/receive, settings management
|
||||
ChatState - Message storage (deque, max 100), channel filtering, mutex-protected
|
||||
ChatView - LVGL UI: toolbar, message list, input bar, settings/channel panels
|
||||
ChatProtocol - MessageHeader struct, serialize/deserialize, PayloadType enum
|
||||
ChatSettings - Properties file load/save with encrypted key storage, sender ID generation
|
||||
```
|
||||
|
||||
All files are guarded with `#if defined(CONFIG_SOC_WIFI_SUPPORTED) && !defined(CONFIG_SLAVE_SOC_WIFI_SUPPORTED)` to exclude from P4 builds.
|
||||
|
||||
## Message Flow
|
||||
|
||||
### Sending
|
||||
|
||||
1. User types message and taps Send
|
||||
2. `serializeTextMessage()` builds compact packet with sender ID, nickname, channel, message
|
||||
3. Broadcast via ESP-NOW to nearby devices
|
||||
4. Own message stored and displayed locally
|
||||
|
||||
### Receiving
|
||||
|
||||
1. ESP-NOW callback fires with raw data
|
||||
2. Validate packet:
|
||||
- Minimum size: 21 bytes (16 header + 2 min nickname + 1 null + 0 min target + 1 null + 1 min message)
|
||||
- Magic bytes: must be `0x54435432` ("TCT2")
|
||||
- Protocol version: must be 2
|
||||
- Payload size: `header.payload_size` must equal `received_length - 16`
|
||||
3. Parse null-terminated nickname and target from payload
|
||||
4. Validate minimum lengths: nickname >= 2 chars, message >= 1 byte
|
||||
5. Extract message from remaining bytes (length derived from payload_size)
|
||||
6. Store in message deque with sender ID
|
||||
7. Display if target matches current channel or is broadcast (empty)
|
||||
|
||||
## Limitations
|
||||
|
||||
- Maximum 100 stored messages (oldest discarded when full)
|
||||
- Nickname: 23 characters max
|
||||
- Channel name: 23 characters max
|
||||
- Message text: 200 characters max (UI limit; actual wire limit varies by nickname/target length)
|
||||
- No message persistence across app restarts (messages are in-memory only)
|
||||
- All communication is broadcast; channel filtering is client-side only
|
||||
- Sender ID collisions: 32-bit random IDs have ~50% collision probability at ~77,000 active devices (birthday paradox); no collision detection/resolution implemented
|
||||
|
||||
## Security Considerations
|
||||
|
||||
The chat protocol relies on ESP-NOW's built-in encryption (when configured) but has additional security limitations:
|
||||
|
||||
- **No message authentication**: No MAC/HMAC to verify message integrity or sender authenticity beyond the sender ID
|
||||
- **No replay protection**: No sequence numbers or timestamps; messages can be replayed
|
||||
- **Sender ID spoofing**: Any device knowing the encryption key can forge messages with arbitrary sender IDs
|
||||
- **No forward secrecy**: Compromise of the shared key exposes all past and future messages
|
||||
|
||||
These tradeoffs are acceptable for casual local communication but should be understood before using for sensitive applications.
|
||||
+7
-16
@@ -2,7 +2,6 @@
|
||||
|
||||
## Before release
|
||||
|
||||
- Remove incubating flag from various devices
|
||||
- Add `// SPDX-License-Identifier: GPL-3.0-only` and `// SPDX-License-Identifier: Apache-2.0` to individual files in the project
|
||||
- Elecrow Basic & Advance 3.5" memory issue: not enough memory for App Hub
|
||||
- App Hub crashes if you close it while an app is being installed
|
||||
@@ -12,26 +11,20 @@
|
||||
|
||||
## Higher Priority
|
||||
|
||||
- Devices with a keyboard attached should always highlight the first widget (~Cardputer navigation issue), same for LV_INDEV_TYPE_ENCODER being present
|
||||
- Move USB host task stacks to SPIRAM when available: esp32_usbhost*.cpp
|
||||
- wifi: wifi_add_event_callback() and wifi_remove_event_callback() should be replaced by a subscribe/await pattern like system events.
|
||||
When that's changed reduce LVGL callstack size in Tactility.cpp run()
|
||||
- Make it more clear to end-users that an SD card is required to run Tactility
|
||||
- Move "# Fix error "PSRAM space not enough for the Flash instructions" on boot:" fix from T-Deck and others to device.py
|
||||
- Make it possible to override stack size for an app via config file (loaded at boot), and make it possible to set preferred memory location (e.g. internal/external)
|
||||
- Put task stacks in PSRAM when possible.
|
||||
- Wrap file operations like fopen/fclose with file_mutex
|
||||
- Add bold fonts for e-ink readability improvement
|
||||
- Split up Claude instructions: https://code.claude.com/docs/en/memory#import-additional-files
|
||||
and add https://github.com/multica-ai/andrej-karpathy-skills/blob/main/CLAUDE.md
|
||||
- Move test projects to their relevant subproject
|
||||
- tt_alertdialog start() etc is broken as it can't fetch the app instance id. Fetch automatically via thread context?
|
||||
- Migrate Tactility/Paths.cpp functions to TactilityKernel
|
||||
- app_manager_find_manifest() should make a copy, not return a pointer.
|
||||
- Httpd.cpp: warn if running on same CPU core (or task) as UI/LVGL/window manager.
|
||||
- Improve Setup: Show "Step done" screen
|
||||
- Improve Setup: Add keyboard/keypad navigation explanation
|
||||
- display.h API: get_backlight does not change ref counting, but it should
|
||||
- bluetooth: various getters for child devices do not change ref counting, but they should
|
||||
- Improve kernel_init.cpp (and other modules): create driver_ensure_added() and driver_ensure_destructed()
|
||||
- Remove and migrate `Include/Tactility/kernel/Kernel.h` into `tactility/delay.h`
|
||||
- Drivers/audio-codec-module is not a module. Move it somewhere else. Or make it an actual module.
|
||||
- LilyGO T-Dongle S3: 1 button control, stop auto-launching web server
|
||||
- Core2: support power off via software
|
||||
@@ -39,7 +32,6 @@
|
||||
- Get rid of TactilityC in favour of TactilityKernel and kernel modules
|
||||
- Improve SPI kernel driver (implement read, write, transactions)
|
||||
- Add font design tokens such as "regular", "title" and "smaller". Perhaps via the LVGL kernel module.
|
||||
- Kernel concepts for ELF loading (generic approach for GUI apps, console apps, libraries).
|
||||
- Fix glitches when installing app via App Hub with 4.3" Waveshare
|
||||
- TCA9534 keyboards should use interrupts
|
||||
- External app loading: Check the version of Tactility and check ESP target hardware to check for compatibility
|
||||
@@ -54,19 +46,17 @@
|
||||
|
||||
## Medium Priority
|
||||
|
||||
- `platform-esp32`'s module drivers are declared in start/stop of the module but they should be set via `Module::drivers`
|
||||
- `struct Driver` has an `.owner`, but it's not always set. Either validate on Module construct that it matches, or otherwise set it during module start. The problem: NULL parent currently means that driver is not removable. This clashes with setting it dynamically. Consider some kind of flag to determine removability.
|
||||
- Consider moving certain drivers into separate modules: audio, bt, wifi, etc
|
||||
- Consider using https://github.com/Graphify-Labs/graphify
|
||||
- Consider implementing LVGL gridnav in apps https://lvgl.io/docs/open/9.3/details/auxiliary-modules/gridnav.html
|
||||
- Implement a LED kernel driver (single colour and RGB, plain GPIO and PWM)
|
||||
- Make USB host driver disabled by default, so it doesn't consume memory
|
||||
- Filtering for apps in App Hub:
|
||||
- apps that only work on a specific device
|
||||
- Diceware app has large "+" and "-' buttons on Cardputer. It should be smaller.
|
||||
- Create PwmRgbLedDevice class and implement it for all CYD devices
|
||||
- TactilityTool: Make API compatibility table (and check for compatibility in the tool itself)
|
||||
- Improve EspLcdDisplay to contain all the standard configuration options, and implement a default init function. Add a configuration class.
|
||||
- Make WiFi setup app that starts an access point and hosts a webpage to set up the device.
|
||||
This will be useful for devices without a screen, a small screen or a non-touch screen.
|
||||
- Unify the way displays are dimmed. Some implementations turn off the display when it's fully dimmed. Make this a separate functionality.
|
||||
- Bug: Crash handling app cannot be exited with an EncoderDevice. (current work-around is to manually reset the device)
|
||||
|
||||
@@ -94,6 +84,8 @@
|
||||
- Calculator app should show regular text input field on non-touch devices that have a keyboard (Cardputer, T-Lora Pager)
|
||||
- Allow for WSAD keys to navigate LVGL (this is extra nice for cardputer, but just handy in general)
|
||||
- Create a "How to" app for a device. It could explain things like keyboard navigation on first start.
|
||||
- Make WiFi setup app that starts an access point and hosts a webpage to set up the device.
|
||||
This will be useful for devices without a screen, a small screen or a non-touch screen.
|
||||
|
||||
# Nice-to-haves
|
||||
|
||||
@@ -114,7 +106,6 @@
|
||||
- Weather app: https://lab.flipper.net/apps/flip_weather
|
||||
- wget app: https://lab.flipper.net/apps/web_crawler (add profiles for known public APIs?)
|
||||
- Chip 8 emulator
|
||||
- BadUSB (in December 2024, TinyUSB has a bug where uninstalling and re-installing the driver fails)
|
||||
- Discord bot
|
||||
- IR transceiver app
|
||||
- GPS app
|
||||
|
||||
@@ -1,636 +0,0 @@
|
||||
# GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 [Free Software Foundation, Inc.](http://fsf.org/)
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license
|
||||
document, but changing it is not allowed.
|
||||
|
||||
## Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for software and
|
||||
other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed to take
|
||||
away your freedom to share and change the works. By contrast, the GNU General
|
||||
Public License is intended to guarantee your freedom to share and change all
|
||||
versions of a program--to make sure it remains free software for all its users.
|
||||
We, the Free Software Foundation, use the GNU General Public License for most
|
||||
of our software; it applies also to any other work released this way by its
|
||||
authors. You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our
|
||||
General Public Licenses are designed to make sure that you have the freedom to
|
||||
distribute copies of free software (and charge for them if you wish), that you
|
||||
receive source code or can get it if you want it, that you can change the
|
||||
software or use pieces of it in new free programs, and that you know you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you these rights
|
||||
or asking you to surrender the rights. Therefore, you have certain
|
||||
responsibilities if you distribute copies of the software, or if you modify it:
|
||||
responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for
|
||||
a fee, you must pass on to the recipients the same freedoms that you received.
|
||||
You must make sure that they, too, receive or can get the source code. And you
|
||||
must show them these terms so they know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
|
||||
1. assert copyright on the software, and
|
||||
2. offer you this License giving you legal permission to copy, distribute
|
||||
and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains that
|
||||
there is no warranty for this free software. For both users' and authors' sake,
|
||||
the GPL requires that modified versions be marked as changed, so that their
|
||||
problems will not be attributed erroneously to authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run modified
|
||||
versions of the software inside them, although the manufacturer can do so. This
|
||||
is fundamentally incompatible with the aim of protecting users' freedom to
|
||||
change the software. The systematic pattern of such abuse occurs in the area of
|
||||
products for individuals to use, which is precisely where it is most
|
||||
unacceptable. Therefore, we have designed this version of the GPL to prohibit
|
||||
the practice for those products. If such problems arise substantially in other
|
||||
domains, we stand ready to extend this provision to those domains in future
|
||||
versions of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents. States
|
||||
should not allow patents to restrict development and use of software on
|
||||
general-purpose computers, but in those that do, we wish to avoid the special
|
||||
danger that patents applied to a free program could make it effectively
|
||||
proprietary. To prevent this, the GPL assures that patents cannot be used to
|
||||
render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification
|
||||
follow.
|
||||
|
||||
## TERMS AND CONDITIONS
|
||||
|
||||
### 0. Definitions.
|
||||
|
||||
*This License* refers to version 3 of the GNU General Public License.
|
||||
|
||||
*Copyright* also means copyright-like laws that apply to other kinds of works,
|
||||
such as semiconductor masks.
|
||||
|
||||
*The Program* refers to any copyrightable work licensed under this License.
|
||||
Each licensee is addressed as *you*. *Licensees* and *recipients* may be
|
||||
individuals or organizations.
|
||||
|
||||
To *modify* a work means to copy from or adapt all or part of the work in a
|
||||
fashion requiring copyright permission, other than the making of an exact copy.
|
||||
The resulting work is called a *modified version* of the earlier work or a work
|
||||
*based on* the earlier work.
|
||||
|
||||
A *covered work* means either the unmodified Program or a work based on the
|
||||
Program.
|
||||
|
||||
To *propagate* a work means to do anything with it that, without permission,
|
||||
would make you directly or secondarily liable for infringement under applicable
|
||||
copyright law, except executing it on a computer or modifying a private copy.
|
||||
Propagation includes copying, distribution (with or without modification),
|
||||
making available to the public, and in some countries other activities as well.
|
||||
|
||||
To *convey* a work means any kind of propagation that enables other parties to
|
||||
make or receive copies. Mere interaction with a user through a computer
|
||||
network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays *Appropriate Legal Notices* to the
|
||||
extent that it includes a convenient and prominently visible feature that
|
||||
|
||||
1. displays an appropriate copyright notice, and
|
||||
2. tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the work
|
||||
under this License, and how to view a copy of this License.
|
||||
|
||||
If the interface presents a list of user commands or options, such as a menu, a
|
||||
prominent item in the list meets this criterion.
|
||||
|
||||
### 1. Source Code.
|
||||
|
||||
The *source code* for a work means the preferred form of the work for making
|
||||
modifications to it. *Object code* means any non-source form of a work.
|
||||
|
||||
A *Standard Interface* means an interface that either is an official standard
|
||||
defined by a recognized standards body, or, in the case of interfaces specified
|
||||
for a particular programming language, one that is widely used among developers
|
||||
working in that language.
|
||||
|
||||
The *System Libraries* of an executable work include anything, other than the
|
||||
work as a whole, that (a) is included in the normal form of packaging a Major
|
||||
Component, but which is not part of that Major Component, and (b) serves only
|
||||
to enable use of the work with that Major Component, or to implement a Standard
|
||||
Interface for which an implementation is available to the public in source code
|
||||
form. A *Major Component*, in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system (if any) on
|
||||
which the executable work runs, or a compiler used to produce the work, or an
|
||||
object code interpreter used to run it.
|
||||
|
||||
The *Corresponding Source* for a work in object code form means all the source
|
||||
code needed to generate, install, and (for an executable work) run the object
|
||||
code and to modify the work, including scripts to control those activities.
|
||||
However, it does not include the work's System Libraries, or general-purpose
|
||||
tools or generally available free programs which are used unmodified in
|
||||
performing those activities but which are not part of the work. For example,
|
||||
Corresponding Source includes interface definition files associated with source
|
||||
files for the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require, such as
|
||||
by intimate data communication or control flow between those subprograms and
|
||||
other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users can regenerate
|
||||
automatically from other parts of the Corresponding Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that same work.
|
||||
|
||||
### 2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of copyright on
|
||||
the Program, and are irrevocable provided the stated conditions are met. This
|
||||
License explicitly affirms your unlimited permission to run the unmodified
|
||||
Program. The output from running a covered work is covered by this License only
|
||||
if the output, given its content, constitutes a covered work. This License
|
||||
acknowledges your rights of fair use or other equivalent, as provided by
|
||||
copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not convey, without
|
||||
conditions so long as your license otherwise remains in force. You may convey
|
||||
covered works to others for the sole purpose of having them make modifications
|
||||
exclusively for you, or provide you with facilities for running those works,
|
||||
provided that you comply with the terms of this License in conveying all
|
||||
material for which you do not control copyright. Those thus making or running
|
||||
the covered works for you must do so exclusively on your behalf, under your
|
||||
direction and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under the
|
||||
conditions stated below. Sublicensing is not allowed; section 10 makes it
|
||||
unnecessary.
|
||||
|
||||
### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological measure
|
||||
under any applicable law fulfilling obligations under article 11 of the WIPO
|
||||
copyright treaty adopted on 20 December 1996, or similar laws prohibiting or
|
||||
restricting circumvention of such measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention is
|
||||
effected by exercising rights under this License with respect to the covered
|
||||
work, and you disclaim any intention to limit operation or modification of the
|
||||
work as a means of enforcing, against the work's users, your or third parties'
|
||||
legal rights to forbid circumvention of technological measures.
|
||||
|
||||
### 4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you receive it,
|
||||
in any medium, provided that you conspicuously and appropriately publish on
|
||||
each copy an appropriate copyright notice; keep intact all notices stating that
|
||||
this License and any non-permissive terms added in accord with section 7 apply
|
||||
to the code; keep intact all notices of the absence of any warranty; and give
|
||||
all recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey, and you may
|
||||
offer support or warranty protection for a fee.
|
||||
|
||||
### 5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to produce it
|
||||
from the Program, in the form of source code under the terms of section 4,
|
||||
provided that you also meet all of these conditions:
|
||||
|
||||
- a) The work must carry prominent notices stating that you modified it, and
|
||||
giving a relevant date.
|
||||
- b) The work must carry prominent notices stating that it is released under
|
||||
this License and any conditions added under section 7. This requirement
|
||||
modifies the requirement in section 4 to *keep intact all notices*.
|
||||
- c) You must license the entire work, as a whole, under this License to
|
||||
anyone who comes into possession of a copy. This License will therefore
|
||||
apply, along with any applicable section 7 additional terms, to the whole
|
||||
of the work, and all its parts, regardless of how they are packaged. This
|
||||
License gives no permission to license the work in any other way, but it
|
||||
does not invalidate such permission if you have separately received it.
|
||||
- d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your work need
|
||||
not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent works,
|
||||
which are not by their nature extensions of the covered work, and which are not
|
||||
combined with it such as to form a larger program, in or on a volume of a
|
||||
storage or distribution medium, is called an *aggregate* if the compilation and
|
||||
its resulting copyright are not used to limit the access or legal rights of the
|
||||
compilation's users beyond what the individual works permit. Inclusion of a
|
||||
covered work in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
### 6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms of sections 4
|
||||
and 5, provided that you also convey the machine-readable Corresponding Source
|
||||
under the terms of this License, in one of these ways:
|
||||
|
||||
- a) Convey the object code in, or embodied in, a physical product (including
|
||||
a physical distribution medium), accompanied by the Corresponding Source
|
||||
fixed on a durable physical medium customarily used for software
|
||||
interchange.
|
||||
- b) Convey the object code in, or embodied in, a physical product (including
|
||||
a physical distribution medium), accompanied by a written offer, valid for
|
||||
at least three years and valid for as long as you offer spare parts or
|
||||
customer support for that product model, to give anyone who possesses the
|
||||
object code either
|
||||
1. a copy of the Corresponding Source for all the software in the product
|
||||
that is covered by this License, on a durable physical medium
|
||||
customarily used for software interchange, for a price no more than your
|
||||
reasonable cost of physically performing this conveying of source, or
|
||||
2. access to copy the Corresponding Source from a network server at no
|
||||
charge.
|
||||
- c) Convey individual copies of the object code with a copy of the written
|
||||
offer to provide the Corresponding Source. This alternative is allowed only
|
||||
occasionally and noncommercially, and only if you received the object code
|
||||
with such an offer, in accord with subsection 6b.
|
||||
- d) Convey the object code by offering access from a designated place
|
||||
(gratis or for a charge), and offer equivalent access to the Corresponding
|
||||
Source in the same way through the same place at no further charge. You
|
||||
need not require recipients to copy the Corresponding Source along with the
|
||||
object code. If the place to copy the object code is a network server, the
|
||||
Corresponding Source may be on a different server operated by you or a
|
||||
third party) that supports equivalent copying facilities, provided you
|
||||
maintain clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the Corresponding
|
||||
Source, you remain obligated to ensure that it is available for as long as
|
||||
needed to satisfy these requirements.
|
||||
- e) Convey the object code using peer-to-peer transmission, provided you
|
||||
inform other peers where the object code and Corresponding Source of the
|
||||
work are being offered to the general public at no charge under subsection
|
||||
6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded from the
|
||||
Corresponding Source as a System Library, need not be included in conveying the
|
||||
object code work.
|
||||
|
||||
A *User Product* is either
|
||||
|
||||
1. a *consumer product*, which means any tangible personal property which is
|
||||
normally used for personal, family, or household purposes, or
|
||||
2. anything designed or sold for incorporation into a dwelling.
|
||||
|
||||
In determining whether a product is a consumer product, doubtful cases shall be
|
||||
resolved in favor of coverage. For a particular product received by a
|
||||
particular user, *normally used* refers to a typical or common use of that
|
||||
class of product, regardless of the status of the particular user or of the way
|
||||
in which the particular user actually uses, or expects or is expected to use,
|
||||
the product. A product is a consumer product regardless of whether the product
|
||||
has substantial commercial, industrial or non-consumer uses, unless such uses
|
||||
represent the only significant mode of use of the product.
|
||||
|
||||
*Installation Information* for a User Product means any methods, procedures,
|
||||
authorization keys, or other information required to install and execute
|
||||
modified versions of a covered work in that User Product from a modified
|
||||
version of its Corresponding Source. The information must suffice to ensure
|
||||
that the continued functioning of the modified object code is in no case
|
||||
prevented or interfered with solely because modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as part of a
|
||||
transaction in which the right of possession and use of the User Product is
|
||||
transferred to the recipient in perpetuity or for a fixed term (regardless of
|
||||
how the transaction is characterized), the Corresponding Source conveyed under
|
||||
this section must be accompanied by the Installation Information. But this
|
||||
requirement does not apply if neither you nor any third party retains the
|
||||
ability to install modified object code on the User Product (for example, the
|
||||
work has been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates for a
|
||||
work that has been modified or installed by the recipient, or for the User
|
||||
Product in which it has been modified or installed. Access to a network may be
|
||||
denied when the modification itself materially and adversely affects the
|
||||
operation of the network or violates the rules and protocols for communication
|
||||
across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided, in accord
|
||||
with this section must be in a format that is publicly documented (and with an
|
||||
implementation available to the public in source code form), and must require
|
||||
no special password or key for unpacking, reading or copying.
|
||||
|
||||
### 7. Additional Terms.
|
||||
|
||||
*Additional permissions* are terms that supplement the terms of this License by
|
||||
making exceptions from one or more of its conditions. Additional permissions
|
||||
that are applicable to the entire Program shall be treated as though they were
|
||||
included in this License, to the extent that they are valid under applicable
|
||||
law. If additional permissions apply only to part of the Program, that part may
|
||||
be used separately under those permissions, but the entire Program remains
|
||||
governed by this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option remove any
|
||||
additional permissions from that copy, or from any part of it. (Additional
|
||||
permissions may be written to require their own removal in certain cases when
|
||||
you modify the work.) You may place additional permissions on material, added
|
||||
by you to a covered work, for which you have or can give appropriate copyright
|
||||
permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you add to a
|
||||
covered work, you may (if authorized by the copyright holders of that material)
|
||||
supplement the terms of this License with terms:
|
||||
|
||||
- a) Disclaiming warranty or limiting liability differently from the terms of
|
||||
sections 15 and 16 of this License; or
|
||||
- b) Requiring preservation of specified reasonable legal notices or author
|
||||
attributions in that material or in the Appropriate Legal Notices displayed
|
||||
by works containing it; or
|
||||
- c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in reasonable
|
||||
ways as different from the original version; or
|
||||
- d) Limiting the use for publicity purposes of names of licensors or authors
|
||||
of the material; or
|
||||
- e) Declining to grant rights under trademark law for use of some trade
|
||||
names, trademarks, or service marks; or
|
||||
- f) Requiring indemnification of licensors and authors of that material by
|
||||
anyone who conveys the material (or modified versions of it) with
|
||||
contractual assumptions of liability to the recipient, for any liability
|
||||
that these contractual assumptions directly impose on those licensors and
|
||||
authors.
|
||||
|
||||
All other non-permissive additional terms are considered *further restrictions*
|
||||
within the meaning of section 10. If the Program as you received it, or any
|
||||
part of it, contains a notice stating that it is governed by this License along
|
||||
with a term that is a further restriction, you may remove that term. If a
|
||||
license document contains a further restriction but permits relicensing or
|
||||
conveying under this License, you may add to a covered work material governed
|
||||
by the terms of that license document, provided that the further restriction
|
||||
does not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you must place,
|
||||
in the relevant source files, a statement of the additional terms that apply to
|
||||
those files, or a notice indicating where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the form of a
|
||||
separately written license, or stated as exceptions; the above requirements
|
||||
apply either way.
|
||||
|
||||
### 8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly provided
|
||||
under this License. Any attempt otherwise to propagate or modify it is void,
|
||||
and will automatically terminate your rights under this License (including any
|
||||
patent licenses granted under the third paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your license from a
|
||||
particular copyright holder is reinstated
|
||||
|
||||
- a) provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and
|
||||
- b) permanently, if the copyright holder fails to notify you of the
|
||||
violation by some reasonable means prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is reinstated
|
||||
permanently if the copyright holder notifies you of the violation by some
|
||||
reasonable means, this is the first time you have received notice of violation
|
||||
of this License (for any work) from that copyright holder, and you cure the
|
||||
violation prior to 30 days after your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the licenses
|
||||
of parties who have received copies or rights from you under this License. If
|
||||
your rights have been terminated and not permanently reinstated, you do not
|
||||
qualify to receive new licenses for the same material under section 10.
|
||||
|
||||
### 9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or run a copy
|
||||
of the Program. Ancillary propagation of a covered work occurring solely as a
|
||||
consequence of using peer-to-peer transmission to receive a copy likewise does
|
||||
not require acceptance. However, nothing other than this License grants you
|
||||
permission to propagate or modify any covered work. These actions infringe
|
||||
copyright if you do not accept this License. Therefore, by modifying or
|
||||
propagating a covered work, you indicate your acceptance of this License to do
|
||||
so.
|
||||
|
||||
### 10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically receives a
|
||||
license from the original licensors, to run, modify and propagate that work,
|
||||
subject to this License. You are not responsible for enforcing compliance by
|
||||
third parties with this License.
|
||||
|
||||
An *entity transaction* is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered work
|
||||
results from an entity transaction, each party to that transaction who receives
|
||||
a copy of the work also receives whatever licenses to the work the party's
|
||||
predecessor in interest had or could give under the previous paragraph, plus a
|
||||
right to possession of the Corresponding Source of the work from the
|
||||
predecessor in interest, if the predecessor has it or can get it with
|
||||
reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the rights
|
||||
granted or affirmed under this License. For example, you may not impose a
|
||||
license fee, royalty, or other charge for exercise of rights granted under this
|
||||
License, and you may not initiate litigation (including a cross-claim or
|
||||
counterclaim in a lawsuit) alleging that any patent claim is infringed by
|
||||
making, using, selling, offering for sale, or importing the Program or any
|
||||
portion of it.
|
||||
|
||||
### 11. Patents.
|
||||
|
||||
A *contributor* is a copyright holder who authorizes use under this License of
|
||||
the Program or a work on which the Program is based. The work thus licensed is
|
||||
called the contributor's *contributor version*.
|
||||
|
||||
A contributor's *essential patent claims* are all patent claims owned or
|
||||
controlled by the contributor, whether already acquired or hereafter acquired,
|
||||
that would be infringed by some manner, permitted by this License, of making,
|
||||
using, or selling its contributor version, but do not include claims that would
|
||||
be infringed only as a consequence of further modification of the contributor
|
||||
version. For purposes of this definition, *control* includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of this
|
||||
License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free patent
|
||||
license under the contributor's essential patent claims, to make, use, sell,
|
||||
offer for sale, import and otherwise run, modify and propagate the contents of
|
||||
its contributor version.
|
||||
|
||||
In the following three paragraphs, a *patent license* is any express agreement
|
||||
or commitment, however denominated, not to enforce a patent (such as an express
|
||||
permission to practice a patent or covenant not to sue for patent
|
||||
infringement). To *grant* such a patent license to a party means to make such
|
||||
an agreement or commitment not to enforce a patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license, and the
|
||||
Corresponding Source of the work is not available for anyone to copy, free of
|
||||
charge and under the terms of this License, through a publicly available
|
||||
network server or other readily accessible means, then you must either
|
||||
|
||||
1. cause the Corresponding Source to be so available, or
|
||||
2. arrange to deprive yourself of the benefit of the patent license for this
|
||||
particular work, or
|
||||
3. arrange, in a manner consistent with the requirements of this License, to
|
||||
extend the patent license to downstream recipients.
|
||||
|
||||
*Knowingly relying* means you have actual knowledge that, but for the patent
|
||||
license, your conveying the covered work in a country, or your recipient's use
|
||||
of the covered work in a country, would infringe one or more identifiable
|
||||
patents in that country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or arrangement, you
|
||||
convey, or propagate by procuring conveyance of, a covered work, and grant a
|
||||
patent license to some of the parties receiving the covered work authorizing
|
||||
them to use, propagate, modify or convey a specific copy of the covered work,
|
||||
then the patent license you grant is automatically extended to all recipients
|
||||
of the covered work and works based on it.
|
||||
|
||||
A patent license is *discriminatory* if it does not include within the scope of
|
||||
its coverage, prohibits the exercise of, or is conditioned on the non-exercise
|
||||
of one or more of the rights that are specifically granted under this License.
|
||||
You may not convey a covered work if you are a party to an arrangement with a
|
||||
third party that is in the business of distributing software, under which you
|
||||
make payment to the third party based on the extent of your activity of
|
||||
conveying the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory patent
|
||||
license
|
||||
|
||||
- a) in connection with copies of the covered work conveyed by you (or copies
|
||||
made from those copies), or
|
||||
- b) primarily for and in connection with specific products or compilations
|
||||
that contain the covered work, unless you entered into that arrangement, or
|
||||
that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting any implied
|
||||
license or other defenses to infringement that may otherwise be available to
|
||||
you under applicable patent law.
|
||||
|
||||
### 12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not excuse
|
||||
you from the conditions of this License. If you cannot convey a covered work so
|
||||
as to satisfy simultaneously your obligations under this License and any other
|
||||
pertinent obligations, then as a consequence you may not convey it at all. For
|
||||
example, if you agree to terms that obligate you to collect a royalty for
|
||||
further conveying from those to whom you convey the Program, the only way you
|
||||
could satisfy both those terms and this License would be to refrain entirely
|
||||
from conveying the Program.
|
||||
|
||||
### 13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have permission to
|
||||
link or combine any covered work with a work licensed under version 3 of the
|
||||
GNU Affero General Public License into a single combined work, and to convey
|
||||
the resulting work. The terms of this License will continue to apply to the
|
||||
part which is the covered work, but the special requirements of the GNU Affero
|
||||
General Public License, section 13, concerning interaction through a network
|
||||
will apply to the combination as such.
|
||||
|
||||
### 14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of the GNU
|
||||
General Public License from time to time. Such new versions will be similar in
|
||||
spirit to the present version, but may differ in detail to address new problems
|
||||
or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies
|
||||
that a certain numbered version of the GNU General Public License *or any later
|
||||
version* applies to it, you have the option of following the terms and
|
||||
conditions either of that numbered version or of any later version published by
|
||||
the Free Software Foundation. If the Program does not specify a version number
|
||||
of the GNU General Public License, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future versions of the
|
||||
GNU General Public License can be used, that proxy's public statement of
|
||||
acceptance of a version permanently authorizes you to choose that version for
|
||||
the Program.
|
||||
|
||||
Later license versions may give you additional or different permissions.
|
||||
However, no additional obligations are imposed on any author or copyright
|
||||
holder as a result of your choosing to follow a later version.
|
||||
|
||||
### 15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
|
||||
LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
|
||||
PARTIES PROVIDE THE PROGRAM *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE
|
||||
QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
|
||||
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
|
||||
CORRECTION.
|
||||
|
||||
### 16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY
|
||||
COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS
|
||||
PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
|
||||
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
|
||||
THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
|
||||
INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
|
||||
PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY
|
||||
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
### 17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided above cannot
|
||||
be given local legal effect according to their terms, reviewing courts shall
|
||||
apply local law that most closely approximates an absolute waiver of all civil
|
||||
liability in connection with the Program, unless a warranty or assumption of
|
||||
liability accompanies a copy of the Program in return for a fee.
|
||||
|
||||
## END OF TERMS AND CONDITIONS ###
|
||||
|
||||
### How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible
|
||||
use to the public, the best way to achieve this is to make it free software
|
||||
which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach
|
||||
them to the start of each source file to most effectively state the exclusion
|
||||
of warranty; and each file should have at least the *copyright* line and a
|
||||
pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short notice like
|
||||
this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w` and `show c` should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands might
|
||||
be different; for a GUI interface, you would use an *about box*.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school, if
|
||||
any, to sign a *copyright disclaimer* for the program, if necessary. For more
|
||||
information on this, and how to apply and follow the GNU GPL, see
|
||||
[http://www.gnu.org/licenses/](http://www.gnu.org/licenses/).
|
||||
|
||||
The GNU General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may consider
|
||||
it more useful to permit linking proprietary applications with the library. If
|
||||
this is what you want to do, use the GNU Lesser General Public License instead
|
||||
of this License. But first, please read
|
||||
[http://www.gnu.org/philosophy/why-not-lgpl.html](http://www.gnu.org/philosophy/why-not-lgpl.html).
|
||||
@@ -1,157 +0,0 @@
|
||||
# GNU LESSER GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
<https://fsf.org/>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license document, but changing it is not allowed.
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates the
|
||||
terms and conditions of version 3 of the GNU General Public License,
|
||||
supplemented by the additional permissions listed below.
|
||||
|
||||
## 0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the
|
||||
GNU General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License, other
|
||||
than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
## 1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
## 2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
- a) under this License, provided that you make a good faith effort
|
||||
to ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
- b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
## 3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from a
|
||||
header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
- a) Give prominent notice with each copy of the object code that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
- b) Accompany the object code with a copy of the GNU GPL and this
|
||||
license document.
|
||||
|
||||
## 4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that, taken
|
||||
together, effectively do not restrict modification of the portions of
|
||||
the Library contained in the Combined Work and reverse engineering for
|
||||
debugging such modifications, if you also do each of the following:
|
||||
|
||||
- a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
- b) Accompany the Combined Work with a copy of the GNU GPL and this
|
||||
license document.
|
||||
- c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
- d) Do one of the following:
|
||||
- 0) Convey the Minimal Corresponding Source under the terms of
|
||||
this License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
- 1) Use a suitable shared library mechanism for linking with
|
||||
the Library. A suitable mechanism is one that (a) uses at run
|
||||
time a copy of the Library already present on the user's
|
||||
computer system, and (b) will operate properly with a modified
|
||||
version of the Library that is interface-compatible with the
|
||||
Linked Version.
|
||||
- e) Provide Installation Information, but only if you would
|
||||
otherwise be required to provide such information under section 6
|
||||
of the GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the Application
|
||||
with a modified version of the Linked Version. (If you use option
|
||||
4d0, the Installation Information must accompany the Minimal
|
||||
Corresponding Source and Corresponding Application Code. If you
|
||||
use option 4d1, you must provide the Installation Information in
|
||||
the manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.)
|
||||
|
||||
## 5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the Library
|
||||
side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
- a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities, conveyed under the terms of this License.
|
||||
- b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
## 6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
as you received it specifies that a certain numbered version of the
|
||||
GNU Lesser General Public License "or any later version" applies to
|
||||
it, you have the option of following the terms and conditions either
|
||||
of that published version or of any later version published by the
|
||||
Free Software Foundation. If the Library as you received it does not
|
||||
specify a version number of the GNU Lesser General Public License, you
|
||||
may choose any version of the GNU Lesser General Public License ever
|
||||
published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
@@ -1,110 +0,0 @@
|
||||
# DisplayIdle Service
|
||||
|
||||
The DisplayIdle service manages screen timeout, screensavers, and backlight control for Tactility devices.
|
||||
|
||||
## Features
|
||||
|
||||
### Screen Timeout
|
||||
When enabled, the display will automatically dim after a configurable period of inactivity. Timeout options:
|
||||
- 15 seconds
|
||||
- 30 seconds
|
||||
- 1 minute
|
||||
- 2 minutes
|
||||
- 5 minutes
|
||||
- Never
|
||||
|
||||
### Screensavers
|
||||
Four screensaver options are available:
|
||||
|
||||
| Type | Description |
|
||||
|------|-------------|
|
||||
| **None** | Black screen only, backlight turns off immediately |
|
||||
| **Bouncing Balls** | Colored balls bouncing around the screen |
|
||||
| **Mystify** | Classic Windows-style polygon trails with color-changing effects |
|
||||
| **Matrix Rain** | Digital rain effect with terminal-style grid movement, 6-color gradient trails, glow effects, and random character flicker |
|
||||
|
||||
### Auto-Off Feature
|
||||
After 5 minutes of screensaver activity, the screensaver animation stops and the backlight turns off completely to save power. Touching the screen restores normal operation.
|
||||
|
||||
## Public API
|
||||
|
||||
The service exposes a public header for external control:
|
||||
|
||||
```cpp
|
||||
#include <Tactility/service/displayidle/DisplayIdleService.h>
|
||||
|
||||
// Get service instance
|
||||
auto displayIdle = tt::service::displayidle::findService();
|
||||
|
||||
// Force start screensaver immediately
|
||||
displayIdle->startScreensaver();
|
||||
|
||||
// Force stop screensaver and restore backlight
|
||||
displayIdle->stopScreensaver();
|
||||
|
||||
// Check if screensaver is currently active
|
||||
bool active = displayIdle->isScreensaverActive();
|
||||
|
||||
// Reload settings (call after external settings changes)
|
||||
displayIdle->reloadSettings();
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
### Files
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `DisplayIdleService.h` | Public header with service interface |
|
||||
| `DisplayIdle.cpp` | Service implementation |
|
||||
| `Screensaver.h` | Base class for screensaver implementations |
|
||||
| `BouncingBallsScreensaver.h/cpp` | Bouncing balls screensaver |
|
||||
| `MystifyScreensaver.h/cpp` | Mystify polygon screensaver |
|
||||
| `MatrixRainScreensaver.h/cpp` | Matrix digital rain screensaver |
|
||||
|
||||
### Screensaver Base Class
|
||||
|
||||
All screensavers inherit from the `Screensaver` base class:
|
||||
|
||||
```cpp
|
||||
class Screensaver {
|
||||
public:
|
||||
virtual void start(lv_obj_t* overlay, lv_coord_t screenW, lv_coord_t screenH) = 0;
|
||||
virtual void stop() = 0;
|
||||
virtual void update(lv_coord_t screenW, lv_coord_t screenH) = 0;
|
||||
};
|
||||
```
|
||||
|
||||
### Adding a New Screensaver
|
||||
|
||||
1. Create header and implementation files inheriting from `Screensaver`
|
||||
2. Add enum value to `ScreensaverType` in `DisplaySettings.h` (before `Count` sentinel)
|
||||
3. Add string conversion in `DisplaySettings.cpp` (`toString` and `fromString`)
|
||||
4. Add dropdown option in `Display.cpp` (order must match enum order)
|
||||
5. Add case in `DisplayIdle.cpp` `activateScreensaver()` switch
|
||||
6. Include the new header in `DisplayIdle.cpp`
|
||||
|
||||
**Note:** The `ScreensaverType::Count` sentinel must always be the last enum value - it's used for bounds checking in the UI.
|
||||
|
||||
## Settings Integration
|
||||
|
||||
Settings are stored in `/data/settings/display.properties` and managed through `DisplaySettings.h`:
|
||||
|
||||
```cpp
|
||||
struct DisplaySettings {
|
||||
Orientation orientation;
|
||||
uint8_t gammaCurve;
|
||||
uint8_t backlightDuty;
|
||||
bool backlightTimeoutEnabled;
|
||||
uint32_t backlightTimeoutMs;
|
||||
ScreensaverType screensaverType;
|
||||
};
|
||||
```
|
||||
|
||||
The Display app (`Display.cpp`) provides the UI for configuring these settings and notifies the DisplayIdle service when settings change via `reloadSettings()`.
|
||||
|
||||
## Timing
|
||||
|
||||
- Service tick interval: 50ms
|
||||
- Wake activity threshold: 100ms
|
||||
- Screensaver auto-off: 5 minutes (6000 ticks)
|
||||
@@ -1,515 +0,0 @@
|
||||
# WebServer Service
|
||||
|
||||
The WebServer service provides a built-in HTTP server for remote device management, file operations, and system monitoring through a web browser.
|
||||
|
||||
## Features
|
||||
|
||||
- **Dashboard**: Real-time system information, memory stats, and storage overview
|
||||
- **File Browser**: Navigate, upload, download, rename, and delete files on internal storage and SD card
|
||||
- **App Management**: List installed apps, run apps remotely, install/uninstall external apps
|
||||
- **WiFi Status**: View current WiFi connection details
|
||||
- **Screenshot Capture**: Capture the current display as a PNG
|
||||
- **System Controls**: Sync assets, reboot device
|
||||
|
||||
## Enabling the WebServer
|
||||
|
||||
The WebServer is disabled by default to conserve memory. Enable it through:
|
||||
|
||||
1. **Settings App**: Navigate to Settings > WebServer Settings
|
||||
2. **Programmatically**: Call `tt::service::webserver::setWebServerEnabled(true)`
|
||||
|
||||
When enabled, a statusbar icon appears indicating the server mode (AP or Station).
|
||||
|
||||
## Accessing the Dashboard
|
||||
|
||||
Once enabled, access the dashboard by navigating to the device's IP address in a web browser:
|
||||
|
||||
```text
|
||||
http://<device-ip>/
|
||||
```
|
||||
|
||||
**Access Point Mode:** When using AP mode, connect to the device's WiFi network (SSID shown in settings, default `Tactility-XXXX`) and navigate to `http://192.168.4.1/`
|
||||
|
||||
The root URL redirects to `/dashboard.html` which provides a tabbed interface for all features.
|
||||
|
||||
## API Endpoints
|
||||
|
||||
All API endpoints return JSON responses unless otherwise noted.
|
||||
|
||||
### System Information
|
||||
|
||||
#### GET /api/sysinfo
|
||||
|
||||
Returns comprehensive system information.
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"firmware": {
|
||||
"version": "1.0.0",
|
||||
"idf_version": "5.3.0"
|
||||
},
|
||||
"chip": {
|
||||
"model": "ESP32-S3",
|
||||
"cores": 2,
|
||||
"revision": 0,
|
||||
"features": ["Embedded Flash", "WiFi 2.4GHz", "BLE"],
|
||||
"flash_size": 16777216
|
||||
},
|
||||
"heap": {
|
||||
"free": 123456,
|
||||
"total": 327680,
|
||||
"min_free": 100000,
|
||||
"largest_block": 65536
|
||||
},
|
||||
"psram": {
|
||||
"free": 4000000,
|
||||
"total": 8388608,
|
||||
"min_free": 3500000,
|
||||
"largest_block": 2000000
|
||||
},
|
||||
"storage": {
|
||||
"data": {
|
||||
"free": 1000000,
|
||||
"total": 3145728,
|
||||
"mounted": true
|
||||
},
|
||||
"sdcard": {
|
||||
"free": 15000000000,
|
||||
"total": 32000000000,
|
||||
"mounted": true
|
||||
}
|
||||
},
|
||||
"uptime": 3600,
|
||||
"task_count": 25
|
||||
}
|
||||
```
|
||||
|
||||
### WiFi Status
|
||||
|
||||
#### GET /api/wifi
|
||||
|
||||
Returns current WiFi connection status.
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"state": "connected",
|
||||
"ip": "192.168.1.100",
|
||||
"ssid": "MyNetwork",
|
||||
"rssi": -45,
|
||||
"secure": true
|
||||
}
|
||||
```
|
||||
|
||||
**State values:**
|
||||
- `off` - WiFi radio is off
|
||||
- `turning_on` - WiFi is starting
|
||||
- `turning_off` - WiFi is stopping
|
||||
- `on` - WiFi is on but not connected
|
||||
- `connecting` - Connection in progress
|
||||
- `connected` - Connected to access point
|
||||
|
||||
### Screenshot
|
||||
|
||||
#### GET /api/screenshot
|
||||
|
||||
Captures the current display and returns a PNG. The screenshot is also saved to storage with an incrementing filename.
|
||||
|
||||
**Response:** PNG data (`image/png`)
|
||||
|
||||
**Save Location:**
|
||||
- SD card root (if mounted): `/sdcard/webscreenshot1.png`, `/sdcard/webscreenshot2.png`, etc.
|
||||
- Internal storage (fallback): `/data/webscreenshot1.png`, `/data/webscreenshot2.png`, etc.
|
||||
|
||||
**Requirements:** `TT_FEATURE_SCREENSHOT_ENABLED` must be defined in the build.
|
||||
|
||||
**Note:** Returns 501 Not Implemented if screenshot feature is disabled.
|
||||
|
||||
### App Management
|
||||
|
||||
#### GET /api/apps
|
||||
|
||||
Lists all installed applications.
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"apps": [
|
||||
{
|
||||
"id": "com.example.myapp",
|
||||
"name": "My App",
|
||||
"version": "1.0.0",
|
||||
"category": "user",
|
||||
"isExternal": true,
|
||||
"hidden": false,
|
||||
"icon": "/data/app/com.example.myapp/icon.png"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Category values:** `user`, `system`, `settings`
|
||||
|
||||
#### POST /api/apps/run?id=xxx
|
||||
|
||||
Runs an application by its ID. If the app is already running, it will be stopped first.
|
||||
|
||||
**Parameters:**
|
||||
- `id` (required): Application ID
|
||||
|
||||
**Response:** `ok` on success
|
||||
|
||||
#### POST /api/apps/uninstall?id=xxx
|
||||
|
||||
Uninstalls an external application. System apps cannot be uninstalled.
|
||||
|
||||
**Parameters:**
|
||||
- `id` (required): Application ID
|
||||
|
||||
**Response:** `ok` on success
|
||||
|
||||
**Errors:**
|
||||
- 403 Forbidden: Cannot uninstall system apps
|
||||
- 500 Internal Server Error: Uninstall failed
|
||||
|
||||
#### PUT /api/apps/install
|
||||
|
||||
Installs an application from an uploaded `.app` file (tar archive).
|
||||
|
||||
**Content-Type:** `multipart/form-data`
|
||||
|
||||
**Form field:** `file` - The `.app` file to install
|
||||
|
||||
**Response:** `ok` on success
|
||||
|
||||
### File System Operations
|
||||
|
||||
#### GET /fs/list?path=/path
|
||||
|
||||
Lists directory contents.
|
||||
|
||||
**Parameters:**
|
||||
- `path` (optional): Directory path. Defaults to `/` which shows mount points.
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"path": "/data",
|
||||
"entries": [
|
||||
{"name": "app", "type": "dir", "size": 0},
|
||||
{"name": "settings.json", "type": "file", "size": 1234}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Special paths:**
|
||||
- `/` - Shows available mount points (data, sdcard if mounted)
|
||||
- `/data` - Internal flash storage
|
||||
- `/sdcard` - SD card (if mounted)
|
||||
|
||||
#### GET /fs/download?path=/path/to/file
|
||||
|
||||
Downloads a file.
|
||||
|
||||
**Parameters:**
|
||||
- `path` (required): Full path to the file
|
||||
|
||||
**Response:** File contents with appropriate Content-Type header and Content-Disposition for download.
|
||||
|
||||
#### POST /fs/upload?path=/path/to/file
|
||||
|
||||
Uploads a file. The request body contains the raw file data.
|
||||
|
||||
**Parameters:**
|
||||
- `path` (required): Full destination path including filename
|
||||
|
||||
**Content-Type:** Any (raw file data in body)
|
||||
|
||||
**Response:** `Uploaded X bytes`
|
||||
|
||||
**Limits:** Maximum file size is 10MB.
|
||||
|
||||
#### POST /fs/mkdir?path=/path/to/newdir
|
||||
|
||||
Creates a new directory.
|
||||
|
||||
**Parameters:**
|
||||
- `path` (required): Full path of directory to create
|
||||
|
||||
**Response:** `ok` on success
|
||||
|
||||
#### POST /fs/delete?path=/path/to/item
|
||||
|
||||
Deletes a file or directory (recursive for directories).
|
||||
|
||||
**Parameters:**
|
||||
- `path` (required): Full path to delete
|
||||
|
||||
**Response:** `ok` on success
|
||||
|
||||
**Restrictions:** Cannot delete mount points (`/data`, `/sdcard`).
|
||||
|
||||
#### POST /fs/rename?path=/path/to/old&newName=newname
|
||||
|
||||
Renames a file or directory.
|
||||
|
||||
**Parameters:**
|
||||
- `path` (required): Full path to the item to rename
|
||||
- `newName` (required): New name (filename only, not a path)
|
||||
|
||||
**Response:** `ok` on success
|
||||
|
||||
**Restrictions:**
|
||||
- `newName` cannot contain path separators or `..`
|
||||
- Cannot overwrite existing items
|
||||
|
||||
#### GET /fs/tree
|
||||
|
||||
Returns a tree structure of all mount points and their immediate contents.
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"mounts": [
|
||||
{
|
||||
"name": "data",
|
||||
"path": "/data",
|
||||
"entries": [
|
||||
{"name": "app", "type": "dir"},
|
||||
{"name": "tmp", "type": "dir"}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Admin Operations
|
||||
|
||||
#### POST /admin/sync
|
||||
|
||||
Synchronizes web assets from the Data partition.
|
||||
|
||||
**Response:** `Assets synchronized successfully`
|
||||
|
||||
#### POST /admin/reboot
|
||||
|
||||
Reboots the device after a 1-second delay.
|
||||
|
||||
**Response:** `Rebooting...`
|
||||
|
||||
## Static Assets
|
||||
|
||||
The WebServer serves static files from:
|
||||
|
||||
1. **Primary**: `/data/webserver/` (internal flash)
|
||||
2. **Fallback**: `/sdcard/tactility/webserver/` (SD card)
|
||||
|
||||
The dashboard HTML file is served from these locations. If `dashboard.html` doesn't exist, `default.html` is served as a fallback.
|
||||
|
||||
## Asset Synchronization
|
||||
|
||||
The WebServer includes an asset synchronization system that keeps web assets in sync between the Data partition and SD card. This enables recovery after firmware updates and backup of user customizations.
|
||||
|
||||
### Storage Locations
|
||||
|
||||
| Location | Path | Purpose |
|
||||
|----------|------|---------|
|
||||
| Data Partition | `/data/webserver/` | Primary storage, served by WebServer |
|
||||
| SD Card | `/sdcard/tactility/webserver/` | Backup storage for recovery |
|
||||
|
||||
### Version Tracking
|
||||
|
||||
Each storage location maintains a `version.json` file:
|
||||
|
||||
```json
|
||||
{
|
||||
"version": 1
|
||||
}
|
||||
```
|
||||
|
||||
The version is an integer that increments when assets are updated. This allows the sync system to determine which location has newer assets.
|
||||
|
||||
### Sync Scenarios
|
||||
|
||||
The `syncAssets()` function handles several scenarios:
|
||||
|
||||
#### First Boot (No SD Card Backup)
|
||||
- **Condition**: Data partition has assets, SD card backup doesn't exist
|
||||
- **Action**: Skip backup during boot to avoid watchdog timeout
|
||||
- **Note**: SD backup is deferred to first settings save
|
||||
|
||||
#### No SD Card Available
|
||||
- **Condition**: SD card not mounted or unavailable
|
||||
- **Action**: Create default Data structure with version 0 if needed
|
||||
- **Note**: System operates normally without SD backup
|
||||
|
||||
#### Post-Flash Recovery
|
||||
- **Condition**: Data partition empty, SD card has backup
|
||||
- **Action**: Copy entire SD backup to Data partition
|
||||
- **Use Case**: Restoring assets after flashing new firmware that erased Data
|
||||
|
||||
#### Firmware Update (SD Newer)
|
||||
- **Condition**: SD version > Data version
|
||||
- **Action**: Copy SD assets to Data partition
|
||||
- **Use Case**: SD card contains newer assets from a firmware update package
|
||||
|
||||
#### User Customization (Data Newer)
|
||||
- **Condition**: Data version > SD version
|
||||
- **Action**: Defer backup to avoid boot watchdog timeout
|
||||
- **Note**: Backup occurs on next settings save or manual sync
|
||||
|
||||
#### Versions Match
|
||||
- **Condition**: Data version == SD version
|
||||
- **Action**: No synchronization needed
|
||||
|
||||
### Boot Watchdog Considerations
|
||||
|
||||
Some sync operations are intentionally deferred during boot to avoid triggering the ESP32 watchdog timer:
|
||||
|
||||
- **Deferred**: Copying from Data to SD (user customization backup)
|
||||
- **Deferred**: Creating SD version.json
|
||||
- **Immediate**: Copying from SD to Data (recovery and firmware update)
|
||||
|
||||
This ensures the device boots reliably even with slow or corrupted SD cards.
|
||||
|
||||
### Manual Synchronization
|
||||
|
||||
#### Settings App
|
||||
Navigate to **Settings > Web Server** and tap **"Sync Assets Now"** to manually trigger synchronization.
|
||||
|
||||
#### API Endpoint
|
||||
Send a POST request to `/admin/sync`:
|
||||
|
||||
```bash
|
||||
curl -X POST http://<device-ip>/admin/sync
|
||||
```
|
||||
|
||||
**Response:** `Assets synchronized successfully`
|
||||
|
||||
### Programmatic Access
|
||||
|
||||
```cpp
|
||||
#include <Tactility/service/webserver/AssetVersion.h>
|
||||
|
||||
// Check asset status
|
||||
bool hasData = tt::service::webserver::hasDataAssets();
|
||||
bool hasSd = tt::service::webserver::hasSdAssets();
|
||||
|
||||
// Load versions
|
||||
tt::service::webserver::AssetVersion dataVer, sdVer;
|
||||
tt::service::webserver::loadDataVersion(dataVer);
|
||||
tt::service::webserver::loadSdVersion(sdVer);
|
||||
|
||||
// Trigger sync
|
||||
bool success = tt::service::webserver::syncAssets();
|
||||
```
|
||||
|
||||
### Directory Structure
|
||||
|
||||
```text
|
||||
/data/webserver/
|
||||
├── version.json # Version tracking
|
||||
├── dashboard.html # Main dashboard UI
|
||||
└── ... # Other web assets
|
||||
|
||||
/sdcard/tactility/webserver/
|
||||
├── version.json # Version tracking (backup)
|
||||
├── dashboard.html # Dashboard backup
|
||||
└── ... # Other web assets (backup)
|
||||
```
|
||||
|
||||
### Updating Assets
|
||||
|
||||
To update web assets with a new version:
|
||||
|
||||
1. Place new assets in `/sdcard/tactility/webserver/`
|
||||
2. Update `/sdcard/tactility/webserver/version.json` with a higher version number
|
||||
3. Reboot the device or trigger manual sync
|
||||
4. The sync system will detect the newer SD version and copy to Data
|
||||
|
||||
## Security Considerations
|
||||
|
||||
> **⚠️ Security Warning**: The WebServer is unauthenticated by default, allowing anyone on the network to:
|
||||
> - Upload, download, and delete files
|
||||
> - Install and uninstall applications
|
||||
> - Reboot the device
|
||||
> - Capture screenshots
|
||||
>
|
||||
> **Strongly recommended**:
|
||||
> - Enable HTTP Basic Authentication in Settings > Web Server before exposing the device to untrusted networks
|
||||
> - Keep "AP Open Network" disabled (use WPA2 password protection) to prevent unauthorized network access
|
||||
|
||||
- **⚠️ Open Network Option**: The "AP Open Network" setting allows creating an unprotected access point without a password. **This is convenient for quick access but exposes the device to anyone within WiFi range**, potentially allowing unauthorized access to all WebServer functionality if HTTP authentication is also disabled.
|
||||
- **Automatic credential generation**: Credentials are automatically generated when empty:
|
||||
- **AP Password**: Generated when empty (unless "AP Open Network" is enabled)
|
||||
- **HTTP Auth**: Generated when auth is enabled but username or password are empty
|
||||
- Generated credentials are 12 alphanumeric characters (~71 bits of entropy) and persisted immediately
|
||||
- User-set credentials are preserved (the system only replaces empty credentials, not weak user-chosen passwords)
|
||||
- Check Settings > Web Server to view the generated credentials
|
||||
- File operations are restricted to `/data` and `/sdcard` paths
|
||||
- Path traversal attacks are blocked (e.g., `../` is rejected)
|
||||
- Mount points cannot be deleted
|
||||
- System apps cannot be uninstalled via the API
|
||||
|
||||
## Configuration
|
||||
|
||||
Settings are stored in the WebServer settings file and can be configured via **Settings > Web Server**:
|
||||
|
||||
| Setting | Description | Default |
|
||||
|---------|-------------|---------|
|
||||
| WiFi Mode | Station (connect to existing network) or Access Point (create own network) | Station |
|
||||
| AP Open Network | Create an open AP without password protection | Disabled |
|
||||
| AP Password | Password for Access Point mode (WPA2, 8-63 chars). Disabled when Open Network is enabled. | Auto-generated |
|
||||
| Web Server Enabled | Whether the HTTP server is running | Disabled |
|
||||
| Require Authentication | Enable HTTP Basic Authentication | Disabled |
|
||||
| Username | Authentication username (when auth enabled) | Auto-generated |
|
||||
| Password | Authentication password (when auth enabled) | Auto-generated |
|
||||
|
||||
**Note:** The system automatically generates secure credentials when they are empty. Generated credentials are 12-character alphanumeric strings with ~71 bits of entropy. See **Security Considerations** for details.
|
||||
|
||||
**Note:** WiFi Station credentials are managed separately via the WiFi settings menu.
|
||||
|
||||
## Statusbar Icons
|
||||
|
||||
When the WebServer is running, a statusbar icon indicates the WiFi mode:
|
||||
- `webserver_ap_white.png` - Access Point mode
|
||||
- `webserver_station_white.png` - Station mode
|
||||
|
||||
## Events
|
||||
|
||||
The WebServer publishes events:
|
||||
- `WebServerStarted` - Fired when the HTTP server starts
|
||||
- `WebServerStopped` - Fired when the HTTP server stops
|
||||
- `WebServerSettingsChanged` - Fired when settings are modified
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "No slots left for registering handler"
|
||||
|
||||
The ESP-IDF HTTP server has a limit on URI handlers. The WebServer configures this dynamically based on the number of handlers needed, but if you see this error, check `CONFIG_HTTPD_MAX_URI_HANDLERS` in sdkconfig.
|
||||
|
||||
### 404 for dashboard.html
|
||||
|
||||
Ensure the `dashboard.html` file exists in `/data/webserver/`. Run the asset sync operation or copy files manually.
|
||||
|
||||
### Screenshot fails
|
||||
|
||||
- Verify `TT_FEATURE_SCREENSHOT_ENABLED` is defined
|
||||
- Check available heap memory (screenshot requires ~width*height*3 bytes)
|
||||
- Ensure the save location (SD card or `/data`) is writable
|
||||
- Screenshots are saved as `webscreenshot1.png`, `webscreenshot2.png`, etc. up to 9999
|
||||
|
||||
### File upload fails
|
||||
|
||||
- Check file size is under 10MB limit
|
||||
- Verify the destination path is writable
|
||||
- Ensure the parent directory exists
|
||||
|
||||
### Asset sync fails
|
||||
|
||||
- Check SD card is properly mounted and writable
|
||||
- Verify sufficient space on destination (Data or SD card)
|
||||
- Check logs for specific file copy errors
|
||||
- Maximum directory depth is 16 levels
|
||||
- If sync hangs during boot, the SD card may be slow or corrupted
|
||||
Reference in New Issue
Block a user