mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-12 21:36:30 +00:00
Compare commits
208 Commits
v14.6.0
...
developmen
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4efc2d6ce6 | ||
![]() |
46e6f7ea02 | ||
![]() |
7e77086a2d | ||
![]() |
3b207db27c | ||
![]() |
d3e2bb6906 | ||
![]() |
6c699e9b95 | ||
![]() |
fc22688b5d | ||
![]() |
b4796836b0 | ||
![]() |
9e25fc0f30 | ||
![]() |
c909e20fb1 | ||
![]() |
a052ee00a2 | ||
![]() |
bb53b42790 | ||
![]() |
fca68c6b30 | ||
![]() |
6751bd397c | ||
![]() |
c22cdd24b2 | ||
![]() |
e0515a7d30 | ||
![]() |
dc14f1c3bd | ||
![]() |
d8b40263e2 | ||
![]() |
56eb8d98c0 | ||
![]() |
ae3dbde4b1 | ||
![]() |
3dec15322f | ||
![]() |
19c212f261 | ||
![]() |
850fd07d3a | ||
![]() |
59c80254cd | ||
![]() |
9e7be254c2 | ||
![]() |
912cb15beb | ||
![]() |
5086863322 | ||
![]() |
0a80f45636 | ||
![]() |
fffda63f3c | ||
![]() |
07dcbcc53e | ||
![]() |
39013e4f7b | ||
![]() |
99b73aaaf8 | ||
![]() |
c5aced3dd0 | ||
![]() |
ece26ccfaf | ||
![]() |
407c274229 | ||
![]() |
ac51cd7340 | ||
![]() |
638b3b5c1e | ||
![]() |
2380c33ef0 | ||
![]() |
4904a43b33 | ||
![]() |
143cfdd4f2 | ||
![]() |
550b8c5307 | ||
![]() |
cc95aa5f0f | ||
![]() |
aeb3005c3e | ||
![]() |
45dd2a331e | ||
![]() |
99297d6dfc | ||
![]() |
942e419b0c | ||
![]() |
8158db7dad | ||
![]() |
ddf96fb58f | ||
![]() |
232db5ce77 | ||
![]() |
8de22ee4cc | ||
![]() |
727756283d | ||
![]() |
decdfc6b51 | ||
![]() |
e9b62811c7 | ||
![]() |
25c85a90ac | ||
![]() |
91e5be450d | ||
![]() |
07809eede5 | ||
![]() |
fef5ee9a6f | ||
![]() |
7d7a9ea6fb | ||
![]() |
67d428cd3d | ||
![]() |
384edd22a7 | ||
![]() |
fb44d42426 | ||
![]() |
f378e68b3d | ||
![]() |
e30ad61e00 | ||
![]() |
9392ac7d55 | ||
![]() |
76d4651163 | ||
![]() |
ea4e399b18 | ||
![]() |
d4d6a2c779 | ||
![]() |
390927c190 | ||
![]() |
b5d6e95164 | ||
![]() |
79024cdd23 | ||
![]() |
f7d4b0e726 | ||
![]() |
0687520c93 | ||
![]() |
64d6231111 | ||
![]() |
ea99e4724f | ||
![]() |
004f1ec36a | ||
![]() |
742b7338fd | ||
![]() |
84059199d4 | ||
![]() |
4002344227 | ||
![]() |
bba5ba008e | ||
![]() |
7c2eabcd94 | ||
![]() |
76a39f7597 | ||
![]() |
17cc37b889 | ||
![]() |
8da8c97d4f | ||
![]() |
5522f3f6ba | ||
![]() |
f3d4b5275d | ||
![]() |
26613aacb2 | ||
![]() |
4be87d41ef | ||
![]() |
55c7dc0654 | ||
![]() |
93a22628e5 | ||
![]() |
263d84315f | ||
![]() |
81465a8506 | ||
![]() |
bafcfcd227 | ||
![]() |
e7f9f51e27 | ||
![]() |
d94d7c8972 | ||
![]() |
de0d88514a | ||
![]() |
601ddc564d | ||
![]() |
ea9a24e76d | ||
![]() |
1cd4e27123 | ||
![]() |
fcf4706914 | ||
![]() |
692cf547cb | ||
![]() |
04302414c8 | ||
![]() |
b90ef3b400 | ||
![]() |
2eb56b77a2 | ||
![]() |
2914554f5e | ||
![]() |
b822a37a7c | ||
![]() |
6aca98673d | ||
![]() |
429537ce4c | ||
![]() |
fe596c680d | ||
![]() |
559209ee14 | ||
![]() |
6a4f09c888 | ||
![]() |
d7f9142833 | ||
![]() |
553ee44b02 | ||
![]() |
6853e88116 | ||
![]() |
f6bf4351f5 | ||
![]() |
b684486570 | ||
![]() |
4f4bf7c61b | ||
![]() |
92f14dd0c0 | ||
![]() |
67d223dc78 | ||
![]() |
c10686e366 | ||
![]() |
c8d6f723c1 | ||
![]() |
36a2d253e5 | ||
![]() |
40bc108ba1 | ||
![]() |
7ce3ba376c | ||
![]() |
6a27899241 | ||
![]() |
a6ab85f3cd | ||
![]() |
08e1ff548b | ||
![]() |
e2d30dd64d | ||
![]() |
02ce050727 | ||
![]() |
78787f693e | ||
![]() |
3327f4a5ca | ||
![]() |
17210d1aca | ||
![]() |
54a9a117fc | ||
![]() |
2b460aa112 | ||
![]() |
a088c8791f | ||
![]() |
f5fe75c9b0 | ||
![]() |
65b1c9668f | ||
![]() |
1ee3d8c079 | ||
![]() |
1306f7a8c7 | ||
![]() |
e86af24056 | ||
![]() |
aff2157356 | ||
![]() |
fc492bb6b2 | ||
![]() |
c61462a8ea | ||
![]() |
f90be50d2d | ||
![]() |
0abe70816b | ||
![]() |
28f4a07fd6 | ||
![]() |
7fb8654c6c | ||
![]() |
08e8f0b64d | ||
![]() |
ca9df09d6a | ||
![]() |
9f764ac414 | ||
![]() |
f660ba7e04 | ||
![]() |
8471832b3a | ||
![]() |
eef115f2c5 | ||
![]() |
56ce7b3f93 | ||
![]() |
b29ef3dfbc | ||
![]() |
8ea150328d | ||
![]() |
3d11cc4fee | ||
![]() |
42a1aee832 | ||
![]() |
98c6b0730f | ||
![]() |
66013fcf04 | ||
![]() |
1e74d6fd4d | ||
![]() |
2d16798263 | ||
![]() |
c25b9827e8 | ||
![]() |
5475fcc8f3 | ||
![]() |
502cdfb9ea | ||
![]() |
75b109c893 | ||
![]() |
b5ae6bc035 | ||
![]() |
5d8b90d83b | ||
![]() |
9329dbc52b | ||
![]() |
c148c8e84d | ||
![]() |
38802ab5b7 | ||
![]() |
f83b5a8c80 | ||
![]() |
2ab84dd3a4 | ||
![]() |
faf12234f6 | ||
![]() |
7624016efb | ||
![]() |
9ed833ec5f | ||
![]() |
d7073b3bdf | ||
![]() |
195fd7c6a3 | ||
![]() |
ddf3e38ef8 | ||
![]() |
e2eae10db6 | ||
![]() |
a52f3450b8 | ||
![]() |
a4ce9efd2c | ||
![]() |
f72a989976 | ||
![]() |
736d4d6576 | ||
![]() |
060f47678d | ||
![]() |
2e251468f9 | ||
![]() |
ce5fae934b | ||
![]() |
70bf5daff9 | ||
![]() |
6cd19c0e59 | ||
![]() |
326fa9ca10 | ||
![]() |
d95200939a | ||
![]() |
7e7f237292 | ||
![]() |
2c2f7f1149 | ||
![]() |
402c9e8e8d | ||
![]() |
94652ad6ed | ||
![]() |
723684bb06 | ||
![]() |
115cefc557 | ||
![]() |
0ad8696dfc | ||
![]() |
6344c46d08 | ||
![]() |
ed6203e114 | ||
![]() |
015fa1da89 | ||
![]() |
a11e269ca0 | ||
![]() |
2831bbfd18 | ||
![]() |
92b3f7d37c | ||
![]() |
a2d1915692 | ||
![]() |
082170374c | ||
![]() |
c2628c95f3 | ||
![]() |
2bc5f682b0 | ||
![]() |
cea46bb660 |
1682
.doc_for_ai/BERRY_LANGUAGE_REFERENCE.md
Normal file
1682
.doc_for_ai/BERRY_LANGUAGE_REFERENCE.md
Normal file
File diff suppressed because it is too large
Load Diff
175
.doc_for_ai/DOC_DEEP_ANALYSIS.md
Normal file
175
.doc_for_ai/DOC_DEEP_ANALYSIS.md
Normal file
@ -0,0 +1,175 @@
|
|||||||
|
# Deep Analysis of Tasmota Documentation Repository
|
||||||
|
|
||||||
|
This file is a summary of the Tasmota Documentation for the "docs" repository. It is provided here for convenience for GenAI to read it easily.
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Tasmota is a comprehensive open-source firmware for ESP8266/ESP8285 and ESP32-based IoT devices that provides local control, MQTT integration, and extensive customization capabilities. The documentation repository contains over 250 markdown files covering every aspect of the firmware, from basic installation to advanced development topics.
|
||||||
|
|
||||||
|
## Repository Structure
|
||||||
|
|
||||||
|
The documentation is organized into several key categories:
|
||||||
|
|
||||||
|
### Core Documentation
|
||||||
|
- **Getting Started**: Complete setup guide from hardware preparation to initial configuration
|
||||||
|
- **Commands**: Comprehensive reference of 200+ commands for device control
|
||||||
|
- **MQTT**: Central communication protocol documentation
|
||||||
|
- **Rules**: Flexible automation system documentation
|
||||||
|
- **Templates**: Device configuration system
|
||||||
|
- **Components**: GPIO mapping and peripheral management
|
||||||
|
|
||||||
|
### Hardware Support
|
||||||
|
- **ESP Platforms**: ESP8266, ESP8285, ESP32 (all variants including S2, S3, C3)
|
||||||
|
- **Supported Devices**: 125+ device-specific configuration files
|
||||||
|
- **Peripherals**: 85+ sensor and peripheral drivers documented
|
||||||
|
- **Pinouts**: Detailed GPIO mappings for common modules
|
||||||
|
|
||||||
|
### Advanced Features
|
||||||
|
- **Berry Scripting**: Modern scripting language for ESP32 (163KB documentation)
|
||||||
|
- **Scripting Language**: Legacy scripting for ESP8266 (93KB documentation)
|
||||||
|
- **Matter Protocol**: Thread/Matter support for modern IoT ecosystems
|
||||||
|
- **Zigbee**: Zigbee2Tasmota gateway functionality (100KB documentation)
|
||||||
|
- **Bluetooth**: BLE sensor integration and device control
|
||||||
|
|
||||||
|
### Integration Ecosystem
|
||||||
|
- **Home Assistant**: Native integration with autodiscovery
|
||||||
|
- **OpenHAB**: Configuration examples and best practices
|
||||||
|
- **Domoticz**: Integration guide
|
||||||
|
- **KNX**: Building automation protocol support
|
||||||
|
- **AWS IoT**: Cloud integration with certificates
|
||||||
|
- **Azure IoT**: Microsoft cloud platform integration
|
||||||
|
|
||||||
|
## Key Technical Insights
|
||||||
|
|
||||||
|
### Architecture Philosophy
|
||||||
|
Tasmota follows a modular architecture where:
|
||||||
|
- Core firmware provides basic functionality (WiFi, MQTT, web interface)
|
||||||
|
- Features are conditionally compiled based on `#define` directives
|
||||||
|
- GPIO mapping is completely flexible through templates
|
||||||
|
- All functionality is controllable via commands (MQTT, HTTP, serial, web console)
|
||||||
|
|
||||||
|
### Memory Management
|
||||||
|
- ESP8266: 80KB RAM total, ~25-30KB available for applications
|
||||||
|
- ESP32: Much more generous memory, supports advanced features
|
||||||
|
- Code size optimization is critical for ESP8266 OTA updates
|
||||||
|
- Flash memory partitioned for dual-boot OTA capability
|
||||||
|
|
||||||
|
### Communication Protocols
|
||||||
|
1. **MQTT** (Primary): All device control and telemetry
|
||||||
|
2. **HTTP**: Web interface and REST API
|
||||||
|
3. **Serial**: Direct console access
|
||||||
|
4. **WebSocket**: Real-time web interface updates
|
||||||
|
|
||||||
|
### Extensibility Mechanisms
|
||||||
|
1. **Rules**: Event-driven automation (up to 1536 characters)
|
||||||
|
2. **Berry Scripts**: Full programming language (ESP32 only)
|
||||||
|
3. **Scripting**: Legacy scripting system (ESP8266)
|
||||||
|
4. **Templates**: Device configuration sharing
|
||||||
|
5. **Custom Drivers**: C++ sensor/peripheral drivers
|
||||||
|
|
||||||
|
## Development Ecosystem
|
||||||
|
|
||||||
|
### Build System
|
||||||
|
- PlatformIO-based compilation
|
||||||
|
- Multiple build environments for different ESP variants
|
||||||
|
- Conditional compilation for feature selection
|
||||||
|
- OTA update system with safety mechanisms
|
||||||
|
|
||||||
|
### Driver Development
|
||||||
|
- Standardized sensor API with callback system
|
||||||
|
- I2C/SPI/UART peripheral support
|
||||||
|
- Memory-conscious development practices
|
||||||
|
- Extensive debugging and profiling tools
|
||||||
|
|
||||||
|
### Scripting Capabilities
|
||||||
|
- **Berry**: Modern language with object-oriented features, garbage collection
|
||||||
|
- **Rules**: Simple trigger-action automation
|
||||||
|
- **Legacy Scripting**: Procedural language for complex automation
|
||||||
|
|
||||||
|
### Integration APIs
|
||||||
|
- **JSON Status Responses**: Standardized telemetry format
|
||||||
|
- **Command Interface**: Unified control mechanism
|
||||||
|
- **Sensor API**: Standardized peripheral integration
|
||||||
|
- **Web Interface Extensions**: Custom UI components
|
||||||
|
|
||||||
|
## Notable Features
|
||||||
|
|
||||||
|
### Advanced Networking
|
||||||
|
- IPv6 support
|
||||||
|
- Wireguard VPN client
|
||||||
|
- Range extender functionality (NAPT)
|
||||||
|
- Multiple WiFi network support
|
||||||
|
- Ethernet support (ESP32)
|
||||||
|
|
||||||
|
### Security Features
|
||||||
|
- TLS/SSL support (ESP32)
|
||||||
|
- Certificate-based authentication
|
||||||
|
- Secure boot options
|
||||||
|
- Network isolation capabilities
|
||||||
|
|
||||||
|
### Display and UI
|
||||||
|
- Universal Display Driver supporting 50+ display types
|
||||||
|
- LVGL graphics library integration
|
||||||
|
- HASPmota: Advanced touch interface system
|
||||||
|
- Web interface customization
|
||||||
|
|
||||||
|
### Industrial Features
|
||||||
|
- Modbus bridge functionality
|
||||||
|
- KNX building automation
|
||||||
|
- Smart meter interfaces (P1, Teleinfo)
|
||||||
|
- Industrial sensor support (4-20mA, etc.)
|
||||||
|
|
||||||
|
## Documentation Quality Assessment
|
||||||
|
|
||||||
|
### Strengths
|
||||||
|
- **Comprehensive Coverage**: Every feature documented with examples
|
||||||
|
- **Practical Focus**: Heavy emphasis on real-world usage scenarios
|
||||||
|
- **Community-Driven**: Active contribution from users and developers
|
||||||
|
- **Multi-Level**: From beginner tutorials to advanced development guides
|
||||||
|
- **Well-Structured**: Logical organization with cross-references
|
||||||
|
|
||||||
|
### Areas for Improvement
|
||||||
|
- **Fragmentation**: Some information scattered across multiple files
|
||||||
|
- **Version Consistency**: Some docs may lag behind rapid development
|
||||||
|
- **Advanced Topics**: Some complex features could use more examples
|
||||||
|
|
||||||
|
## Community and Ecosystem
|
||||||
|
|
||||||
|
### Support Channels
|
||||||
|
- Discord server for real-time help
|
||||||
|
- GitHub discussions for feature requests
|
||||||
|
- Telegram and Matrix communities
|
||||||
|
- Reddit community
|
||||||
|
|
||||||
|
### Device Database
|
||||||
|
- Templates repository with 1000+ device configurations
|
||||||
|
- Community-contributed device support
|
||||||
|
- Standardized template sharing format
|
||||||
|
|
||||||
|
### Integration Ecosystem
|
||||||
|
- Native Home Assistant integration
|
||||||
|
- Multiple home automation platform support
|
||||||
|
- Cloud service integrations (AWS, Azure)
|
||||||
|
- Third-party tool ecosystem
|
||||||
|
|
||||||
|
## Development Trends
|
||||||
|
|
||||||
|
### Modern Features
|
||||||
|
- Matter protocol support for interoperability
|
||||||
|
- Berry scripting for advanced automation
|
||||||
|
- LVGL for rich user interfaces
|
||||||
|
- Machine learning integration (TensorFlow Lite)
|
||||||
|
|
||||||
|
### Hardware Evolution
|
||||||
|
- ESP32 as primary platform for new features
|
||||||
|
- ESP8266 maintained for compatibility
|
||||||
|
- Support for latest ESP32 variants (S2, S3, C3)
|
||||||
|
- Increasing focus on low-power applications
|
||||||
|
|
||||||
|
## Conclusion
|
||||||
|
|
||||||
|
The Tasmota documentation represents one of the most comprehensive firmware documentation projects in the IoT space. It successfully bridges the gap between simple device control and advanced IoT development, providing pathways for users to grow from basic usage to sophisticated automation and custom development.
|
||||||
|
|
||||||
|
The documentation's strength lies in its practical approach, extensive hardware support coverage, and community-driven nature. It serves as both a user manual and a development reference, making Tasmota accessible to a wide range of users while providing the depth needed for serious IoT development.
|
||||||
|
|
||||||
|
The modular architecture, extensive command system, and multiple scripting options make Tasmota a powerful platform for IoT development, with documentation that adequately supports this complexity while remaining approachable for newcomers.
|
977
.doc_for_ai/FOR_DEVELOPERS.md
Normal file
977
.doc_for_ai/FOR_DEVELOPERS.md
Normal file
@ -0,0 +1,977 @@
|
|||||||
|
# Tasmota Developer Guide
|
||||||
|
|
||||||
|
This file is a summary of the Tasmota Documentation for the "docs" repository. It is provided here for convenience for GenAI to read it easily.
|
||||||
|
|
||||||
|
## How Tasmota Works
|
||||||
|
|
||||||
|
### Core Architecture
|
||||||
|
|
||||||
|
Tasmota is a modular firmware that transforms ESP8266/ESP8285 and ESP32 microcontrollers into intelligent IoT devices. The architecture follows these key principles:
|
||||||
|
|
||||||
|
#### 1. Event-Driven System
|
||||||
|
- Main loop processes events and callbacks
|
||||||
|
- Non-blocking operations to maintain responsiveness
|
||||||
|
- Callback system for sensors, drivers, and features
|
||||||
|
- Timer-based scheduling for periodic tasks
|
||||||
|
|
||||||
|
#### 2. Modular Design
|
||||||
|
- Core functionality always present (WiFi, MQTT, web interface)
|
||||||
|
- Optional features compiled conditionally using `#define` directives
|
||||||
|
- Plugin architecture for sensors and peripherals
|
||||||
|
- Template system for device configuration
|
||||||
|
|
||||||
|
#### 3. Communication Hub
|
||||||
|
- **MQTT**: Primary communication protocol for automation systems
|
||||||
|
- **HTTP**: Web interface and REST API
|
||||||
|
- **Serial**: Direct console access for debugging and configuration
|
||||||
|
- **WebSocket**: Real-time web interface updates
|
||||||
|
|
||||||
|
### Firmware Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
tasmota/
|
||||||
|
├── tasmota.ino # Main firmware file
|
||||||
|
├── tasmota_xdrv_driver/ # Driver files directory (187 files)
|
||||||
|
│ ├── xdrv_01_9_webserver.ino # Web server driver
|
||||||
|
│ ├── xdrv_02_9_mqtt.ino # MQTT driver
|
||||||
|
│ ├── xdrv_04_light.ino # Light driver
|
||||||
|
│ └── xdrv_##_name.ino # Other drivers
|
||||||
|
├── tasmota_xsns_sensor/ # Sensor files directory (143 files)
|
||||||
|
│ ├── xsns_01_counter.ino # Counter sensor
|
||||||
|
│ ├── xsns_02_analog.ino # Analog sensor
|
||||||
|
│ └── xsns_##_name.ino # Other sensors
|
||||||
|
├── tasmota_xlgt_light/ # Light driver files directory
|
||||||
|
├── tasmota_xnrg_energy/ # Energy monitoring files directory
|
||||||
|
├── tasmota_support/ # Support functions directory (29 files)
|
||||||
|
│ ├── support.ino # Core support functions
|
||||||
|
│ ├── settings.ino # Settings management
|
||||||
|
│ └── support_*.ino # Other support modules
|
||||||
|
├── include/ # Header files directory (18 files)
|
||||||
|
│ ├── tasmota.h # Main header
|
||||||
|
│ ├── tasmota_types.h # Type definitions
|
||||||
|
│ ├── tasmota_globals.h # Global variables
|
||||||
|
│ └── *.h # Other headers
|
||||||
|
└── my_user_config.h # User configuration overrides
|
||||||
|
```
|
||||||
|
|
||||||
|
### Command System
|
||||||
|
|
||||||
|
All Tasmota functionality is accessible through a unified command system:
|
||||||
|
|
||||||
|
- Commands can be sent via MQTT, HTTP, serial, or web console
|
||||||
|
- Format: `Command [parameter]`
|
||||||
|
- Response format: JSON for structured data
|
||||||
|
- Backlog support for multiple commands: `Backlog cmd1; cmd2; cmd3`
|
||||||
|
|
||||||
|
### GPIO Management
|
||||||
|
|
||||||
|
Tasmota uses a flexible GPIO assignment system:
|
||||||
|
|
||||||
|
1. **Templates**: Pre-defined GPIO configurations for specific devices
|
||||||
|
2. **Components**: Logical functions assigned to physical pins
|
||||||
|
3. **Modules**: Base hardware configurations
|
||||||
|
4. **Runtime Configuration**: GPIO can be reassigned without recompilation
|
||||||
|
|
||||||
|
## Development Environment Setup
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
1. **PlatformIO**: Primary build system
|
||||||
|
2. **Git**: Version control
|
||||||
|
3. **Python**: For build scripts and tools
|
||||||
|
4. **Serial Programmer**: For initial flashing
|
||||||
|
|
||||||
|
### Build Configuration
|
||||||
|
|
||||||
|
Create `platformio_tasmota_cenv.ini` for custom environments:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[env:tasmota32-custom]
|
||||||
|
extends = env:tasmota32
|
||||||
|
build_flags = ${env:tasmota32.build_flags}
|
||||||
|
-DUSE_MY_CUSTOM_FEATURE
|
||||||
|
```
|
||||||
|
|
||||||
|
### User Configuration
|
||||||
|
|
||||||
|
Create `tasmota/user_config_override.h`:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#ifndef _USER_CONFIG_OVERRIDE_H_
|
||||||
|
#define _USER_CONFIG_OVERRIDE_H_
|
||||||
|
|
||||||
|
// Enable custom features
|
||||||
|
#define USE_CUSTOM_SENSOR
|
||||||
|
#define USE_BERRY_DEBUG
|
||||||
|
|
||||||
|
// Disable unused features to save space
|
||||||
|
#undef USE_DOMOTICZ
|
||||||
|
#undef USE_KNX
|
||||||
|
|
||||||
|
#endif
|
||||||
|
```
|
||||||
|
|
||||||
|
## Driver Development
|
||||||
|
|
||||||
|
### Sensor Driver Structure
|
||||||
|
|
||||||
|
All sensor drivers follow a standardized pattern:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#ifdef USE_MY_SENSOR
|
||||||
|
#define XSNS_XX XX // Unique sensor ID
|
||||||
|
|
||||||
|
bool MySensorDetected = false;
|
||||||
|
|
||||||
|
void MySensorInit(void) {
|
||||||
|
// Initialize sensor
|
||||||
|
if (sensor_detected) {
|
||||||
|
MySensorDetected = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MySensorEverySecond(void) {
|
||||||
|
// Read sensor data
|
||||||
|
}
|
||||||
|
|
||||||
|
void MySensorShow(bool json) {
|
||||||
|
if (json) {
|
||||||
|
ResponseAppend_P(PSTR(",\"MySensor\":{\"Temperature\":%d}"), temperature);
|
||||||
|
}
|
||||||
|
#ifdef USE_WEBSERVER
|
||||||
|
else {
|
||||||
|
WSContentSend_PD(HTTP_SNS_TEMP, "MySensor", temperature);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Xsns_XX(byte function) {
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
if (i2c_flg) { // Only for I2C sensors
|
||||||
|
switch (function) {
|
||||||
|
case FUNC_INIT:
|
||||||
|
MySensorInit();
|
||||||
|
break;
|
||||||
|
case FUNC_EVERY_SECOND:
|
||||||
|
MySensorEverySecond();
|
||||||
|
break;
|
||||||
|
case FUNC_JSON_APPEND:
|
||||||
|
MySensorShow(1);
|
||||||
|
break;
|
||||||
|
#ifdef USE_WEBSERVER
|
||||||
|
case FUNC_WEB_SENSOR:
|
||||||
|
MySensorShow(0);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#endif // USE_MY_SENSOR
|
||||||
|
```
|
||||||
|
|
||||||
|
### Complete Driver Callback Functions Reference
|
||||||
|
|
||||||
|
**VERIFIED FROM SOURCE CODE**: `tasmota/include/tasmota.h` lines 433-454
|
||||||
|
|
||||||
|
#### Core System Callbacks (Functions WITHOUT return results)
|
||||||
|
|
||||||
|
| Function | Purpose | When Called | Parameters |
|
||||||
|
|----------|---------|-------------|-----------|
|
||||||
|
| `FUNC_SETTINGS_OVERRIDE` | Override default settings | Before settings load | None |
|
||||||
|
| `FUNC_SETUP_RING1` | Early setup phase 1 | System initialization | None |
|
||||||
|
| `FUNC_SETUP_RING2` | Early setup phase 2 | System initialization | None |
|
||||||
|
| `FUNC_PRE_INIT` | Pre-initialization | Before main init | None |
|
||||||
|
| `FUNC_INIT` | Initialize driver/sensor | Once at startup | None |
|
||||||
|
| `FUNC_ACTIVE` | Check if driver is active | Status queries | None |
|
||||||
|
| `FUNC_ABOUT_TO_RESTART` | Prepare for restart | Before system restart | None |
|
||||||
|
|
||||||
|
#### Loop and Timing Callbacks
|
||||||
|
|
||||||
|
| Function | Purpose | Frequency | Parameters |
|
||||||
|
|----------|---------|-----------|-----------|
|
||||||
|
| `FUNC_LOOP` | Main loop processing | Every loop cycle (~1ms) | None |
|
||||||
|
| `FUNC_SLEEP_LOOP` | Sleep mode processing | During sleep cycles | None |
|
||||||
|
| `FUNC_EVERY_50_MSECOND` | Fast polling operations | Every 50ms | None |
|
||||||
|
| `FUNC_EVERY_100_MSECOND` | Medium polling | Every 100ms | None |
|
||||||
|
| `FUNC_EVERY_200_MSECOND` | Slower polling | Every 200ms | None |
|
||||||
|
| `FUNC_EVERY_250_MSECOND` | Quarter second tasks | Every 250ms | None |
|
||||||
|
| `FUNC_EVERY_SECOND` | Regular updates | Every second | None |
|
||||||
|
|
||||||
|
#### Settings and Configuration Callbacks
|
||||||
|
|
||||||
|
| Function | Purpose | When Called | Parameters |
|
||||||
|
|----------|---------|-------------|-----------|
|
||||||
|
| `FUNC_RESET_SETTINGS` | Reset to defaults | Settings reset | None |
|
||||||
|
| `FUNC_RESTORE_SETTINGS` | Restore from backup | Settings restore | None |
|
||||||
|
| `FUNC_SAVE_SETTINGS` | Save current settings | Settings save | None |
|
||||||
|
| `FUNC_SAVE_AT_MIDNIGHT` | Midnight save operations | Daily at 00:00 | None |
|
||||||
|
| `FUNC_SAVE_BEFORE_RESTART` | Save critical data | Before restart | None |
|
||||||
|
|
||||||
|
#### Interrupt and System Control
|
||||||
|
|
||||||
|
| Function | Purpose | When Called | Parameters |
|
||||||
|
|----------|---------|-------------|-----------|
|
||||||
|
| `FUNC_INTERRUPT_STOP` | Stop interrupts | Before critical section | None |
|
||||||
|
| `FUNC_INTERRUPT_START` | Resume interrupts | After critical section | None |
|
||||||
|
| `FUNC_FREE_MEM` | Memory cleanup | Low memory conditions | None |
|
||||||
|
|
||||||
|
#### Telemetry and JSON Callbacks
|
||||||
|
|
||||||
|
| Function | Purpose | When Called | Parameters |
|
||||||
|
|----------|---------|-------------|-----------|
|
||||||
|
| `FUNC_AFTER_TELEPERIOD` | Post-telemetry cleanup | After TelePeriod | None |
|
||||||
|
| `FUNC_JSON_APPEND` | Add JSON telemetry | Every TelePeriod | None |
|
||||||
|
| `FUNC_TELEPERIOD_RULES_PROCESS` | Rules after telemetry | Post-TelePeriod | None |
|
||||||
|
|
||||||
|
#### Web Interface Callbacks
|
||||||
|
|
||||||
|
| Function | Purpose | When Called | Parameters |
|
||||||
|
|----------|---------|-------------|-----------|
|
||||||
|
| `FUNC_WEB_SENSOR` | Show sensor on web | Sensor page load | None |
|
||||||
|
| `FUNC_WEB_COL_SENSOR` | Column sensor display | Web page layout | None |
|
||||||
|
| `FUNC_WEB_ADD_BUTTON` | Add web buttons | Main page load | None |
|
||||||
|
| `FUNC_WEB_ADD_CONSOLE_BUTTON` | Add console button | Console page | None |
|
||||||
|
| `FUNC_WEB_ADD_MANAGEMENT_BUTTON` | Add config button | Config page | None |
|
||||||
|
| `FUNC_WEB_ADD_MAIN_BUTTON` | Add main menu button | Main page | None |
|
||||||
|
| `FUNC_WEB_GET_ARG` | Process web arguments | Form submission | None |
|
||||||
|
| `FUNC_WEB_ADD_HANDLER` | Add URL handlers | Web server init | None |
|
||||||
|
| `FUNC_WEB_STATUS_LEFT` | Left status column | Status page | None |
|
||||||
|
| `FUNC_WEB_STATUS_RIGHT` | Right status column | Status page | None |
|
||||||
|
|
||||||
|
#### MQTT and Communication Callbacks
|
||||||
|
|
||||||
|
| Function | Purpose | When Called | Parameters |
|
||||||
|
|----------|---------|-------------|-----------|
|
||||||
|
| `FUNC_MQTT_SUBSCRIBE` | Subscribe to MQTT topics | MQTT connect | None |
|
||||||
|
| `FUNC_MQTT_INIT` | Initialize MQTT | MQTT setup | None |
|
||||||
|
|
||||||
|
#### Power and Hardware Control
|
||||||
|
|
||||||
|
| Function | Purpose | When Called | Parameters |
|
||||||
|
|----------|---------|-------------|-----------|
|
||||||
|
| `FUNC_SET_POWER` | Handle power changes | Power state change | None |
|
||||||
|
| `FUNC_SHOW_SENSOR` | Display sensor data | Status request | None |
|
||||||
|
| `FUNC_ANY_KEY` | Handle any key press | Key event | None |
|
||||||
|
| `FUNC_LED_LINK` | Control link LED | Network state change | None |
|
||||||
|
| `FUNC_ENERGY_EVERY_SECOND` | Energy monitoring | Every second | None |
|
||||||
|
| `FUNC_ENERGY_RESET` | Reset energy counters | Reset command | None |
|
||||||
|
|
||||||
|
#### Advanced System Callbacks
|
||||||
|
|
||||||
|
| Function | Purpose | When Called | Parameters |
|
||||||
|
|----------|---------|-------------|-----------|
|
||||||
|
| `FUNC_SET_SCHEME` | Set color scheme | Theme change | None |
|
||||||
|
| `FUNC_HOTPLUG_SCAN` | Scan for hotplug devices | Device detection | None |
|
||||||
|
| `FUNC_TIME_SYNCED` | Time synchronization | NTP sync complete | None |
|
||||||
|
| `FUNC_DEVICE_GROUP_ITEM` | Device group processing | Group operations | None |
|
||||||
|
| `FUNC_NETWORK_UP` | Network connected | WiFi/Ethernet up | None |
|
||||||
|
| `FUNC_NETWORK_DOWN` | Network disconnected | WiFi/Ethernet down | None |
|
||||||
|
|
||||||
|
#### Callback Functions WITH Return Results (ID >= 200)
|
||||||
|
|
||||||
|
These functions are expected to return boolean results:
|
||||||
|
|
||||||
|
| Function | Purpose | When Called | Return Value |
|
||||||
|
|----------|---------|-------------|--------------|
|
||||||
|
| `FUNC_PIN_STATE` | GPIO state query | Pin state check | true if handled |
|
||||||
|
| `FUNC_MODULE_INIT` | Module initialization | Module setup | true if success |
|
||||||
|
| `FUNC_ADD_BUTTON` | Add button handler | Button config | true if added |
|
||||||
|
| `FUNC_ADD_SWITCH` | Add switch handler | Switch config | true if added |
|
||||||
|
| `FUNC_BUTTON_PRESSED` | Handle button press | Button event | true if handled |
|
||||||
|
| `FUNC_BUTTON_MULTI_PRESSED` | Multi-button press | Button combo | true if handled |
|
||||||
|
| `FUNC_SET_DEVICE_POWER` | Device power control | Power command | true if handled |
|
||||||
|
| `FUNC_MQTT_DATA` | Process MQTT data | MQTT message | true if handled |
|
||||||
|
| `FUNC_SERIAL` | Serial data processing | Serial input | true if handled |
|
||||||
|
| `FUNC_COMMAND` | Process commands | Command received | true if handled |
|
||||||
|
| `FUNC_COMMAND_SENSOR` | Sensor commands | Sensor command | true if handled |
|
||||||
|
| `FUNC_COMMAND_DRIVER` | Driver commands | Driver command | true if handled |
|
||||||
|
| `FUNC_RULES_PROCESS` | Process rules | Rule evaluation | true if handled |
|
||||||
|
| `FUNC_SET_CHANNELS` | Set PWM channels | Channel update | true if handled |
|
||||||
|
|
||||||
|
#### Callback Implementation Pattern
|
||||||
|
|
||||||
|
```c
|
||||||
|
bool Xdrv_XX(uint8_t function) {
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
switch (function) {
|
||||||
|
case FUNC_INIT:
|
||||||
|
MyDriverInit();
|
||||||
|
break;
|
||||||
|
case FUNC_EVERY_SECOND:
|
||||||
|
MyDriverEverySecond();
|
||||||
|
break;
|
||||||
|
case FUNC_COMMAND:
|
||||||
|
result = MyDriverCommand();
|
||||||
|
break;
|
||||||
|
case FUNC_JSON_APPEND:
|
||||||
|
MyDriverJsonAppend();
|
||||||
|
break;
|
||||||
|
case FUNC_WEB_SENSOR:
|
||||||
|
MyDriverWebSensor();
|
||||||
|
break;
|
||||||
|
case FUNC_SAVE_BEFORE_RESTART:
|
||||||
|
MyDriverSaveSettings();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
### I2C Development
|
||||||
|
|
||||||
|
```c
|
||||||
|
// I2C Helper Functions
|
||||||
|
bool I2cValidRead8(uint8_t *data, uint8_t addr, uint8_t reg);
|
||||||
|
bool I2cValidRead16(uint16_t *data, uint8_t addr, uint8_t reg);
|
||||||
|
uint8_t I2cRead8(uint8_t addr, uint8_t reg);
|
||||||
|
uint16_t I2cRead16(uint8_t addr, uint8_t reg);
|
||||||
|
bool I2cWrite8(uint8_t addr, uint8_t reg, uint8_t val);
|
||||||
|
|
||||||
|
// Device Detection Pattern
|
||||||
|
void MySensorDetect(void) {
|
||||||
|
if (MySensorDetected) return;
|
||||||
|
|
||||||
|
for (uint8_t i = 0; i < SENSOR_MAX_ADDR; i++) {
|
||||||
|
uint8_t addr = SENSOR_BASE_ADDR + i;
|
||||||
|
if (I2cValidRead8(&sensor_id, addr, SENSOR_ID_REG)) {
|
||||||
|
if (sensor_id == EXPECTED_ID) {
|
||||||
|
MySensorDetected = true;
|
||||||
|
AddLog(LOG_LEVEL_INFO, PSTR("MySensor found at 0x%02X"), addr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Scripting and Automation
|
||||||
|
|
||||||
|
### Rules System
|
||||||
|
|
||||||
|
Rules provide event-driven automation:
|
||||||
|
|
||||||
|
```
|
||||||
|
Rule1 ON Switch1#State DO Power1 %value% ENDON
|
||||||
|
ON Time#Minute=30 DO Publish stat/topic/alert {"time":"30min"} ENDON
|
||||||
|
```
|
||||||
|
|
||||||
|
### Berry Scripting (ESP32)
|
||||||
|
|
||||||
|
Berry is a modern scripting language for advanced automation:
|
||||||
|
|
||||||
|
```berry
|
||||||
|
# Simple sensor reading
|
||||||
|
import json
|
||||||
|
|
||||||
|
def read_sensor()
|
||||||
|
var temp = tasmota.read_sensors()
|
||||||
|
if temp.contains("Temperature")
|
||||||
|
print("Current temperature:", temp["Temperature"])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Set up timer
|
||||||
|
tasmota.set_timer(5000, read_sensor)
|
||||||
|
|
||||||
|
# Web interface extension
|
||||||
|
def web_add_button()
|
||||||
|
webserver.content_send("<button onclick='la(\"&m_toggle=1\");'>Toggle</button>")
|
||||||
|
end
|
||||||
|
|
||||||
|
tasmota.add_driver(web_add_button)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Command Extensions
|
||||||
|
|
||||||
|
Add custom commands through Berry or C++:
|
||||||
|
|
||||||
|
```berry
|
||||||
|
def my_command(cmd, idx, payload)
|
||||||
|
if cmd == "MYCMD"
|
||||||
|
print("Custom command received:", payload)
|
||||||
|
tasmota.resp_cmnd_done()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
tasmota.add_cmd('MYCMD', my_command)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Complete Settings Structure Reference
|
||||||
|
|
||||||
|
### Settings Memory Layout
|
||||||
|
|
||||||
|
Tasmota uses a structured settings system stored in flash memory. The main settings structure is defined in `settings.h`:
|
||||||
|
|
||||||
|
```c
|
||||||
|
typedef struct {
|
||||||
|
unsigned long cfg_holder; // 000 v6.0.0a
|
||||||
|
unsigned long save_flag; // 004
|
||||||
|
unsigned long version; // 008
|
||||||
|
unsigned short flag; // 00C
|
||||||
|
unsigned short save_data; // 00E
|
||||||
|
int8_t timezone; // 010
|
||||||
|
char ota_url[101]; // 011
|
||||||
|
char mqtt_prefix[3][11]; // 076
|
||||||
|
char serial_delimiter; // 09D
|
||||||
|
uint8_t seriallog_level; // 09E
|
||||||
|
uint8_t sta_config; // 09F
|
||||||
|
char sta_ssid[2][33]; // 0A0
|
||||||
|
char sta_pwd[2][65]; // 102
|
||||||
|
char hostname[33]; // 183
|
||||||
|
char syslog_host[33]; // 1A4
|
||||||
|
uint16_t syslog_port; // 1C5
|
||||||
|
uint8_t syslog_level; // 1C7
|
||||||
|
uint8_t webserver; // 1C8
|
||||||
|
uint8_t weblog_level; // 1C9
|
||||||
|
char mqtt_fingerprint[2][60]; // 1CA
|
||||||
|
char mqtt_host[33]; // 236
|
||||||
|
uint16_t mqtt_port; // 257
|
||||||
|
char mqtt_client[33]; // 259
|
||||||
|
char mqtt_user[33]; // 27A
|
||||||
|
char mqtt_pwd[33]; // 29B
|
||||||
|
char mqtt_topic[33]; // 2BC
|
||||||
|
char button_topic[33]; // 2DD
|
||||||
|
char mqtt_grptopic[33]; // 2FE
|
||||||
|
uint8_t display_model; // 31F
|
||||||
|
uint8_t display_mode; // 320
|
||||||
|
uint8_t display_refresh; // 321
|
||||||
|
uint8_t display_rows; // 322
|
||||||
|
uint8_t display_cols[2]; // 323
|
||||||
|
uint8_t display_address[8]; // 325
|
||||||
|
uint8_t display_dimmer; // 32D
|
||||||
|
uint8_t display_size; // 32E
|
||||||
|
uint16_t pwm_frequency; // 32F
|
||||||
|
power_t power; // 331
|
||||||
|
uint16_t pwm_value[MAX_PWMS]; // 335
|
||||||
|
int16_t altitude; // 345
|
||||||
|
uint16_t tele_period; // 347
|
||||||
|
uint8_t ledstate; // 349
|
||||||
|
uint8_t param[PARAM_MAX]; // 34A
|
||||||
|
int16_t toffset[2]; // 35A
|
||||||
|
uint8_t display_font; // 35E
|
||||||
|
} Settings;
|
||||||
|
|
||||||
|
### ESP8266 Constraints
|
||||||
|
|
||||||
|
- **Flash**: 1MB total, ~500KB available for firmware
|
||||||
|
- **RAM**: 80KB total, ~25-30KB available for application
|
||||||
|
- **Stack**: 4KB maximum
|
||||||
|
|
||||||
|
### Optimization Techniques
|
||||||
|
|
||||||
|
1. **Use PROGMEM for constants**:
|
||||||
|
```c
|
||||||
|
const char MyString[] PROGMEM = "Constant string";
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Minimize dynamic allocation**:
|
||||||
|
```c
|
||||||
|
// Avoid
|
||||||
|
String result = String(value1) + "," + String(value2);
|
||||||
|
|
||||||
|
// Prefer
|
||||||
|
char result[32];
|
||||||
|
snprintf(result, sizeof(result), "%d,%d", value1, value2);
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Use flash-efficient data types**:
|
||||||
|
```c
|
||||||
|
// Use uint32_t instead of uint8_t for local variables
|
||||||
|
// Use uint8_t only in structs to save memory
|
||||||
|
```
|
||||||
|
|
||||||
|
## Communication Protocols
|
||||||
|
|
||||||
|
### Command Context Structure
|
||||||
|
|
||||||
|
All command handlers receive context through the global XdrvMailbox structure:
|
||||||
|
|
||||||
|
```c
|
||||||
|
struct XDRVMAILBOX {
|
||||||
|
bool grpflg; // Group flag
|
||||||
|
bool usridx; // User index flag
|
||||||
|
uint16_t command_code; // Command code
|
||||||
|
uint32_t index; // Command index
|
||||||
|
uint32_t data_len; // Parameter length
|
||||||
|
int32_t payload; // Numeric parameter
|
||||||
|
char *topic; // MQTT topic
|
||||||
|
char *data; // Command parameters
|
||||||
|
char *command; // Command name
|
||||||
|
} XdrvMailbox;
|
||||||
|
```
|
||||||
|
|
||||||
|
**Key Fields:**
|
||||||
|
- `command`: The command name (e.g., "Power", "Status")
|
||||||
|
- `data`: Raw parameter string
|
||||||
|
- `payload`: Numeric value of first parameter
|
||||||
|
- `data_len`: Length of parameter string
|
||||||
|
- `index`: Command index for numbered commands (Power1, Power2, etc.)
|
||||||
|
|
||||||
|
### MQTT Integration
|
||||||
|
|
||||||
|
```c
|
||||||
|
// Publish sensor data
|
||||||
|
void PublishSensorData(void) {
|
||||||
|
Response_P(PSTR("{\"MySensor\":{\"Value\":%d}}"), sensor_value);
|
||||||
|
MqttPublishTeleSensor();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Subscribe to commands
|
||||||
|
bool MyCommand(void) {
|
||||||
|
if (XdrvMailbox.data_len > 0) {
|
||||||
|
// Process command
|
||||||
|
ResponseCmndDone();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
ResponseCmndNumber(current_value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Web Interface Extensions
|
||||||
|
|
||||||
|
```c
|
||||||
|
#ifdef USE_WEBSERVER
|
||||||
|
void MySensorWebShow(void) {
|
||||||
|
WSContentSend_PD(PSTR(
|
||||||
|
"{s}MySensor Temperature{m}%d°C{e}"
|
||||||
|
"{s}MySensor Humidity{m}%d%%{e}"),
|
||||||
|
temperature, humidity);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
```
|
||||||
|
|
||||||
|
## Advanced Features
|
||||||
|
|
||||||
|
### Template System
|
||||||
|
|
||||||
|
Templates define device GPIO configurations:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"NAME":"Custom Device",
|
||||||
|
"GPIO":[416,0,418,0,417,2720,0,0,2624,32,2656,224,0,0],
|
||||||
|
"FLAG":0,
|
||||||
|
"BASE":45
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Matter Protocol Support
|
||||||
|
|
||||||
|
For ESP32 devices, Matter provides standardized IoT communication:
|
||||||
|
|
||||||
|
```c
|
||||||
|
// Matter endpoint configuration
|
||||||
|
matter.add_endpoint(1, 0x0100); // On/Off Light
|
||||||
|
matter.add_endpoint(2, 0x0106); // Light with dimming
|
||||||
|
```
|
||||||
|
|
||||||
|
### Display Integration
|
||||||
|
|
||||||
|
Universal Display Driver supports 50+ display types:
|
||||||
|
|
||||||
|
```
|
||||||
|
DisplayModel 1 # Select display type
|
||||||
|
DisplayMode 1 # Text mode
|
||||||
|
DisplayText [s1l1]Hello World
|
||||||
|
```
|
||||||
|
|
||||||
|
## Testing and Debugging
|
||||||
|
|
||||||
|
### Debug Options
|
||||||
|
|
||||||
|
Enable debugging in `user_config_override.h`:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define DEBUG_TASMOTA_CORE
|
||||||
|
#define DEBUG_TASMOTA_DRIVER
|
||||||
|
#define USE_DEBUG_DRIVER
|
||||||
|
```
|
||||||
|
|
||||||
|
### Serial Debugging
|
||||||
|
|
||||||
|
```c
|
||||||
|
AddLog(LOG_LEVEL_INFO, PSTR("Debug: value=%d"), value);
|
||||||
|
AddLog(LOG_LEVEL_DEBUG, PSTR("Detailed info: %s"), info_string);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Memory Monitoring
|
||||||
|
|
||||||
|
```c
|
||||||
|
// Check free heap
|
||||||
|
uint32_t free_heap = ESP.getFreeHeap();
|
||||||
|
AddLog(LOG_LEVEL_DEBUG, PSTR("Free heap: %d"), free_heap);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Best Practices
|
||||||
|
|
||||||
|
### Code Organization
|
||||||
|
|
||||||
|
1. **Use consistent naming**: `MySensor` prefix for all functions
|
||||||
|
2. **Follow callback patterns**: Implement standard driver callbacks
|
||||||
|
3. **Handle errors gracefully**: Check return values and sensor presence
|
||||||
|
4. **Document thoroughly**: Include usage examples and pin assignments
|
||||||
|
|
||||||
|
### Performance Considerations
|
||||||
|
|
||||||
|
1. **Minimize blocking operations**: Use state machines for long operations
|
||||||
|
2. **Cache sensor readings**: Don't read sensors more often than necessary
|
||||||
|
3. **Use appropriate data types**: Consider memory usage vs. precision
|
||||||
|
4. **Optimize for common cases**: Fast path for normal operations
|
||||||
|
|
||||||
|
### Security Guidelines
|
||||||
|
|
||||||
|
1. **Validate all inputs**: Check command parameters and sensor data
|
||||||
|
2. **Use secure defaults**: Enable security features by default
|
||||||
|
3. **Minimize attack surface**: Disable unused network services
|
||||||
|
4. **Regular updates**: Keep firmware and dependencies current
|
||||||
|
|
||||||
|
## Integration Examples
|
||||||
|
|
||||||
|
### Home Assistant Discovery
|
||||||
|
|
||||||
|
```c
|
||||||
|
void PublishDiscovery(void) {
|
||||||
|
Response_P(PSTR("{"
|
||||||
|
"\"name\":\"%s MySensor\","
|
||||||
|
"\"stat_t\":\"%s\","
|
||||||
|
"\"unit_of_meas\":\"°C\","
|
||||||
|
"\"dev_cla\":\"temperature\""
|
||||||
|
"}"), SettingsText(SET_DEVICENAME), GetStateTopic());
|
||||||
|
|
||||||
|
MqttPublish(GetDiscoveryTopic("sensor", "temperature"), true);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Custom Web Interface
|
||||||
|
|
||||||
|
```c
|
||||||
|
const char HTTP_MYSENSOR[] PROGMEM =
|
||||||
|
"{s}MySensor{m}"
|
||||||
|
"<input type='range' min='0' max='100' value='%d' "
|
||||||
|
"onchange='la(\"&mysensor_val=\"+this.value);'>"
|
||||||
|
"{e}";
|
||||||
|
|
||||||
|
void MySensorWebShow(void) {
|
||||||
|
WSContentSend_PD(HTTP_MYSENSOR, current_value);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This guide provides the foundation for understanding and extending Tasmota. The modular architecture, standardized APIs, and extensive documentation make it an excellent platform for IoT development, whether you're adding simple sensor support or implementing complex automation systems.
|
||||||
|
|
||||||
|
## Complete Command Reference
|
||||||
|
|
||||||
|
### Core System Commands
|
||||||
|
|
||||||
|
| Command | Parameters | Description | Example |
|
||||||
|
|---------|------------|-------------|---------|
|
||||||
|
| `Status` | 0-11 | System status information | `Status 0` |
|
||||||
|
| `Reset` | 1-6 | Reset device with options | `Reset 1` |
|
||||||
|
| `Restart` | 1 | Restart device | `Restart 1` |
|
||||||
|
| `Upgrade` | 1 | Start OTA upgrade | `Upgrade 1` |
|
||||||
|
| `Upload` | 1 | Start file upload | `Upload 1` |
|
||||||
|
| `Otaurl` | url | Set OTA URL | `Otaurl http://ota.server/firmware.bin` |
|
||||||
|
| `Seriallog` | 0-4 | Set serial log level | `Seriallog 2` |
|
||||||
|
| `Syslog` | 0-4 | Set syslog level | `Syslog 2` |
|
||||||
|
| `Loghost` | hostname | Set syslog host | `Loghost 192.168.1.100` |
|
||||||
|
| `Logport` | port | Set syslog port | `Logport 514` |
|
||||||
|
| `Ipaddress` | x.x.x.x | Set IP address | `Ipaddress 192.168.1.100` |
|
||||||
|
| `Gateway` | x.x.x.x | Set gateway | `Gateway 192.168.1.1` |
|
||||||
|
| `Subnetmask` | x.x.x.x | Set subnet mask | `Subnetmask 255.255.255.0` |
|
||||||
|
| `Dnsserver` | x.x.x.x | Set DNS server | `Dnsserver 8.8.8.8` |
|
||||||
|
| `Mac` | - | Show MAC address | `Mac` |
|
||||||
|
| `Hostname` | name | Set hostname | `Hostname tasmota-device` |
|
||||||
|
|
||||||
|
### WiFi Commands
|
||||||
|
|
||||||
|
| Command | Parameters | Description | Example |
|
||||||
|
|---------|------------|-------------|---------|
|
||||||
|
| `Ssid1` | ssid | Set WiFi SSID 1 | `Ssid1 MyNetwork` |
|
||||||
|
| `Ssid2` | ssid | Set WiFi SSID 2 | `Ssid2 BackupNetwork` |
|
||||||
|
| `Password1` | password | Set WiFi password 1 | `Password1 MyPassword` |
|
||||||
|
| `Password2` | password | Set WiFi password 2 | `Password2 BackupPassword` |
|
||||||
|
| `Ap` | 0-2 | Set AP mode | `Ap 1` |
|
||||||
|
| `WebServer` | 0-2 | Enable web server | `WebServer 1` |
|
||||||
|
| `WebPassword` | password | Set web password | `WebPassword admin` |
|
||||||
|
| `WifiConfig` | 0-7 | WiFi configuration mode | `WifiConfig 4` |
|
||||||
|
|
||||||
|
### MQTT Commands
|
||||||
|
|
||||||
|
| Command | Parameters | Description | Example |
|
||||||
|
|---------|------------|-------------|---------|
|
||||||
|
| `MqttHost` | hostname | Set MQTT broker | `MqttHost 192.168.1.100` |
|
||||||
|
| `MqttPort` | port | Set MQTT port | `MqttPort 1883` |
|
||||||
|
| `MqttUser` | username | Set MQTT username | `MqttUser myuser` |
|
||||||
|
| `MqttPassword` | password | Set MQTT password | `MqttPassword mypass` |
|
||||||
|
| `MqttClient` | clientid | Set MQTT client ID | `MqttClient tasmota-device` |
|
||||||
|
| `Topic` | topic | Set MQTT topic | `Topic tasmota` |
|
||||||
|
| `GroupTopic` | topic | Set group topic | `GroupTopic tasmotas` |
|
||||||
|
| `FullTopic` | template | Set full topic template | `FullTopic %prefix%/%topic%/` |
|
||||||
|
| `Prefix1` | prefix | Set command prefix | `Prefix1 cmnd` |
|
||||||
|
| `Prefix2` | prefix | Set status prefix | `Prefix2 stat` |
|
||||||
|
| `Prefix3` | prefix | Set telemetry prefix | `Prefix3 tele` |
|
||||||
|
| `Publish` | topic payload | Publish MQTT message | `Publish stat/topic/test Hello` |
|
||||||
|
| `MqttRetry` | seconds | Set MQTT retry time | `MqttRetry 10` |
|
||||||
|
| `StateText1` | text | Set OFF state text | `StateText1 OFF` |
|
||||||
|
| `StateText2` | text | Set ON state text | `StateText2 ON` |
|
||||||
|
| `StateText3` | text | Set TOGGLE state text | `StateText3 TOGGLE` |
|
||||||
|
| `StateText4` | text | Set HOLD state text | `StateText4 HOLD` |
|
||||||
|
|
||||||
|
### Power and Relay Commands
|
||||||
|
|
||||||
|
| Command | Parameters | Description | Example |
|
||||||
|
|---------|------------|-------------|---------|
|
||||||
|
| `Power` | 0/1/2 | Control main power | `Power 1` |
|
||||||
|
| `Power1` | 0/1/2 | Control power 1 | `Power1 ON` |
|
||||||
|
| `Power2` | 0/1/2 | Control power 2 | `Power2 OFF` |
|
||||||
|
| `Power3` | 0/1/2 | Control power 3 | `Power3 TOGGLE` |
|
||||||
|
| `Power4` | 0/1/2 | Control power 4 | `Power4 1` |
|
||||||
|
| `PowerOnState` | 0-4 | Set power on state | `PowerOnState 1` |
|
||||||
|
| `PulseTime` | 1-111 | Set pulse time | `PulseTime1 10` |
|
||||||
|
| `BlinkTime` | 2-3600 | Set blink time | `BlinkTime 10` |
|
||||||
|
| `BlinkCount` | 0-32000 | Set blink count | `BlinkCount 5` |
|
||||||
|
| `Interlock` | 0/1 | Enable interlock | `Interlock 1` |
|
||||||
|
| `Ledstate` | 0-8 | Set LED state | `Ledstate 1` |
|
||||||
|
| `LedPower` | 0-2 | Control LED power | `LedPower 1` |
|
||||||
|
| `LedMask` | hex | Set LED mask | `LedMask 0xFF00` |
|
||||||
|
|
||||||
|
### Sensor Commands
|
||||||
|
|
||||||
|
| Command | Parameters | Description | Example |
|
||||||
|
|---------|------------|-------------|---------|
|
||||||
|
| `TelePeriod` | 10-3600 | Set telemetry period | `TelePeriod 300` |
|
||||||
|
| `Resolution` | 0-3 | Set sensor resolution | `Resolution 2` |
|
||||||
|
| `HumRes` | 0-3 | Set humidity resolution | `HumRes 1` |
|
||||||
|
| `TempRes` | 0-3 | Set temperature resolution | `TempRes 2` |
|
||||||
|
| `PressRes` | 0-3 | Set pressure resolution | `PressRes 1` |
|
||||||
|
| `EnergyRes` | 0-5 | Set energy resolution | `EnergyRes 3` |
|
||||||
|
| `SpeedUnit` | 1-4 | Set speed unit | `SpeedUnit 1` |
|
||||||
|
| `WeightRes` | 0-3 | Set weight resolution | `WeightRes 2` |
|
||||||
|
| `FreqRes` | 0-3 | Set frequency resolution | `FreqRes 2` |
|
||||||
|
|
||||||
|
### Timer Commands
|
||||||
|
|
||||||
|
| Command | Parameters | Description | Example |
|
||||||
|
|---------|------------|-------------|---------|
|
||||||
|
| `Timer1` | parameters | Configure timer 1 | `Timer1 {"Enable":1,"Time":"06:00","Days":"1111100","Repeat":1,"Action":1}` |
|
||||||
|
| `Timer2` | parameters | Configure timer 2 | `Timer2 {"Enable":1,"Time":"22:00","Action":0}` |
|
||||||
|
| `Timers` | 0/1 | Enable/disable timers | `Timers 1` |
|
||||||
|
| `Latitude` | degrees | Set latitude | `Latitude 52.520008` |
|
||||||
|
| `Longitude` | degrees | Set longitude | `Longitude 13.404954` |
|
||||||
|
| `Sunrise` | - | Show sunrise time | `Sunrise` |
|
||||||
|
| `Sunset` | - | Show sunset time | `Sunset` |
|
||||||
|
|
||||||
|
### GPIO and Template Commands
|
||||||
|
|
||||||
|
| Command | Parameters | Description | Example |
|
||||||
|
|---------|------------|-------------|---------|
|
||||||
|
| `Gpio` | pin,function | Set GPIO function | `Gpio 14,21` |
|
||||||
|
| `Gpios` | - | Show GPIO configuration | `Gpios` |
|
||||||
|
| `Template` | json | Set device template | `Template {"NAME":"Generic","GPIO":[255,255,255,255,255,255,255,255,255,255,255,255,255],"FLAG":1,"BASE":18}` |
|
||||||
|
| `Module` | 0-255 | Set device module | `Module 1` |
|
||||||
|
| `Modules` | - | Show available modules | `Modules` |
|
||||||
|
| `I2CScan` | - | Scan I2C bus | `I2CScan` |
|
||||||
|
| `I2CDriver` | driver | Enable I2C driver | `I2CDriver10 1` |
|
||||||
|
|
||||||
|
### Display Commands
|
||||||
|
|
||||||
|
| Command | Parameters | Description | Example |
|
||||||
|
|---------|------------|-------------|---------|
|
||||||
|
| `Display` | - | Show display info | `Display` |
|
||||||
|
| `DisplayModel` | 1-16 | Set display model | `DisplayModel 2` |
|
||||||
|
| `DisplayMode` | 0-5 | Set display mode | `DisplayMode 1` |
|
||||||
|
| `DisplayDimmer` | 0-100 | Set display brightness | `DisplayDimmer 50` |
|
||||||
|
| `DisplaySize` | 1-4 | Set display size | `DisplaySize 2` |
|
||||||
|
| `DisplayRotate` | 0-3 | Set display rotation | `DisplayRotate 2` |
|
||||||
|
| `DisplayText` | text | Display text | `DisplayText [s1l1]Hello World` |
|
||||||
|
| `DisplayClear` | - | Clear display | `DisplayClear` |
|
||||||
|
|
||||||
|
### Rule Commands
|
||||||
|
|
||||||
|
| Command | Parameters | Description | Example |
|
||||||
|
|---------|------------|-------------|---------|
|
||||||
|
| `Rule1` | rule | Set rule 1 | `Rule1 ON Switch1#State DO Power1 %value% ENDON` |
|
||||||
|
| `Rule2` | rule | Set rule 2 | `Rule2 ON Time#Minute=30 DO Publish stat/alert 30min ENDON` |
|
||||||
|
| `Rule3` | rule | Set rule 3 | `Rule3 ON Button1#State DO Backlog Power1 TOGGLE; Delay 10; Power2 TOGGLE ENDON` |
|
||||||
|
| `RuleTimer1` | 0-3600 | Set rule timer 1 | `RuleTimer1 60` |
|
||||||
|
| `RuleTimer2` | 0-3600 | Set rule timer 2 | `RuleTimer2 120` |
|
||||||
|
| `Mem1` | value | Set memory 1 | `Mem1 Hello` |
|
||||||
|
| `Mem2` | value | Set memory 2 | `Mem2 World` |
|
||||||
|
| `Var1` | value | Set variable 1 | `Var1 42` |
|
||||||
|
| `Var2` | value | Set variable 2 | `Var2 3.14` |
|
||||||
|
| `CalcRes` | 0-7 | Set calculation resolution | `CalcRes 2` |
|
||||||
|
|
||||||
|
### Berry Script Commands (ESP32)
|
||||||
|
|
||||||
|
| Command | Parameters | Description | Example |
|
||||||
|
|---------|------------|-------------|---------|
|
||||||
|
| `Br` | code | Execute Berry code | `Br print("Hello")` |
|
||||||
|
| `BrLoad` | filename | Load Berry file | `BrLoad autoexec.be` |
|
||||||
|
| `BrRun` | filename | Run Berry file | `BrRun script.be` |
|
||||||
|
| `BrRestart` | - | Restart Berry VM | `BrRestart` |
|
||||||
|
|
||||||
|
### Energy Monitoring Commands
|
||||||
|
|
||||||
|
| Command | Parameters | Description | Example |
|
||||||
|
|---------|------------|-------------|---------|
|
||||||
|
| `PowerCal` | value | Calibrate power | `PowerCal 12530` |
|
||||||
|
| `VoltageCal` | value | Calibrate voltage | `VoltageCal 1950` |
|
||||||
|
| `CurrentCal` | value | Calibrate current | `CurrentCal 3500` |
|
||||||
|
| `PowerSet` | watts | Set power reading | `PowerSet 100` |
|
||||||
|
| `VoltageSet` | volts | Set voltage reading | `VoltageSet 230` |
|
||||||
|
| `CurrentSet` | amps | Set current reading | `CurrentSet 0.43` |
|
||||||
|
| `FrequencySet` | hz | Set frequency reading | `FrequencySet 50` |
|
||||||
|
| `EnergyReset1` | kWh | Reset energy total | `EnergyReset1 0` |
|
||||||
|
| `EnergyReset2` | kWh | Reset energy yesterday | `EnergyReset2 0` |
|
||||||
|
| `EnergyReset3` | kWh | Reset energy today | `EnergyReset3 0` |
|
||||||
|
| `MaxPower` | watts | Set max power | `MaxPower 3500` |
|
||||||
|
| `MaxPowerHold` | seconds | Set max power hold | `MaxPowerHold 10` |
|
||||||
|
| `MaxPowerWindow` | seconds | Set max power window | `MaxPowerWindow 30` |
|
||||||
|
| `SafePower` | watts | Set safe power | `SafePower 3000` |
|
||||||
|
| `SafePowerHold` | seconds | Set safe power hold | `SafePowerHold 10` |
|
||||||
|
| `SafePowerWindow` | seconds | Set safe power window | `SafePowerWindow 30` |
|
||||||
|
|
||||||
|
## Complete Logging and Debug Reference
|
||||||
|
|
||||||
|
### Log Levels
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define LOG_LEVEL_NONE 0 // No logging
|
||||||
|
#define LOG_LEVEL_ERROR 1 // Critical errors only
|
||||||
|
#define LOG_LEVEL_INFO 2 // Errors and info
|
||||||
|
#define LOG_LEVEL_DEBUG 3 // Errors, info and debug
|
||||||
|
#define LOG_LEVEL_DEBUG_MORE 4 // All logging
|
||||||
|
```
|
||||||
|
|
||||||
|
### Logging Functions
|
||||||
|
|
||||||
|
```c
|
||||||
|
// Main logging function
|
||||||
|
void AddLog(uint32_t loglevel, const char* formatP, ...);
|
||||||
|
|
||||||
|
// Convenience macros
|
||||||
|
#define AddLog_P(loglevel, formatP, ...) AddLog(loglevel, PSTR(formatP), ##__VA_ARGS__)
|
||||||
|
#define AddLog_P2(loglevel, formatP, ...) AddLog(loglevel, formatP, ##__VA_ARGS__)
|
||||||
|
|
||||||
|
// Debug logging (only in debug builds)
|
||||||
|
#ifdef DEBUG_TASMOTA_CORE
|
||||||
|
#define DEBUG_CORE_LOG(...) AddLog(__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define DEBUG_CORE_LOG(...)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_TASMOTA_DRIVER
|
||||||
|
#define DEBUG_DRIVER_LOG(...) AddLog(__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define DEBUG_DRIVER_LOG(...)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_TASMOTA_SENSOR
|
||||||
|
#define DEBUG_SENSOR_LOG(...) AddLog(__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define DEBUG_SENSOR_LOG(...)
|
||||||
|
#endif
|
||||||
|
```
|
||||||
|
|
||||||
|
### Debug Build Options
|
||||||
|
|
||||||
|
```c
|
||||||
|
// Enable in user_config_override.h for debugging
|
||||||
|
#define DEBUG_TASMOTA_CORE // Core system debugging
|
||||||
|
#define DEBUG_TASMOTA_DRIVER // Driver debugging
|
||||||
|
#define DEBUG_TASMOTA_SENSOR // Sensor debugging
|
||||||
|
#define USE_DEBUG_DRIVER // Enable debug driver
|
||||||
|
#define DEBUG_TASMOTA_PORT Serial // Debug output port
|
||||||
|
```
|
||||||
|
|
||||||
|
### Memory Debugging
|
||||||
|
|
||||||
|
```c
|
||||||
|
// Memory monitoring functions
|
||||||
|
uint32_t ESP_getFreeHeap(void);
|
||||||
|
uint32_t ESP_getMaxAllocHeap(void);
|
||||||
|
uint8_t ESP_getHeapFragmentation(void);
|
||||||
|
uint32_t ESP_getFreeContStack(void);
|
||||||
|
|
||||||
|
// Memory debugging macros
|
||||||
|
#define SHOW_FREE_MEM(x) AddLog(LOG_LEVEL_DEBUG, PSTR(x " free mem: %d"), ESP_getFreeHeap())
|
||||||
|
#define CHECK_OOM() if (ESP_getFreeHeap() < 1000) AddLog(LOG_LEVEL_ERROR, PSTR("Low memory: %d"), ESP_getFreeHeap())
|
||||||
|
```
|
||||||
|
|
||||||
|
## Complete I2C Reference
|
||||||
|
|
||||||
|
### I2C Configuration
|
||||||
|
|
||||||
|
```c
|
||||||
|
// I2C pins (can be changed via GPIO configuration)
|
||||||
|
#define I2C_SDA_PIN 4 // Default SDA pin
|
||||||
|
#define I2C_SCL_PIN 5 // Default SCL pin
|
||||||
|
|
||||||
|
// I2C speeds
|
||||||
|
#define I2C_SPEED_SLOW 50000 // 50kHz
|
||||||
|
#define I2C_SPEED_STANDARD 100000 // 100kHz
|
||||||
|
#define I2C_SPEED_FAST 400000 // 400kHz
|
||||||
|
#define I2C_SPEED_FAST_PLUS 1000000 // 1MHz
|
||||||
|
```
|
||||||
|
|
||||||
|
### I2C Helper Functions
|
||||||
|
|
||||||
|
```c
|
||||||
|
// Basic I2C operations
|
||||||
|
bool I2cValidRead(uint8_t addr, uint8_t reg, uint8_t size);
|
||||||
|
bool I2cValidRead8(uint8_t *data, uint8_t addr, uint8_t reg);
|
||||||
|
bool I2cValidRead16(uint16_t *data, uint8_t addr, uint8_t reg);
|
||||||
|
bool I2cValidRead16LE(uint16_t *data, uint8_t addr, uint8_t reg);
|
||||||
|
bool I2cValidRead24(int32_t *data, uint8_t addr, uint8_t reg);
|
||||||
|
bool I2cValidReadS32(int32_t *data, uint8_t addr, uint8_t reg);
|
||||||
|
bool I2cValidReadS32_LE(int32_t *data, uint8_t addr, uint8_t reg);
|
||||||
|
|
||||||
|
uint8_t I2cRead8(uint8_t addr, uint8_t reg);
|
||||||
|
uint16_t I2cRead16(uint8_t addr, uint8_t reg);
|
||||||
|
uint16_t I2cRead16LE(uint8_t addr, uint8_t reg);
|
||||||
|
int32_t I2cRead24(uint8_t addr, uint8_t reg);
|
||||||
|
int32_t I2cReadS32(uint8_t addr, uint8_t reg);
|
||||||
|
int32_t I2cReadS32_LE(uint8_t addr, uint8_t reg);
|
||||||
|
|
||||||
|
bool I2cWrite8(uint8_t addr, uint8_t reg, uint8_t val);
|
||||||
|
bool I2cWrite16(uint8_t addr, uint8_t reg, uint16_t val);
|
||||||
|
bool I2cWrite16LE(uint8_t addr, uint8_t reg, uint16_t val);
|
||||||
|
|
||||||
|
// Buffer operations
|
||||||
|
uint8_t I2cReadBuffer(uint8_t addr, uint8_t reg, uint8_t *data, uint16_t len);
|
||||||
|
uint8_t I2cWriteBuffer(uint8_t addr, uint8_t reg, uint8_t *data, uint16_t len);
|
||||||
|
|
||||||
|
// Device detection
|
||||||
|
bool I2cActive(uint8_t addr);
|
||||||
|
void I2cScan(char *devs, unsigned int devs_len);
|
||||||
|
void I2cResetActive(uint8_t addr, uint8_t count = 1);
|
||||||
|
void I2cSetActive(uint8_t addr, uint8_t count = 1);
|
||||||
|
void I2cSetActiveFound(uint8_t addr, const char *types);
|
||||||
|
```
|
||||||
|
|
||||||
|
### I2C Device Detection Pattern
|
||||||
|
|
||||||
|
```c
|
||||||
|
void MySensorDetect(void) {
|
||||||
|
if (MySensorDetected) return;
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < SENSOR_MAX_ADDR; i++) {
|
||||||
|
uint8_t addr = SENSOR_BASE_ADDR + i;
|
||||||
|
if (I2cActive(addr)) continue; // Address already in use
|
||||||
|
|
||||||
|
if (I2cValidRead8(&sensor_id, addr, SENSOR_ID_REG)) {
|
||||||
|
if (sensor_id == EXPECTED_SENSOR_ID) {
|
||||||
|
I2cSetActiveFound(addr, "MySensor");
|
||||||
|
MySensorDetected = true;
|
||||||
|
MySensorAddress = addr;
|
||||||
|
AddLog(LOG_LEVEL_INFO, PSTR("MySensor found at address 0x%02X"), addr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This comprehensive developer reference provides all the essential information needed to understand, extend, and debug Tasmota firmware. The detailed callback system, complete command reference, GPIO configuration options, and debugging tools give developers everything needed to create robust IoT solutions.
|
2124
.doc_for_ai/TASMOTA_SUPPORT_DEEP_ANALYSIS.md
Normal file
2124
.doc_for_ai/TASMOTA_SUPPORT_DEEP_ANALYSIS.md
Normal file
File diff suppressed because it is too large
Load Diff
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -7,7 +7,7 @@
|
|||||||
- [ ] Only relevant files were touched
|
- [ ] Only relevant files were touched
|
||||||
- [ ] Only one feature/fix was added per PR and the code change compiles without warnings
|
- [ ] Only one feature/fix was added per PR and the code change compiles without warnings
|
||||||
- [ ] The code change is tested and works with Tasmota core ESP8266 V.2.7.8
|
- [ ] The code change is tested and works with Tasmota core ESP8266 V.2.7.8
|
||||||
- [ ] The code change is tested and works with Tasmota core ESP32 V.3.1.3.250411
|
- [ ] The code change is tested and works with Tasmota core ESP32 V.3.1.3.250707
|
||||||
- [ ] I accept the [CLA](https://github.com/arendst/Tasmota/blob/development/CONTRIBUTING.md#contributor-license-agreement-cla).
|
- [ ] I accept the [CLA](https://github.com/arendst/Tasmota/blob/development/CONTRIBUTING.md#contributor-license-agreement-cla).
|
||||||
|
|
||||||
_NOTE: The code change must pass CI tests. **Your PR cannot be merged unless tests pass**_
|
_NOTE: The code change must pass CI tests. **Your PR cannot be merged unless tests pass**_
|
||||||
|
40
.github/workflows/Tasmota_build_devel.yml
vendored
40
.github/workflows/Tasmota_build_devel.yml
vendored
@ -24,7 +24,7 @@ jobs:
|
|||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.13'
|
||||||
|
|
||||||
- name: Make Berry and Solidify code
|
- name: Make Berry and Solidify code
|
||||||
run: |
|
run: |
|
||||||
@ -61,7 +61,7 @@ jobs:
|
|||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.13'
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
pattern: berry
|
pattern: berry
|
||||||
@ -105,11 +105,11 @@ jobs:
|
|||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.13'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install wheel
|
pip install uv
|
||||||
pip install -U platformio
|
uv pip install --system platformio
|
||||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
cp ./platformio_override_sample.ini ./platformio_override.ini
|
||||||
- name: Add SHA to footer
|
- name: Add SHA to footer
|
||||||
run: |
|
run: |
|
||||||
@ -117,6 +117,9 @@ jobs:
|
|||||||
SHA=${COMMIT_SHA_LONG::7}
|
SHA=${COMMIT_SHA_LONG::7}
|
||||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
|
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
|
||||||
- name: Run PlatformIO
|
- name: Run PlatformIO
|
||||||
|
env:
|
||||||
|
PYTHONIOENCODING: utf-8
|
||||||
|
PYTHONUTF8: '1'
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
run: platformio run -e ${{ matrix.variant }}
|
||||||
#- name: Use esp32-solo1 safeboot for esp32 too
|
#- name: Use esp32-solo1 safeboot for esp32 too
|
||||||
#run: |
|
#run: |
|
||||||
@ -152,17 +155,20 @@ jobs:
|
|||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.13'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install wheel
|
pip install uv
|
||||||
pip install -U platformio
|
uv pip install --system platformio
|
||||||
- name: Add SHA to footer
|
- name: Add SHA to footer
|
||||||
run: |
|
run: |
|
||||||
COMMIT_SHA_LONG=$(git rev-parse --short HEAD || echo "")
|
COMMIT_SHA_LONG=$(git rev-parse --short HEAD || echo "")
|
||||||
SHA=${COMMIT_SHA_LONG::7}
|
SHA=${COMMIT_SHA_LONG::7}
|
||||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
|
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
|
||||||
- name: Run PlatformIO
|
- name: Run PlatformIO
|
||||||
|
env:
|
||||||
|
PYTHONIOENCODING: utf-8
|
||||||
|
PYTHONUTF8: '1'
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
run: platformio run -e ${{ matrix.variant }}
|
||||||
- name: Upload firmware artifacts
|
- name: Upload firmware artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@ -200,11 +206,11 @@ jobs:
|
|||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.13'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install wheel
|
pip install uv
|
||||||
pip install -U platformio
|
uv pip install --system platformio
|
||||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
cp ./platformio_override_sample.ini ./platformio_override.ini
|
||||||
- name: Download safeboot firmwares
|
- name: Download safeboot firmwares
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@ -221,6 +227,9 @@ jobs:
|
|||||||
SHA=${COMMIT_SHA_LONG::7}
|
SHA=${COMMIT_SHA_LONG::7}
|
||||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
|
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
|
||||||
- name: Run PlatformIO
|
- name: Run PlatformIO
|
||||||
|
env:
|
||||||
|
PYTHONIOENCODING: utf-8
|
||||||
|
PYTHONUTF8: '1'
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
run: platformio run -e ${{ matrix.variant }}
|
||||||
- name: Upload firmware artifacts
|
- name: Upload firmware artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@ -244,11 +253,11 @@ jobs:
|
|||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.13'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install wheel
|
pip install uv
|
||||||
pip install -U platformio
|
uv pip install --system platformio
|
||||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
cp ./platformio_override_sample.ini ./platformio_override.ini
|
||||||
- name: Download safeboot firmwares
|
- name: Download safeboot firmwares
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@ -265,6 +274,9 @@ jobs:
|
|||||||
SHA=${COMMIT_SHA_LONG::7}
|
SHA=${COMMIT_SHA_LONG::7}
|
||||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
|
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
|
||||||
- name: Run PlatformIO
|
- name: Run PlatformIO
|
||||||
|
env:
|
||||||
|
PYTHONIOENCODING: utf-8
|
||||||
|
PYTHONUTF8: '1'
|
||||||
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
|
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
|
||||||
- name: Upload language firmware artifacts
|
- name: Upload language firmware artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
36
.github/workflows/Tasmota_build_master.yml
vendored
36
.github/workflows/Tasmota_build_master.yml
vendored
@ -39,16 +39,19 @@ jobs:
|
|||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.13'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install wheel
|
pip install uv
|
||||||
pip install -U platformio
|
uv pip install --system platformio
|
||||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
cp ./platformio_override_sample.ini ./platformio_override.ini
|
||||||
- name: Add "release" to footer
|
- name: Add "release" to footer
|
||||||
run: |
|
run: |
|
||||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
|
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
|
||||||
- name: Run PlatformIO
|
- name: Run PlatformIO
|
||||||
|
env:
|
||||||
|
PYTHONIOENCODING: utf-8
|
||||||
|
PYTHONUTF8: '1'
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
run: platformio run -e ${{ matrix.variant }}
|
||||||
- name: Upload safeboot firmware artifacts
|
- name: Upload safeboot firmware artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@ -80,16 +83,19 @@ jobs:
|
|||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.13'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install wheel
|
pip install uv
|
||||||
pip install -U platformio
|
uv pip install --system platformio
|
||||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
cp ./platformio_override_sample.ini ./platformio_override.ini
|
||||||
- name: Add "release" to footer
|
- name: Add "release" to footer
|
||||||
run: |
|
run: |
|
||||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
|
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
|
||||||
- name: Run PlatformIO
|
- name: Run PlatformIO
|
||||||
|
env:
|
||||||
|
PYTHONIOENCODING: utf-8
|
||||||
|
PYTHONUTF8: '1'
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
run: platformio run -e ${{ matrix.variant }}
|
||||||
- name: Upload firmware artifacts
|
- name: Upload firmware artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@ -127,11 +133,11 @@ jobs:
|
|||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.13'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install wheel
|
pip install uv
|
||||||
pip install -U platformio
|
uv pip install --system platformio
|
||||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
cp ./platformio_override_sample.ini ./platformio_override.ini
|
||||||
- name: Download safeboot firmwares
|
- name: Download safeboot firmwares
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@ -146,6 +152,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
|
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
|
||||||
- name: Run PlatformIO
|
- name: Run PlatformIO
|
||||||
|
env:
|
||||||
|
PYTHONIOENCODING: utf-8
|
||||||
|
PYTHONUTF8: '1'
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
run: platformio run -e ${{ matrix.variant }}
|
||||||
- name: Upload firmware artifacts
|
- name: Upload firmware artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@ -169,11 +178,11 @@ jobs:
|
|||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.13'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install wheel
|
pip install uv
|
||||||
pip install -U platformio
|
uv pip install --system platformio
|
||||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
cp ./platformio_override_sample.ini ./platformio_override.ini
|
||||||
- name: Download safeboot firmwares
|
- name: Download safeboot firmwares
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@ -188,6 +197,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
|
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
|
||||||
- name: Run PlatformIO
|
- name: Run PlatformIO
|
||||||
|
env:
|
||||||
|
PYTHONIOENCODING: utf-8
|
||||||
|
PYTHONUTF8: '1'
|
||||||
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
|
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
|
||||||
- name: Upload language firmware artifacts
|
- name: Upload language firmware artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
50
.github/workflows/build_all_the_things.yml
vendored
50
.github/workflows/build_all_the_things.yml
vendored
@ -19,7 +19,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
os-check-win:
|
os-check-win:
|
||||||
runs-on: windows-2019
|
runs-on: windows-latest
|
||||||
if: github.repository == 'arendst/Tasmota'
|
if: github.repository == 'arendst/Tasmota'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
@ -31,15 +31,15 @@ jobs:
|
|||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.13'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install wheel
|
pip install uv
|
||||||
#python -m pip install --upgrade pip
|
uv pip install --system platformio
|
||||||
pip install -U platformio
|
|
||||||
#platformio upgrade --dev
|
|
||||||
#platformio update
|
|
||||||
- name: Run PlatformIO
|
- name: Run PlatformIO
|
||||||
|
env:
|
||||||
|
PYTHONIOENCODING: utf-8
|
||||||
|
PYTHONUTF8: '1'
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
run: platformio run -e ${{ matrix.variant }}
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@ -59,15 +59,15 @@ jobs:
|
|||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.12'
|
python-version: '3.13'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install wheel
|
pip install uv
|
||||||
#python -m pip install --upgrade pip
|
uv pip install --system platformio
|
||||||
pip install -U platformio
|
|
||||||
#platformio upgrade --dev
|
|
||||||
#platformio update
|
|
||||||
- name: Run PlatformIO
|
- name: Run PlatformIO
|
||||||
|
env:
|
||||||
|
PYTHONIOENCODING: utf-8
|
||||||
|
PYTHONUTF8: '1'
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
run: platformio run -e ${{ matrix.variant }}
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@ -117,16 +117,16 @@ jobs:
|
|||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.13'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install wheel
|
pip install uv
|
||||||
#python -m pip install --upgrade pip
|
uv pip install --system platformio
|
||||||
pip install -U platformio
|
|
||||||
#platformio upgrade --dev
|
|
||||||
#platformio update
|
|
||||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
cp ./platformio_override_sample.ini ./platformio_override.ini
|
||||||
- name: Run PlatformIO
|
- name: Run PlatformIO
|
||||||
|
env:
|
||||||
|
PYTHONIOENCODING: utf-8
|
||||||
|
PYTHONUTF8: '1'
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
run: platformio run -e ${{ matrix.variant }}
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@ -146,15 +146,15 @@ jobs:
|
|||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.13'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install wheel
|
pip install uv
|
||||||
#python -m pip install --upgrade pip
|
uv pip install --system platformio
|
||||||
pip install -U platformio
|
|
||||||
#platformio upgrade --dev
|
|
||||||
#platformio update
|
|
||||||
- name: Run PlatformIO
|
- name: Run PlatformIO
|
||||||
|
env:
|
||||||
|
PYTHONIOENCODING: utf-8
|
||||||
|
PYTHONUTF8: '1'
|
||||||
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
|
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -19,6 +19,8 @@ managed_components
|
|||||||
.cache
|
.cache
|
||||||
.dummy
|
.dummy
|
||||||
sdkconfig.*
|
sdkconfig.*
|
||||||
|
sdkconfig.defaults
|
||||||
|
CMakeLists.txt
|
||||||
data
|
data
|
||||||
unpacked_fs
|
unpacked_fs
|
||||||
unpacked_boards
|
unpacked_boards
|
||||||
|
126
CHANGELOG.md
126
CHANGELOG.md
@ -3,7 +3,126 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
## [Unreleased] - Development
|
## [Unreleased] - Development
|
||||||
|
|
||||||
## [14.5.0.3]
|
## [15.0.1.2]
|
||||||
|
### Added
|
||||||
|
- Command `I2sPause` (#23646)
|
||||||
|
- Basic support for ESP32-P4 (#23663)
|
||||||
|
- ESP32-P4 command `HostedOta` (#23675)
|
||||||
|
- Support for RV3028 RTC (#23672)
|
||||||
|
|
||||||
|
### Breaking Changed
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- ESP32 Platform from 2025.05.30 to 2025.07.30, Framework (Arduino Core) from v3.1.3.250504 to v3.1.3.250707 and IDF from v5.3.3.250501 to v5.3.3.250707 (#23642)
|
||||||
|
- ESP32 Domoticz supports persistent settings for all relays, keys and switches using filesystem
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [15.0.1.1] 20250708
|
||||||
|
### Added
|
||||||
|
- I2S additions (#23543)
|
||||||
|
- NeoPool add Redox tank alarm (#19811)
|
||||||
|
- Berry f-strings now support ':' in expression (#23618)
|
||||||
|
- Universal display driver for ZJY169S0800TG01 ST7789 280x240 (#23638)
|
||||||
|
- Commands `LoRaWanDecoder "` and `LoRaWanName "` to clear name (#23394)
|
||||||
|
- Internal function 'WSContentSendRaw_P' (#23641)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- BLE updates for esp-nimble-cpp v2.x (#23553)
|
||||||
|
- Library names (#23560)
|
||||||
|
- ESP32 LoRaWan decoding won't duplicate non-decoded message if `SO147 0`
|
||||||
|
- VEML6070 and AHT2x device detection (#23581)
|
||||||
|
- CSS uses named colors variables (#23597)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- LVGL restore `lv_chart.set_range` removed in LVGL 9.3.0 in favor of `lv_chart.set_axis_range` (#23567)
|
||||||
|
- Berry vulnerability in JSON parsing for unicode (#23603)
|
||||||
|
- Berry security issues in `int64` and improve documentation (#23605)
|
||||||
|
- Berry security issues in `berry_mapping` and improve documentation (#23606)
|
||||||
|
- Berry Hue regression from #23429 (#23623)
|
||||||
|
- AHT30 sensor start with null values after deep sleep (#23624)
|
||||||
|
|
||||||
|
## [Released]
|
||||||
|
|
||||||
|
## [15.0.1] 20250614
|
||||||
|
- Release Sharon
|
||||||
|
|
||||||
|
## [15.0.0.1] 20250614
|
||||||
|
### Fixed
|
||||||
|
- LVGL regression missing `lv.ANIM_OFF` and `lv.ANIM_ON` (#23544)
|
||||||
|
- Berry fix `realline` (#23546)
|
||||||
|
- LVGL HASPmota fix regression introduced with LVGL 9.3.0 (#23547)
|
||||||
|
|
||||||
|
## [15.0.0] 20250613
|
||||||
|
- Release Sharon
|
||||||
|
|
||||||
|
## [14.6.0.2] 20250613
|
||||||
|
### Added
|
||||||
|
- Allow temporary change of DisplayDimmer (#23406)
|
||||||
|
- Support for LoRaWan Rx1 and Rx2 profiles (#23394)
|
||||||
|
- HASPmota auto-dimming when no touch (#23425)
|
||||||
|
- Provide serial upload port from VSC to PIO (#23436)
|
||||||
|
- Berry support for `sortedmap` (#23441)
|
||||||
|
- Berry `introspect.module` option to not cache module entry (#23451)
|
||||||
|
- Berry `webserver.remove_route` to revert `webserver.on` (#23452)
|
||||||
|
- Berry `compile` and `tasmota.compile` option to compile in local context (#23457)
|
||||||
|
- Support for AP33772S USB PD Sink Controller as used in CentyLab RotoPD
|
||||||
|
- Berry mqtt publish rule processing
|
||||||
|
- Berry `tasmota.is_network_up()` (#23532)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- ESP32 Platform from 2025.04.30 to 2025.05.40, Framework (Arduino Core) from v3.1.3.250411 to v3.2.0.250504 and IDF from v5.3.2.250403 to v5.4.1.250501 (#23397)
|
||||||
|
- ESP32 Platform from 2025.05.40 to 2025.05.30, Framework (Arduino Core) from v3.2.0.250504 to v3.1.3.250504 and IDF from v5.4.1.250501 to v5.3.3.250501 (#23404)
|
||||||
|
- ESP8266 platform update from 2024.09.00 to 2025.05.00 (#23448)
|
||||||
|
- Increase number of supported LoRaWan nodes from 4 to 16
|
||||||
|
- Berry change number parser for json to reuse same parser as lexer (#23505)
|
||||||
|
- Berry increase web hooks from 16 to 32 (#23507)
|
||||||
|
- ESP32 LVGL library from v9.2.2 to v9.3.0 (#23518)
|
||||||
|
- Zigbee improved message when coordinator failed to start (#23525)
|
||||||
|
- Format syslog messages according to RFC5424 adding local log time (#23509)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Haspmota `haspmota.parse()` page parsing (#23403)
|
||||||
|
- ESP32-S3 display stability regression from #23397 (#23404)
|
||||||
|
- DNS setting with `IPAddress4/5` not persisted (#23426)
|
||||||
|
- Berry avoid json parsing for unmatched commands (#23494)
|
||||||
|
- Berry integer and real parser to handle overflows (#23495)
|
||||||
|
- Berry potential pointer underflow with `string.endswith` (#23496)
|
||||||
|
- Autoconf failing when last line has no trailing LF (#23537)
|
||||||
|
- LVGL Tasmota logo splash screen (#23538)
|
||||||
|
|
||||||
|
## [14.6.0.1] 20250510
|
||||||
|
### Added
|
||||||
|
- Command `JsonPP 0..7` to enable (>0) JSON Pretty Print on user interfaces and set number of indents
|
||||||
|
- Command `JsonPP <command>|backlog <command>;...` to enable JSON PP only once
|
||||||
|
- WebUI status line for MQTT and TLS, added `FUNC_WEB_STATUS` event (#23326)
|
||||||
|
- Wireguard VPN (#23347)
|
||||||
|
- Optional Wifi strength indicator in WebUI status line (#23352)
|
||||||
|
- WebUI status line left and renamed events `FUNC_WEB_STATUS_LEFT` and `FUNC_WEB_STATUS_RIGHT` (#23354)
|
||||||
|
- WebUI heap status (#23356)
|
||||||
|
- Support for multi channel AU915-928 LoRaWanBridge by Rob Clark (#23372)
|
||||||
|
- HASPmota `antiburn()` (#23400)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Allow command `WebRefresh` minimum from 1000 to 400 mSec
|
||||||
|
- GPIOViewer from v1.6.2 to v1.6.3 (No functional change)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Berry `bytes().asstring()` now truncates a string if buffer contains NULL (#23311)
|
||||||
|
- Berry string literals containing NULL are truncated (#23312)
|
||||||
|
- Berry `display.touch_update` wrongly applies resistive calibration (#23363)
|
||||||
|
- NimBLE log_level definition conflict (#23366)
|
||||||
|
- Matter and mDNS can be enabled at the same time (#23373)
|
||||||
|
- Berry `introspect.module()` failed to load modules in files (#23376)
|
||||||
|
|
||||||
|
## [14.6.0] 20250416
|
||||||
|
- Release Ryan
|
||||||
|
|
||||||
|
## [14.5.0.3] 20250416
|
||||||
### Added
|
### Added
|
||||||
- Extend command `GPIO` with different display options and allowing updating of module GPIO's in one go
|
- Extend command `GPIO` with different display options and allowing updating of module GPIO's in one go
|
||||||
- Berry `bytes.add()` now accepts 3-bytes values (#23200)
|
- Berry `bytes.add()` now accepts 3-bytes values (#23200)
|
||||||
@ -29,9 +148,6 @@ All notable changes to this project will be documented in this file.
|
|||||||
- TLS increase timeout and fix crash (#23249)
|
- TLS increase timeout and fix crash (#23249)
|
||||||
- Berry `readline` when a line is exactly 98 characters (#23276)
|
- Berry `readline` when a line is exactly 98 characters (#23276)
|
||||||
|
|
||||||
### Removed
|
|
||||||
|
|
||||||
|
|
||||||
## [14.5.0.2] 20250325
|
## [14.5.0.2] 20250325
|
||||||
### Added
|
### Added
|
||||||
- Berry load `.tapp` files in `/.extensions/` then in `/` (#23113)
|
- Berry load `.tapp` files in `/.extensions/` then in `/` (#23113)
|
||||||
@ -77,8 +193,6 @@ All notable changes to this project will be documented in this file.
|
|||||||
### Fixed
|
### Fixed
|
||||||
- Too many zeros in RCSwitch received data regression from v14.4.1.4 (#23050)
|
- Too many zeros in RCSwitch received data regression from v14.4.1.4 (#23050)
|
||||||
|
|
||||||
## [Released]
|
|
||||||
|
|
||||||
## [14.5.0] 20250219
|
## [14.5.0] 20250219
|
||||||
- Release Ruth
|
- Release Ruth
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ In addition to @arendst the following code is mainly owned by:
|
|||||||
| xdrv_77_wizmote | @arendst
|
| xdrv_77_wizmote | @arendst
|
||||||
| xdrv_78_telnet | @arendst
|
| xdrv_78_telnet | @arendst
|
||||||
| xdrv_79_esp32_ble | @staars, @btsimonh
|
| xdrv_79_esp32_ble | @staars, @btsimonh
|
||||||
| xdrv_80 |
|
| xdrv_80_wireguard_client | @s-hadinger
|
||||||
| xdrv_81_esp32_webcam | @gemu, @philrich
|
| xdrv_81_esp32_webcam | @gemu, @philrich
|
||||||
| xdrv_82_esp32_ethernet | @arendst
|
| xdrv_82_esp32_ethernet | @arendst
|
||||||
| xdrv_83_esp32_watch | @gemu
|
| xdrv_83_esp32_watch | @gemu
|
||||||
@ -101,11 +101,12 @@ In addition to @arendst the following code is mainly owned by:
|
|||||||
| xdrv_88_esp32_shelly_pro | @arendst
|
| xdrv_88_esp32_shelly_pro | @arendst
|
||||||
| xdrv_89_ |
|
| xdrv_89_ |
|
||||||
| xdrv_90_esp32_dingtian_relay | @barbudor
|
| xdrv_90_esp32_dingtian_relay | @barbudor
|
||||||
| xdrv_91_ |
|
| xdrv_91_esp32_twai | @arendst
|
||||||
| xdrv_92_ |
|
| xdrv_92_ |
|
||||||
| xdrv_93_ |
|
| xdrv_93_ |
|
||||||
| xdrv_94_ |
|
| xdrv_94_ |
|
||||||
| |
|
| |
|
||||||
|
| xdrv_119_i2c_ap33772s | @arendst
|
||||||
| xdrv_120_xyzmodem | @arendst
|
| xdrv_120_xyzmodem | @arendst
|
||||||
| xdrv_121_gpioviewer | @arendst
|
| xdrv_121_gpioviewer | @arendst
|
||||||
| xdrv_122_file_settings_demo | @arendst
|
| xdrv_122_file_settings_demo | @arendst
|
||||||
|
@ -18,7 +18,7 @@ See [CHANGELOG.md](https://github.com/arendst/Tasmota/blob/development/CHANGELOG
|
|||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
[](https://github.com/arendst/Tasmota)
|
[](https://github.com/arendst/Tasmota)
|
||||||
[](http://ota.tasmota.com/tasmota/)
|
[](http://ota.tasmota.com/tasmota/)
|
||||||
[](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+CI%22)
|
[](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+CI%22)
|
||||||
[](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+ESP32+CI%22)
|
[](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+ESP32+CI%22)
|
||||||
|
@ -130,5 +130,7 @@ Index | Define | Driver | Device | Address(es) | Bus2 | Descrip
|
|||||||
90 | USE_RX8010 | xdrv_56 | RX8010 | 0x32 | Yes | RX8010 RTC from IOTTIMER
|
90 | USE_RX8010 | xdrv_56 | RX8010 | 0x32 | Yes | RX8010 RTC from IOTTIMER
|
||||||
91 | USE_MS5837 | xsns_116 | MS5837 | 0x76 | | Pressure and temperature sensor
|
91 | USE_MS5837 | xsns_116 | MS5837 | 0x76 | | Pressure and temperature sensor
|
||||||
92 | USE_PCF85063 | xdrv_56 | PCF85063 | 0x51 | | PCF85063 Real time clock
|
92 | USE_PCF85063 | xdrv_56 | PCF85063 | 0x51 | | PCF85063 Real time clock
|
||||||
|
93 | USE_AS33772S | xdrv_119 | AS33772S | 0x52 | Yes | AS33772S USB PD Sink Controller
|
||||||
|
94 | USE_RV3028 | xdrv_56 | RV3028 | 0x52 | Yes | RV-3028-C7 RTC Controller
|
||||||
|
|
||||||
NOTE: Bus2 supported on ESP32 only.
|
NOTE: Bus2 supported on ESP32 only.
|
||||||
|
@ -31,7 +31,7 @@ Firmware binaries can be downloaded from http://ota.tasmota.com/tasmota/release/
|
|||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
[](https://github.com/arendst/Tasmota)
|
[](https://github.com/arendst/Tasmota)
|
||||||
[](http://ota.tasmota.com/tasmota/)
|
[](http://ota.tasmota.com/tasmota/)
|
||||||
[](https://github.com/arendst/Tasmota/actions/workflows/build_all_the_things.yml)
|
[](https://github.com/arendst/Tasmota/actions/workflows/build_all_the_things.yml)
|
||||||
[](https://github.com/arendst/Tasmota/actions/workflows/Tasmota_build_devel.yml)
|
[](https://github.com/arendst/Tasmota/actions/workflows/Tasmota_build_devel.yml)
|
||||||
|
@ -36,9 +36,9 @@ While fallback or downgrading is common practice it was never supported due to S
|
|||||||
|
|
||||||
This release will be supported from ESP8266/Arduino library Core version **2.7.8** due to reported security and stability issues on previous Core version. This will also support gzipped binaries.
|
This release will be supported from ESP8266/Arduino library Core version **2.7.8** due to reported security and stability issues on previous Core version. This will also support gzipped binaries.
|
||||||
|
|
||||||
This release will be supported from ESP32/Arduino library Core version **v3.1.1.250203**.
|
This release will be supported from ESP32/Arduino library Core version **v3.1.3.250504**.
|
||||||
|
|
||||||
Support of ESP8266 Core versions before 2.7.8 and ESP32 Core versions before v3.1.1.250203 have been removed.
|
Support of ESP8266 Core versions before 2.7.8 and ESP32 Core versions before v3.1.3.250504 have been removed.
|
||||||
|
|
||||||
## Support of TLS
|
## Support of TLS
|
||||||
|
|
||||||
@ -75,12 +75,12 @@ Latest released binaries can be downloaded from
|
|||||||
- http://ota.tasmota.com/tasmota/release
|
- http://ota.tasmota.com/tasmota/release
|
||||||
|
|
||||||
Historical binaries can be downloaded from
|
Historical binaries can be downloaded from
|
||||||
- http://ota.tasmota.com/tasmota/release-14.5.0
|
- http://ota.tasmota.com/tasmota/release-15.0.1
|
||||||
|
|
||||||
The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota/release/tasmota.bin.gz``
|
The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota/release/tasmota.bin.gz``
|
||||||
|
|
||||||
### ESP32, ESP32-C2, ESP32-C3, ESP32-C6, ESP32-S2 and ESP32-S3 based
|
### ESP32, ESP32-C2, ESP32-C3, ESP32-C6, ESP32-S2 and ESP32-S3 based
|
||||||
The following binary downloads have been compiled with ESP32/Arduino library core version **v3.1.1.250203**.
|
The following binary downloads have been compiled with ESP32/Arduino library core version **v3.1.3.250504**.
|
||||||
|
|
||||||
- **tasmota32.bin** = The Tasmota version with most drivers including additional sensors and KNX for 4M+ flash. **RECOMMENDED RELEASE BINARY**
|
- **tasmota32.bin** = The Tasmota version with most drivers including additional sensors and KNX for 4M+ flash. **RECOMMENDED RELEASE BINARY**
|
||||||
- **tasmota32solo1.bin** = The Tasmota version with most drivers including additional sensors and KNX for single core ESP32 and 4M+ flash.
|
- **tasmota32solo1.bin** = The Tasmota version with most drivers including additional sensors and KNX for single core ESP32 and 4M+ flash.
|
||||||
@ -104,7 +104,7 @@ Latest released binaries can be downloaded from
|
|||||||
- https://ota.tasmota.com/tasmota32/release
|
- https://ota.tasmota.com/tasmota32/release
|
||||||
|
|
||||||
Historical binaries can be downloaded from
|
Historical binaries can be downloaded from
|
||||||
- https://ota.tasmota.com/tasmota32/release-14.5.0
|
- https://ota.tasmota.com/tasmota32/release-15.0.1
|
||||||
|
|
||||||
The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasmota.com/tasmota32/release/tasmota32.bin``
|
The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasmota.com/tasmota32/release/tasmota32.bin``
|
||||||
|
|
||||||
@ -114,58 +114,36 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
|
|||||||
|
|
||||||
[Complete list](BUILDS.md) of available feature and sensors.
|
[Complete list](BUILDS.md) of available feature and sensors.
|
||||||
|
|
||||||
## Changelog v14.5.0.3
|
## Changelog v15.0.1.2
|
||||||
### Added
|
### Added
|
||||||
- Filesystem command ``UfsList[2]``
|
- Commands `LoRaWanDecoder "` and `LoRaWanName "` to clear name [#23394](https://github.com/arendst/Tasmota/issues/23394)
|
||||||
- Extend command `GPIO` with different display options and allowing updating of module GPIO's in one go
|
- Command `I2sPause` [#23646](https://github.com/arendst/Tasmota/issues/23646)
|
||||||
- Support Vango Technologies V924x ultralow power, single-phase, power measurement [#23127](https://github.com/arendst/Tasmota/issues/23127)
|
- Support for RV3028 RTC [#23672](https://github.com/arendst/Tasmota/issues/23672)
|
||||||
- Support for HLK-LD2402 24GHz smart wave motion sensor [#23133](https://github.com/arendst/Tasmota/issues/23133)
|
- Internal function 'WSContentSendRaw_P' [#23641](https://github.com/arendst/Tasmota/issues/23641)
|
||||||
- Support for Telnet server using command `Telnet <0|1|port>[,<IP filter>]` if enabled with `#define USE_TELNET`
|
- Universal display driver for ZJY169S0800TG01 ST7789 280x240 [#23638](https://github.com/arendst/Tasmota/issues/23638)
|
||||||
- Support for XMODEM over serial and telnet if enabled with `#define USE_XYZMODEM`
|
- NeoPool add Redox tank alarm [#19811](https://github.com/arendst/Tasmota/issues/19811)
|
||||||
- PZEM_AC device address in JSON and GUI [#23268](https://github.com/arendst/Tasmota/issues/23268)
|
- I2S additions [#23543](https://github.com/arendst/Tasmota/issues/23543)
|
||||||
- Allow acl in mqtt when client certificate is in use with `#define USE_MQTT_CLIENT_CERT` [#22998](https://github.com/arendst/Tasmota/issues/22998)
|
- Basic support for ESP32-P4 [#23663](https://github.com/arendst/Tasmota/issues/23663)
|
||||||
- AlpineJS 2.8.2 - optional for now [#23259](https://github.com/arendst/Tasmota/issues/23259)
|
- ESP32-P4 command `HostedOta` [#23675](https://github.com/arendst/Tasmota/issues/23675)
|
||||||
- ESP32 show network interface priority in `Status 5` debug logging [#23302](https://github.com/arendst/Tasmota/issues/23302)
|
- Berry f-strings now support ':' in expression [#23618](https://github.com/arendst/Tasmota/issues/23618)
|
||||||
- Berry experimental driver for AXP2101 for M5Core2v1.1 [#23039](https://github.com/arendst/Tasmota/issues/23039)
|
|
||||||
- Berry `tasmota.when_network_up()` and simplified Matter using it [#23057](https://github.com/arendst/Tasmota/issues/23057)
|
|
||||||
- Berry `introspect.solidified()` to know if a Berry object is solidified or in RAM [#23063](https://github.com/arendst/Tasmota/issues/23063)
|
|
||||||
- Berry `global.undef()` to undefine a global variable [#23073](https://github.com/arendst/Tasmota/issues/23073)
|
|
||||||
- Berry load `.tapp` files in `/.extensions/` then in `/` [#23113](https://github.com/arendst/Tasmota/issues/23113)
|
|
||||||
- Berry `re.dump()` [#23162](https://github.com/arendst/Tasmota/issues/23162)
|
|
||||||
- Berry `bytes.add()` now accepts 3-bytes values [#23200](https://github.com/arendst/Tasmota/issues/23200)
|
|
||||||
- Berry expose `esp_http_server` for websockets [#23206](https://github.com/arendst/Tasmota/issues/23206)
|
|
||||||
- Matter prepare for ICD cluster [#23158](https://github.com/arendst/Tasmota/issues/23158)
|
|
||||||
- LVGL experimental mirroring of display on Web UI [#23041](https://github.com/arendst/Tasmota/issues/23041)
|
|
||||||
- HASPmota autostart when `pages.jsonl` exists [#23181](https://github.com/arendst/Tasmota/issues/23181)
|
|
||||||
|
|
||||||
### Breaking Changed
|
### Breaking Changed
|
||||||
- Berry remove `Leds.create_matrix` from the standard library waiting for reimplementation [#23114](https://github.com/arendst/Tasmota/issues/23114)
|
|
||||||
- HASPmota added `y2_min` and `y2_max` to control the second series of `chart` [#23287](https://github.com/arendst/Tasmota/issues/23287)
|
|
||||||
- HASPmota default theme is now Tasmota-style [#23288](https://github.com/arendst/Tasmota/issues/23288)
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- ESP32 Platform from 2025.02.30 to 2025.04.30, Framework (Arduino Core) from v3.1.1.250203 to v3.1.3.250411 and IDF from v5.3.2.250120 to 5.3.2.250403 [#23280](https://github.com/arendst/Tasmota/issues/23280)
|
- ESP32 Platform from 2025.05.30 to 2025.07.30, Framework (Arduino Core) from v3.1.3.250504 to v3.1.3.250707 and IDF from v5.3.3.250501 to v5.3.3.250707 [#23642](https://github.com/arendst/Tasmota/issues/23642)
|
||||||
- Output of commands `GPIO` and `GPIOs` swapped
|
- Library names [#23560](https://github.com/arendst/Tasmota/issues/23560)
|
||||||
- Smoothen light gamma curve when using `Fade` [#23230](https://github.com/arendst/Tasmota/issues/23230)
|
- CSS uses named colors variables [#23597](https://github.com/arendst/Tasmota/issues/23597)
|
||||||
- RCSwitch `RCSWITCH_SEPARATION_LIMIT` from 4100 to 3600
|
- VEML6070 and AHT2x device detection [#23581](https://github.com/arendst/Tasmota/issues/23581)
|
||||||
- GPIOViewer from v1.6.1 to v1.6.2 (No functional change)
|
- ESP32 Domoticz supports persistent settings for all relays, keys and switches using filesystem
|
||||||
- HLK-LD2402 updates for firmware 3.3.5+ [#23281](https://github.com/arendst/Tasmota/issues/23281)
|
- ESP32 LoRaWan decoding won't duplicate non-decoded message if `SO147 0`
|
||||||
- ESP8266 enable FTP for >= 4MB variants [#23120](https://github.com/arendst/Tasmota/issues/23120)
|
- BLE updates for esp-nimble-cpp v2.x [#23553](https://github.com/arendst/Tasmota/issues/23553)
|
||||||
- ESP32 enable webcam version 2 [#18732](https://github.com/arendst/Tasmota/issues/18732)
|
|
||||||
- Berry update flasher for Sonoff ZBBridge Pro [#23136](https://github.com/arendst/Tasmota/issues/23136)
|
|
||||||
- Berry `re` now accepts `bytes()` as precompiled patterns, added `re.compilebytes()` [#23149](https://github.com/arendst/Tasmota/issues/23149)
|
|
||||||
- LVGL, prepare for HASPmota theme, change: no-grow when clicked, DPI set to 160 [#23040](https://github.com/arendst/Tasmota/issues/23040)
|
|
||||||
- LVGL Mirroring add checkbox to enable/disable the feature (in the iterim for a better solution) [#23047](https://github.com/arendst/Tasmota/issues/23047)
|
|
||||||
- Leds Panel add checkbox to enable/disable the feature (in the iterim for a better solution) [#23048](https://github.com/arendst/Tasmota/issues/23048)
|
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Too many zeros in RCSwitch received data regression from v14.4.1.4 [#23050](https://github.com/arendst/Tasmota/issues/23050)
|
- AHT30 sensor start with null values after deep sleep [#23624](https://github.com/arendst/Tasmota/issues/23624)
|
||||||
- INA226 driver fixes [#23197](https://github.com/arendst/Tasmota/issues/23197)
|
- Berry vulnerability in JSON parsing for unicode [#23603](https://github.com/arendst/Tasmota/issues/23603)
|
||||||
- TLS increase timeout and fix crash [#23249](https://github.com/arendst/Tasmota/issues/23249)
|
- Berry security issues in `int64` and improve documentation [#23605](https://github.com/arendst/Tasmota/issues/23605)
|
||||||
- ESP32 receive incomplete serial data over 128 bytes [#23156](https://github.com/arendst/Tasmota/issues/23156)
|
- Berry security issues in `berry_mapping` and improve documentation [#23606](https://github.com/arendst/Tasmota/issues/23606)
|
||||||
- ESP32 intermittent exception on WiFi AP cannot be reached [#23115](https://github.com/arendst/Tasmota/issues/23115)
|
- Berry Hue regression from #23429 [#23623](https://github.com/arendst/Tasmota/issues/23623)
|
||||||
- ESP32-C3 WiFi sleep [#23096](https://github.com/arendst/Tasmota/issues/23096)
|
- LVGL restore `lv_chart.set_range` removed in LVGL 9.3.0 in favor of `lv_chart.set_axis_range` [#23567](https://github.com/arendst/Tasmota/issues/23567)
|
||||||
- Berry prevent `import` from hiding a solidified class [#23112](https://github.com/arendst/Tasmota/issues/23112)
|
|
||||||
- Berry `readline` when a line is exactly 98 characters [#23276](https://github.com/arendst/Tasmota/issues/23276)
|
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
# Templates
|
# Templates
|
||||||
|
|
||||||
Find below the available templates as of April 2025. More template information can be found in the [Tasmota Device Templates Repository](http://blakadder.github.io/templates)
|
Find below the available templates as of June 2025. More template information can be found in the [Tasmota Device Templates Repository](http://blakadder.github.io/templates)
|
||||||
|
|
||||||
## Adapter Board
|
## Adapter Board
|
||||||
```
|
```
|
||||||
@ -403,7 +403,6 @@ Shelly Vintage 4W 260lm 2700k {"NAME":"Shelly Vintage","GPIO":[0,0,0,0,416,0,0,
|
|||||||
Shelly Vintage 7W 750lm 2700k {"NAME":"Shelly Vintage","GPIO":[0,0,0,0,416,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
|
Shelly Vintage 7W 750lm 2700k {"NAME":"Shelly Vintage","GPIO":[0,0,0,0,416,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
|
||||||
Shelly Vintage 7W 750lm 2700k {"NAME":"Shelly Vintage","GPIO":[0,0,0,0,416,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
|
Shelly Vintage 7W 750lm 2700k {"NAME":"Shelly Vintage","GPIO":[0,0,0,0,416,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
|
||||||
SmartDGM 9W 806lm {"NAME":"L-WB9W1","GPIO":[0,0,0,0,0,416,0,0,160,0,0,0,0,0],"FLAG":0,"BASE":18}
|
SmartDGM 9W 806lm {"NAME":"L-WB9W1","GPIO":[0,0,0,0,0,416,0,0,160,0,0,0,0,0],"FLAG":0,"BASE":18}
|
||||||
Smitch 10W 6500K {"NAME":"Smitch Ambience SB-0110","GPIO":[0,0,0,0,416,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
|
|
||||||
Smitch 10W 6500K {"NAME":"Smitch 10W 6500K Dimmable Bulb (SB0110 - E27)","GPIO":[0,0,0,0,0,416,0,0,0,417,0,0,0,0],"FLAG":0,"BASE":1}
|
Smitch 10W 6500K {"NAME":"Smitch 10W 6500K Dimmable Bulb (SB0110 - E27)","GPIO":[0,0,0,0,0,416,0,0,0,417,0,0,0,0],"FLAG":0,"BASE":1}
|
||||||
TCP Smart 806lm Warm White {"NAME":"TCP Smart Clas","GPIO":[0,0,0,0,0,0,0,0,0,416,0,0,0,0],"FLAG":0,"BASE":1}
|
TCP Smart 806lm Warm White {"NAME":"TCP Smart Clas","GPIO":[0,0,0,0,0,0,0,0,0,416,0,0,0,0],"FLAG":0,"BASE":1}
|
||||||
TCP Smart 810lm Filament {"NAME":"TCP Filament","GPIO":[0,0,0,0,0,0,0,0,0,0,448,0,0,0],"FLAG":0,"BASE":18}
|
TCP Smart 810lm Filament {"NAME":"TCP Filament","GPIO":[0,0,0,0,0,0,0,0,0,0,448,0,0,0],"FLAG":0,"BASE":18}
|
||||||
@ -464,7 +463,7 @@ QS-WiFi-D01-TRIAC 150W {"NAME":"QS-WiFi-D01-TRIAC","GPIO":[0,3200,0,3232,0
|
|||||||
RJWF-02A {"NAME":"RJWF-02A","GPIO":[32,2272,0,2304,0,0,0,0,0,0,288,0,0,0],"FLAG":0,"BASE":54}
|
RJWF-02A {"NAME":"RJWF-02A","GPIO":[32,2272,0,2304,0,0,0,0,0,0,288,0,0,0],"FLAG":0,"BASE":54}
|
||||||
Shelly Dimmer {"NAME":"Shelly Dimmer 1","GPIO":[0,3200,0,3232,5568,5600,0,0,192,0,193,288,0,4736],"FLAG":0,"BASE":18}
|
Shelly Dimmer {"NAME":"Shelly Dimmer 1","GPIO":[0,3200,0,3232,5568,5600,0,0,192,0,193,288,0,4736],"FLAG":0,"BASE":18}
|
||||||
Shelly Dimmer 2 {"NAME":"Shelly Dimmer 2","GPIO":[0,3200,0,3232,5568,5600,0,0,193,0,192,0,320,4736],"FLAG":0,"BASE":18}
|
Shelly Dimmer 2 {"NAME":"Shelly Dimmer 2","GPIO":[0,3200,0,3232,5568,5600,0,0,193,0,192,0,320,4736],"FLAG":0,"BASE":18}
|
||||||
Shelly Plus 0-10V Dimmer {"NAME":"Shelly Plus 0-10V Dimmer","GPIO":[288,0,0,0,192,0,0,0,0,0,0,0,0,0,193,1,0,0,0,0,0,32,416,0,0,0,0,0,4736,0,0,0,0,0,0,0],"FLAG":0,"BASE":1}
|
Shelly Plus 0-10V Dimmer {"NAME":"Shelly Plus 0-10V Dimmer","GPIO":[288,0,0,0,192,0,0,0,0,0,0,0,0,0,193,1,0,0,0,0,0,32,448,0,0,0,0,0,4736,0,0,0,0,0,0,0],"FLAG":0,"BASE":1}
|
||||||
Sonoff D1 {"NAME":"Sonoff D1","GPIO":[1,3200,0,3232,0,0,0,0,0,320,0,0,0,0],"FLAG":0,"BASE":74}
|
Sonoff D1 {"NAME":"Sonoff D1","GPIO":[1,3200,0,3232,0,0,0,0,0,320,0,0,0,0],"FLAG":0,"BASE":74}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -41,6 +41,11 @@
|
|||||||
"download": {
|
"download": {
|
||||||
"speed": 230400
|
"speed": 230400
|
||||||
},
|
},
|
||||||
|
"espidf": {
|
||||||
|
"custom_sdkconfig": [
|
||||||
|
"CONFIG_FREERTOS_UNICORE=y"
|
||||||
|
]
|
||||||
|
},
|
||||||
"url": "https://www.espressif.com/sites/default/files/documentation/esp32-solo-1_datasheet_en.pdf",
|
"url": "https://www.espressif.com/sites/default/files/documentation/esp32-solo-1_datasheet_en.pdf",
|
||||||
"vendor": "Espressif"
|
"vendor": "Espressif"
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,6 @@
|
|||||||
"download": {
|
"download": {
|
||||||
"speed": 230400
|
"speed": 230400
|
||||||
},
|
},
|
||||||
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
|
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp8684/esp8684-devkitm-1/user_guide.html",
|
||||||
"vendor": "Espressif"
|
"vendor": "Espressif"
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,6 @@
|
|||||||
"download": {
|
"download": {
|
||||||
"speed": 230400
|
"speed": 230400
|
||||||
},
|
},
|
||||||
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
|
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp8684/esp8684-devkitm-1/user_guide.html",
|
||||||
"vendor": "Espressif"
|
"vendor": "Espressif"
|
||||||
}
|
}
|
||||||
|
46
boards/esp32p4_ev.json
Normal file
46
boards/esp32p4_ev.json
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DARDUINO_TASMOTA -DESP32P4 -DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=1 -DUSE_USB_CDC_CONSOLE"
|
||||||
|
],
|
||||||
|
"f_cpu": "360000000L",
|
||||||
|
"f_flash": "80000000L",
|
||||||
|
"flash_mode": "qio",
|
||||||
|
"mcu": "esp32p4",
|
||||||
|
"variant": "esp32p4",
|
||||||
|
"partitions": "partitions/esp32_partition_app3904k_fs3392k.csv"
|
||||||
|
},
|
||||||
|
"connectivity": [
|
||||||
|
"wifi",
|
||||||
|
"bluetooth",
|
||||||
|
"openthread",
|
||||||
|
"ethernet"
|
||||||
|
],
|
||||||
|
"debug": {
|
||||||
|
"openocd_target": "esp32p4.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": [
|
||||||
|
"arduino",
|
||||||
|
"espidf"
|
||||||
|
],
|
||||||
|
"name": "Espressif ESP32-P4 Function EV Board",
|
||||||
|
"upload": {
|
||||||
|
"arduino": {
|
||||||
|
"flash_extra_images": [
|
||||||
|
[
|
||||||
|
"0x10000",
|
||||||
|
"tasmota32p4-safeboot.bin"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"flash_size": "16MB",
|
||||||
|
"maximum_ram_size": 768000,
|
||||||
|
"maximum_size": 16777216,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 1500000
|
||||||
|
},
|
||||||
|
"url": "https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32p4/esp32-p4-function-ev-board/index.html",
|
||||||
|
"vendor": "Espressif"
|
||||||
|
}
|
||||||
|
|
@ -61,7 +61,7 @@
|
|||||||
// SPI_MOSI_DLEN_REG is not defined anymore in esp32s3
|
// SPI_MOSI_DLEN_REG is not defined anymore in esp32s3
|
||||||
#define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x)
|
#define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x)
|
||||||
|
|
||||||
#elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6
|
#elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32P4
|
||||||
#define SPI_HOST SPI1_HOST
|
#define SPI_HOST SPI1_HOST
|
||||||
#define HSPI_HOST SPI2_HOST
|
#define HSPI_HOST SPI2_HOST
|
||||||
#define VSPI_HOST SPI2_HOST /* No SPI3_host on C2/C6 */
|
#define VSPI_HOST SPI2_HOST /* No SPI3_host on C2/C6 */
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
name=Unishox Compressor Decompressor highly customized and optimized for ESP8266 and Tasmota
|
name=Unishox (De)Compressor
|
||||||
version=1.0
|
version=1.0
|
||||||
author=Arundale Ramanathan, Stephan Hadinger
|
author=Arundale Ramanathan, Stephan Hadinger
|
||||||
maintainer=Arun <arun@siara.cc>, Stephan <stephan.hadinger@gmail.com>
|
maintainer=Arun <arun@siara.cc>, Stephan <stephan.hadinger@gmail.com>
|
||||||
sentence=Unishox compression for Tasmota Rules
|
sentence=Unishox compression for Tasmota Rules
|
||||||
paragraph=It is based on Unishox hybrid encoding technique. This version has specific Unicode code removed for size.
|
paragraph=It is based on Unishox hybrid encoding technique. This Tasmota version has specific Unicode code removed for size.
|
||||||
url=https://github.com/siara-cc/Unishox
|
url=https://github.com/siara-cc/Unishox
|
||||||
architectures=esp8266,esp32
|
architectures=esp8266,esp32
|
@ -27,8 +27,8 @@ enum LoggingLevels {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_D
|
|||||||
|
|
||||||
|
|
||||||
#ifdef USE_IPV6
|
#ifdef USE_IPV6
|
||||||
ip_addr_t dns_save4[DNS_MAX_SERVERS] = {}; // IPv4 DNS servers
|
ip_addr_t dns_save4[2] = {}; // IPv4 DNS servers
|
||||||
ip_addr_t dns_save6[DNS_MAX_SERVERS] = {}; // IPv6 DNS servers
|
ip_addr_t dns_save6[2] = {}; // IPv6 DNS servers
|
||||||
#endif // USE_IPV6
|
#endif // USE_IPV6
|
||||||
|
|
||||||
#include "tasmota_options.h"
|
#include "tasmota_options.h"
|
||||||
@ -76,48 +76,72 @@ extern bool WifiHasIPv6(void);
|
|||||||
extern bool EthernetHasIPv6(void);
|
extern bool EthernetHasIPv6(void);
|
||||||
|
|
||||||
void WiFiHelper::scrubDNS(void) {
|
void WiFiHelper::scrubDNS(void) {
|
||||||
|
// AddLog(LOG_LEVEL_DEBUG, "IP>1: dns_save4 %s %s dns_save6 %s %s",
|
||||||
|
// IPAddress(&dns_save4[0]).toString().c_str(),IPAddress(&dns_save4[1]).toString().c_str(),
|
||||||
|
// IPAddress(&dns_save6[0]).toString().c_str(),IPAddress(&dns_save6[1]).toString().c_str());
|
||||||
// String dns_entry0 = IPAddress(dns_getserver(0)).toString();
|
// String dns_entry0 = IPAddress(dns_getserver(0)).toString();
|
||||||
// String dns_entry1 = IPAddress(dns_getserver(1)).toString();
|
// String dns_entry1 = IPAddress(dns_getserver(1)).toString();
|
||||||
|
|
||||||
// scan DNS entries
|
// scan DNS entries
|
||||||
bool has_v4 = WifiHasIPv4() || EthernetHasIPv4();
|
bool has_v4 = WifiHasIPv4() || EthernetHasIPv4();
|
||||||
bool has_v6 = false;
|
bool has_v6 = false;
|
||||||
#ifdef USE_IPV6
|
#ifdef USE_IPV6
|
||||||
has_v6 = WifiHasIPv6() || EthernetHasIPv6();
|
has_v6 = WifiHasIPv6() || EthernetHasIPv6();
|
||||||
#endif
|
#endif
|
||||||
|
// AddLog(LOG_LEVEL_DEBUG, "IP>1: DNS: (%s %s) has4/6:%i-%i", dns_entry0.c_str(), dns_entry1.c_str(), has_v4, has_v6);
|
||||||
|
|
||||||
// First pass, save values
|
|
||||||
for (uint32_t i=0; i<DNS_MAX_SERVERS; i++) {
|
|
||||||
#ifdef USE_IPV6
|
#ifdef USE_IPV6
|
||||||
|
// First pass, save values
|
||||||
|
for (uint32_t i=0; i<2; i++) {
|
||||||
const IPAddress ip_dns = IPAddress(dns_getserver(i));
|
const IPAddress ip_dns = IPAddress(dns_getserver(i));
|
||||||
// Step 1. save valid values from DNS
|
// Step 1. save valid values from DNS
|
||||||
if (!ip_addr_isany_val((const ip_addr_t &)ip_dns)) {
|
if (!ip_addr_isany_val((const ip_addr_t &)ip_dns)) {
|
||||||
if (ip_dns.type() == IPv4 && has_v4) {
|
if (ip_dns.type() == IPv4 && (has_v4 || !has_v6)) {
|
||||||
ip_dns.to_ip_addr_t(&dns_save4[i]);
|
ip_dns.to_ip_addr_t(&dns_save4[i]); // dns entry is populated, save it in v4 slot
|
||||||
// dns_save4[i] = (ip_addr_t) ip_dns; // dns entry is populated, save it in v4 slot
|
|
||||||
} else if (has_v6) {
|
} else if (has_v6) {
|
||||||
ip_dns.to_ip_addr_t(&dns_save6[i]);
|
ip_dns.to_ip_addr_t(&dns_save6[i]); // dns entry is populated, save it in v6 slot
|
||||||
// dns_save6[i] = (ip_addr_t) ip_dns; // dns entry is populated, save it in v6 slot
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 2. scrub addresses not supported
|
|
||||||
if (!has_v4) { dns_save4[i] = *IP4_ADDR_ANY; }
|
|
||||||
if (!has_v6) { dns_save6[i] = *IP_ADDR_ANY; }
|
|
||||||
|
|
||||||
// Step 3. restore saved value
|
|
||||||
if (has_v4 && has_v6) { // if both IPv4 and IPv6 are active, prefer IPv4
|
|
||||||
if (!ip_addr_isany_val(dns_save4[i])) { dns_setserver(i, &dns_save4[i]); }
|
|
||||||
else { dns_setserver(i, &dns_save6[i]); }
|
|
||||||
} else if (has_v4) {
|
|
||||||
dns_setserver(i, &dns_save4[i]);
|
|
||||||
} else if (has_v6) {
|
|
||||||
dns_setserver(i, &dns_save6[i]);
|
|
||||||
} else {
|
|
||||||
dns_setserver(i, IP4_ADDR_ANY);
|
|
||||||
}
|
|
||||||
#endif // USE_IPV6
|
|
||||||
}
|
}
|
||||||
// AddLog(LOG_LEVEL_DEBUG, "IP>: DNS: from(%s %s) to (%s %s) has4/6:%i-%i", dns_entry0.c_str(), dns_entry1.c_str(), IPAddress(dns_getserver(0)).toString().c_str(), IPAddress(dns_getserver(1)).toString().c_str(), has_v4, has_v6);
|
|
||||||
|
// Step 2. scrub addresses not supported
|
||||||
|
if (!has_v4 && has_v6) { // v6 only
|
||||||
|
dns_save4[0] = *IP4_ADDR_ANY;
|
||||||
|
dns_save4[1] = *IP4_ADDR_ANY;
|
||||||
|
}
|
||||||
|
if (!has_v6) {
|
||||||
|
dns_save6[0] = *IP_ADDR_ANY;
|
||||||
|
dns_save6[1] = *IP_ADDR_ANY;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Step 3. restore saved value
|
||||||
|
if (has_v4 && has_v6) { // if both IPv4 and IPv6 are active, prefer IPv4 for first and IPv6 for second
|
||||||
|
if (!ip_addr_isany_val(dns_save4[0])) {
|
||||||
|
// First DNS IPv4
|
||||||
|
dns_setserver(0, &dns_save4[0]);
|
||||||
|
if (!ip_addr_isany_val(dns_save6[0])) {
|
||||||
|
dns_setserver(1, &dns_save6[0]); // take first IPv6 as second DNS
|
||||||
|
} else {
|
||||||
|
dns_setserver(1, &dns_save4[1]); // or revert to second IPv4
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// If no DNS IPv4, use IPv6
|
||||||
|
dns_setserver(0, &dns_save6[0]);
|
||||||
|
dns_setserver(1, &dns_save6[1]);
|
||||||
|
}
|
||||||
|
} else if (has_v6) { // v6 and no v4
|
||||||
|
dns_setserver(0, &dns_save6[0]);
|
||||||
|
dns_setserver(1, &dns_save6[1]);
|
||||||
|
} else { // no v6, we use v4 even if not connected
|
||||||
|
dns_setserver(0, &dns_save4[0]);
|
||||||
|
dns_setserver(1, &dns_save4[1]);
|
||||||
|
}
|
||||||
|
#endif // USE_IPV6
|
||||||
|
// AddLog(LOG_LEVEL_DEBUG, "IP>2: DNS: from(%s %s) to (%s %s) has4/6:%i-%i", dns_entry0.c_str(), dns_entry1.c_str(), IPAddress(dns_getserver(0)).toString().c_str(), IPAddress(dns_getserver(1)).toString().c_str(), has_v4, has_v6);
|
||||||
|
|
||||||
|
// AddLog(LOG_LEVEL_DEBUG, "IP>2: dns_save4 %s %s dns_save6 %s %s",
|
||||||
|
// IPAddress(&dns_save4[0]).toString().c_str(),IPAddress(&dns_save4[1]).toString().c_str(),
|
||||||
|
// IPAddress(&dns_save6[0]).toString().c_str(),IPAddress(&dns_save6[1]).toString().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -142,6 +166,10 @@ int WiFiHelper::getPhyMode() {
|
|||||||
WIFI_PHY_MODE_HE20, // PHY mode for Bandwidth HE20 (11ax)
|
WIFI_PHY_MODE_HE20, // PHY mode for Bandwidth HE20 (11ax)
|
||||||
} wifi_phy_mode_t;
|
} wifi_phy_mode_t;
|
||||||
*/
|
*/
|
||||||
|
#ifndef SOC_WIFI_SUPPORTED
|
||||||
|
// ESP32-P4 does not support PHY modes, return 0
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
int phy_mode = 0; // "low rate|11b|11g|HT20|HT40|HE20"
|
int phy_mode = 0; // "low rate|11b|11g|HT20|HT40|HE20"
|
||||||
wifi_phy_mode_t WiFiMode;
|
wifi_phy_mode_t WiFiMode;
|
||||||
if (esp_wifi_sta_get_negotiated_phymode(&WiFiMode) == ESP_OK) {
|
if (esp_wifi_sta_get_negotiated_phymode(&WiFiMode) == ESP_OK) {
|
||||||
@ -151,9 +179,13 @@ int WiFiHelper::getPhyMode() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return phy_mode;
|
return phy_mode;
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WiFiHelper::setPhyMode(WiFiPhyMode_t mode) {
|
bool WiFiHelper::setPhyMode(WiFiPhyMode_t mode) {
|
||||||
|
# ifndef SOC_WIFI_SUPPORTED
|
||||||
|
return false; // ESP32-P4 does not support PHY modes
|
||||||
|
# else
|
||||||
uint8_t protocol_bitmap = WIFI_PROTOCOL_11B; // 1
|
uint8_t protocol_bitmap = WIFI_PROTOCOL_11B; // 1
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
#if ESP_IDF_VERSION_MAJOR >= 5
|
#if ESP_IDF_VERSION_MAJOR >= 5
|
||||||
@ -163,6 +195,7 @@ bool WiFiHelper::setPhyMode(WiFiPhyMode_t mode) {
|
|||||||
case 2: protocol_bitmap |= WIFI_PROTOCOL_11G; // 2
|
case 2: protocol_bitmap |= WIFI_PROTOCOL_11G; // 2
|
||||||
}
|
}
|
||||||
return (ESP_OK == esp_wifi_set_protocol(WIFI_IF_STA, protocol_bitmap));
|
return (ESP_OK == esp_wifi_set_protocol(WIFI_IF_STA, protocol_bitmap));
|
||||||
|
#endif // CONFIG_IDF_TARGET_ESP32P4
|
||||||
}
|
}
|
||||||
|
|
||||||
void WiFiHelper::setOutputPower(int n) {
|
void WiFiHelper::setOutputPower(int n) {
|
||||||
@ -346,8 +379,11 @@ String WiFiHelper::macAddress(void) {
|
|||||||
#else
|
#else
|
||||||
uint8_t mac[6] = {0,0,0,0,0,0};
|
uint8_t mac[6] = {0,0,0,0,0,0};
|
||||||
char macStr[18] = { 0 };
|
char macStr[18] = { 0 };
|
||||||
|
#ifdef CONFIG_SOC_HAS_WIFI
|
||||||
esp_read_mac(mac, ESP_MAC_WIFI_STA);
|
esp_read_mac(mac, ESP_MAC_WIFI_STA);
|
||||||
|
#else
|
||||||
|
esp_read_mac(mac, ESP_MAC_BASE);
|
||||||
|
#endif // CONFIG_SOC_HAS_WIFI
|
||||||
snprintf(macStr, sizeof(macStr), "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
|
snprintf(macStr, sizeof(macStr), "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
|
||||||
return String(macStr);
|
return String(macStr);
|
||||||
#endif
|
#endif
|
||||||
|
128
lib/default/base64-1.1.1/src/base64.cpp
Normal file
128
lib/default/base64-1.1.1/src/base64.cpp
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
/**
|
||||||
|
* Base64 encoding and decoding of strings. Uses '+' for 62, '/' for 63, '=' for padding
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "base64.hpp"
|
||||||
|
|
||||||
|
unsigned char binary_to_base64(unsigned char v) {
|
||||||
|
// Capital letters - 'A' is ascii 65 and base64 0
|
||||||
|
if(v < 26) return v + 'A';
|
||||||
|
|
||||||
|
// Lowercase letters - 'a' is ascii 97 and base64 26
|
||||||
|
if(v < 52) return v + 71;
|
||||||
|
|
||||||
|
// Digits - '0' is ascii 48 and base64 52
|
||||||
|
if(v < 62) return v - 4;
|
||||||
|
|
||||||
|
// '+' is ascii 43 and base64 62
|
||||||
|
if(v == 62) return '+';
|
||||||
|
|
||||||
|
// '/' is ascii 47 and base64 63
|
||||||
|
if(v == 63) return '/';
|
||||||
|
|
||||||
|
return 64;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char base64_to_binary(unsigned char c) {
|
||||||
|
// Capital letters - 'A' is ascii 65 and base64 0
|
||||||
|
if('A' <= c && c <= 'Z') return c - 'A';
|
||||||
|
|
||||||
|
// Lowercase letters - 'a' is ascii 97 and base64 26
|
||||||
|
if('a' <= c && c <= 'z') return c - 71;
|
||||||
|
|
||||||
|
// Digits - '0' is ascii 48 and base64 52
|
||||||
|
if('0' <= c && c <= '9') return c + 4;
|
||||||
|
|
||||||
|
// '+' is ascii 43 and base64 62
|
||||||
|
if(c == '+') return 62;
|
||||||
|
|
||||||
|
// '/' is ascii 47 and base64 63
|
||||||
|
if(c == '/') return 63;
|
||||||
|
|
||||||
|
return 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int encode_base64_length(unsigned int input_length) {
|
||||||
|
return (input_length + 2)/3*4;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int decode_base64_length(unsigned char input[]) {
|
||||||
|
unsigned char *start = input;
|
||||||
|
|
||||||
|
while(base64_to_binary(input[0]) < 64) {
|
||||||
|
++input;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int input_length = input - start;
|
||||||
|
|
||||||
|
unsigned int output_length = input_length/4*3;
|
||||||
|
|
||||||
|
switch(input_length % 4) {
|
||||||
|
default: return output_length;
|
||||||
|
case 2: return output_length + 1;
|
||||||
|
case 3: return output_length + 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int encode_base64(unsigned char input[], unsigned int input_length, unsigned char output[]) {
|
||||||
|
unsigned int full_sets = input_length/3;
|
||||||
|
|
||||||
|
// While there are still full sets of 24 bits...
|
||||||
|
for(unsigned int i = 0; i < full_sets; ++i) {
|
||||||
|
output[0] = binary_to_base64( input[0] >> 2);
|
||||||
|
output[1] = binary_to_base64((input[0] & 0x03) << 4 | input[1] >> 4);
|
||||||
|
output[2] = binary_to_base64((input[1] & 0x0F) << 2 | input[2] >> 6);
|
||||||
|
output[3] = binary_to_base64( input[2] & 0x3F);
|
||||||
|
|
||||||
|
input += 3;
|
||||||
|
output += 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(input_length % 3) {
|
||||||
|
case 0:
|
||||||
|
output[0] = '\0';
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
output[0] = binary_to_base64( input[0] >> 2);
|
||||||
|
output[1] = binary_to_base64((input[0] & 0x03) << 4);
|
||||||
|
output[2] = '=';
|
||||||
|
output[3] = '=';
|
||||||
|
output[4] = '\0';
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
output[0] = binary_to_base64( input[0] >> 2);
|
||||||
|
output[1] = binary_to_base64((input[0] & 0x03) << 4 | input[1] >> 4);
|
||||||
|
output[2] = binary_to_base64((input[1] & 0x0F) << 2);
|
||||||
|
output[3] = '=';
|
||||||
|
output[4] = '\0';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return encode_base64_length(input_length);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int decode_base64(unsigned char input[], unsigned char output[]) {
|
||||||
|
unsigned int output_length = decode_base64_length(input);
|
||||||
|
|
||||||
|
// While there are still full sets of 24 bits...
|
||||||
|
for(unsigned int i = 2; i < output_length; i += 3) {
|
||||||
|
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
|
||||||
|
output[1] = base64_to_binary(input[1]) << 4 | base64_to_binary(input[2]) >> 2;
|
||||||
|
output[2] = base64_to_binary(input[2]) << 6 | base64_to_binary(input[3]);
|
||||||
|
|
||||||
|
input += 4;
|
||||||
|
output += 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(output_length % 3) {
|
||||||
|
case 1:
|
||||||
|
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
|
||||||
|
output[1] = base64_to_binary(input[1]) << 4 | base64_to_binary(input[2]) >> 2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return output_length;
|
||||||
|
}
|
@ -69,127 +69,4 @@ unsigned int encode_base64(unsigned char input[], unsigned int input_length, uns
|
|||||||
*/
|
*/
|
||||||
unsigned int decode_base64(unsigned char input[], unsigned char output[]);
|
unsigned int decode_base64(unsigned char input[], unsigned char output[]);
|
||||||
|
|
||||||
unsigned char binary_to_base64(unsigned char v) {
|
|
||||||
// Capital letters - 'A' is ascii 65 and base64 0
|
|
||||||
if(v < 26) return v + 'A';
|
|
||||||
|
|
||||||
// Lowercase letters - 'a' is ascii 97 and base64 26
|
|
||||||
if(v < 52) return v + 71;
|
|
||||||
|
|
||||||
// Digits - '0' is ascii 48 and base64 52
|
|
||||||
if(v < 62) return v - 4;
|
|
||||||
|
|
||||||
// '+' is ascii 43 and base64 62
|
|
||||||
if(v == 62) return '+';
|
|
||||||
|
|
||||||
// '/' is ascii 47 and base64 63
|
|
||||||
if(v == 63) return '/';
|
|
||||||
|
|
||||||
return 64;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned char base64_to_binary(unsigned char c) {
|
|
||||||
// Capital letters - 'A' is ascii 65 and base64 0
|
|
||||||
if('A' <= c && c <= 'Z') return c - 'A';
|
|
||||||
|
|
||||||
// Lowercase letters - 'a' is ascii 97 and base64 26
|
|
||||||
if('a' <= c && c <= 'z') return c - 71;
|
|
||||||
|
|
||||||
// Digits - '0' is ascii 48 and base64 52
|
|
||||||
if('0' <= c && c <= '9') return c + 4;
|
|
||||||
|
|
||||||
// '+' is ascii 43 and base64 62
|
|
||||||
if(c == '+') return 62;
|
|
||||||
|
|
||||||
// '/' is ascii 47 and base64 63
|
|
||||||
if(c == '/') return 63;
|
|
||||||
|
|
||||||
return 255;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int encode_base64_length(unsigned int input_length) {
|
|
||||||
return (input_length + 2)/3*4;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int decode_base64_length(unsigned char input[]) {
|
|
||||||
unsigned char *start = input;
|
|
||||||
|
|
||||||
while(base64_to_binary(input[0]) < 64) {
|
|
||||||
++input;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int input_length = input - start;
|
|
||||||
|
|
||||||
unsigned int output_length = input_length/4*3;
|
|
||||||
|
|
||||||
switch(input_length % 4) {
|
|
||||||
default: return output_length;
|
|
||||||
case 2: return output_length + 1;
|
|
||||||
case 3: return output_length + 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int encode_base64(unsigned char input[], unsigned int input_length, unsigned char output[]) {
|
|
||||||
unsigned int full_sets = input_length/3;
|
|
||||||
|
|
||||||
// While there are still full sets of 24 bits...
|
|
||||||
for(unsigned int i = 0; i < full_sets; ++i) {
|
|
||||||
output[0] = binary_to_base64( input[0] >> 2);
|
|
||||||
output[1] = binary_to_base64((input[0] & 0x03) << 4 | input[1] >> 4);
|
|
||||||
output[2] = binary_to_base64((input[1] & 0x0F) << 2 | input[2] >> 6);
|
|
||||||
output[3] = binary_to_base64( input[2] & 0x3F);
|
|
||||||
|
|
||||||
input += 3;
|
|
||||||
output += 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(input_length % 3) {
|
|
||||||
case 0:
|
|
||||||
output[0] = '\0';
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
output[0] = binary_to_base64( input[0] >> 2);
|
|
||||||
output[1] = binary_to_base64((input[0] & 0x03) << 4);
|
|
||||||
output[2] = '=';
|
|
||||||
output[3] = '=';
|
|
||||||
output[4] = '\0';
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
output[0] = binary_to_base64( input[0] >> 2);
|
|
||||||
output[1] = binary_to_base64((input[0] & 0x03) << 4 | input[1] >> 4);
|
|
||||||
output[2] = binary_to_base64((input[1] & 0x0F) << 2);
|
|
||||||
output[3] = '=';
|
|
||||||
output[4] = '\0';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return encode_base64_length(input_length);
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int decode_base64(unsigned char input[], unsigned char output[]) {
|
|
||||||
unsigned int output_length = decode_base64_length(input);
|
|
||||||
|
|
||||||
// While there are still full sets of 24 bits...
|
|
||||||
for(unsigned int i = 2; i < output_length; i += 3) {
|
|
||||||
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
|
|
||||||
output[1] = base64_to_binary(input[1]) << 4 | base64_to_binary(input[2]) >> 2;
|
|
||||||
output[2] = base64_to_binary(input[2]) << 6 | base64_to_binary(input[3]);
|
|
||||||
|
|
||||||
input += 4;
|
|
||||||
output += 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(output_length % 3) {
|
|
||||||
case 1:
|
|
||||||
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
|
|
||||||
output[1] = base64_to_binary(input[1]) << 4 | base64_to_binary(input[2]) >> 2;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return output_length;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // ifndef
|
#endif // ifndef
|
||||||
|
@ -25,9 +25,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
// #define strcmp_P(x, y) strcmp(x,y)
|
|
||||||
// #define strcasecmp_P(x,y) strcasecmp(x,y)
|
|
||||||
// #define pgm_read_byte(x) (*(uint8_t*)(x))
|
|
||||||
#ifndef ARRAY_SIZE
|
#ifndef ARRAY_SIZE
|
||||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||||
#endif
|
#endif
|
||||||
|
@ -402,8 +402,10 @@ void IRac::airton(IRAirtonAc *ac,
|
|||||||
const int16_t sleep) {
|
const int16_t sleep) {
|
||||||
ac->begin();
|
ac->begin();
|
||||||
ac->setPower(on);
|
ac->setPower(on);
|
||||||
ac->setMode(ac->convertMode(mode));
|
|
||||||
ac->setTemp(degrees);
|
ac->setTemp(degrees);
|
||||||
|
// Mode needs to be set after temp as Fan-only uses a special temp.
|
||||||
|
ac->setMode(ac->convertMode(mode));
|
||||||
|
// Fan needs to be set after mode, as setMode can change the fan speed.
|
||||||
ac->setFan(ac->convertFan(fan));
|
ac->setFan(ac->convertFan(fan));
|
||||||
ac->setSwingV(swingv != stdAc::swingv_t::kOff);
|
ac->setSwingV(swingv != stdAc::swingv_t::kOff);
|
||||||
// No Quiet setting available.
|
// No Quiet setting available.
|
||||||
|
@ -235,7 +235,7 @@ bool directRead(IO_REG_TYPE mask)
|
|||||||
static inline __attribute__((always_inline))
|
static inline __attribute__((always_inline))
|
||||||
IO_REG_TYPE directRead(IO_REG_TYPE pin)
|
IO_REG_TYPE directRead(IO_REG_TYPE pin)
|
||||||
{
|
{
|
||||||
#if SOC_GPIO_PIN_COUNT <= 32
|
#if SOC_GPIO_PIN_COUNT <= 32 || CONFIG_IDF_TARGET_ESP32P4
|
||||||
return (GPIO.in.val >> pin) & 0x1;
|
return (GPIO.in.val >> pin) & 0x1;
|
||||||
#else // ESP32 with over 32 gpios
|
#else // ESP32 with over 32 gpios
|
||||||
if ( pin < 32 )
|
if ( pin < 32 )
|
||||||
@ -250,7 +250,7 @@ IO_REG_TYPE directRead(IO_REG_TYPE pin)
|
|||||||
static inline __attribute__((always_inline))
|
static inline __attribute__((always_inline))
|
||||||
void directWriteLow(IO_REG_TYPE pin)
|
void directWriteLow(IO_REG_TYPE pin)
|
||||||
{
|
{
|
||||||
#if SOC_GPIO_PIN_COUNT <= 32
|
#if SOC_GPIO_PIN_COUNT <= 32 || CONFIG_IDF_TARGET_ESP32P4
|
||||||
GPIO.out_w1tc.val = ((uint32_t)1 << pin);
|
GPIO.out_w1tc.val = ((uint32_t)1 << pin);
|
||||||
#else // ESP32 with over 32 gpios
|
#else // ESP32 with over 32 gpios
|
||||||
if ( pin < 32 )
|
if ( pin < 32 )
|
||||||
@ -263,7 +263,7 @@ void directWriteLow(IO_REG_TYPE pin)
|
|||||||
static inline __attribute__((always_inline))
|
static inline __attribute__((always_inline))
|
||||||
void directWriteHigh(IO_REG_TYPE pin)
|
void directWriteHigh(IO_REG_TYPE pin)
|
||||||
{
|
{
|
||||||
#if SOC_GPIO_PIN_COUNT <= 32
|
#if SOC_GPIO_PIN_COUNT <= 32 || CONFIG_IDF_TARGET_ESP32P4
|
||||||
GPIO.out_w1ts.val = ((uint32_t)1 << pin);
|
GPIO.out_w1ts.val = ((uint32_t)1 << pin);
|
||||||
#else // ESP32 with over 32 gpios
|
#else // ESP32 with over 32 gpios
|
||||||
if ( pin < 32 )
|
if ( pin < 32 )
|
||||||
@ -280,7 +280,7 @@ void directModeInput(IO_REG_TYPE pin)
|
|||||||
if ( digitalPinIsValid(pin) )
|
if ( digitalPinIsValid(pin) )
|
||||||
{
|
{
|
||||||
// Input
|
// Input
|
||||||
#if SOC_GPIO_PIN_COUNT <= 32
|
#if SOC_GPIO_PIN_COUNT <= 32 || CONFIG_IDF_TARGET_ESP32P4
|
||||||
GPIO.enable_w1tc.val = ((uint32_t)1 << (pin));
|
GPIO.enable_w1tc.val = ((uint32_t)1 << (pin));
|
||||||
#else // ESP32 with over 32 gpios
|
#else // ESP32 with over 32 gpios
|
||||||
if ( pin < 32 )
|
if ( pin < 32 )
|
||||||
@ -298,7 +298,7 @@ void directModeOutput(IO_REG_TYPE pin)
|
|||||||
if ( digitalPinCanOutput(pin) )
|
if ( digitalPinCanOutput(pin) )
|
||||||
{
|
{
|
||||||
// Output
|
// Output
|
||||||
#if SOC_GPIO_PIN_COUNT <= 32
|
#if SOC_GPIO_PIN_COUNT <= 32 || CONFIG_IDF_TARGET_ESP32P4
|
||||||
GPIO.enable_w1ts.val = ((uint32_t)1 << (pin));
|
GPIO.enable_w1ts.val = ((uint32_t)1 << (pin));
|
||||||
#else // ESP32 with over 32 gpios
|
#else // ESP32 with over 32 gpios
|
||||||
if ( pin < 32 )
|
if ( pin < 32 )
|
||||||
|
@ -112,7 +112,7 @@ enum uColorType { uCOLOR_BW, uCOLOR_COLOR };
|
|||||||
#undef GPIO_SET_SLOW
|
#undef GPIO_SET_SLOW
|
||||||
#undef GPIO_CLR_SLOW
|
#undef GPIO_CLR_SLOW
|
||||||
|
|
||||||
#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6
|
#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32P4
|
||||||
#define GPIO_CLR(A) GPIO.out_w1tc.val = (1 << A)
|
#define GPIO_CLR(A) GPIO.out_w1tc.val = (1 << A)
|
||||||
#define GPIO_SET(A) GPIO.out_w1ts.val = (1 << A)
|
#define GPIO_SET(A) GPIO.out_w1ts.val = (1 << A)
|
||||||
#else // plain ESP32
|
#else // plain ESP32
|
||||||
|
@ -154,6 +154,7 @@ static const RCSwitch::Protocol PROGMEM proto[] = {
|
|||||||
{ 250, 0, { 0, 0 }, 1, { 18, 6 }, { 1, 3 }, { 3, 1 }, false, 0 }, // 36 Dooya remote DC2700AC for Dooya DT82TV curtains motor
|
{ 250, 0, { 0, 0 }, 1, { 18, 6 }, { 1, 3 }, { 3, 1 }, false, 0 }, // 36 Dooya remote DC2700AC for Dooya DT82TV curtains motor
|
||||||
{ 200, 0, { 0, 0 }, 0, { 0, 0 }, { 1, 3 }, { 3, 1 }, false, 20 }, // 37 DEWENWILS Power Strip
|
{ 200, 0, { 0, 0 }, 0, { 0, 0 }, { 1, 3 }, { 3, 1 }, false, 20 }, // 37 DEWENWILS Power Strip
|
||||||
{ 500, 0, { 0, 0 }, 1, { 7, 1 }, { 2, 1 }, { 4, 1 }, true, 0 }, // 38 temperature and humidity sensor, various brands, nexus protocol, 36 bits + start impulse
|
{ 500, 0, { 0, 0 }, 1, { 7, 1 }, { 2, 1 }, { 4, 1 }, true, 0 }, // 38 temperature and humidity sensor, various brands, nexus protocol, 36 bits + start impulse
|
||||||
|
{ 560, 0, { 0, 0 }, 1, { 15, 1 }, { 3, 1 }, { 7, 1 }, true, 0 } // 39 Hyundai WS Senzor 77/77TH, 36 bits (requires disabled protocol 38: 'RfProtocol38 0')
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@ -658,17 +659,6 @@ void RCSwitch::send(unsigned long long code, unsigned int length) {
|
|||||||
else
|
else
|
||||||
this->transmit(protocol.zero);
|
this->transmit(protocol.zero);
|
||||||
}
|
}
|
||||||
// for kilok, there should be a duration of 66, and 64 significant data codes are stored
|
|
||||||
// send two more bits for even count
|
|
||||||
if (length == 64) {
|
|
||||||
if (nRepeat == 0) {
|
|
||||||
this->transmit(protocol.zero);
|
|
||||||
this->transmit(protocol.zero);
|
|
||||||
} else {
|
|
||||||
this->transmit(protocol.one);
|
|
||||||
this->transmit(protocol.one);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Set the guard Time
|
// Set the guard Time
|
||||||
if (protocol.Guard > 0) {
|
if (protocol.Guard > 0) {
|
||||||
digitalWrite(this->nTransmitterPin, LOW);
|
digitalWrite(this->nTransmitterPin, LOW);
|
||||||
|
504
lib/lib_ssl/IniFile-Tasmota/LICENSE
Normal file
504
lib/lib_ssl/IniFile-Tasmota/LICENSE
Normal file
@ -0,0 +1,504 @@
|
|||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
Version 2.1, February 1999
|
||||||
|
|
||||||
|
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
(This is the first released version of the Lesser GPL. It also counts
|
||||||
|
as the successor of the GNU Library Public License, version 2, hence
|
||||||
|
the version number 2.1.)
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The licenses for most software are designed to take away your
|
||||||
|
freedom to share and change it. By contrast, the GNU General Public
|
||||||
|
Licenses are intended to guarantee your freedom to share and change
|
||||||
|
free software--to make sure the software is free for all its users.
|
||||||
|
|
||||||
|
This license, the Lesser General Public License, applies to some
|
||||||
|
specially designated software packages--typically libraries--of the
|
||||||
|
Free Software Foundation and other authors who decide to use it. You
|
||||||
|
can use it too, but we suggest you first think carefully about whether
|
||||||
|
this license or the ordinary General Public License is the better
|
||||||
|
strategy to use in any particular case, based on the explanations below.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom of use,
|
||||||
|
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 this service if you wish); that you receive source code or can get
|
||||||
|
it if you want it; that you can change the software and use pieces of
|
||||||
|
it in new free programs; and that you are informed that you can do
|
||||||
|
these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to make restrictions that forbid
|
||||||
|
distributors to deny you these rights or to ask you to surrender these
|
||||||
|
rights. These restrictions translate to certain responsibilities for
|
||||||
|
you if you distribute copies of the library or if you modify it.
|
||||||
|
|
||||||
|
For example, if you distribute copies of the library, whether gratis
|
||||||
|
or for a fee, you must give the recipients all the rights that we gave
|
||||||
|
you. You must make sure that they, too, receive or can get the source
|
||||||
|
code. If you link other code with the library, you must provide
|
||||||
|
complete object files to the recipients, so that they can relink them
|
||||||
|
with the library after making changes to the library and recompiling
|
||||||
|
it. And you must show them these terms so they know their rights.
|
||||||
|
|
||||||
|
We protect your rights with a two-step method: (1) we copyright the
|
||||||
|
library, and (2) we offer you this license, which gives you legal
|
||||||
|
permission to copy, distribute and/or modify the library.
|
||||||
|
|
||||||
|
To protect each distributor, we want to make it very clear that
|
||||||
|
there is no warranty for the free library. Also, if the library is
|
||||||
|
modified by someone else and passed on, the recipients should know
|
||||||
|
that what they have is not the original version, so that the original
|
||||||
|
author's reputation will not be affected by problems that might be
|
||||||
|
introduced by others.
|
||||||
|
|
||||||
|
Finally, software patents pose a constant threat to the existence of
|
||||||
|
any free program. We wish to make sure that a company cannot
|
||||||
|
effectively restrict the users of a free program by obtaining a
|
||||||
|
restrictive license from a patent holder. Therefore, we insist that
|
||||||
|
any patent license obtained for a version of the library must be
|
||||||
|
consistent with the full freedom of use specified in this license.
|
||||||
|
|
||||||
|
Most GNU software, including some libraries, is covered by the
|
||||||
|
ordinary GNU General Public License. This license, the GNU Lesser
|
||||||
|
General Public License, applies to certain designated libraries, and
|
||||||
|
is quite different from the ordinary General Public License. We use
|
||||||
|
this license for certain libraries in order to permit linking those
|
||||||
|
libraries into non-free programs.
|
||||||
|
|
||||||
|
When a program is linked with a library, whether statically or using
|
||||||
|
a shared library, the combination of the two is legally speaking a
|
||||||
|
combined work, a derivative of the original library. The ordinary
|
||||||
|
General Public License therefore permits such linking only if the
|
||||||
|
entire combination fits its criteria of freedom. The Lesser General
|
||||||
|
Public License permits more lax criteria for linking other code with
|
||||||
|
the library.
|
||||||
|
|
||||||
|
We call this license the "Lesser" General Public License because it
|
||||||
|
does Less to protect the user's freedom than the ordinary General
|
||||||
|
Public License. It also provides other free software developers Less
|
||||||
|
of an advantage over competing non-free programs. These disadvantages
|
||||||
|
are the reason we use the ordinary General Public License for many
|
||||||
|
libraries. However, the Lesser license provides advantages in certain
|
||||||
|
special circumstances.
|
||||||
|
|
||||||
|
For example, on rare occasions, there may be a special need to
|
||||||
|
encourage the widest possible use of a certain library, so that it becomes
|
||||||
|
a de-facto standard. To achieve this, non-free programs must be
|
||||||
|
allowed to use the library. A more frequent case is that a free
|
||||||
|
library does the same job as widely used non-free libraries. In this
|
||||||
|
case, there is little to gain by limiting the free library to free
|
||||||
|
software only, so we use the Lesser General Public License.
|
||||||
|
|
||||||
|
In other cases, permission to use a particular library in non-free
|
||||||
|
programs enables a greater number of people to use a large body of
|
||||||
|
free software. For example, permission to use the GNU C Library in
|
||||||
|
non-free programs enables many more people to use the whole GNU
|
||||||
|
operating system, as well as its variant, the GNU/Linux operating
|
||||||
|
system.
|
||||||
|
|
||||||
|
Although the Lesser General Public License is Less protective of the
|
||||||
|
users' freedom, it does ensure that the user of a program that is
|
||||||
|
linked with the Library has the freedom and the wherewithal to run
|
||||||
|
that program using a modified version of the Library.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow. Pay close attention to the difference between a
|
||||||
|
"work based on the library" and a "work that uses the library". The
|
||||||
|
former contains code derived from the library, whereas the latter must
|
||||||
|
be combined with the library in order to run.
|
||||||
|
|
||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. This License Agreement applies to any software library or other
|
||||||
|
program which contains a notice placed by the copyright holder or
|
||||||
|
other authorized party saying it may be distributed under the terms of
|
||||||
|
this Lesser General Public License (also called "this License").
|
||||||
|
Each licensee is addressed as "you".
|
||||||
|
|
||||||
|
A "library" means a collection of software functions and/or data
|
||||||
|
prepared so as to be conveniently linked with application programs
|
||||||
|
(which use some of those functions and data) to form executables.
|
||||||
|
|
||||||
|
The "Library", below, refers to any such software library or work
|
||||||
|
which has been distributed under these terms. A "work based on the
|
||||||
|
Library" means either the Library or any derivative work under
|
||||||
|
copyright law: that is to say, a work containing the Library or a
|
||||||
|
portion of it, either verbatim or with modifications and/or translated
|
||||||
|
straightforwardly into another language. (Hereinafter, translation is
|
||||||
|
included without limitation in the term "modification".)
|
||||||
|
|
||||||
|
"Source code" for a work means the preferred form of the work for
|
||||||
|
making modifications to it. For a library, complete source code means
|
||||||
|
all the source code for all modules it contains, plus any associated
|
||||||
|
interface definition files, plus the scripts used to control compilation
|
||||||
|
and installation of the library.
|
||||||
|
|
||||||
|
Activities other than copying, distribution and modification are not
|
||||||
|
covered by this License; they are outside its scope. The act of
|
||||||
|
running a program using the Library is not restricted, and output from
|
||||||
|
such a program is covered only if its contents constitute a work based
|
||||||
|
on the Library (independent of the use of the Library in a tool for
|
||||||
|
writing it). Whether that is true depends on what the Library does
|
||||||
|
and what the program that uses the Library does.
|
||||||
|
|
||||||
|
1. You may copy and distribute verbatim copies of the Library's
|
||||||
|
complete source code as you receive it, in any medium, provided that
|
||||||
|
you conspicuously and appropriately publish on each copy an
|
||||||
|
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||||
|
all the notices that refer to this License and to the absence of any
|
||||||
|
warranty; and distribute a copy of this License along with the
|
||||||
|
Library.
|
||||||
|
|
||||||
|
You may charge a fee for the physical act of transferring a copy,
|
||||||
|
and you may at your option offer warranty protection in exchange for a
|
||||||
|
fee.
|
||||||
|
|
||||||
|
2. You may modify your copy or copies of the Library or any portion
|
||||||
|
of it, thus forming a work based on the Library, and copy and
|
||||||
|
distribute such modifications or work under the terms of Section 1
|
||||||
|
above, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The modified work must itself be a software library.
|
||||||
|
|
||||||
|
b) You must cause the files modified to carry prominent notices
|
||||||
|
stating that you changed the files and the date of any change.
|
||||||
|
|
||||||
|
c) You must cause the whole of the work to be licensed at no
|
||||||
|
charge to all third parties under the terms of this License.
|
||||||
|
|
||||||
|
d) If a facility in the modified Library refers to a function or a
|
||||||
|
table of data to be supplied by an application program that uses
|
||||||
|
the facility, other than as an argument passed when the facility
|
||||||
|
is invoked, then you must make a good faith effort to ensure that,
|
||||||
|
in the event an application does not supply such function or
|
||||||
|
table, the facility still operates, and performs whatever part of
|
||||||
|
its purpose remains meaningful.
|
||||||
|
|
||||||
|
(For example, a function in a library to compute square roots has
|
||||||
|
a purpose that is entirely well-defined independent of the
|
||||||
|
application. Therefore, Subsection 2d requires that any
|
||||||
|
application-supplied function or table used by this function must
|
||||||
|
be optional: if the application does not supply it, the square
|
||||||
|
root function must still compute square roots.)
|
||||||
|
|
||||||
|
These requirements apply to the modified work as a whole. If
|
||||||
|
identifiable sections of that work are not derived from the Library,
|
||||||
|
and can be reasonably considered independent and separate works in
|
||||||
|
themselves, then this License, and its terms, do not apply to those
|
||||||
|
sections when you distribute them as separate works. But when you
|
||||||
|
distribute the same sections as part of a whole which is a work based
|
||||||
|
on the Library, the distribution of the whole must be on the terms of
|
||||||
|
this License, whose permissions for other licensees extend to the
|
||||||
|
entire whole, and thus to each and every part regardless of who wrote
|
||||||
|
it.
|
||||||
|
|
||||||
|
Thus, it is not the intent of this section to claim rights or contest
|
||||||
|
your rights to work written entirely by you; rather, the intent is to
|
||||||
|
exercise the right to control the distribution of derivative or
|
||||||
|
collective works based on the Library.
|
||||||
|
|
||||||
|
In addition, mere aggregation of another work not based on the Library
|
||||||
|
with the Library (or with a work based on the Library) on a volume of
|
||||||
|
a storage or distribution medium does not bring the other work under
|
||||||
|
the scope of this License.
|
||||||
|
|
||||||
|
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||||
|
License instead of this License to a given copy of the Library. To do
|
||||||
|
this, you must alter all the notices that refer to this License, so
|
||||||
|
that they refer to the ordinary GNU General Public License, version 2,
|
||||||
|
instead of to this License. (If a newer version than version 2 of the
|
||||||
|
ordinary GNU General Public License has appeared, then you can specify
|
||||||
|
that version instead if you wish.) Do not make any other change in
|
||||||
|
these notices.
|
||||||
|
|
||||||
|
Once this change is made in a given copy, it is irreversible for
|
||||||
|
that copy, so the ordinary GNU General Public License applies to all
|
||||||
|
subsequent copies and derivative works made from that copy.
|
||||||
|
|
||||||
|
This option is useful when you wish to copy part of the code of
|
||||||
|
the Library into a program that is not a library.
|
||||||
|
|
||||||
|
4. You may copy and distribute the Library (or a portion or
|
||||||
|
derivative of it, under Section 2) in object code or executable form
|
||||||
|
under the terms of Sections 1 and 2 above provided that you accompany
|
||||||
|
it with the complete corresponding machine-readable source code, which
|
||||||
|
must be distributed under the terms of Sections 1 and 2 above on a
|
||||||
|
medium customarily used for software interchange.
|
||||||
|
|
||||||
|
If distribution of object code is made by offering access to copy
|
||||||
|
from a designated place, then offering equivalent access to copy the
|
||||||
|
source code from the same place satisfies the requirement to
|
||||||
|
distribute the source code, even though third parties are not
|
||||||
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
|
5. A program that contains no derivative of any portion of the
|
||||||
|
Library, but is designed to work with the Library by being compiled or
|
||||||
|
linked with it, is called a "work that uses the Library". Such a
|
||||||
|
work, in isolation, is not a derivative work of the Library, and
|
||||||
|
therefore falls outside the scope of this License.
|
||||||
|
|
||||||
|
However, linking a "work that uses the Library" with the Library
|
||||||
|
creates an executable that is a derivative of the Library (because it
|
||||||
|
contains portions of the Library), rather than a "work that uses the
|
||||||
|
library". The executable is therefore covered by this License.
|
||||||
|
Section 6 states terms for distribution of such executables.
|
||||||
|
|
||||||
|
When a "work that uses the Library" uses material from a header file
|
||||||
|
that is part of the Library, the object code for the work may be a
|
||||||
|
derivative work of the Library even though the source code is not.
|
||||||
|
Whether this is true is especially significant if the work can be
|
||||||
|
linked without the Library, or if the work is itself a library. The
|
||||||
|
threshold for this to be true is not precisely defined by law.
|
||||||
|
|
||||||
|
If such an object file uses only numerical parameters, data
|
||||||
|
structure layouts and accessors, and small macros and small inline
|
||||||
|
functions (ten lines or less in length), then the use of the object
|
||||||
|
file is unrestricted, regardless of whether it is legally a derivative
|
||||||
|
work. (Executables containing this object code plus portions of the
|
||||||
|
Library will still fall under Section 6.)
|
||||||
|
|
||||||
|
Otherwise, if the work is a derivative of the Library, you may
|
||||||
|
distribute the object code for the work under the terms of Section 6.
|
||||||
|
Any executables containing that work also fall under Section 6,
|
||||||
|
whether or not they are linked directly with the Library itself.
|
||||||
|
|
||||||
|
6. As an exception to the Sections above, you may also combine or
|
||||||
|
link a "work that uses the Library" with the Library to produce a
|
||||||
|
work containing portions of the Library, and distribute that work
|
||||||
|
under terms of your choice, provided that the terms permit
|
||||||
|
modification of the work for the customer's own use and reverse
|
||||||
|
engineering for debugging such modifications.
|
||||||
|
|
||||||
|
You must give prominent notice with each copy of the work that the
|
||||||
|
Library is used in it and that the Library and its use are covered by
|
||||||
|
this License. You must supply a copy of this License. If the work
|
||||||
|
during execution displays copyright notices, you must include the
|
||||||
|
copyright notice for the Library among them, as well as a reference
|
||||||
|
directing the user to the copy of this License. Also, you must do one
|
||||||
|
of these things:
|
||||||
|
|
||||||
|
a) Accompany the work with the complete corresponding
|
||||||
|
machine-readable source code for the Library including whatever
|
||||||
|
changes were used in the work (which must be distributed under
|
||||||
|
Sections 1 and 2 above); and, if the work is an executable linked
|
||||||
|
with the Library, with the complete machine-readable "work that
|
||||||
|
uses the Library", as object code and/or source code, so that the
|
||||||
|
user can modify the Library and then relink to produce a modified
|
||||||
|
executable containing the modified Library. (It is understood
|
||||||
|
that the user who changes the contents of definitions files in the
|
||||||
|
Library will not necessarily be able to recompile the application
|
||||||
|
to use the modified definitions.)
|
||||||
|
|
||||||
|
b) Use a suitable shared library mechanism for linking with the
|
||||||
|
Library. A suitable mechanism is one that (1) uses at run time a
|
||||||
|
copy of the library already present on the user's computer system,
|
||||||
|
rather than copying library functions into the executable, and (2)
|
||||||
|
will operate properly with a modified version of the library, if
|
||||||
|
the user installs one, as long as the modified version is
|
||||||
|
interface-compatible with the version that the work was made with.
|
||||||
|
|
||||||
|
c) Accompany the work with a written offer, valid for at
|
||||||
|
least three years, to give the same user the materials
|
||||||
|
specified in Subsection 6a, above, for a charge no more
|
||||||
|
than the cost of performing this distribution.
|
||||||
|
|
||||||
|
d) If distribution of the work is made by offering access to copy
|
||||||
|
from a designated place, offer equivalent access to copy the above
|
||||||
|
specified materials from the same place.
|
||||||
|
|
||||||
|
e) Verify that the user has already received a copy of these
|
||||||
|
materials or that you have already sent this user a copy.
|
||||||
|
|
||||||
|
For an executable, the required form of the "work that uses the
|
||||||
|
Library" must include any data and utility programs needed for
|
||||||
|
reproducing the executable from it. However, as a special exception,
|
||||||
|
the materials to be distributed need not include anything that is
|
||||||
|
normally distributed (in either source or binary form) with the major
|
||||||
|
components (compiler, kernel, and so on) of the operating system on
|
||||||
|
which the executable runs, unless that component itself accompanies
|
||||||
|
the executable.
|
||||||
|
|
||||||
|
It may happen that this requirement contradicts the license
|
||||||
|
restrictions of other proprietary libraries that do not normally
|
||||||
|
accompany the operating system. Such a contradiction means you cannot
|
||||||
|
use both them and the Library together in an executable that you
|
||||||
|
distribute.
|
||||||
|
|
||||||
|
7. 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 not covered by this License, and distribute such a combined
|
||||||
|
library, provided that the separate distribution of the work based on
|
||||||
|
the Library and of the other library facilities is otherwise
|
||||||
|
permitted, and provided that you do these two things:
|
||||||
|
|
||||||
|
a) Accompany the combined library with a copy of the same work
|
||||||
|
based on the Library, uncombined with any other library
|
||||||
|
facilities. This must be distributed under the terms of the
|
||||||
|
Sections above.
|
||||||
|
|
||||||
|
b) Give prominent notice with the combined library of the fact
|
||||||
|
that part of it is a work based on the Library, and explaining
|
||||||
|
where to find the accompanying uncombined form of the same work.
|
||||||
|
|
||||||
|
8. You may not copy, modify, sublicense, link with, or distribute
|
||||||
|
the Library except as expressly provided under this License. Any
|
||||||
|
attempt otherwise to copy, modify, sublicense, link with, or
|
||||||
|
distribute the Library is void, and will automatically terminate your
|
||||||
|
rights under this License. However, parties who have received copies,
|
||||||
|
or rights, from you under this License will not have their licenses
|
||||||
|
terminated so long as such parties remain in full compliance.
|
||||||
|
|
||||||
|
9. You are not required to accept this License, since you have not
|
||||||
|
signed it. However, nothing else grants you permission to modify or
|
||||||
|
distribute the Library or its derivative works. These actions are
|
||||||
|
prohibited by law if you do not accept this License. Therefore, by
|
||||||
|
modifying or distributing the Library (or any work based on the
|
||||||
|
Library), you indicate your acceptance of this License to do so, and
|
||||||
|
all its terms and conditions for copying, distributing or modifying
|
||||||
|
the Library or works based on it.
|
||||||
|
|
||||||
|
10. Each time you redistribute the Library (or any work based on the
|
||||||
|
Library), the recipient automatically receives a license from the
|
||||||
|
original licensor to copy, distribute, link with or modify the Library
|
||||||
|
subject to these terms and conditions. You may not impose any further
|
||||||
|
restrictions on the recipients' exercise of the rights granted herein.
|
||||||
|
You are not responsible for enforcing compliance by third parties with
|
||||||
|
this License.
|
||||||
|
|
||||||
|
11. If, as a consequence of a court judgment or allegation of patent
|
||||||
|
infringement or for any other reason (not limited to patent issues),
|
||||||
|
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
|
||||||
|
distribute so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you
|
||||||
|
may not distribute the Library at all. For example, if a patent
|
||||||
|
license would not permit royalty-free redistribution of the Library by
|
||||||
|
all those who receive copies directly or indirectly through you, then
|
||||||
|
the only way you could satisfy both it and this License would be to
|
||||||
|
refrain entirely from distribution of the Library.
|
||||||
|
|
||||||
|
If any portion of this section is held invalid or unenforceable under any
|
||||||
|
particular circumstance, the balance of the section is intended to apply,
|
||||||
|
and the section as a whole is intended to apply in other circumstances.
|
||||||
|
|
||||||
|
It is not the purpose of this section to induce you to infringe any
|
||||||
|
patents or other property right claims or to contest validity of any
|
||||||
|
such claims; this section has the sole purpose of protecting the
|
||||||
|
integrity of the free software distribution system which is
|
||||||
|
implemented by public license practices. Many people have made
|
||||||
|
generous contributions to the wide range of software distributed
|
||||||
|
through that system in reliance on consistent application of that
|
||||||
|
system; it is up to the author/donor to decide if he or she is willing
|
||||||
|
to distribute software through any other system and a licensee cannot
|
||||||
|
impose that choice.
|
||||||
|
|
||||||
|
This section is intended to make thoroughly clear what is believed to
|
||||||
|
be a consequence of the rest of this License.
|
||||||
|
|
||||||
|
12. If the distribution and/or use of the Library is restricted in
|
||||||
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
|
original copyright holder who places the Library under this License may add
|
||||||
|
an explicit geographical distribution limitation excluding those countries,
|
||||||
|
so that distribution is permitted only in or among countries not thus
|
||||||
|
excluded. In such case, this License incorporates the limitation as if
|
||||||
|
written in the body of this License.
|
||||||
|
|
||||||
|
13. The Free Software Foundation may publish revised and/or new
|
||||||
|
versions of the 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
|
||||||
|
specifies a version number of this License which applies to it and
|
||||||
|
"any later version", you have the option of following the terms and
|
||||||
|
conditions either of that version or of any later version published by
|
||||||
|
the Free Software Foundation. If the Library does not specify a
|
||||||
|
license version number, you may choose any version ever published by
|
||||||
|
the Free Software Foundation.
|
||||||
|
|
||||||
|
14. If you wish to incorporate parts of the Library into other free
|
||||||
|
programs whose distribution conditions are incompatible with these,
|
||||||
|
write to the author to ask for permission. For software which is
|
||||||
|
copyrighted by the Free Software Foundation, write to the Free
|
||||||
|
Software Foundation; we sometimes make exceptions for this. Our
|
||||||
|
decision will be guided by the two goals of preserving the free status
|
||||||
|
of all derivatives of our free software and of promoting the sharing
|
||||||
|
and reuse of software generally.
|
||||||
|
|
||||||
|
NO WARRANTY
|
||||||
|
|
||||||
|
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||||
|
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||||
|
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||||
|
OTHER PARTIES PROVIDE THE LIBRARY "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
|
||||||
|
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||||
|
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||||
|
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||||
|
AND/OR REDISTRIBUTE THE LIBRARY 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
|
||||||
|
LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||||
|
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||||
|
DAMAGES.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Libraries
|
||||||
|
|
||||||
|
If you develop a new library, and you want it to be of the greatest
|
||||||
|
possible use to the public, we recommend making it free software that
|
||||||
|
everyone can redistribute and change. You can do so by permitting
|
||||||
|
redistribution under these terms (or, alternatively, under the terms of the
|
||||||
|
ordinary General Public License).
|
||||||
|
|
||||||
|
To apply these terms, attach the following notices to the library. It is
|
||||||
|
safest to attach them to the start of each source file to most effectively
|
||||||
|
convey the exclusion of warranty; and each file should have at least the
|
||||||
|
"copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
{description}
|
||||||
|
Copyright (C) {year} {fullname}
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2.1 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library 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
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||||
|
USA
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or your
|
||||||
|
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||||
|
necessary. Here is a sample; alter the names:
|
||||||
|
|
||||||
|
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||||
|
library `Frob' (a library for tweaking knobs) written by James Random
|
||||||
|
Hacker.
|
||||||
|
|
||||||
|
{signature of Ty Coon}, 1 April 1990
|
||||||
|
Ty Coon, President of Vice
|
||||||
|
|
||||||
|
That's all there is to it!
|
101
lib/lib_ssl/IniFile-Tasmota/README.md
Normal file
101
lib/lib_ssl/IniFile-Tasmota/README.md
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
# IniFile
|
||||||
|
|
||||||
|
IniFile is an Arduino library for reading ini files. The format is
|
||||||
|
similar to that seen in Microsoft `.ini` files but the implementation
|
||||||
|
is completely independent. IniFile is designed to use minimal memory
|
||||||
|
requirements, and the only buffer used is one supplied by the user,
|
||||||
|
thus the user remains in charge of memory usage.
|
||||||
|
|
||||||
|
The ini file is separated into sections, where the section names are
|
||||||
|
written inside square brackets. If you don't wish to use sections then
|
||||||
|
pass a `NULL` pointer for the section name. Under each section are a
|
||||||
|
set of key-value pairs, separated by an equals sign (`=`). Spaces
|
||||||
|
around keys and values are ignored, but extra spaces inside the key
|
||||||
|
are significant. Whitespace inside the value string is preserved; if
|
||||||
|
leading or trailing whitespace is important you must quote the value
|
||||||
|
string inside the ini file, and you must strip out the quotes
|
||||||
|
yourself. If multiple entries for the same key exist inside the
|
||||||
|
selected section (if using) then only the first value is returned. If
|
||||||
|
a section is defined more than once only the first is used. The .ini
|
||||||
|
file can contain comments, which begin with a semicolon (`;`) or hash
|
||||||
|
(`#`). The user-supplied buffer must be large enough to accomodate the
|
||||||
|
longest line in the file.
|
||||||
|
|
||||||
|
## Example file format
|
||||||
|
|
||||||
|
; Semi-colon comment
|
||||||
|
[network]
|
||||||
|
mac = 01:23:45:67:89:AB
|
||||||
|
|
||||||
|
# hash comment, leading spaces below
|
||||||
|
gateway = 192.168.1.1
|
||||||
|
|
||||||
|
# extraneous spaces before and after key and value
|
||||||
|
ip = 192.168.1.2
|
||||||
|
|
||||||
|
hosts allow = example.com
|
||||||
|
|
||||||
|
# A similarly-named section
|
||||||
|
[network2]
|
||||||
|
mac = ee:ee:ee:ee:ee:ee
|
||||||
|
subnet mask=255.255.255.0
|
||||||
|
|
||||||
|
; Extra whitespace around the key and value is permitted
|
||||||
|
; (and ignored)
|
||||||
|
hosts allow = sloppy.example.com
|
||||||
|
|
||||||
|
[misc]
|
||||||
|
|
||||||
|
string = 123456789012345678901234567890123456789001234567890
|
||||||
|
string2 = a string with spaces in it
|
||||||
|
|
||||||
|
; This section is a repeat of en existing section and will be ignored.
|
||||||
|
[network]
|
||||||
|
mac = 01:23:45:67:89:ab
|
||||||
|
ip = 192.168.1.2
|
||||||
|
gateway = 192.168.1.1
|
||||||
|
|
||||||
|
|
||||||
|
## Write support
|
||||||
|
|
||||||
|
Write support is a feature that has been requested on several
|
||||||
|
occasions but as I am no longer using the IniFile library I will not
|
||||||
|
add this feature. For anyone planning to add such support the
|
||||||
|
information below may be useful.
|
||||||
|
|
||||||
|
One goal of the `IniFile` implementation was to limit the amount of
|
||||||
|
memory required. For use in embedded systems `malloc` and `new` are
|
||||||
|
deliberately not used. Another goal was that tasks which take a longer
|
||||||
|
duration were broken down into smaller chunks of work, eg
|
||||||
|
`IniFile::getValue(const char* section, const char* key, char* buffer,
|
||||||
|
int len, IniFileState &state)`. This was because I wanted my `WwwServer`
|
||||||
|
library, which uses `IniFile`, to avoid interfering with time-critical
|
||||||
|
code.
|
||||||
|
|
||||||
|
I don't think that write support can meet the time-critical goal but
|
||||||
|
that doesn't prevent its inclusion. I think the way I would choose to
|
||||||
|
implement write support is to use `IniFile::findKey()` to find where the
|
||||||
|
desired key is located in the file. I'd then copy everything up to
|
||||||
|
that point to a temporary file, insert a line for the value and new
|
||||||
|
key, skip the current line in the existing file (using
|
||||||
|
`IniFile::readline()`) and then write out the reminder of the existing
|
||||||
|
file into the temporary file. I'd like to move or rename the temporary
|
||||||
|
file over the existing file but the Arduino SD library doesn't provide
|
||||||
|
this functionality; I'd probably just copy the temporary file over the
|
||||||
|
old one and then delete the temporary one.
|
||||||
|
|
||||||
|
The code has been written under a standard Linux environment, using a
|
||||||
|
compatibility header file to mimic the SD library. This was far more
|
||||||
|
convenient than doing everything on the Arduino and enabled me to use
|
||||||
|
`gdb` to debug the code and core dumps. You'll find `arduino_compat.h`
|
||||||
|
inside the test directory, along with a `Makefile` which can be used for
|
||||||
|
regression testing. Any proposed changes must pass the regression
|
||||||
|
tests.
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
* [Steve Marple](https://github.com/stevemarple)
|
||||||
|
* [per1234](https://github.com/per1234)
|
||||||
|
* [OscarVanL](https://github.com/OscarVanL)
|
||||||
|
* [MikuX2](https://github.com/toybox01)
|
||||||
|
* [kaixxx](https://github.com/kaixxx)
|
@ -0,0 +1,135 @@
|
|||||||
|
#include <SD.h>
|
||||||
|
|
||||||
|
#include <SPI.h>
|
||||||
|
#include <IPAddress.h>
|
||||||
|
#include <IniFile.h>
|
||||||
|
|
||||||
|
// The select pin used for the SD card
|
||||||
|
#define SD_SELECT 10
|
||||||
|
//#define ETHERNET_SELECT 10
|
||||||
|
|
||||||
|
void printErrorMessage(uint8_t e, bool eol = true)
|
||||||
|
{
|
||||||
|
switch (e) {
|
||||||
|
case IniFile::errorNoError:
|
||||||
|
Serial.print("no error");
|
||||||
|
break;
|
||||||
|
case IniFile::errorFileNotFound:
|
||||||
|
Serial.print("file not found");
|
||||||
|
break;
|
||||||
|
case IniFile::errorFileNotOpen:
|
||||||
|
Serial.print("file not open");
|
||||||
|
break;
|
||||||
|
case IniFile::errorBufferTooSmall:
|
||||||
|
Serial.print("buffer too small");
|
||||||
|
break;
|
||||||
|
case IniFile::errorSeekError:
|
||||||
|
Serial.print("seek error");
|
||||||
|
break;
|
||||||
|
case IniFile::errorSectionNotFound:
|
||||||
|
Serial.print("section not found");
|
||||||
|
break;
|
||||||
|
case IniFile::errorKeyNotFound:
|
||||||
|
Serial.print("key not found");
|
||||||
|
break;
|
||||||
|
case IniFile::errorEndOfFile:
|
||||||
|
Serial.print("end of file");
|
||||||
|
break;
|
||||||
|
case IniFile::errorUnknownError:
|
||||||
|
Serial.print("unknown error");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Serial.print("unknown error value");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (eol)
|
||||||
|
Serial.println();
|
||||||
|
}
|
||||||
|
|
||||||
|
void setup()
|
||||||
|
{
|
||||||
|
// Configure all of the SPI select pins as outputs and make SPI
|
||||||
|
// devices inactive, otherwise the earlier init routines may fail
|
||||||
|
// for devices which have not yet been configured.
|
||||||
|
pinMode(SD_SELECT, OUTPUT);
|
||||||
|
digitalWrite(SD_SELECT, HIGH); // disable SD card
|
||||||
|
|
||||||
|
// pinMode(ETHERNET_SELECT, OUTPUT);
|
||||||
|
// digitalWrite(ETHERNET_SELECT, HIGH); // disable Ethernet
|
||||||
|
|
||||||
|
const size_t bufferLen = 80;
|
||||||
|
char buffer[bufferLen];
|
||||||
|
|
||||||
|
const char *filename = "/lunch.ini";
|
||||||
|
Serial.begin(9600);
|
||||||
|
SPI.begin();
|
||||||
|
if (!SD.begin(SD_SELECT))
|
||||||
|
while (1)
|
||||||
|
Serial.println("SD.begin() failed");
|
||||||
|
|
||||||
|
IniFile ini(filename);
|
||||||
|
if (!ini.open()) {
|
||||||
|
Serial.print("Ini file ");
|
||||||
|
Serial.print(filename);
|
||||||
|
Serial.println(" does not exist");
|
||||||
|
// Cannot do anything else
|
||||||
|
while (1)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
Serial.println("Ini file exists");
|
||||||
|
|
||||||
|
// Check the file is valid. This can be used to warn if any lines
|
||||||
|
// are longer than the buffer.
|
||||||
|
if (!ini.validate(buffer, bufferLen)) {
|
||||||
|
Serial.print("ini file ");
|
||||||
|
Serial.print(ini.getFilename());
|
||||||
|
Serial.print(" not valid: ");
|
||||||
|
printErrorMessage(ini.getError());
|
||||||
|
// Cannot do anything else
|
||||||
|
while (1)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Browse through all sections and print contents:
|
||||||
|
IniFileState state;
|
||||||
|
char sectName[bufferLen];
|
||||||
|
Serial.println();
|
||||||
|
|
||||||
|
while (ini.browseSections(sectName, bufferLen, state)) {
|
||||||
|
Serial.print("> ");
|
||||||
|
Serial.print(sectName);
|
||||||
|
|
||||||
|
if (ini.getValue(sectName, "meal", buffer, bufferLen)) {
|
||||||
|
Serial.print(" eats ");
|
||||||
|
Serial.print(buffer);
|
||||||
|
} else
|
||||||
|
Serial.print(" eats nothing");
|
||||||
|
|
||||||
|
if (ini.getValue(sectName, "drinks", buffer, bufferLen)) {
|
||||||
|
Serial.print(", drinks ");
|
||||||
|
Serial.print(buffer);
|
||||||
|
} else
|
||||||
|
Serial.print(", drinks nothing");
|
||||||
|
|
||||||
|
if (ini.getValue(sectName, "dessert", buffer, bufferLen)) {
|
||||||
|
Serial.print(" and has ");
|
||||||
|
Serial.print(buffer);
|
||||||
|
Serial.println(" for dessert.");
|
||||||
|
} else
|
||||||
|
Serial.println(" and has no dessert.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// finished!
|
||||||
|
Serial.println();
|
||||||
|
printErrorMessage(ini.getError());
|
||||||
|
// Cannot do anything else
|
||||||
|
while (1)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void loop()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user