Compare commits
No commits in common. "v15.2.0" and "master" have entirely different histories.
File diff suppressed because it is too large
Load Diff
@ -1,743 +0,0 @@
|
|||||||
# Berry for Tasmota
|
|
||||||
|
|
||||||
This document covers Tasmota-specific Berry features and extensions, complementing the general Berry language reference.
|
|
||||||
|
|
||||||
## Introduction
|
|
||||||
|
|
||||||
Berry is the next generation scripting language for Tasmota, embedded by default in all ESP32 based firmwares (NOT supported on ESP8266). It is used for advanced scripting, superseding Rules, and enables building drivers, automations, and UI extensions.
|
|
||||||
|
|
||||||
## Tasmota-Specific Modules
|
|
||||||
|
|
||||||
Beyond standard Berry modules, Tasmota provides additional modules:
|
|
||||||
|
|
||||||
| Module | Description | Import |
|
|
||||||
|--------|-------------|--------|
|
|
||||||
| `tasmota` | Core integration module | Automatically imported |
|
|
||||||
| `light` | Light control | Automatically imported |
|
|
||||||
| `mqtt` | MQTT operations | `import mqtt` |
|
|
||||||
| `webserver` | Web server extensions | `import webserver` |
|
|
||||||
| `gpio` | GPIO control | `import gpio` |
|
|
||||||
| `persist` | Data persistence | `import persist` |
|
|
||||||
| `path` | File system operations | `import path` |
|
|
||||||
| `energy` | Energy monitoring | Automatically imported |
|
|
||||||
| `display` | Display driver integration | `import display` |
|
|
||||||
| `crypto` | Cryptographic functions | `import crypto` |
|
|
||||||
| `re` | Regular expressions | `import re` |
|
|
||||||
| `mdns` | mDNS/Bonjour support | `import mdns` |
|
|
||||||
| `ULP` | Ultra Low Power coprocessor | `import ULP` |
|
|
||||||
| `uuid` | UUID generation | `import uuid` |
|
|
||||||
| `crc` | CRC calculations | `import crc` |
|
|
||||||
|
|
||||||
## Additional Resources
|
|
||||||
|
|
||||||
For Tasmota-specific Berry features and extensions, please refer to the companion document `BERRY_TASMOTA.md`.
|
|
||||||
|
|
||||||
### Tasmota Constants and Enums
|
|
||||||
|
|
||||||
```berry
|
|
||||||
# GPIO constants (gpio module)
|
|
||||||
gpio.INPUT, gpio.OUTPUT, gpio.PULLUP, gpio.PULLDOWN
|
|
||||||
gpio.HIGH, gpio.LOW
|
|
||||||
gpio.REL1, gpio.KEY1, gpio.LED1, gpio.I2C_SCL, gpio.I2C_SDA
|
|
||||||
# ... many more GPIO function constants
|
|
||||||
|
|
||||||
# Serial constants
|
|
||||||
serial.SERIAL_8N1, serial.SERIAL_7E1, etc.
|
|
||||||
|
|
||||||
# Webserver constants
|
|
||||||
webserver.HTTP_GET, webserver.HTTP_POST, webserver.HTTP_OPTIONS, webserver.HTTP_ANY
|
|
||||||
webserver.HTTP_OFF, webserver.HTTP_USER, webserver.HTTP_ADMIN, webserver.HTTP_MANAGER
|
|
||||||
webserver.HTTP_MANAGER_RESET_ONLY
|
|
||||||
webserver.BUTTON_MAIN, webserver.BUTTON_CONFIGURATION, webserver.BUTTON_INFORMATION
|
|
||||||
webserver.BUTTON_MANAGEMENT, webserver.BUTTON_MODULE
|
|
||||||
```
|
|
||||||
|
|
||||||
### Console and REPL
|
|
||||||
|
|
||||||
Access Berry console via *Configuration* → *Berry Scripting Console*. The console supports:
|
|
||||||
- Multi-line input (press Enter twice or click "Run")
|
|
||||||
- Command history (arrow keys)
|
|
||||||
- Colorful syntax highlighting
|
|
||||||
- Berry VM restart with `BrRestart` command
|
|
||||||
|
|
||||||
### File System and Loading
|
|
||||||
|
|
||||||
Berry files can be source (`.be`) or pre-compiled bytecode (`.bec`):
|
|
||||||
|
|
||||||
```berry
|
|
||||||
load("filename") # Loads .be or .bec file
|
|
||||||
tasmota.compile("file.be") # Compiles .be to .bec
|
|
||||||
```
|
|
||||||
|
|
||||||
**Autostart**: Place `autoexec.be` in filesystem to run Berry code at boot.
|
|
||||||
|
|
||||||
### Tasmota Integration Functions
|
|
||||||
|
|
||||||
#### Core Tasmota Functions
|
|
||||||
|
|
||||||
```berry
|
|
||||||
# System information
|
|
||||||
tasmota.get_free_heap() # Free heap bytes
|
|
||||||
tasmota.memory() # Memory stats map
|
|
||||||
tasmota.arch() # Architecture: "esp32", "esp32s2", etc.
|
|
||||||
tasmota.millis() # Milliseconds since boot
|
|
||||||
tasmota.yield() # Give time to low-level functions
|
|
||||||
tasmota.delay(ms) # Block execution for ms milliseconds
|
|
||||||
|
|
||||||
# Commands and responses
|
|
||||||
tasmota.cmd("command") # Execute Tasmota command
|
|
||||||
tasmota.resp_cmnd_done() # Respond "Done"
|
|
||||||
tasmota.resp_cmnd_error() # Respond "Error"
|
|
||||||
tasmota.resp_cmnd_str(msg) # Custom response string
|
|
||||||
tasmota.resp_cmnd(json) # Custom JSON response
|
|
||||||
|
|
||||||
# Configuration
|
|
||||||
tasmota.get_option(index) # Get SetOption value
|
|
||||||
tasmota.read_sensors() # Get sensor JSON string
|
|
||||||
tasmota.wifi() # WiFi connection info
|
|
||||||
tasmota.eth() # Ethernet connection info
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Rules and Events
|
|
||||||
|
|
||||||
```berry
|
|
||||||
# Add rules (similar to Tasmota Rules but more powerful)
|
|
||||||
tasmota.add_rule("trigger", function)
|
|
||||||
tasmota.add_rule(["trigger1", "trigger2"], function) # AND logic
|
|
||||||
tasmota.remove_rule("trigger")
|
|
||||||
|
|
||||||
# Rule function signature
|
|
||||||
def rule_function(value, trigger, msg)
|
|
||||||
# value: trigger value (%value% equivalent)
|
|
||||||
# trigger: full trigger string
|
|
||||||
# msg: parsed JSON map or original string
|
|
||||||
end
|
|
||||||
|
|
||||||
# Examples
|
|
||||||
tasmota.add_rule("Dimmer>50", def() print("Bright!") end)
|
|
||||||
tasmota.add_rule("ANALOG#A1>300", def(val) print("ADC:", val) end)
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Timers and Scheduling
|
|
||||||
|
|
||||||
```berry
|
|
||||||
# Timers (50ms resolution)
|
|
||||||
tasmota.set_timer(delay_ms, function)
|
|
||||||
tasmota.remove_timer(id)
|
|
||||||
tasmota.defer(function) # Run in next millisecond
|
|
||||||
|
|
||||||
# Cron scheduling
|
|
||||||
tasmota.add_cron("*/15 * * * * *", function, "id")
|
|
||||||
tasmota.remove_cron("id")
|
|
||||||
tasmota.next_cron("id") # Next execution timestamp
|
|
||||||
|
|
||||||
# Time functions
|
|
||||||
tasmota.rtc() # Current time info
|
|
||||||
tasmota.time_dump(timestamp) # Decompose timestamp
|
|
||||||
tasmota.time_str(timestamp) # ISO 8601 string
|
|
||||||
tasmota.strftime(format, timestamp)
|
|
||||||
tasmota.strptime(time_str, format)
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Device Control
|
|
||||||
|
|
||||||
```berry
|
|
||||||
# Relays and Power
|
|
||||||
tasmota.get_power() # Array of relay states
|
|
||||||
tasmota.set_power(idx, state) # Set relay state
|
|
||||||
|
|
||||||
# Lights (use light module)
|
|
||||||
light.get() # Current light status
|
|
||||||
light.set({"power": true, "bri": 128, "hue": 120})
|
|
||||||
|
|
||||||
# Light attributes: power, bri (0-255), hue (0-360), sat (0-255),
|
|
||||||
# ct (153-500), rgb (hex string), channels (array)
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Custom Commands
|
|
||||||
|
|
||||||
```berry
|
|
||||||
# Add custom Tasmota commands
|
|
||||||
def my_command(cmd, idx, payload, payload_json)
|
|
||||||
# cmd: command name, idx: command index
|
|
||||||
# payload: raw string, payload_json: parsed JSON
|
|
||||||
tasmota.resp_cmnd_done()
|
|
||||||
end
|
|
||||||
|
|
||||||
tasmota.add_cmd("MyCmd", my_command)
|
|
||||||
tasmota.remove_cmd("MyCmd")
|
|
||||||
```
|
|
||||||
|
|
||||||
### Tasmota Drivers
|
|
||||||
|
|
||||||
Create complete Tasmota drivers by implementing event methods:
|
|
||||||
|
|
||||||
```berry
|
|
||||||
class MyDriver
|
|
||||||
def every_second() # Called every second
|
|
||||||
end
|
|
||||||
|
|
||||||
def every_50ms() # Called every 50ms
|
|
||||||
end
|
|
||||||
|
|
||||||
def web_sensor() # Add to web UI
|
|
||||||
tasmota.web_send("{s}Sensor{m}Value{e}")
|
|
||||||
end
|
|
||||||
|
|
||||||
def json_append() # Add to JSON teleperiod
|
|
||||||
tasmota.response_append(',"MySensor":{"Value":123}')
|
|
||||||
end
|
|
||||||
|
|
||||||
def web_add_main_button() # Add button to main page
|
|
||||||
import webserver
|
|
||||||
webserver.content_send("<button onclick='la(\"&myaction=1\");'>My Button</button>")
|
|
||||||
end
|
|
||||||
|
|
||||||
def button_pressed() # Handle button press
|
|
||||||
end
|
|
||||||
|
|
||||||
def mqtt_data(topic, idx, data, databytes) # Handle MQTT
|
|
||||||
end
|
|
||||||
|
|
||||||
def save_before_restart() # Before restart
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Register driver
|
|
||||||
driver = MyDriver()
|
|
||||||
tasmota.add_driver(driver)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Fast Loop
|
|
||||||
|
|
||||||
For near real-time events (200Hz, 5ms intervals):
|
|
||||||
|
|
||||||
```berry
|
|
||||||
def fast_function()
|
|
||||||
# High-frequency processing
|
|
||||||
end
|
|
||||||
|
|
||||||
tasmota.add_fast_loop(fast_function)
|
|
||||||
tasmota.remove_fast_loop(fast_function)
|
|
||||||
```
|
|
||||||
|
|
||||||
### GPIO Control
|
|
||||||
|
|
||||||
```berry
|
|
||||||
import gpio
|
|
||||||
|
|
||||||
# GPIO detection and control
|
|
||||||
gpio.pin_used(gpio.REL1) # Check if GPIO is used
|
|
||||||
gpio.pin(gpio.REL1) # Get physical GPIO number
|
|
||||||
gpio.digital_write(pin, gpio.HIGH) # Set GPIO state
|
|
||||||
gpio.digital_read(pin) # Read GPIO state
|
|
||||||
gpio.pin_mode(pin, gpio.OUTPUT) # Set GPIO mode
|
|
||||||
|
|
||||||
# PWM control
|
|
||||||
gpio.set_pwm(pin, duty, phase) # Set PWM value
|
|
||||||
gpio.set_pwm_freq(pin, freq) # Set PWM frequency
|
|
||||||
|
|
||||||
# DAC (ESP32 GPIO 25-26, ESP32-S2 GPIO 17-18)
|
|
||||||
gpio.dac_voltage(pin, voltage_mv) # Set DAC voltage
|
|
||||||
|
|
||||||
# Counters
|
|
||||||
gpio.counter_read(counter) # Read counter value
|
|
||||||
gpio.counter_set(counter, value) # Set counter value
|
|
||||||
```
|
|
||||||
|
|
||||||
### I²C Communication
|
|
||||||
|
|
||||||
```berry
|
|
||||||
# Wire objects: wire1, wire2 for I²C buses
|
|
||||||
wire1.bus -> int # Bus number (read-only)
|
|
||||||
wire1.enabled() -> bool # Check if bus initialized
|
|
||||||
wire1.scan() -> list(int) # Scan for device addresses (decimal)
|
|
||||||
wire1.detect(addr:int) -> bool # Check if device present
|
|
||||||
|
|
||||||
# High-level I/O
|
|
||||||
wire1.read(addr:int, reg:int, size:int) -> int|nil # Read 1-4 bytes
|
|
||||||
wire1.write(addr:int, reg:int, val:int, size:int) -> bool # Write 1-4 bytes
|
|
||||||
wire1.read_bytes(addr:int, reg:int, size:int) -> bytes # Read byte sequence
|
|
||||||
wire1.write_bytes(addr:int, reg:int, val:bytes) -> nil # Write byte sequence
|
|
||||||
|
|
||||||
# Low-level control
|
|
||||||
wire1._begin_transmission(addr:int) -> nil
|
|
||||||
wire1._end_transmission([stop:bool]) -> nil
|
|
||||||
wire1._request_from(addr:int, size:int, [stop:bool]) -> nil
|
|
||||||
wire1._available() -> bool
|
|
||||||
wire1._read() -> int # Read single byte
|
|
||||||
wire1._write(val:int|string) -> nil # Write single byte or string
|
|
||||||
|
|
||||||
# Device discovery
|
|
||||||
wire = tasmota.wire_scan(addr:int, i2c_index:int) -> wire_instance|nil
|
|
||||||
```
|
|
||||||
|
|
||||||
### MQTT Integration
|
|
||||||
|
|
||||||
```berry
|
|
||||||
import mqtt
|
|
||||||
|
|
||||||
# MQTT operations
|
|
||||||
mqtt.publish(topic:string, payload:string|bytes, [retain:bool, start:int, len:int]) -> nil
|
|
||||||
mqtt.subscribe(topic:string, [function:closure]) -> nil # Pattern matching, add wildcards manually
|
|
||||||
mqtt.unsubscribe(topic:string) -> nil
|
|
||||||
mqtt.connected() -> bool
|
|
||||||
|
|
||||||
# Callback function signature (topic, idx, payload_s, payload_b) -> bool
|
|
||||||
def mqtt_callback(topic, idx, payload_s, payload_b)
|
|
||||||
# topic: full topic, idx: unused, payload_s: string, payload_b: bytes
|
|
||||||
return true # Return true if handled (prevents Tasmota command)
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
### Web Server Extensions
|
|
||||||
|
|
||||||
```berry
|
|
||||||
import webserver
|
|
||||||
|
|
||||||
# In driver's web_add_handler() method
|
|
||||||
webserver.on("/my_page", def()
|
|
||||||
webserver.content_send("<html>My Page</html>")
|
|
||||||
end)
|
|
||||||
|
|
||||||
# Request handling
|
|
||||||
webserver.has_arg("param") # Check parameter exists
|
|
||||||
webserver.arg("param") # Get parameter value
|
|
||||||
webserver.arg_size() # Number of parameters
|
|
||||||
|
|
||||||
# Response functions
|
|
||||||
webserver.content_send(html) # Send HTML content
|
|
||||||
webserver.content_button() # Standard button
|
|
||||||
webserver.html_escape(str) # Escape HTML
|
|
||||||
```
|
|
||||||
|
|
||||||
### Persistence
|
|
||||||
|
|
||||||
```berry
|
|
||||||
import persist
|
|
||||||
|
|
||||||
# Automatic persistence to _persist.json
|
|
||||||
persist.my_value = 123
|
|
||||||
persist.save() # Force save to flash
|
|
||||||
persist.has("key") # Check if key exists
|
|
||||||
persist.remove("key") # Remove key
|
|
||||||
persist.find("key", default) # Get with default
|
|
||||||
```
|
|
||||||
|
|
||||||
### Network Clients
|
|
||||||
|
|
||||||
#### HTTP/HTTPS Client
|
|
||||||
|
|
||||||
```berry
|
|
||||||
cl = webclient()
|
|
||||||
cl.begin("https://example.com/api")
|
|
||||||
cl.set_auth("user", "pass")
|
|
||||||
cl.add_header("Content-Type", "application/json")
|
|
||||||
|
|
||||||
result = cl.GET() # or POST(payload)
|
|
||||||
if result == 200
|
|
||||||
response = cl.get_string()
|
|
||||||
# or cl.write_file("filename") for binary
|
|
||||||
end
|
|
||||||
cl.close()
|
|
||||||
```
|
|
||||||
|
|
||||||
#### TCP Client
|
|
||||||
|
|
||||||
```berry
|
|
||||||
tcp = tcpclient()
|
|
||||||
tcp.connect("192.168.1.100", 80)
|
|
||||||
tcp.write("GET / HTTP/1.0\r\n\r\n")
|
|
||||||
response = tcp.read()
|
|
||||||
tcp.close()
|
|
||||||
```
|
|
||||||
|
|
||||||
#### UDP Communication
|
|
||||||
|
|
||||||
```berry
|
|
||||||
u = udp()
|
|
||||||
u.begin("", 2000) # Listen on port 2000
|
|
||||||
u.send("192.168.1.10", 2000, bytes("Hello"))
|
|
||||||
|
|
||||||
# Receive (polling)
|
|
||||||
packet = u.read() # Returns bytes or nil
|
|
||||||
if packet
|
|
||||||
print("From:", u.remote_ip, u.remote_port)
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
### Serial Communication
|
|
||||||
|
|
||||||
```berry
|
|
||||||
ser = serial(rx_gpio, tx_gpio, baud, serial.SERIAL_8N1)
|
|
||||||
ser.write(bytes("Hello")) # Send data
|
|
||||||
data = ser.read() # Read available data
|
|
||||||
ser.available() # Check bytes available
|
|
||||||
ser.flush() # Flush buffers
|
|
||||||
ser.close() # Close port
|
|
||||||
```
|
|
||||||
|
|
||||||
### Cryptography
|
|
||||||
|
|
||||||
```berry
|
|
||||||
import crypto
|
|
||||||
|
|
||||||
# AES Encryption Classes
|
|
||||||
crypto.AES_CTR(key:bytes(32)).encrypt(data:bytes, iv:bytes(12), cc:int) -> bytes
|
|
||||||
crypto.AES_CTR(key:bytes(32)).decrypt(data:bytes, iv:bytes(12), cc:int) -> bytes
|
|
||||||
|
|
||||||
crypto.AES_GCM(key:bytes(32), iv:bytes(12)).encrypt(data:bytes) -> bytes
|
|
||||||
crypto.AES_GCM(key:bytes(32), iv:bytes(12)).decrypt(data:bytes) -> bytes
|
|
||||||
crypto.AES_GCM(key:bytes(32), iv:bytes(12)).tag() -> bytes(16)
|
|
||||||
|
|
||||||
crypto.AES_CCM(key:bytes(16|32), iv:bytes(7..13), aad:bytes, data_len:int, tag_len:int)
|
|
||||||
crypto.AES_CCM.encrypt1/decrypt1(...) -> bool # Single-call variants
|
|
||||||
|
|
||||||
crypto.AES_CBC.encrypt1(key:bytes(16), iv:bytes(16), data:bytes) -> bool
|
|
||||||
crypto.AES_CBC.decrypt1(key:bytes(16), iv:bytes(16), data:bytes) -> bool
|
|
||||||
|
|
||||||
# Elliptic Curve (requires defines)
|
|
||||||
crypto.EC_C25519().public_key(priv:bytes(32)) -> bytes(32)
|
|
||||||
crypto.EC_C25519().shared_key(our_priv:bytes(32), their_pub:bytes(32)) -> bytes(32)
|
|
||||||
|
|
||||||
crypto.EC_P256().public_key(priv:bytes(32)) -> bytes(65)
|
|
||||||
crypto.EC_P256().shared_key(our_priv:bytes(32), their_pub:bytes(65)) -> bytes(32)
|
|
||||||
crypto.EC_P256().mod/neg/mul/muladd(...) -> bytes # Math operations
|
|
||||||
|
|
||||||
# Key Derivation
|
|
||||||
crypto.HKDF_SHA256().derive(ikm:bytes, salt:bytes, info:bytes, out_len:int) -> bytes
|
|
||||||
crypto.PBKDF2_HMAC_SHA256().derive(pwd:bytes, salt:bytes, iter:int, out_len:int) -> bytes
|
|
||||||
|
|
||||||
# Hashing
|
|
||||||
crypto.SHA256().update(data:bytes).out() -> bytes(32)
|
|
||||||
crypto.MD5().update(data:bytes).finish() -> bytes(16)
|
|
||||||
crypto.HMAC_SHA256(key:bytes).update(data:bytes).out() -> bytes(32)
|
|
||||||
|
|
||||||
# RSA (requires define)
|
|
||||||
crypto.RSA.rs256(private_key_der:bytes, payload:bytes) -> bytes # JWT signing
|
|
||||||
```
|
|
||||||
|
|
||||||
### File System Operations
|
|
||||||
|
|
||||||
```berry
|
|
||||||
import path
|
|
||||||
|
|
||||||
# File/directory operations (SD card: /sd/ subdirectory)
|
|
||||||
path.exists(file:string) -> bool # Check file exists
|
|
||||||
path.isdir(name:string) -> bool # Check if directory
|
|
||||||
path.listdir(dir:string) -> list # List directory contents
|
|
||||||
path.mkdir(dir:string) -> bool # Create directory
|
|
||||||
path.rmdir(dir:string) -> bool # Remove empty directory
|
|
||||||
path.remove(file:string) -> bool # Delete file
|
|
||||||
path.rename(old:string, new:string) -> bool # Rename file/folder
|
|
||||||
path.last_modified(file:string) -> int # File timestamp (nil if not exists)
|
|
||||||
path.format(true) -> bool # Format LittleFS (erases all!)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Regular Expressions
|
|
||||||
|
|
||||||
```berry
|
|
||||||
import re
|
|
||||||
|
|
||||||
# Pattern matching
|
|
||||||
matches = re.search("a.*?b(z+)", "aaaabbbzzz") # Returns matches array
|
|
||||||
all_matches = re.searchall('<([a-zA-Z]+)>', html) # All matches
|
|
||||||
parts = re.split('/', "path/to/file") # Split string
|
|
||||||
|
|
||||||
# Compiled patterns (faster for reuse)
|
|
||||||
pattern = re.compilebytes("\\d+")
|
|
||||||
matches = re.search(pattern, "abc123def")
|
|
||||||
```
|
|
||||||
|
|
||||||
### Energy Monitoring
|
|
||||||
|
|
||||||
```berry
|
|
||||||
# Read energy values
|
|
||||||
energy.voltage # Main phase voltage
|
|
||||||
energy.current # Main phase current
|
|
||||||
energy.active_power # Active power (W)
|
|
||||||
energy.total # Total energy (kWh)
|
|
||||||
|
|
||||||
# Multi-phase access
|
|
||||||
energy.voltage_phases[0] # Phase 0 voltage
|
|
||||||
energy.current_phases[1] # Phase 1 current
|
|
||||||
|
|
||||||
# Berry energy driver (with OPTION_A 9 GPIO)
|
|
||||||
if energy.driver_enabled()
|
|
||||||
energy.voltage = 240
|
|
||||||
energy.current = 1.5
|
|
||||||
energy.active_power = 360 # This drives energy calculation
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
### Display Integration
|
|
||||||
|
|
||||||
```berry
|
|
||||||
import display
|
|
||||||
|
|
||||||
# Initialize display driver
|
|
||||||
display.start(display_ini_string)
|
|
||||||
display.started() # Check if initialized
|
|
||||||
display.dimmer(50) # Set brightness 0-100
|
|
||||||
display.driver_name() # Get driver name
|
|
||||||
|
|
||||||
# Touch screen updates
|
|
||||||
display.touch_update(touches, x, y, gesture)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Advanced Features
|
|
||||||
|
|
||||||
#### ULP (Ultra Low Power) Coprocessor
|
|
||||||
|
|
||||||
```berry
|
|
||||||
import ULP
|
|
||||||
|
|
||||||
ULP.wake_period(0, 500000) # Configure wake timer
|
|
||||||
ULP.load(bytecode) # Load ULP program
|
|
||||||
ULP.run() # Execute ULP program
|
|
||||||
ULP.set_mem(addr, value) # Set RTC memory
|
|
||||||
ULP.get_mem(addr) # Get RTC memory
|
|
||||||
```
|
|
||||||
|
|
||||||
#### mDNS Support
|
|
||||||
|
|
||||||
```berry
|
|
||||||
import mdns
|
|
||||||
|
|
||||||
mdns.start("hostname") # Start mDNS
|
|
||||||
mdns.add_service("_http", "_tcp", 80, {"path": "/"})
|
|
||||||
mdns.stop() # Stop mDNS
|
|
||||||
```
|
|
||||||
|
|
||||||
### Error Handling Patterns
|
|
||||||
|
|
||||||
Many Tasmota functions return `nil` for errors rather than raising exceptions:
|
|
||||||
|
|
||||||
```berry
|
|
||||||
# Check return values
|
|
||||||
data = json.load(json_string)
|
|
||||||
if data == nil
|
|
||||||
print("Invalid JSON")
|
|
||||||
end
|
|
||||||
|
|
||||||
# Wire operations
|
|
||||||
result = wire1.read(addr, reg, 1)
|
|
||||||
if result == nil
|
|
||||||
print("I2C read failed")
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
### Best Practices for Tasmota
|
|
||||||
|
|
||||||
1. **Memory Management**: Use `tasmota.gc()` to monitor memory usage
|
|
||||||
2. **Non-blocking**: Use timers instead of `delay()` for long waits
|
|
||||||
3. **Error Handling**: Always check return values for `nil`
|
|
||||||
4. **Persistence**: Use `persist` module for settings that survive reboots
|
|
||||||
5. **Performance**: Use fast_loop sparingly, prefer regular driver events
|
|
||||||
6. **Debugging**: Enable `#define USE_BERRY_DEBUG` for development
|
|
||||||
|
|
||||||
## Common Tasmota Berry Patterns
|
|
||||||
|
|
||||||
### Simple Sensor Driver
|
|
||||||
|
|
||||||
```berry
|
|
||||||
class MySensor
|
|
||||||
var wire, addr
|
|
||||||
|
|
||||||
def init()
|
|
||||||
self.addr = 0x48
|
|
||||||
self.wire = tasmota.wire_scan(self.addr, 99) # I2C index 99
|
|
||||||
if self.wire
|
|
||||||
print("MySensor found on bus", self.wire.bus)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def every_second()
|
|
||||||
if !self.wire return end
|
|
||||||
var temp = self.wire.read(self.addr, 0x00, 2) # Read temperature
|
|
||||||
self.temperature = temp / 256.0 # Convert to Celsius
|
|
||||||
end
|
|
||||||
|
|
||||||
def web_sensor()
|
|
||||||
if !self.wire return end
|
|
||||||
import string
|
|
||||||
var msg = string.format("{s}MySensor Temp{m}%.1f °C{e}", self.temperature)
|
|
||||||
tasmota.web_send_decimal(msg)
|
|
||||||
end
|
|
||||||
|
|
||||||
def json_append()
|
|
||||||
if !self.wire return end
|
|
||||||
import string
|
|
||||||
var msg = string.format(',"MySensor":{"Temperature":%.1f}', self.temperature)
|
|
||||||
tasmota.response_append(msg)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
sensor = MySensor()
|
|
||||||
tasmota.add_driver(sensor)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Custom Command with JSON Response
|
|
||||||
|
|
||||||
```berry
|
|
||||||
def my_status_cmd(cmd, idx, payload, payload_json)
|
|
||||||
import string
|
|
||||||
var response = {
|
|
||||||
"Uptime": tasmota.millis(),
|
|
||||||
"FreeHeap": tasmota.get_free_heap(),
|
|
||||||
"WiFi": tasmota.wifi("rssi")
|
|
||||||
}
|
|
||||||
tasmota.resp_cmnd(json.dump(response))
|
|
||||||
end
|
|
||||||
|
|
||||||
tasmota.add_cmd("MyStatus", my_status_cmd)
|
|
||||||
```
|
|
||||||
|
|
||||||
### MQTT Automation
|
|
||||||
|
|
||||||
```berry
|
|
||||||
import mqtt
|
|
||||||
|
|
||||||
def handle_sensor_data(topic, idx, payload_s, payload_b)
|
|
||||||
var data = json.load(payload_s)
|
|
||||||
if data && data.find("temperature")
|
|
||||||
var temp = data["temperature"]
|
|
||||||
if temp > 25
|
|
||||||
tasmota.cmd("Power1 ON") # Turn on fan
|
|
||||||
elif temp < 20
|
|
||||||
tasmota.cmd("Power1 OFF") # Turn off fan
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
mqtt.subscribe("sensors/+/temperature", handle_sensor_data)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Web UI Button with Action
|
|
||||||
|
|
||||||
```berry
|
|
||||||
class WebButton
|
|
||||||
def web_add_main_button()
|
|
||||||
import webserver
|
|
||||||
webserver.content_send("<p><button onclick='la(\"&toggle_led=1\");'>Toggle LED</button></p>")
|
|
||||||
end
|
|
||||||
|
|
||||||
def web_sensor()
|
|
||||||
import webserver
|
|
||||||
if webserver.has_arg("toggle_led")
|
|
||||||
# Toggle GPIO2 (built-in LED on many ESP32 boards)
|
|
||||||
var pin = 2
|
|
||||||
var current = gpio.digital_read(pin)
|
|
||||||
gpio.digital_write(pin, !current)
|
|
||||||
print("LED toggled to", !current)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
button = WebButton()
|
|
||||||
tasmota.add_driver(button)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Scheduled Task with Persistence
|
|
||||||
|
|
||||||
```berry
|
|
||||||
import persist
|
|
||||||
|
|
||||||
class ScheduledTask
|
|
||||||
def init()
|
|
||||||
if !persist.has("task_count")
|
|
||||||
persist.task_count = 0
|
|
||||||
end
|
|
||||||
# Run every 5 minutes
|
|
||||||
tasmota.add_cron("0 */5 * * * *", /-> self.run_task(), "my_task")
|
|
||||||
end
|
|
||||||
|
|
||||||
def run_task()
|
|
||||||
persist.task_count += 1
|
|
||||||
print("Task executed", persist.task_count, "times")
|
|
||||||
|
|
||||||
# Do something useful
|
|
||||||
var sensors = tasmota.read_sensors()
|
|
||||||
print("Current sensors:", sensors)
|
|
||||||
|
|
||||||
persist.save() # Save counter to flash
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
task = ScheduledTask()
|
|
||||||
```
|
|
||||||
|
|
||||||
### HTTP API Client
|
|
||||||
|
|
||||||
```berry
|
|
||||||
class WeatherAPI
|
|
||||||
var api_key, city
|
|
||||||
|
|
||||||
def init(key, city_name)
|
|
||||||
self.api_key = key
|
|
||||||
self.city = city_name
|
|
||||||
tasmota.add_cron("0 0 * * * *", /-> self.fetch_weather(), "weather")
|
|
||||||
end
|
|
||||||
|
|
||||||
def fetch_weather()
|
|
||||||
var cl = webclient()
|
|
||||||
var url = f"http://api.openweathermap.org/data/2.5/weather?q={self.city}&appid={self.api_key}"
|
|
||||||
|
|
||||||
cl.begin(url)
|
|
||||||
var result = cl.GET()
|
|
||||||
|
|
||||||
if result == 200
|
|
||||||
var response = cl.get_string()
|
|
||||||
var data = json.load(response)
|
|
||||||
if data
|
|
||||||
var temp = data["main"]["temp"] - 273.15 # Kelvin to Celsius
|
|
||||||
print(f"Weather in {self.city}: {temp:.1f}°C")
|
|
||||||
|
|
||||||
# Store in global for other scripts to use
|
|
||||||
import global
|
|
||||||
global.weather_temp = temp
|
|
||||||
end
|
|
||||||
end
|
|
||||||
cl.close()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# weather = WeatherAPI("your_api_key", "London")
|
|
||||||
```
|
|
||||||
|
|
||||||
### Rule-based Automation
|
|
||||||
|
|
||||||
```berry
|
|
||||||
# Advanced rule that combines multiple conditions
|
|
||||||
tasmota.add_rule(["ANALOG#A0>500", "Switch1#State=1"],
|
|
||||||
def(values, triggers)
|
|
||||||
print("Both conditions met:")
|
|
||||||
print("ADC value:", values[0])
|
|
||||||
print("Switch state:", values[1])
|
|
||||||
tasmota.cmd("Power2 ON") # Activate something
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
# Time-based rule
|
|
||||||
tasmota.add_rule("Time#Minute=30",
|
|
||||||
def()
|
|
||||||
if tasmota.rtc()["hour"] == 18 # 6:30 PM
|
|
||||||
tasmota.cmd("Dimmer 20") # Dim lights for evening
|
|
||||||
end
|
|
||||||
end
|
|
||||||
)
|
|
||||||
```
|
|
||||||
|
|
||||||
## Best Practices and Tips
|
|
||||||
|
|
||||||
1. **Always check for nil returns** from Tasmota functions
|
|
||||||
2. **Use timers instead of delay()** to avoid blocking Tasmota
|
|
||||||
3. **Implement proper error handling** in I²C and network operations
|
|
||||||
4. **Use persist module** for settings that should survive reboots
|
|
||||||
5. **Test memory usage** with `tasmota.gc()` during development
|
|
||||||
6. **Use fast_loop sparingly** - it runs 200 times per second
|
|
||||||
7. **Prefer driver events** over polling when possible
|
|
||||||
8. **Use f-strings** for readable string formatting
|
|
||||||
9. **Import modules only when needed** to save memory
|
|
||||||
10. **Use `tasmota.wire_scan()`** instead of manual I²C bus detection
|
|
||||||
@ -1,175 +0,0 @@
|
|||||||
# 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.
|
|
||||||
@ -1,977 +0,0 @@
|
|||||||
# 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.
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,705 +0,0 @@
|
|||||||
# Tasmota WebUI Coding Guide
|
|
||||||
|
|
||||||
This guide provides comprehensive instructions for coding WebUI interfaces for Tasmota, based on analysis of the actual Tasmota web interface source code and screenshots.
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
Tasmota's WebUI is a lightweight, embedded web interface designed for ESP8266/ESP32 microcontrollers with severe memory constraints. The interface follows a minimalist design philosophy while providing comprehensive device control and configuration capabilities.
|
|
||||||
|
|
||||||
### Visual Design Analysis
|
|
||||||
|
|
||||||
Based on the actual Tasmota WebUI screenshots, the interface features:
|
|
||||||
|
|
||||||
1. **Main Control Page**:
|
|
||||||
- Large status display showing device state ("OFF")
|
|
||||||
- Color control sliders with visual gradients (hue, saturation, brightness)
|
|
||||||
- Toggle buttons for device control
|
|
||||||
- Clean button layout with consistent spacing
|
|
||||||
|
|
||||||
2. **Configuration Pages**:
|
|
||||||
- Nested fieldsets for logical grouping
|
|
||||||
- Form elements with proper labels and placeholders
|
|
||||||
- Consistent button styling with color coding (blue for navigation, green for save, red for dangerous actions)
|
|
||||||
- Mobile-optimized layout with full-width buttons
|
|
||||||
|
|
||||||
3. **Navigation Structure**:
|
|
||||||
- Hierarchical menu system
|
|
||||||
- Clear visual separation between sections
|
|
||||||
- Consistent header with device name and Tasmota branding
|
|
||||||
|
|
||||||
## Core Design Principles
|
|
||||||
|
|
||||||
### 1. Memory Efficiency
|
|
||||||
- Minimal HTML/CSS/JavaScript footprint
|
|
||||||
- Inline styles and scripts to reduce HTTP requests
|
|
||||||
- Compressed and minified code
|
|
||||||
- CSS variables for theming without duplication
|
|
||||||
|
|
||||||
### 2. Responsive Design
|
|
||||||
- Mobile-first approach with `viewport` meta tag
|
|
||||||
- Flexible layouts that work on small screens
|
|
||||||
- Touch-friendly button sizes and spacing
|
|
||||||
- Minimal external dependencies
|
|
||||||
|
|
||||||
### 3. Dark Theme by Default
|
|
||||||
- Professional dark color scheme
|
|
||||||
- High contrast for readability
|
|
||||||
- Consistent color variables throughout
|
|
||||||
|
|
||||||
### 4. Progressive Enhancement
|
|
||||||
- Core functionality works without JavaScript
|
|
||||||
- JavaScript enhances user experience
|
|
||||||
- Graceful degradation for older browsers
|
|
||||||
|
|
||||||
## HTML Structure Pattern
|
|
||||||
|
|
||||||
### Basic Page Template
|
|
||||||
|
|
||||||
```html
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en" class="">
|
|
||||||
<head>
|
|
||||||
<meta charset='utf-8'>
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1"/>
|
|
||||||
<link rel="icon" href="data:image/x-icon;base64,AAABAAEAEBACAAEAAQCwAAAAFgAAACgAAAAQAAAAIAAAAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////AP5/b+H6X2/h8k9v4eZnb+Hud2/h7ndv4e53b+FmZm/hMkxv4ZgZb+HOc2/h5+dv4fPPb+H5n2/h/D9v4f5/b+EAAO4EAADuBAAA7gQAAO4EAADuBAAA7gQAAO4EAADuBAAA7gQAAO4EAADuBAAA7gQAAO4EAADuBAAA7gQAAO4E">
|
|
||||||
<title>Tasmota Configuration</title>
|
|
||||||
<script>
|
|
||||||
// Core JavaScript functions
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
/* CSS styles */
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div style='background:var(--c_bg);text-align:left;display:inline-block;color:var(--c_txt);min-width:340px;position:relative;'>
|
|
||||||
<!-- Page content -->
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
```
|
|
||||||
|
|
||||||
### Key HTML Structure Elements
|
|
||||||
|
|
||||||
1. **Container Div**: Main wrapper with consistent styling
|
|
||||||
2. **Header Section**: Device name and page title
|
|
||||||
3. **Content Area**: Forms, buttons, and configuration options
|
|
||||||
4. **Footer**: Version information and links
|
|
||||||
|
|
||||||
## CSS Design System
|
|
||||||
|
|
||||||
### Color Variables
|
|
||||||
|
|
||||||
Tasmota uses CSS custom properties for consistent theming:
|
|
||||||
|
|
||||||
```css
|
|
||||||
:root {
|
|
||||||
--c_bg: #252525; /* Background color */
|
|
||||||
--c_frm: #4f4f4f; /* Form/fieldset background */
|
|
||||||
--c_ttl: #eaeaea; /* Title text color */
|
|
||||||
--c_txt: #eaeaea; /* Regular text color */
|
|
||||||
--c_txtwrn: #ff5661; /* Warning text color */
|
|
||||||
--c_txtscc: #008000; /* Success text color */
|
|
||||||
--c_btn: #1fa3ec; /* Primary button color */
|
|
||||||
--c_btnoff: #08405e; /* Disabled button color */
|
|
||||||
--c_btntxt: #faffff; /* Button text color */
|
|
||||||
--c_btnhvr: #0e70a4; /* Button hover color */
|
|
||||||
--c_btnrst: #d43535; /* Reset/danger button color */
|
|
||||||
--c_btnrsthvr: #931f1f; /* Reset button hover */
|
|
||||||
--c_btnsv: #47c266; /* Save button color */
|
|
||||||
--c_btnsvhvr: #5aaf6f; /* Save button hover */
|
|
||||||
--c_in: #dddddd; /* Input background */
|
|
||||||
--c_intxt: #000000; /* Input text color */
|
|
||||||
--c_csl: #1f1f1f; /* Console background */
|
|
||||||
--c_csltxt: #65c115; /* Console text color */
|
|
||||||
--c_tab: #999999; /* Tab color */
|
|
||||||
--c_tabtxt: #faffff; /* Tab text color */
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Typography and Layout
|
|
||||||
|
|
||||||
```css
|
|
||||||
body {
|
|
||||||
text-align: center;
|
|
||||||
font-family: verdana, sans-serif;
|
|
||||||
background: var(--c_bg);
|
|
||||||
}
|
|
||||||
|
|
||||||
div, fieldset, input, select {
|
|
||||||
padding: 5px;
|
|
||||||
font-size: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
fieldset {
|
|
||||||
background: var(--c_frm);
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin: 0.5em 0;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Input Styling
|
|
||||||
|
|
||||||
```css
|
|
||||||
input {
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
background: var(--c_in);
|
|
||||||
color: var(--c_intxt);
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type=checkbox], input[type=radio] {
|
|
||||||
width: 1em;
|
|
||||||
margin-right: 6px;
|
|
||||||
vertical-align: -1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type=range] {
|
|
||||||
width: 99%;
|
|
||||||
}
|
|
||||||
|
|
||||||
select {
|
|
||||||
width: 100%;
|
|
||||||
background: var(--c_in);
|
|
||||||
color: var(--c_intxt);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Button System
|
|
||||||
|
|
||||||
```css
|
|
||||||
button {
|
|
||||||
border: 0;
|
|
||||||
border-radius: 0.3rem;
|
|
||||||
background: var(--c_btn);
|
|
||||||
color: var(--c_btntxt);
|
|
||||||
line-height: 2.4rem;
|
|
||||||
font-size: 1.2rem;
|
|
||||||
width: 100%;
|
|
||||||
-webkit-transition-duration: 0.4s;
|
|
||||||
transition-duration: 0.4s;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
button:hover {
|
|
||||||
background: var(--c_btnhvr);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bred {
|
|
||||||
background: var(--c_btnrst);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bred:hover {
|
|
||||||
background: var(--c_btnrsthvr);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bgrn {
|
|
||||||
background: var(--c_btnsv);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bgrn:hover {
|
|
||||||
background: var(--c_btnsvhvr);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## JavaScript Patterns
|
|
||||||
|
|
||||||
### Core Utility Functions
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Element selection shortcuts
|
|
||||||
var eb = s => document.getElementById(s);
|
|
||||||
var qs = s => document.querySelector(s);
|
|
||||||
|
|
||||||
// Password visibility toggle
|
|
||||||
var sp = i => eb(i).type = (eb(i).type === 'text' ? 'password' : 'text');
|
|
||||||
|
|
||||||
// Window load event handler
|
|
||||||
var wl = f => window.addEventListener('load', f);
|
|
||||||
|
|
||||||
// Auto-assign names to form elements
|
|
||||||
function jd() {
|
|
||||||
var t = 0, i = document.querySelectorAll('input,button,textarea,select');
|
|
||||||
while (i.length >= t) {
|
|
||||||
if (i[t]) {
|
|
||||||
i[t]['name'] = (i[t].hasAttribute('id') && (!i[t].hasAttribute('name')))
|
|
||||||
? i[t]['id'] : i[t]['name'];
|
|
||||||
}
|
|
||||||
t++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show/hide elements with class 'hf'
|
|
||||||
function sf(s) {
|
|
||||||
var t = 0, i = document.querySelectorAll('.hf');
|
|
||||||
while (i.length >= t) {
|
|
||||||
if (i[t]) {
|
|
||||||
i[t].style.display = s ? 'block' : 'none';
|
|
||||||
}
|
|
||||||
t++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
wl(jd); // Auto-assign names on load
|
|
||||||
```
|
|
||||||
|
|
||||||
### AJAX Communication
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
var x = null, lt, to, tp, pc = '';
|
|
||||||
|
|
||||||
// Load data with AJAX
|
|
||||||
function la(p) {
|
|
||||||
a = p || '';
|
|
||||||
clearTimeout(ft);
|
|
||||||
clearTimeout(lt);
|
|
||||||
if (x != null) { x.abort(); }
|
|
||||||
|
|
||||||
x = new XMLHttpRequest();
|
|
||||||
x.onreadystatechange = () => {
|
|
||||||
if (x.readyState == 4 && x.status == 200) {
|
|
||||||
var s = x.responseText
|
|
||||||
.replace(/{t}/g, "<table style='width:100%'>")
|
|
||||||
.replace(/{s}/g, "<tr><th>")
|
|
||||||
.replace(/{m}/g, "</th><td style='width:20px;white-space:nowrap'>")
|
|
||||||
.replace(/{e}/g, "</td></tr>");
|
|
||||||
eb('l1').innerHTML = s;
|
|
||||||
clearTimeout(ft);
|
|
||||||
clearTimeout(lt);
|
|
||||||
lt = setTimeout(la, 400); // Auto-refresh every 400ms
|
|
||||||
}
|
|
||||||
};
|
|
||||||
x.open('GET', '.?m=1' + a, true);
|
|
||||||
x.send();
|
|
||||||
ft = setTimeout(la, 2e4); // Fallback timeout 20 seconds
|
|
||||||
}
|
|
||||||
|
|
||||||
// Control function for sliders and buttons
|
|
||||||
function lc(v, i, p) {
|
|
||||||
if (eb('s')) {
|
|
||||||
if (v == 'h' || v == 'd') {
|
|
||||||
var sl = eb('sl4').value;
|
|
||||||
eb('s').style.background = 'linear-gradient(to right,rgb(' + sl + '%,' + sl + '%,' + sl + '%),hsl(' + eb('sl2').value + ',100%,50%))';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
la('&' + v + i + '=' + p);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Form Handling
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Submit form with UI feedback
|
|
||||||
function su(t) {
|
|
||||||
eb('f3').style.display = 'none';
|
|
||||||
eb('f2').style.display = 'block';
|
|
||||||
t.form.submit();
|
|
||||||
}
|
|
||||||
|
|
||||||
// File upload with validation
|
|
||||||
function upl(t) {
|
|
||||||
var sl = t.form['u2'].files[0].slice(0, 1);
|
|
||||||
var rd = new FileReader();
|
|
||||||
rd.onload = () => {
|
|
||||||
var bb = new Uint8Array(rd.result);
|
|
||||||
if (bb.length == 1 && bb[0] == 0xE9) {
|
|
||||||
fct(t); // Factory reset check
|
|
||||||
} else {
|
|
||||||
t.form.submit();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
rd.readAsArrayBuffer(sl);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Factory reset confirmation
|
|
||||||
function fct(t) {
|
|
||||||
var x = new XMLHttpRequest();
|
|
||||||
x.open('GET', '/u4?u4=fct&api=', true);
|
|
||||||
x.onreadystatechange = () => {
|
|
||||||
if (x.readyState == 4 && x.status == 200) {
|
|
||||||
var s = x.responseText;
|
|
||||||
if (s == 'false') setTimeout(() => { fct(t); }, 6000);
|
|
||||||
if (s == 'true') setTimeout(() => { su(t); }, 1000);
|
|
||||||
} else if (x.readyState == 4 && x.status == 0) {
|
|
||||||
setTimeout(() => { fct(t); }, 2000);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
x.send();
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Page Layout Patterns
|
|
||||||
|
|
||||||
### Configuration Menu Layout
|
|
||||||
|
|
||||||
Based on the Tasmota configuration menu, here's the standard layout pattern:
|
|
||||||
|
|
||||||
```html
|
|
||||||
<div style='background:var(--c_bg);text-align:left;display:inline-block;color:var(--c_txt);min-width:340px;position:relative;'>
|
|
||||||
<!-- Header -->
|
|
||||||
<div style='text-align:center;color:var(--c_ttl);'>
|
|
||||||
<noscript>To use Tasmota, please enable JavaScript<br></noscript>
|
|
||||||
<h3>ESP32-DevKit</h3>
|
|
||||||
<h2>Tasmota</h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Page Title -->
|
|
||||||
<div style='padding:0px 5px;text-align:center;'>
|
|
||||||
<h3><hr>Configuration<hr></h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Menu Items -->
|
|
||||||
<p></p>
|
|
||||||
<form id="but7" style="display:block;" action='md' method='get'>
|
|
||||||
<button>Module</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<p></p>
|
|
||||||
<form id="but8" style="display:block;" action='wi' method='get'>
|
|
||||||
<button>WiFi</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<!-- More menu items... -->
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
<div style='text-align:right;font-size:11px;'>
|
|
||||||
<hr>
|
|
||||||
<a href='https://github.com/arendst/Tasmota' target='_blank' style='color:#aaa;'>
|
|
||||||
Tasmota 15.0.1.4 (tasmota) by Theo Arends
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
```
|
|
||||||
|
|
||||||
### Configuration Form Layout
|
|
||||||
|
|
||||||
For configuration pages with forms:
|
|
||||||
|
|
||||||
```html
|
|
||||||
<fieldset>
|
|
||||||
<legend><b> Other parameters </b></legend>
|
|
||||||
<form method='get' action='co'>
|
|
||||||
|
|
||||||
<!-- Template Section -->
|
|
||||||
<fieldset>
|
|
||||||
<legend><b> Template </b></legend>
|
|
||||||
<p>
|
|
||||||
<input id='t1' placeholder="Template" value='{"NAME":"ESP32-DevKit","GPIO":[1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1376,0,1,224,1,0,1,1,0,0,0,0,0,1,1,0,1,1,0,0,1],"FLAG":0,"BASE":1}'>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<label>
|
|
||||||
<input id='t2' type='checkbox' checked disabled>
|
|
||||||
<b>Activate</b>
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<!-- Password Field with Toggle -->
|
|
||||||
<br>
|
|
||||||
<label>
|
|
||||||
<b>Web Admin Password</b>
|
|
||||||
<input type='checkbox' onclick='sp("wp")'>
|
|
||||||
</label>
|
|
||||||
<br>
|
|
||||||
<input id='wp' type='password' placeholder="Web Admin Password" value="****">
|
|
||||||
|
|
||||||
<!-- Checkboxes -->
|
|
||||||
<br><br>
|
|
||||||
<label>
|
|
||||||
<input id='b3' type='checkbox' checked>
|
|
||||||
<b>HTTP API enable</b>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<!-- Text Inputs -->
|
|
||||||
<br><br>
|
|
||||||
<label><b>Device Name</b> (Tasmota)</label>
|
|
||||||
<br>
|
|
||||||
<input id='dn' placeholder="" value="Tasmota">
|
|
||||||
|
|
||||||
<!-- Radio Buttons -->
|
|
||||||
<fieldset>
|
|
||||||
<legend><b> Emulation </b></legend>
|
|
||||||
<p>
|
|
||||||
<label>
|
|
||||||
<input id='r0' name='b2' type='radio' value='0'>
|
|
||||||
<b>None</b>
|
|
||||||
</label>
|
|
||||||
<br>
|
|
||||||
<label>
|
|
||||||
<input id='r2' name='b2' type='radio' value='2' checked>
|
|
||||||
<b>Hue Bridge</b> multi device
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<!-- Submit Button -->
|
|
||||||
<br>
|
|
||||||
<button name='save' type='submit' class='button bgrn'>Save</button>
|
|
||||||
</form>
|
|
||||||
</fieldset>
|
|
||||||
```
|
|
||||||
|
|
||||||
### Main Page with Controls
|
|
||||||
|
|
||||||
The main control page features a prominent status display and interactive controls. Based on the screenshot analysis:
|
|
||||||
|
|
||||||
```html
|
|
||||||
<!-- Dynamic Content Area -->
|
|
||||||
<div style='padding:0;' id='l1' name='l1'></div>
|
|
||||||
|
|
||||||
<!-- Control Buttons -->
|
|
||||||
<table style='width:100%'>
|
|
||||||
<tr>
|
|
||||||
<td style='width:100%'>
|
|
||||||
<button id='o1' onclick='la("&o=1");'>Toggle 1</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<!-- Color Controls -->
|
|
||||||
<table style='width:100%'>
|
|
||||||
<!-- Hue Slider -->
|
|
||||||
<tr>
|
|
||||||
<td colspan='2' style='width:100%'>
|
|
||||||
<div id='b' class='r' style='background-image:linear-gradient(to right,#800,#f00 5%,#ff0 20%,#0f0 35%,#0ff 50%,#00f 65%,#f0f 80%,#f00 95%,#800);'>
|
|
||||||
<input id='sl2' type='range' min='0' max='359' value='95' onchange='lc("h",0,value)'>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!-- Saturation Slider -->
|
|
||||||
<tr>
|
|
||||||
<td colspan='2' style='width:100%'>
|
|
||||||
<div id='s' class='r' style='background-image:linear-gradient(to right,#CCCCCC,#6AFF00);'>
|
|
||||||
<input id='sl3' type='range' min='0' max='100' value='94' onchange='lc("n",0,value)'>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!-- Brightness Control -->
|
|
||||||
<tr>
|
|
||||||
<td style='width:15%'>
|
|
||||||
<button id='o2' onclick='la("&o=2");'>T2</button>
|
|
||||||
</td>
|
|
||||||
<td colspan='1' style='width:85%'>
|
|
||||||
<div id='c' class='r' style='background-image:linear-gradient(to right,#000,#fff);'>
|
|
||||||
<input id='sl4' type='range' min='0' max='100' value='80' onchange='lc("d",0,value)'>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<!-- Button State Script -->
|
|
||||||
<script>
|
|
||||||
eb('o1').style.background = 'var(--c_btnoff)';
|
|
||||||
</script>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Advanced UI Components
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Advanced UI Components
|
|
||||||
|
|
||||||
### Range Sliders with Visual Feedback
|
|
||||||
|
|
||||||
```css
|
|
||||||
.r {
|
|
||||||
border-radius: 0.3em;
|
|
||||||
padding: 2px;
|
|
||||||
margin: 4px 2px;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Textarea for Console/Logs
|
|
||||||
|
|
||||||
```css
|
|
||||||
textarea {
|
|
||||||
resize: vertical;
|
|
||||||
width: 98%;
|
|
||||||
height: 318px;
|
|
||||||
padding: 5px;
|
|
||||||
overflow: auto;
|
|
||||||
background: var(--c_bg);
|
|
||||||
color: var(--c_csltxt);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Hidden Elements
|
|
||||||
|
|
||||||
```css
|
|
||||||
.hf {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Utility Classes
|
|
||||||
|
|
||||||
```css
|
|
||||||
.p {
|
|
||||||
float: left;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.q {
|
|
||||||
float: right;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: var(--c_btn);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
td {
|
|
||||||
padding: 0px;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Best Practices
|
|
||||||
|
|
||||||
### 1. Memory Optimization
|
|
||||||
- Use inline styles for unique elements
|
|
||||||
- Minimize JavaScript object creation
|
|
||||||
- Reuse DOM elements where possible
|
|
||||||
- Use CSS variables for consistent theming
|
|
||||||
|
|
||||||
### 2. User Experience
|
|
||||||
- Provide immediate visual feedback for actions
|
|
||||||
- Use consistent button sizing and spacing
|
|
||||||
- Implement proper form validation
|
|
||||||
- Show loading states during operations
|
|
||||||
|
|
||||||
### 3. Accessibility
|
|
||||||
- Use semantic HTML elements
|
|
||||||
- Provide proper labels for form controls
|
|
||||||
- Ensure sufficient color contrast
|
|
||||||
- Support keyboard navigation
|
|
||||||
|
|
||||||
### 4. Performance
|
|
||||||
- Minimize HTTP requests
|
|
||||||
- Use efficient DOM manipulation
|
|
||||||
- Implement proper error handling
|
|
||||||
- Cache frequently accessed elements
|
|
||||||
|
|
||||||
### 5. Responsive Design
|
|
||||||
- Use flexible layouts
|
|
||||||
- Test on various screen sizes
|
|
||||||
- Ensure touch-friendly interface
|
|
||||||
- Provide appropriate viewport settings
|
|
||||||
|
|
||||||
## Integration with Tasmota Backend
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Common UI Patterns
|
|
||||||
|
|
||||||
### 1. Toggle Buttons (from original source)
|
|
||||||
```html
|
|
||||||
<button id='o1' onclick='la("&o=1");'>Toggle 1</button>
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. Configuration Sections
|
|
||||||
```html
|
|
||||||
<fieldset>
|
|
||||||
<legend><b> Section Title </b></legend>
|
|
||||||
<!-- Configuration options -->
|
|
||||||
</fieldset>
|
|
||||||
```
|
|
||||||
|
|
||||||
### 3. Input with Label
|
|
||||||
```html
|
|
||||||
<label><b>Setting Name</b> (default)</label>
|
|
||||||
<br>
|
|
||||||
<input id='setting' placeholder="Enter value" value="current_value">
|
|
||||||
```
|
|
||||||
|
|
||||||
### 4. Checkbox with Label
|
|
||||||
```html
|
|
||||||
<label>
|
|
||||||
<input id='option' type='checkbox' checked>
|
|
||||||
<b>Option Description</b>
|
|
||||||
</label>
|
|
||||||
```
|
|
||||||
|
|
||||||
### 5. Radio Button Group
|
|
||||||
```html
|
|
||||||
<fieldset>
|
|
||||||
<legend><b> Emulation </b></legend>
|
|
||||||
<p>
|
|
||||||
<label>
|
|
||||||
<input name='emulation' type='radio' value='0'>
|
|
||||||
<b>None</b>
|
|
||||||
</label>
|
|
||||||
<br>
|
|
||||||
<label>
|
|
||||||
<input name='emulation' type='radio' value='2' checked>
|
|
||||||
<b>Hue Bridge</b> multi device
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
</fieldset>
|
|
||||||
```
|
|
||||||
|
|
||||||
### 6. Password Field with Toggle
|
|
||||||
```html
|
|
||||||
<label>
|
|
||||||
<b>Web Admin Password</b>
|
|
||||||
<input type='checkbox' onclick='sp("wp")' style='width:auto;margin-left:10px;'>
|
|
||||||
</label>
|
|
||||||
<br>
|
|
||||||
<input id='wp' type='password' placeholder="Web Admin Password" value="****">
|
|
||||||
```
|
|
||||||
|
|
||||||
### 7. Template Configuration (from original source)
|
|
||||||
```html
|
|
||||||
<fieldset>
|
|
||||||
<legend><b> Template </b></legend>
|
|
||||||
<p>
|
|
||||||
<input id='t1' placeholder="Template" value='{"NAME":"ESP32-DevKit","GPIO":[1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1376,0,1,224,1,0,1,1,0,0,0,0,0,1,1,0,1,1,0,0,1],"FLAG":0,"BASE":1}'>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<label>
|
|
||||||
<input id='t2' type='checkbox' checked disabled>
|
|
||||||
<b>Activate</b>
|
|
||||||
</label>
|
|
||||||
</p>
|
|
||||||
</fieldset>
|
|
||||||
```
|
|
||||||
|
|
||||||
### 8. Color Control Sliders (from original source)
|
|
||||||
```html
|
|
||||||
<table style='width:100%'>
|
|
||||||
<tr>
|
|
||||||
<td colspan='2' style='width:100%'>
|
|
||||||
<div id='b' class='r' style='background-image:linear-gradient(to right,#800,#f00 5%,#ff0 20%,#0f0 35%,#0ff 50%,#00f 65%,#f0f 80%,#f00 95%,#800);'>
|
|
||||||
<input id='sl2' type='range' min='0' max='359' value='95' onchange='lc("h",0,value)'>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan='2' style='width:100%'>
|
|
||||||
<div id='s' class='r' style='background-image:linear-gradient(to right,#CCCCCC,#6AFF00);'>
|
|
||||||
<input id='sl3' type='range' min='0' max='100' value='94' onchange='lc("n",0,value)'>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td style='width:15%'>
|
|
||||||
<button id='o2' onclick='la("&o=2");'>T2</button>
|
|
||||||
</td>
|
|
||||||
<td colspan='1' style='width:85%'>
|
|
||||||
<div id='c' class='r' style='background-image:linear-gradient(to right,#000,#fff);'>
|
|
||||||
<input id='sl4' type='range' min='0' max='100' value='80' onchange='lc("d",0,value)'>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
```
|
|
||||||
|
|
||||||
This guide provides the foundation for creating Tasmota-compatible WebUI interfaces that are efficient, user-friendly, and consistent with the existing design system. The visual specifications are based on actual Tasmota WebUI screenshots showing the main control page, configuration forms, and navigation menus.
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 74 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 107 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 89 KiB |
23
.gitattributes
vendored
23
.gitattributes
vendored
@ -1,23 +0,0 @@
|
|||||||
# Auto detect text files and perform LF normalization
|
|
||||||
* text=off
|
|
||||||
|
|
||||||
# Custom for Visual Studio
|
|
||||||
*.cs diff=csharp
|
|
||||||
|
|
||||||
# Standard to msysgit
|
|
||||||
*.doc diff=astextplain
|
|
||||||
*.DOC diff=astextplain
|
|
||||||
*.docx diff=astextplain
|
|
||||||
*.DOCX diff=astextplain
|
|
||||||
*.dot diff=astextplain
|
|
||||||
*.DOT diff=astextplain
|
|
||||||
*.pdf diff=astextplain
|
|
||||||
*.PDF diff=astextplain
|
|
||||||
*.rtf diff=astextplain
|
|
||||||
*.RTF diff=astextplain
|
|
||||||
|
|
||||||
# No changes for zip files
|
|
||||||
*.zip binary
|
|
||||||
*.autoconf binary
|
|
||||||
*.bin binary
|
|
||||||
*.tapp binary
|
|
||||||
82
.github/ISSUE_TEMPLATE/Bug_report.md
vendored
82
.github/ISSUE_TEMPLATE/Bug_report.md
vendored
@ -1,82 +0,0 @@
|
|||||||
---
|
|
||||||
name: Problem Report
|
|
||||||
about: Create a Report to help us improve
|
|
||||||
---
|
|
||||||
|
|
||||||
<!-- Thanks for reporting a problem for this project. READ THIS FIRST:
|
|
||||||
|
|
||||||
This issue template is meant to REPORT Tasmota software PROBLEMS ONLY
|
|
||||||
|
|
||||||
Please DO NOT OPEN AN ISSUE:
|
|
||||||
- If your Tasmota version is not the latest from the development branch, please update your device before submitting your issue. Your problem might already be solved. The latest precompiled binaries of Tasmota can be downloaded from http://ota.tasmota.com/tasmota/
|
|
||||||
- If you have an issue when flashing was done via Tuya Convert, please address it to Tuya Convert Team
|
|
||||||
- If your issue is a flashing issue, please address it to the [Tasmota Support Chat](https://discord.gg/Ks2Kzd4)
|
|
||||||
- If your issue is compilation problem, please address it to the [Tasmota Support Chat](https://discord.gg/Ks2Kzd4)
|
|
||||||
- If your issue has been addressed before (i.e., duplicated issue), please ask in the original issue
|
|
||||||
- If your issue is a Wi-Fi problem or MQTT problem, please try the steps provided in the [FAQ](https://tasmota.github.io/docs/FAQ) and [Troubleshooting](https://tasmota.github.io/docs/Troubleshooting)
|
|
||||||
|
|
||||||
Please take a few minutes to complete the requested information below. Our ability to provide assistance is greatly hampered without it. The details requested potentially affect which options to pursue. The small amount of time you spend completing the template will also help the volunteers providing the assistance to you to reduce the time required to help you.
|
|
||||||
|
|
||||||
DO NOT DELETE ANY TEXT from this template! Otherwise the issue will be auto-closed.
|
|
||||||
-->
|
|
||||||
|
|
||||||
### PROBLEM DESCRIPTION
|
|
||||||
_A clear and concise description of what the problem is._
|
|
||||||
|
|
||||||
|
|
||||||
### REQUESTED INFORMATION
|
|
||||||
_Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!_
|
|
||||||
|
|
||||||
- [ ] Read the [Contributing Guide and Policy](https://github.com/arendst/Tasmota/blob/development/CONTRIBUTING.md) and [the Code of Conduct](https://github.com/arendst/Tasmota/blob/development/CODE_OF_CONDUCT.md)
|
|
||||||
- [ ] Searched the problem in [issues](https://github.com/arendst/Tasmota/issues)
|
|
||||||
- [ ] Searched the problem in [discussions](https://github.com/arendst/Tasmota/discussions)
|
|
||||||
- [ ] Searched the problem in the [docs](https://tasmota.github.io/docs/FAQ)
|
|
||||||
- [ ] Searched the problem in the [chat](https://discord.gg/Ks2Kzd4)
|
|
||||||
- [ ] Problem is not scripter related, in this case open a discussion and tag gemu2015
|
|
||||||
- [ ] Device used (e.g., Sonoff Basic): _____
|
|
||||||
- [ ] Tasmota binary firmware version number used: _____
|
|
||||||
- [ ] Pre-compiled
|
|
||||||
- [ ] Self-compiled
|
|
||||||
- [ ] Flashing tools used: _____
|
|
||||||
- [ ] Provide the output of command: `Backlog Template; Module; GPIO 255`:
|
|
||||||
```lua
|
|
||||||
Configuration output here:
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
- [ ] If using rules, provide the output of this command: `Backlog Rule1; Rule2; Rule3`:
|
|
||||||
```lua
|
|
||||||
Rules output here:
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
- [ ] Provide the output of this command: `Status 0`:
|
|
||||||
```lua
|
|
||||||
STATUS 0 output here:
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
- [ ] Set `weblog` to 4 and then, when you experience your issue, provide the output of the Console log:
|
|
||||||
```lua
|
|
||||||
Console output here:
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### TO REPRODUCE
|
|
||||||
_Steps to reproduce the behavior:_
|
|
||||||
|
|
||||||
|
|
||||||
### EXPECTED BEHAVIOUR
|
|
||||||
_A clear and concise description of what you expected to happen._
|
|
||||||
|
|
||||||
|
|
||||||
### SCREENSHOTS
|
|
||||||
_If applicable, add screenshots to help explain your problem._
|
|
||||||
|
|
||||||
|
|
||||||
### ADDITIONAL CONTEXT
|
|
||||||
_Add any other context about the problem here._
|
|
||||||
|
|
||||||
|
|
||||||
**(Please, remember to close the issue when the problem has been addressed)**
|
|
||||||
11
.github/ISSUE_TEMPLATE/config.yml
vendored
11
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1,11 +0,0 @@
|
|||||||
blank_issues_enabled: false
|
|
||||||
contact_links:
|
|
||||||
- name: Tasmota Docs
|
|
||||||
url: https://tasmota.github.io/docs
|
|
||||||
about: All the information related to Tasmota.
|
|
||||||
- name: Tasmota Discussions and Support
|
|
||||||
url: https://github.com/arendst/Tasmota/discussions
|
|
||||||
about: Tasmota usage Questions, Feature Requests and Projects.
|
|
||||||
- name: Tasmota Users Chat
|
|
||||||
url: https://discord.gg/Ks2Kzd4
|
|
||||||
about: Chat for feedback, questions and troubleshooting.
|
|
||||||
13
.github/PULL_REQUEST_TEMPLATE.md
vendored
13
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,13 +0,0 @@
|
|||||||
## Description:
|
|
||||||
|
|
||||||
**Related issue (if applicable):** fixes #<Tasmota issue number goes here>
|
|
||||||
|
|
||||||
## Checklist:
|
|
||||||
- [ ] The pull request is done against the latest development branch
|
|
||||||
- [ ] Only relevant files were touched
|
|
||||||
- [ ] 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 ESP32 V.3.1.7
|
|
||||||
- [ ] 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**_
|
|
||||||
11
.github/config.yml
vendored
11
.github/config.yml
vendored
@ -1,11 +0,0 @@
|
|||||||
# Configuration for sentiment-bot - https://github.com/behaviorbot/sentiment-bot
|
|
||||||
|
|
||||||
# *Required* toxicity threshold between 0 and .99 with the higher numbers being the most toxic
|
|
||||||
# Anything higher than this threshold will be marked as toxic and commented on
|
|
||||||
sentimentBotToxicityThreshold: .7
|
|
||||||
|
|
||||||
# *Required* Comment to reply with
|
|
||||||
sentimentBotReplyComment: >
|
|
||||||
Please be sure to review the code of conduct and be respectful of other users.
|
|
||||||
|
|
||||||
# Note: the bot will only work if your repository has a Code of Conduct
|
|
||||||
50
.github/issue-close-app.yml
vendored
50
.github/issue-close-app.yml
vendored
@ -1,50 +0,0 @@
|
|||||||
# CLOSE ISSUE BOT
|
|
||||||
# ---------------
|
|
||||||
# A bot which helps you to close issues that don't include some specific contents.
|
|
||||||
# See how to use it in https://github.com/offu/close-issue-app.
|
|
||||||
|
|
||||||
# Comment that will be sent if an issue is judged to be closed.
|
|
||||||
comment: >-
|
|
||||||
This issue has been automatically closed because the PROBLEM REPORT TEMPLATE is missing or incomplete.
|
|
||||||
|
|
||||||
Filling the template is required so standard questions don't need to be asked again each time.
|
|
||||||
Our ability to provide assistance is greatly hampered if few minutes are not taken to complete the issue template
|
|
||||||
with the requested information. The details requested potentially affect which options to pursue. The small amount
|
|
||||||
of time you will spend completing the template will also help the volunteers, providing assistance to you, to reduce
|
|
||||||
the time required to help you.
|
|
||||||
|
|
||||||
Please, could you be so kind on completing the [PROBLEM REPORT TEMPLATE](https://github.com/arendst/Tasmota/issues/new/choose) in order to have more information so as to properly help you?
|
|
||||||
|
|
||||||
Thank you for taking the time to report, hopefully it can be resolved soon.
|
|
||||||
|
|
||||||
[Docs](https://tasmota.github.io/docs/) for more information.
|
|
||||||
|
|
||||||
[Discussions](https://github.com/arendst/Tasmota/discussions) for Questions, Feature Requests and Projects.
|
|
||||||
|
|
||||||
[Chat](https://discord.gg/Ks2Kzd4) for more users experience.
|
|
||||||
|
|
||||||
Please check the [Code of Conduct](https://github.com/arendst/Tasmota/blob/development/CODE_OF_CONDUCT.md) and the [Contributing Guideline and Policy](https://github.com/arendst/Tasmota/blob/development/CONTRIBUTING.md)
|
|
||||||
|
|
||||||
issueConfigs:
|
|
||||||
# There can be several configs for different kind of issues.
|
|
||||||
- content:
|
|
||||||
# template 1: bug report
|
|
||||||
- "PROBLEM DESCRIPTION"
|
|
||||||
- "REQUESTED INFORMATION"
|
|
||||||
- "TO REPRODUCE"
|
|
||||||
- "EXPECTED BEHAVIOUR"
|
|
||||||
- content:
|
|
||||||
# template 2: feature request
|
|
||||||
- "Have you looked for this feature in other issues and in the docs"
|
|
||||||
- "Describe the solution you'd like"
|
|
||||||
|
|
||||||
# Optional configuration:
|
|
||||||
#
|
|
||||||
# whether the keywords are case-insensitive
|
|
||||||
# default value is false, which means keywords are case-sensitive
|
|
||||||
caseInsensitive: true
|
|
||||||
# the label that will be added when the bot close an issue
|
|
||||||
# The bot will only add a label if this property is set.
|
|
||||||
label: "template missing/incomplete"
|
|
||||||
# The issue is judged to be legal if it includes all keywords from any of these two configs.
|
|
||||||
# Or it will be closed by the app.
|
|
||||||
319
.github/workflows/Tasmota_build_devel.yml
vendored
319
.github/workflows/Tasmota_build_devel.yml
vendored
@ -1,319 +0,0 @@
|
|||||||
|
|
||||||
name: Build_development
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch: # Start a workflow
|
|
||||||
push:
|
|
||||||
branches: development
|
|
||||||
paths-ignore:
|
|
||||||
- '.github/**' # Ignore changes towards the .github directory
|
|
||||||
- '**.md' # Do no build if *.md files changes
|
|
||||||
- 'tasmota/berry/**' # Ignore Berry examples
|
|
||||||
|
|
||||||
# Ensures that only one deploy task per branch/environment will run at a time.
|
|
||||||
concurrency:
|
|
||||||
group: environment-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
be_solidify:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'arendst/Tasmota' && github.ref_name == 'development'
|
|
||||||
continue-on-error: true
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
|
||||||
|
|
||||||
- name: Make Berry and Solidify code
|
|
||||||
run: |
|
|
||||||
cd lib/libesp32/berry
|
|
||||||
make
|
|
||||||
cd ../berry_tasmota
|
|
||||||
../berry/berry -s -g solidify_all.be
|
|
||||||
cd ../berry_matter
|
|
||||||
../berry/berry -s -g solidify_all.be
|
|
||||||
cd ../berry_animate
|
|
||||||
../berry/berry -s -g solidify_all.be
|
|
||||||
cd ../../libesp32_lvgl/lv_binding_berry
|
|
||||||
../../libesp32/berry/berry -s -g solidify_all.be
|
|
||||||
cd ../lv_haspmota
|
|
||||||
../../libesp32/berry/berry -s -g solidify_all.be
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: berry
|
|
||||||
path: |
|
|
||||||
./lib/libesp32/berry_tasmota/src/solidify
|
|
||||||
./lib/libesp32/berry_matter/src/solidify
|
|
||||||
./lib/libesp32/berry_animate/src/solidify
|
|
||||||
./lib/libesp32_lvgl/lv_binding_berry/src/solidify
|
|
||||||
./lib/libesp32_lvgl/lv_haspmota/src/solidify
|
|
||||||
./lib/libesp32/berry/generate
|
|
||||||
|
|
||||||
push_solidified:
|
|
||||||
needs: be_solidify
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'arendst/Tasmota' && github.ref_name == 'development'
|
|
||||||
continue-on-error: true
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
pattern: berry
|
|
||||||
path: berry
|
|
||||||
- name: Move solidified Berry files back
|
|
||||||
run: |
|
|
||||||
ls -R ./berry
|
|
||||||
mv berry/berry/libesp32/berry_tasmota/src/solidify/* ./lib/libesp32/berry_tasmota/src/solidify
|
|
||||||
mv berry/berry/libesp32/berry_matter/src/solidify/* ./lib/libesp32/berry_matter/src/solidify
|
|
||||||
mv berry/berry/libesp32/berry_animate/src/solidify/* ./lib/libesp32/berry_animate/src/solidify
|
|
||||||
mv berry/berry/libesp32_lvgl/lv_binding_berry/src/solidify/* ./lib/libesp32_lvgl/lv_binding_berry/src/solidify
|
|
||||||
mv berry/berry/libesp32_lvgl/lv_haspmota/src/solidify/* ./lib/libesp32_lvgl/lv_haspmota/src/solidify
|
|
||||||
mv berry/berry/libesp32/berry/generate/* ./lib/libesp32/berry/generate
|
|
||||||
- uses: stefanzweifel/git-auto-commit-action@v5
|
|
||||||
with:
|
|
||||||
commit_message: Solidified Code updated
|
|
||||||
|
|
||||||
safeboot-images:
|
|
||||||
needs: push_solidified
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'arendst/Tasmota'
|
|
||||||
continue-on-error: true
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
variant:
|
|
||||||
- tasmota32-safeboot
|
|
||||||
- tasmota32solo1-safeboot
|
|
||||||
- tasmota32s2-safeboot
|
|
||||||
- tasmota32s2cdc-safeboot
|
|
||||||
- tasmota32s3-safeboot
|
|
||||||
- tasmota32s3ser-safeboot
|
|
||||||
- tasmota32c2-safeboot
|
|
||||||
- tasmota32c3-safeboot
|
|
||||||
- tasmota32c3ser-safeboot
|
|
||||||
- tasmota32c5-safeboot
|
|
||||||
- tasmota32c5ser-safeboot
|
|
||||||
- tasmota32c6-safeboot
|
|
||||||
- tasmota32c6ser-safeboot
|
|
||||||
- tasmota32p4-safeboot
|
|
||||||
- tasmota32p4ser-safeboot
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: development
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@v6
|
|
||||||
with:
|
|
||||||
version: "latest"
|
|
||||||
enable-cache: false
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
uv pip install --system platformio
|
|
||||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
|
||||||
- name: Add SHA to footer
|
|
||||||
run: |
|
|
||||||
COMMIT_SHA_LONG=$(git rev-parse --short HEAD || echo "")
|
|
||||||
SHA=${COMMIT_SHA_LONG::7}
|
|
||||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
|
|
||||||
- name: Run PlatformIO
|
|
||||||
env:
|
|
||||||
PYTHONIOENCODING: utf-8
|
|
||||||
PYTHONUTF8: '1'
|
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
|
||||||
#- name: Use esp32-solo1 safeboot for esp32 too
|
|
||||||
#run: |
|
|
||||||
#cp ./build_output/firmware/tasmota32solo1-safeboot.bin ./build_output/firmware/tasmota32-safeboot.bin
|
|
||||||
- name: Upload safeboot firmware artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.variant }}
|
|
||||||
path: ./build_output
|
|
||||||
|
|
||||||
base-images:
|
|
||||||
needs: push_solidified
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'arendst/Tasmota'
|
|
||||||
continue-on-error: true
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
variant:
|
|
||||||
- tasmota
|
|
||||||
- tasmota-4M
|
|
||||||
- tasmota-minimal
|
|
||||||
- tasmota-display
|
|
||||||
- tasmota-ir
|
|
||||||
- tasmota-knx
|
|
||||||
- tasmota-lite
|
|
||||||
- tasmota-sensors
|
|
||||||
- tasmota-zbbridge
|
|
||||||
- tasmota-zigbee
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: development
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@v6
|
|
||||||
with:
|
|
||||||
version: "latest"
|
|
||||||
enable-cache: false
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
uv pip install --system platformio
|
|
||||||
- name: Add SHA to footer
|
|
||||||
run: |
|
|
||||||
COMMIT_SHA_LONG=$(git rev-parse --short HEAD || echo "")
|
|
||||||
SHA=${COMMIT_SHA_LONG::7}
|
|
||||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
|
|
||||||
- name: Run PlatformIO
|
|
||||||
env:
|
|
||||||
PYTHONIOENCODING: utf-8
|
|
||||||
PYTHONUTF8: '1'
|
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
|
||||||
- name: Upload firmware artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.variant }}
|
|
||||||
path: ./build_output
|
|
||||||
|
|
||||||
base32-images:
|
|
||||||
needs: safeboot-images
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'arendst/Tasmota'
|
|
||||||
continue-on-error: true
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
variant:
|
|
||||||
- tasmota32
|
|
||||||
- tasmota32-zbbrdgpro
|
|
||||||
- tasmota32-webcam
|
|
||||||
- tasmota32-bluetooth
|
|
||||||
- tasmota32-nspanel
|
|
||||||
- tasmota32-display
|
|
||||||
- tasmota32-ir
|
|
||||||
- tasmota32-lvgl
|
|
||||||
- tasmota32c2
|
|
||||||
- tasmota32c3
|
|
||||||
- tasmota32c5
|
|
||||||
- tasmota32c6
|
|
||||||
- tasmota32p4
|
|
||||||
- tasmota32s2
|
|
||||||
- tasmota32s2cdc
|
|
||||||
- tasmota32s3
|
|
||||||
- tasmota32solo1
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: development
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@v6
|
|
||||||
with:
|
|
||||||
version: "latest"
|
|
||||||
enable-cache: false
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
uv pip install --system platformio
|
|
||||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
|
||||||
- name: Download safeboot firmwares
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
pattern: tasmota32*
|
|
||||||
path: ./temp
|
|
||||||
- name: Move safeboot files
|
|
||||||
run: |
|
|
||||||
mkdir -p ./firmware/firmware
|
|
||||||
find ./temp -type f -exec cp -t ./firmware/firmware {} +
|
|
||||||
- name: Add SHA to footer
|
|
||||||
run: |
|
|
||||||
COMMIT_SHA_LONG=$(git rev-parse --short HEAD || echo "")
|
|
||||||
SHA=${COMMIT_SHA_LONG::7}
|
|
||||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
|
|
||||||
- name: Run PlatformIO
|
|
||||||
env:
|
|
||||||
PYTHONIOENCODING: utf-8
|
|
||||||
PYTHONUTF8: '1'
|
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
|
||||||
- name: Upload firmware artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.variant }}
|
|
||||||
path: ./build_output
|
|
||||||
|
|
||||||
language-images:
|
|
||||||
needs: safeboot-images
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'arendst/Tasmota'
|
|
||||||
continue-on-error: true
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
variant: [ tasmota, tasmota32 ]
|
|
||||||
language: [ AD, AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, LT, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: development
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@v6
|
|
||||||
with:
|
|
||||||
version: "latest"
|
|
||||||
enable-cache: false
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
uv pip install --system platformio
|
|
||||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
|
||||||
- name: Download safeboot firmwares
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
pattern: tasmota32*
|
|
||||||
path: ./temp
|
|
||||||
- name: Move safeboot files
|
|
||||||
run: |
|
|
||||||
mkdir -p ./firmware/firmware
|
|
||||||
find ./temp -type f -exec cp -t ./firmware/firmware {} +
|
|
||||||
- name: Add SHA to footer
|
|
||||||
run: |
|
|
||||||
COMMIT_SHA_LONG=$(git rev-parse --short HEAD || echo "")
|
|
||||||
SHA=${COMMIT_SHA_LONG::7}
|
|
||||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
|
|
||||||
- name: Run PlatformIO
|
|
||||||
env:
|
|
||||||
PYTHONIOENCODING: utf-8
|
|
||||||
PYTHONUTF8: '1'
|
|
||||||
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
|
|
||||||
- name: Upload language firmware artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.variant }}-${{ matrix.language }}
|
|
||||||
path: ./build_output
|
|
||||||
|
|
||||||
Start_final_copy:
|
|
||||||
needs: [base-images, base32-images, language-images]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Dispatch workflow in arendst/Tasmota-firmware
|
|
||||||
run: |
|
|
||||||
curl -X POST https://api.github.com/repos/arendst/Tasmota-firmware/actions/workflows/fetch_deploy.yml/dispatches \
|
|
||||||
-H 'Accept: application/vnd.github.everest-preview+json' \
|
|
||||||
-u ${{ secrets.API_TOKEN_GITHUB }} \
|
|
||||||
--data '{"ref": "gh_actions"}'
|
|
||||||
269
.github/workflows/Tasmota_build_master.yml
vendored
269
.github/workflows/Tasmota_build_master.yml
vendored
@ -1,269 +0,0 @@
|
|||||||
name: Build_firmware_master
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch: # Start a workflow
|
|
||||||
push:
|
|
||||||
branches: master
|
|
||||||
paths-ignore:
|
|
||||||
- '.github/**' # Ignore changes towards the .github directory
|
|
||||||
- '**.md' # Do no build if *.md files changes
|
|
||||||
- 'tasmota/berry/**' # Ignore Berry examples
|
|
||||||
|
|
||||||
# Ensures that only one deploy task per branch/environment will run at a time.
|
|
||||||
concurrency:
|
|
||||||
group: environment-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
safeboot-images:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'arendst/Tasmota'
|
|
||||||
continue-on-error: true
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
variant:
|
|
||||||
- tasmota32-safeboot
|
|
||||||
- tasmota32solo1-safeboot
|
|
||||||
- tasmota32s2-safeboot
|
|
||||||
- tasmota32s2cdc-safeboot
|
|
||||||
- tasmota32s3-safeboot
|
|
||||||
- tasmota32s3ser-safeboot
|
|
||||||
- tasmota32c2-safeboot
|
|
||||||
- tasmota32c3-safeboot
|
|
||||||
- tasmota32c3ser-safeboot
|
|
||||||
- tasmota32c5-safeboot
|
|
||||||
- tasmota32c5ser-safeboot
|
|
||||||
- tasmota32c6-safeboot
|
|
||||||
- tasmota32c6ser-safeboot
|
|
||||||
- tasmota32p4-safeboot
|
|
||||||
- tasmota32p4ser-safeboot
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: master
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@v6
|
|
||||||
with:
|
|
||||||
version: "latest"
|
|
||||||
enable-cache: false
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
uv pip install --system platformio
|
|
||||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
|
||||||
- name: Add "release" to footer
|
|
||||||
run: |
|
|
||||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
|
|
||||||
- name: Run PlatformIO
|
|
||||||
env:
|
|
||||||
PYTHONIOENCODING: utf-8
|
|
||||||
PYTHONUTF8: '1'
|
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
|
||||||
- name: Upload safeboot firmware artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.variant }}
|
|
||||||
path: ./build_output
|
|
||||||
|
|
||||||
base-images:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'arendst/Tasmota'
|
|
||||||
continue-on-error: true
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
variant:
|
|
||||||
- tasmota
|
|
||||||
- tasmota-4M
|
|
||||||
- tasmota-minimal
|
|
||||||
- tasmota-display
|
|
||||||
- tasmota-ir
|
|
||||||
- tasmota-knx
|
|
||||||
- tasmota-lite
|
|
||||||
- tasmota-sensors
|
|
||||||
- tasmota-zbbridge
|
|
||||||
- tasmota-zigbee
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: master
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@v6
|
|
||||||
with:
|
|
||||||
version: "latest"
|
|
||||||
enable-cache: false
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
uv pip install --system platformio
|
|
||||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
|
||||||
- name: Add "release" to footer
|
|
||||||
run: |
|
|
||||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
|
|
||||||
- name: Run PlatformIO
|
|
||||||
env:
|
|
||||||
PYTHONIOENCODING: utf-8
|
|
||||||
PYTHONUTF8: '1'
|
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
|
||||||
- name: Upload firmware artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.variant }}
|
|
||||||
path: ./build_output
|
|
||||||
|
|
||||||
base32-images:
|
|
||||||
needs: safeboot-images
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'arendst/Tasmota'
|
|
||||||
continue-on-error: true
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
variant:
|
|
||||||
- tasmota32
|
|
||||||
- tasmota32-zbbrdgpro
|
|
||||||
- tasmota32-webcam
|
|
||||||
- tasmota32-bluetooth
|
|
||||||
- tasmota32-nspanel
|
|
||||||
- tasmota32-display
|
|
||||||
- tasmota32-ir
|
|
||||||
- tasmota32-lvgl
|
|
||||||
- tasmota32c2
|
|
||||||
- tasmota32c3
|
|
||||||
- tasmota32c5
|
|
||||||
- tasmota32c6
|
|
||||||
- tasmota32p4
|
|
||||||
- tasmota32s2
|
|
||||||
- tasmota32s2cdc
|
|
||||||
- tasmota32s3
|
|
||||||
- tasmota32solo1
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: master
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@v6
|
|
||||||
with:
|
|
||||||
version: "latest"
|
|
||||||
enable-cache: false
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
uv pip install --system platformio
|
|
||||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
|
||||||
- name: Download safeboot firmwares
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
pattern: tasmota32*
|
|
||||||
path: ./temp
|
|
||||||
- name: Move safeboot files
|
|
||||||
run: |
|
|
||||||
mkdir -p ./firmware/firmware
|
|
||||||
find ./temp -type f -exec cp -t ./firmware/firmware {} +
|
|
||||||
- name: Add "release" to footer
|
|
||||||
run: |
|
|
||||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
|
|
||||||
- name: Run PlatformIO
|
|
||||||
env:
|
|
||||||
PYTHONIOENCODING: utf-8
|
|
||||||
PYTHONUTF8: '1'
|
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
|
||||||
- name: Upload firmware artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.variant }}
|
|
||||||
path: ./build_output
|
|
||||||
|
|
||||||
language-images:
|
|
||||||
needs: safeboot-images
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'arendst/Tasmota'
|
|
||||||
continue-on-error: true
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
variant: [ tasmota, tasmota32 ]
|
|
||||||
language: [ AD, AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, LT, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: master
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@v6
|
|
||||||
with:
|
|
||||||
version: "latest"
|
|
||||||
enable-cache: false
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
uv pip install --system platformio
|
|
||||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
|
||||||
- name: Download safeboot firmwares
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
pattern: tasmota32*
|
|
||||||
path: ./temp
|
|
||||||
- name: Move safeboot files
|
|
||||||
run: |
|
|
||||||
mkdir -p ./firmware/firmware
|
|
||||||
find ./temp -type f -exec cp -t ./firmware/firmware {} +
|
|
||||||
- name: Add "release" to footer
|
|
||||||
run: |
|
|
||||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
|
|
||||||
- name: Run PlatformIO
|
|
||||||
env:
|
|
||||||
PYTHONIOENCODING: utf-8
|
|
||||||
PYTHONUTF8: '1'
|
|
||||||
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
|
|
||||||
- name: Upload language firmware artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.variant }}-${{ matrix.language }}
|
|
||||||
path: ./build_output
|
|
||||||
|
|
||||||
Release:
|
|
||||||
needs: [base-images, base32-images, language-images]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
continue-on-error: true
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Download all Tasmota artifacts
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
pattern: tasmota*
|
|
||||||
path: ./temp
|
|
||||||
- name: Move files
|
|
||||||
run: |
|
|
||||||
mkdir -p ./release
|
|
||||||
find ./temp -type f -exec cp -t ./release {} +
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -R ./release/
|
|
||||||
- name: Release
|
|
||||||
uses: jason2866/action-gh-release@v1.2
|
|
||||||
#if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
with:
|
|
||||||
tag_name: ${{ github.run_number }}
|
|
||||||
files: |
|
|
||||||
./release/tasmota*
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
Start_final_copy:
|
|
||||||
needs: Release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Dispatch workflow in arendst/Tasmota-firmware
|
|
||||||
run: |
|
|
||||||
curl -X POST https://api.github.com/repos/arendst/Tasmota-firmware/actions/workflows/fetch_deploy.yml/dispatches \
|
|
||||||
-H 'Accept: application/vnd.github.everest-preview+json' \
|
|
||||||
-u ${{ secrets.API_TOKEN_GITHUB }} \
|
|
||||||
--data '{"ref": "gh_actions"}'
|
|
||||||
182
.github/workflows/build_all_the_things.yml
vendored
182
.github/workflows/build_all_the_things.yml
vendored
@ -1,182 +0,0 @@
|
|||||||
name: Tasmota CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
pull_request:
|
|
||||||
branches: development
|
|
||||||
paths:
|
|
||||||
- '**.c'
|
|
||||||
- '**.cpp'
|
|
||||||
- '**.be'
|
|
||||||
- '**.h'
|
|
||||||
- '**.hpp'
|
|
||||||
- '**.ino'
|
|
||||||
- '**.json'
|
|
||||||
- '**.properties'
|
|
||||||
- 'pio-tools/*.py'
|
|
||||||
- '**.ini'
|
|
||||||
- '.github/workflows/build_all_the_things.yml'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
os-check-win:
|
|
||||||
runs-on: windows-latest
|
|
||||||
if: github.repository == 'arendst/Tasmota'
|
|
||||||
strategy:
|
|
||||||
fail-fast: true
|
|
||||||
matrix:
|
|
||||||
variant:
|
|
||||||
- tasmota32-webcam
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@v6
|
|
||||||
with:
|
|
||||||
version: "latest"
|
|
||||||
enable-cache: false
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
uv pip install --system platformio
|
|
||||||
- name: Run PlatformIO
|
|
||||||
env:
|
|
||||||
PYTHONIOENCODING: utf-8
|
|
||||||
PYTHONUTF8: '1'
|
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.variant }}
|
|
||||||
path: ./build_output
|
|
||||||
|
|
||||||
os-check-mac:
|
|
||||||
runs-on: macos-14
|
|
||||||
if: github.repository == 'arendst/Tasmota'
|
|
||||||
strategy:
|
|
||||||
fail-fast: true
|
|
||||||
matrix:
|
|
||||||
variant:
|
|
||||||
- tasmota32solo1-safeboot
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@v6
|
|
||||||
with:
|
|
||||||
version: "latest"
|
|
||||||
enable-cache: false
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
uv pip install --system platformio
|
|
||||||
- name: Run PlatformIO
|
|
||||||
env:
|
|
||||||
PYTHONIOENCODING: utf-8
|
|
||||||
PYTHONUTF8: '1'
|
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.variant }}
|
|
||||||
path: ./build_output
|
|
||||||
|
|
||||||
base-images:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'arendst/Tasmota'
|
|
||||||
strategy:
|
|
||||||
fail-fast: true
|
|
||||||
matrix:
|
|
||||||
variant:
|
|
||||||
- tasmota
|
|
||||||
- tasmota-4M
|
|
||||||
- tasmota-display
|
|
||||||
- tasmota-ir
|
|
||||||
- tasmota-knx
|
|
||||||
- tasmota-lite
|
|
||||||
- tasmota-minimal
|
|
||||||
- tasmota-sensors
|
|
||||||
- tasmota-zbbridge
|
|
||||||
- tasmota32
|
|
||||||
- tasmota32solo1
|
|
||||||
- tasmota32c2
|
|
||||||
- tasmota32c3
|
|
||||||
- tasmota32c5
|
|
||||||
- tasmota32c6
|
|
||||||
- tasmota32p4
|
|
||||||
- tasmota32s2
|
|
||||||
- tasmota32s2cdc
|
|
||||||
- tasmota32s3
|
|
||||||
- tasmota32-zbbrdgpro
|
|
||||||
- tasmota-zigbee
|
|
||||||
- tasmota32-bluetooth
|
|
||||||
- tasmota32-nspanel
|
|
||||||
- tasmota32-display
|
|
||||||
- tasmota32-ir
|
|
||||||
- tasmota32-lvgl
|
|
||||||
- tasmota32-safeboot
|
|
||||||
- tasmota32s2-safeboot
|
|
||||||
- tasmota32s2cdc-safeboot
|
|
||||||
- tasmota32s3-safeboot
|
|
||||||
- tasmota32c2-safeboot
|
|
||||||
- tasmota32c3-safeboot
|
|
||||||
- tasmota32c5-safeboot
|
|
||||||
- tasmota32c6-safeboot
|
|
||||||
- tasmota32p4-safeboot
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@v6
|
|
||||||
with:
|
|
||||||
version: "latest"
|
|
||||||
enable-cache: false
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
uv pip install --system platformio
|
|
||||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
|
||||||
- name: Run PlatformIO
|
|
||||||
env:
|
|
||||||
PYTHONIOENCODING: utf-8
|
|
||||||
PYTHONUTF8: '1'
|
|
||||||
run: platformio run -e ${{ matrix.variant }}
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.variant }}
|
|
||||||
path: ./build_output
|
|
||||||
|
|
||||||
language-images:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'arendst/Tasmota'
|
|
||||||
strategy:
|
|
||||||
fail-fast: true
|
|
||||||
matrix:
|
|
||||||
variant: [ tasmota ]
|
|
||||||
language: [ AD, AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, LT, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@v6
|
|
||||||
with:
|
|
||||||
version: "latest"
|
|
||||||
enable-cache: false
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
uv pip install --system platformio
|
|
||||||
- name: Run PlatformIO
|
|
||||||
env:
|
|
||||||
PYTHONIOENCODING: utf-8
|
|
||||||
PYTHONUTF8: '1'
|
|
||||||
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.variant }}-${{ matrix.language }}
|
|
||||||
path: ./build_output
|
|
||||||
41
.github/workflows/copy_change.yml
vendored
41
.github/workflows/copy_change.yml
vendored
@ -1,41 +0,0 @@
|
|||||||
name: Copy to docs repo
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch: # Manually start a workflow
|
|
||||||
push:
|
|
||||||
branches: development
|
|
||||||
paths:
|
|
||||||
- 'BUILDS.md'
|
|
||||||
- 'I2CDEVICES.md'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
copy_change:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'arendst/Tasmota'
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Push I2CDevices.md to https://github.com/Tasmota/docs
|
|
||||||
uses: Jason2866/copy_file_to_another_repo_action@main
|
|
||||||
env:
|
|
||||||
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
|
|
||||||
with:
|
|
||||||
source_file: 'I2CDEVICES.md'
|
|
||||||
destination_repo: 'Tasmota/docs'
|
|
||||||
destination_branch: 'development'
|
|
||||||
destination_folder: 'docs'
|
|
||||||
user_email: 'github-actions@github.com'
|
|
||||||
user_name: 'github-actions'
|
|
||||||
commit_message: 'I2CDevices.md changed'
|
|
||||||
- name: Push Builds.md to https://github.com/Tasmota/docs
|
|
||||||
uses: Jason2866/copy_file_to_another_repo_action@main
|
|
||||||
env:
|
|
||||||
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
|
|
||||||
with:
|
|
||||||
source_file: 'BUILDS.md'
|
|
||||||
destination_repo: 'Tasmota/docs'
|
|
||||||
destination_branch: 'development'
|
|
||||||
destination_folder: 'docs'
|
|
||||||
user_email: 'github-actions@github.com'
|
|
||||||
user_name: 'github-actions'
|
|
||||||
commit_message: 'Builds.md changed'
|
|
||||||
61
.github/workflows/pr_comment.yml.off
vendored
61
.github/workflows/pr_comment.yml.off
vendored
@ -1,61 +0,0 @@
|
|||||||
name: Comment on pull request
|
|
||||||
on:
|
|
||||||
workflow_run:
|
|
||||||
workflows: [Tasmota CI]
|
|
||||||
types: [completed]
|
|
||||||
jobs:
|
|
||||||
pr_comment:
|
|
||||||
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
# This snippet is public-domain, taken from
|
|
||||||
# https://github.com/oprypin/nightly.link/blob/master/.github/workflows/pr-comment.yml
|
|
||||||
script: |
|
|
||||||
async function upsertComment(owner, repo, issue_number, purpose, body) {
|
|
||||||
const {data: comments} = await github.rest.issues.listComments(
|
|
||||||
{owner, repo, issue_number});
|
|
||||||
|
|
||||||
const marker = `<!-- bot: ${purpose} -->`;
|
|
||||||
body = marker + "\n" + body;
|
|
||||||
|
|
||||||
const existing = comments.filter((c) => c.body.includes(marker));
|
|
||||||
if (existing.length > 0) {
|
|
||||||
const last = existing[existing.length - 1];
|
|
||||||
core.info(`Updating comment ${last.id}`);
|
|
||||||
await github.rest.issues.updateComment({
|
|
||||||
owner, repo,
|
|
||||||
body,
|
|
||||||
comment_id: last.id,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
core.info(`Creating a comment in issue / PR #${issue_number}`);
|
|
||||||
await github.rest.issues.createComment({issue_number, body, owner, repo});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const {owner, repo} = context.repo;
|
|
||||||
const run_id = ${{github.event.workflow_run.id}};
|
|
||||||
|
|
||||||
const pull_requests = ${{ toJSON(github.event.workflow_run.pull_requests) }};
|
|
||||||
if (!pull_requests.length) {
|
|
||||||
return core.error("This workflow doesn't match any pull requests!");
|
|
||||||
}
|
|
||||||
|
|
||||||
const artifacts = await github.paginate(
|
|
||||||
github.rest.actions.listWorkflowRunArtifacts, {owner, repo, run_id});
|
|
||||||
if (!artifacts.length) {
|
|
||||||
return core.error(`No artifacts found`);
|
|
||||||
}
|
|
||||||
let body = `Download the artifacts for this pull request:\n`;
|
|
||||||
for (const art of artifacts) {
|
|
||||||
body += `\n* [${art.name}.zip](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
|
|
||||||
}
|
|
||||||
|
|
||||||
core.info("Review thread message body:", body);
|
|
||||||
|
|
||||||
for (const pr of pull_requests) {
|
|
||||||
await upsertComment(owner, repo, pr.number,
|
|
||||||
"nightly-link", body);
|
|
||||||
}
|
|
||||||
23
.github/workflows/stale-actions.yml
vendored
23
.github/workflows/stale-actions.yml
vendored
@ -1,23 +0,0 @@
|
|||||||
name: "Mark or close stale issues and PRs"
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "30 * * * *"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
stale:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/stale@v9
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
days-before-stale: 25
|
|
||||||
days-before-close: 5
|
|
||||||
stale-issue-message: "This issue has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions."
|
|
||||||
stale-pr-message: "This PR has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions."
|
|
||||||
close-issue-message: "This issue was automatically closed because of being stale. Feel free to open a new one if you still experience this problem."
|
|
||||||
close-pr-message: "This PR was automatically closed because of being stale."
|
|
||||||
stale-pr-label: "stale"
|
|
||||||
stale-issue-label: "stale"
|
|
||||||
exempt-issue-labels: "bug,enhancement,pinned,security"
|
|
||||||
exempt-pr-labels: "bug,enhancement,pinned,security"
|
|
||||||
405
.gitignore
vendored
405
.gitignore
vendored
@ -1,60 +1,361 @@
|
|||||||
## OS specific ########
|
# ---> C++
|
||||||
.DS_Store
|
# Prerequisites
|
||||||
|
*.d
|
||||||
|
|
||||||
|
# Compiled Object files
|
||||||
|
*.slo
|
||||||
|
*.lo
|
||||||
|
*.o
|
||||||
|
*.obj
|
||||||
|
|
||||||
|
# Precompiled Headers
|
||||||
|
*.gch
|
||||||
|
*.pch
|
||||||
|
|
||||||
|
# Compiled Dynamic libraries
|
||||||
|
*.so
|
||||||
|
*.dylib
|
||||||
|
*.dll
|
||||||
|
|
||||||
|
# Fortran module files
|
||||||
|
*.mod
|
||||||
|
*.smod
|
||||||
|
|
||||||
|
# Compiled Static libraries
|
||||||
|
*.lai
|
||||||
|
*.la
|
||||||
|
*.a
|
||||||
|
*.lib
|
||||||
|
|
||||||
|
# Executables
|
||||||
|
*.exe
|
||||||
|
*.out
|
||||||
|
*.app
|
||||||
|
|
||||||
|
# ---> C
|
||||||
|
# Prerequisites
|
||||||
|
*.d
|
||||||
|
|
||||||
|
# Object files
|
||||||
|
*.o
|
||||||
|
*.ko
|
||||||
|
*.obj
|
||||||
|
*.elf
|
||||||
|
|
||||||
|
# Linker output
|
||||||
|
*.ilk
|
||||||
|
*.map
|
||||||
|
*.exp
|
||||||
|
|
||||||
|
# Precompiled Headers
|
||||||
|
*.gch
|
||||||
|
*.pch
|
||||||
|
|
||||||
|
# Libraries
|
||||||
|
*.lib
|
||||||
|
*.a
|
||||||
|
*.la
|
||||||
|
*.lo
|
||||||
|
|
||||||
|
# Shared objects (inc. Windows DLLs)
|
||||||
|
*.dll
|
||||||
|
*.so
|
||||||
|
*.so.*
|
||||||
|
*.dylib
|
||||||
|
|
||||||
|
# Executables
|
||||||
|
*.exe
|
||||||
|
*.out
|
||||||
|
*.app
|
||||||
|
*.i*86
|
||||||
|
*.x86_64
|
||||||
|
*.hex
|
||||||
|
|
||||||
|
# Debug files
|
||||||
|
*.dSYM/
|
||||||
|
*.su
|
||||||
|
*.idb
|
||||||
|
*.pdb
|
||||||
|
|
||||||
|
# Kernel Module Compile Results
|
||||||
|
*.mod*
|
||||||
|
*.cmd
|
||||||
|
.tmp_versions/
|
||||||
|
modules.order
|
||||||
|
Module.symvers
|
||||||
|
Mkfile.old
|
||||||
|
dkms.conf
|
||||||
|
|
||||||
|
# ---> CMake
|
||||||
|
CMakeLists.txt.user
|
||||||
|
CMakeCache.txt
|
||||||
|
CMakeFiles
|
||||||
|
CMakeScripts
|
||||||
|
Testing
|
||||||
|
Makefile
|
||||||
|
cmake_install.cmake
|
||||||
|
install_manifest.txt
|
||||||
|
compile_commands.json
|
||||||
|
CTestTestfile.cmake
|
||||||
|
_deps
|
||||||
|
|
||||||
|
# ---> JetBrains
|
||||||
|
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
||||||
|
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||||
|
|
||||||
|
# User-specific stuff
|
||||||
|
.idea/**/workspace.xml
|
||||||
|
.idea/**/tasks.xml
|
||||||
|
.idea/**/usage.statistics.xml
|
||||||
|
.idea/**/dictionaries
|
||||||
|
.idea/**/shelf
|
||||||
|
|
||||||
|
# AWS User-specific
|
||||||
|
.idea/**/aws.xml
|
||||||
|
|
||||||
|
# Generated files
|
||||||
|
.idea/**/contentModel.xml
|
||||||
|
|
||||||
|
# Sensitive or high-churn files
|
||||||
|
.idea/**/dataSources/
|
||||||
|
.idea/**/dataSources.ids
|
||||||
|
.idea/**/dataSources.local.xml
|
||||||
|
.idea/**/sqlDataSources.xml
|
||||||
|
.idea/**/dynamic.xml
|
||||||
|
.idea/**/uiDesigner.xml
|
||||||
|
.idea/**/dbnavigator.xml
|
||||||
|
|
||||||
|
# Gradle
|
||||||
|
.idea/**/gradle.xml
|
||||||
|
.idea/**/libraries
|
||||||
|
|
||||||
|
# Gradle and Maven with auto-import
|
||||||
|
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||||
|
# since they will be recreated, and may cause churn. Uncomment if using
|
||||||
|
# auto-import.
|
||||||
|
# .idea/artifacts
|
||||||
|
# .idea/compiler.xml
|
||||||
|
# .idea/jarRepositories.xml
|
||||||
|
# .idea/modules.xml
|
||||||
|
# .idea/*.iml
|
||||||
|
# .idea/modules
|
||||||
|
# *.iml
|
||||||
|
# *.ipr
|
||||||
|
|
||||||
|
# CMake
|
||||||
|
cmake-build-*/
|
||||||
|
|
||||||
|
# Mongo Explorer plugin
|
||||||
|
.idea/**/mongoSettings.xml
|
||||||
|
|
||||||
|
# File-based project format
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
out/
|
||||||
|
|
||||||
|
# mpeltonen/sbt-idea plugin
|
||||||
|
.idea_modules/
|
||||||
|
|
||||||
|
# JIRA plugin
|
||||||
|
atlassian-ide-plugin.xml
|
||||||
|
|
||||||
|
# Cursive Clojure plugin
|
||||||
|
.idea/replstate.xml
|
||||||
|
|
||||||
|
# SonarLint plugin
|
||||||
|
.idea/sonarlint/
|
||||||
|
|
||||||
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||||
|
com_crashlytics_export_strings.xml
|
||||||
|
crashlytics.properties
|
||||||
|
crashlytics-build.properties
|
||||||
|
fabric.properties
|
||||||
|
|
||||||
|
# Editor-based Rest Client
|
||||||
|
.idea/httpRequests
|
||||||
|
|
||||||
|
# Android studio 3.1+ serialized cache file
|
||||||
|
.idea/caches/build_file_checksums.ser
|
||||||
|
|
||||||
|
# ---> Linux
|
||||||
|
*~
|
||||||
|
|
||||||
|
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||||
.fuse_hidden*
|
.fuse_hidden*
|
||||||
|
|
||||||
## Compilation artefacts ########
|
# KDE directory preferences
|
||||||
*.pyc
|
.directory
|
||||||
*.d
|
|
||||||
*.o
|
|
||||||
*.gcno
|
|
||||||
*.gcda
|
|
||||||
dependencies.lock
|
|
||||||
|
|
||||||
## Project files ######
|
# Linux trash folder which might appear on any partition or disk
|
||||||
managed_components
|
.Trash-*
|
||||||
.platformio
|
|
||||||
.pio
|
# .nfs files are created when an open file is removed but is still being accessed
|
||||||
.clang_complete
|
.nfs*
|
||||||
.gcc-flags.json
|
|
||||||
|
# ---> Ninja
|
||||||
|
.ninja_deps
|
||||||
|
.ninja_log
|
||||||
|
|
||||||
|
# ---> Python
|
||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
|
||||||
|
# C extensions
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Distribution / packaging
|
||||||
|
.Python
|
||||||
|
build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
wheels/
|
||||||
|
share/python-wheels/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
MANIFEST
|
||||||
|
|
||||||
|
# PyInstaller
|
||||||
|
# Usually these files are written by a python script from a template
|
||||||
|
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||||
|
*.manifest
|
||||||
|
*.spec
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
pip-delete-this-directory.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
htmlcov/
|
||||||
|
.tox/
|
||||||
|
.nox/
|
||||||
|
.coverage
|
||||||
|
.coverage.*
|
||||||
.cache
|
.cache
|
||||||
.dummy
|
nosetests.xml
|
||||||
sdkconfig.*
|
coverage.xml
|
||||||
sdkconfig.defaults
|
*.cover
|
||||||
CMakeLists.txt
|
*.py,cover
|
||||||
data
|
.hypothesis/
|
||||||
unpacked_fs
|
.pytest_cache/
|
||||||
unpacked_boards
|
cover/
|
||||||
tasmota/user/*
|
|
||||||
tasmota/user_config_override.h
|
|
||||||
tasmota/include/local_ca_data.h
|
|
||||||
tasmota/include/local_ca_descriptor.h
|
|
||||||
variants
|
|
||||||
variants3
|
|
||||||
build
|
|
||||||
build_output/*
|
|
||||||
firmware.map
|
|
||||||
firmware.asm
|
|
||||||
tasmota/tasmota.ino.cpp
|
|
||||||
platformio_override.ini
|
|
||||||
platformio_tasmota_cenv.ini
|
|
||||||
platformio_tasmota_user_env.ini
|
|
||||||
platformio_tasmota_core3_env.ini
|
|
||||||
lib/libesp32/berry/generate/*
|
|
||||||
lib/libesp32/berry/berry
|
|
||||||
|
|
||||||
## Visual Studio Code specific ######
|
# Translations
|
||||||
.vscode
|
*.mo
|
||||||
.vscode/.browse.c_cpp.db*
|
*.pot
|
||||||
.vscode/c_cpp_properties.json
|
|
||||||
.vscode/launch.json
|
|
||||||
.vscode/settings.json
|
|
||||||
.vscode/extensions.json
|
|
||||||
*.bak
|
|
||||||
*.code-workspace
|
|
||||||
|
|
||||||
## IntelliJ ######
|
# Django stuff:
|
||||||
.idea
|
*.log
|
||||||
|
local_settings.py
|
||||||
|
db.sqlite3
|
||||||
|
db.sqlite3-journal
|
||||||
|
|
||||||
## Python virtual environments for Platformio ##
|
# Flask stuff:
|
||||||
venv
|
instance/
|
||||||
|
.webassets-cache
|
||||||
|
|
||||||
|
# Scrapy stuff:
|
||||||
|
.scrapy
|
||||||
|
|
||||||
|
# Sphinx documentation
|
||||||
|
docs/_build/
|
||||||
|
|
||||||
|
# PyBuilder
|
||||||
|
.pybuilder/
|
||||||
|
target/
|
||||||
|
|
||||||
|
# Jupyter Notebook
|
||||||
|
.ipynb_checkpoints
|
||||||
|
|
||||||
|
# IPython
|
||||||
|
profile_default/
|
||||||
|
ipython_config.py
|
||||||
|
|
||||||
|
# pyenv
|
||||||
|
# For a library or package, you might want to ignore these files since the code is
|
||||||
|
# intended to run in multiple environments; otherwise, check them in:
|
||||||
|
# .python-version
|
||||||
|
|
||||||
|
# pipenv
|
||||||
|
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||||
|
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||||
|
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||||
|
# install all needed dependencies.
|
||||||
|
#Pipfile.lock
|
||||||
|
|
||||||
|
# poetry
|
||||||
|
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
||||||
|
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
||||||
|
# commonly ignored for libraries.
|
||||||
|
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
||||||
|
#poetry.lock
|
||||||
|
|
||||||
|
# pdm
|
||||||
|
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
||||||
|
#pdm.lock
|
||||||
|
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
||||||
|
# in version control.
|
||||||
|
# https://pdm.fming.dev/#use-with-ide
|
||||||
|
.pdm.toml
|
||||||
|
|
||||||
|
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
||||||
|
__pypackages__/
|
||||||
|
|
||||||
|
# Celery stuff
|
||||||
|
celerybeat-schedule
|
||||||
|
celerybeat.pid
|
||||||
|
|
||||||
|
# SageMath parsed files
|
||||||
|
*.sage.py
|
||||||
|
|
||||||
|
# Environments
|
||||||
|
.env
|
||||||
.venv
|
.venv
|
||||||
|
env/
|
||||||
|
venv/
|
||||||
|
ENV/
|
||||||
|
env.bak/
|
||||||
|
venv.bak/
|
||||||
|
|
||||||
|
# Spyder project settings
|
||||||
|
.spyderproject
|
||||||
|
.spyproject
|
||||||
|
|
||||||
|
# Rope project settings
|
||||||
|
.ropeproject
|
||||||
|
|
||||||
|
# mkdocs documentation
|
||||||
|
/site
|
||||||
|
|
||||||
|
# mypy
|
||||||
|
.mypy_cache/
|
||||||
|
.dmypy.json
|
||||||
|
dmypy.json
|
||||||
|
|
||||||
|
# Pyre type checker
|
||||||
|
.pyre/
|
||||||
|
|
||||||
|
# pytype static type analyzer
|
||||||
|
.pytype/
|
||||||
|
|
||||||
|
# Cython debug symbols
|
||||||
|
cython_debug/
|
||||||
|
|
||||||
|
# PyCharm
|
||||||
|
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
||||||
|
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
||||||
|
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||||
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
|
#.idea/
|
||||||
|
|
||||||
|
|||||||
10
.vscode/extensions.json
vendored
10
.vscode/extensions.json
vendored
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
|
||||||
// for the documentation about the extensions.json format
|
|
||||||
"recommendations": [
|
|
||||||
"platformio.platformio-ide"
|
|
||||||
],
|
|
||||||
"unwantedRecommendations": [
|
|
||||||
"ms-vscode.cpptools-extension-pack"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
75
.vscode/settings.json
vendored
75
.vscode/settings.json
vendored
@ -1,75 +0,0 @@
|
|||||||
{
|
|
||||||
"platformio-ide.toolbar": [
|
|
||||||
{
|
|
||||||
"text": "$(home)",
|
|
||||||
"tooltip": "PlatformIO: Home",
|
|
||||||
"commands": "platformio-ide.showHome"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"text": "$(trash)",
|
|
||||||
"tooltip": "PlatformIO: Clean",
|
|
||||||
"commands": "platformio-ide.clean"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"text": "$(check)",
|
|
||||||
"tooltip": "PlatformIO: Build",
|
|
||||||
"commands": "platformio-ide.build"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"text": "Upload",
|
|
||||||
"tooltip": "PlatformIO: Flash firmware (NO build run)",
|
|
||||||
"commands": [
|
|
||||||
{
|
|
||||||
"id": "platformio-ide.runPIOCoreCommand",
|
|
||||||
"args": "pio run -t nobuild -t factory_flash -e ${command:platformio-ide.activeEnvironment}"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"text": "$(zap)",
|
|
||||||
"tooltip": "PlatformIO: Build and Upload",
|
|
||||||
"commands": "platformio-ide.upload"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"text": "$(flame)",
|
|
||||||
"tooltip": "PlatformIO: Build, Erase and Upload",
|
|
||||||
"commands": [
|
|
||||||
{
|
|
||||||
"id": "platformio-ide.runPIOCoreCommand",
|
|
||||||
"args": "pio run -t erase_upload -e ${command:platformio-ide.activeEnvironment}"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"text": "$(error)",
|
|
||||||
"tooltip": "PlatformIO: Erase Flash",
|
|
||||||
"commands": [
|
|
||||||
{
|
|
||||||
"id": "platformio-ide.runPIOCoreCommand",
|
|
||||||
"args": "pio run -t nobuild -t erase -e ${command:platformio-ide.activeEnvironment}"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"text": "$(arrow-right)",
|
|
||||||
"tooltip": "PlatformIO: Build, Upload and Monitor",
|
|
||||||
"commands": "platformio-ide.uploadAndMonitor"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"text": "$(device-desktop)",
|
|
||||||
"tooltip": "PlatformIO: Serial Monitor",
|
|
||||||
"commands": "platformio-ide.serialMonitor"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"text": "$(terminal)",
|
|
||||||
"tooltip": "PlatformIO: New Terminal",
|
|
||||||
"commands": "platformio-ide.newTerminal"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"text": "$(refresh)",
|
|
||||||
"tooltip": "PlatformIO: Rebuild IntelliSense Index",
|
|
||||||
"commands": "platformio-ide.rebuildProjectIndex"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"C_Cpp.dimInactiveRegions": false
|
|
||||||
}
|
|
||||||
171
API.md
171
API.md
@ -1,171 +0,0 @@
|
|||||||
<picture>
|
|
||||||
<source media="(prefers-color-scheme: dark)" srcset="./tools/logo/TASMOTA_FullLogo_Vector_White.svg">
|
|
||||||
<img alt="Logo" src="./tools/logo/TASMOTA_FullLogo_Vector.svg" align="right" height="76">
|
|
||||||
</picture>
|
|
||||||
|
|
||||||
# Basic API information
|
|
||||||
|
|
||||||
Tasmota can easily be extended by developers using provided function pointers as callback Ids. This document lists the available callback function Ids. Read [Sensor API](https://tasmota.github.io/docs/Sensor-API) for more information.
|
|
||||||
|
|
||||||
Callback availability can be checked by searching for either XdrvCall, XsnsCall, XdspCall, XnrgCall and XlgtCall.
|
|
||||||
|
|
||||||
## Driver, Sensor, Energy and Light Callback Ids
|
|
||||||
|
|
||||||
The following table lists Callback Ids and their availability for a Driver, Sensor or Energy service.
|
|
||||||
|
|
||||||
Callback Id | Bool | xdrv | xsns | xnrg | xlgt | Description
|
|
||||||
----------------------------|------|------|------|------|------|----------------------------------
|
|
||||||
FUNC_SETTINGS_OVERRIDE | | x | | | | Override start-up settings
|
|
||||||
FUNC_PIN_STATE | x | 1 | 2 | | | At GPIO configuration
|
|
||||||
FUNC_I2C_INIT | | x | | | | Immediately after I2C init
|
|
||||||
FUNC_MODULE_INIT | x | 3 | 1 | | 2 | Init module specific parameters
|
|
||||||
FUNC_PRE_INIT | | 1 | 3 | 2 | | Once GPIO have been established
|
|
||||||
FUNC_INIT | | 1 | 3 | 2 | | At end of initialisation
|
|
||||||
FUNC_LOOP | | 1 | 2 | | | In main loop
|
|
||||||
FUNC_SLEEP_LOOP | | 1 | 2 | | | In main loop during sleep
|
|
||||||
FUNC_EVERY_50_MSECOND | | 1 | 2 | | | In main loop
|
|
||||||
FUNC_EVERY_100_MSECOND | | 1 | 2 | | | In main loop
|
|
||||||
FUNC_EVERY_200_MSECOND | | | | x | | In main loop
|
|
||||||
FUNC_EVERY_250_MSECOND | | 1 | 3 | 2 | | In main loop
|
|
||||||
FUNC_EVERY_SECOND | | 1 | 2 | | | In main loop
|
|
||||||
FUNC_SAVE_SETTINGS | | 2 | 1 | | | Just before saving settings
|
|
||||||
FUNC_SAVE_AT_MIDNIGHT | | | x | | | At midnight
|
|
||||||
FUNC_SAVE_BEFORE_RESTART | | 2 | 1 | | | Just before a planned restart
|
|
||||||
FUNC_AFTER_TELEPERIOD | | 2 | 1 | | | At end of teleperiod
|
|
||||||
FUNC_JSON_APPEND | | 2 | 1 | 3 | | Extend teleperiod JSON text
|
|
||||||
FUNC_WEB_SENSOR | | 2 | 1 | 3 | | Add sensor data to web GUI
|
|
||||||
FUNC_WEB_COL_SENSOR | | 2 | 1 | 3 | | Add sensor data to web GUI using columns
|
|
||||||
FUNC_COMMAND | x | 1 | 2 | 3 | 4 | When a command is not recognized
|
|
||||||
FUNC_COMMAND_DRIVER | x | x | | | | When command Driver\<id\> is executed
|
|
||||||
FUNC_COMMAND_SENSOR | x | | x | | | When command Sensor\<id\> is executed
|
|
||||||
FUNC_MQTT_SUBSCRIBE | | x | | | | At end of MQTT subscriptions
|
|
||||||
FUNC_MQTT_INIT | | x | | | | Once at end of MQTT connection
|
|
||||||
FUNC_MQTT_DATA | x | x | | | | Before decoding command
|
|
||||||
FUNC_SET_POWER | | 1 | 2 | | | Before setting relays
|
|
||||||
FUNC_SET_DEVICE_POWER | x | x | | | | Set relay
|
|
||||||
FUNC_SHOW_SENSOR | | x | | | | When FUNC_JSON_APPEND completes
|
|
||||||
FUNC_ANY_KEY | | x | | | |
|
|
||||||
FUNC_LED_LINK | | x | | | | SetLedLink (On ESP32 only). XdrvMailbox.index holds state
|
|
||||||
FUNC_ENERGY_EVERY_SECOND | | | | x | |
|
|
||||||
FUNC_ENERGY_RESET | | | | x | |
|
|
||||||
FUNC_RULES_PROCESS | x | x | | | | Process specific rule
|
|
||||||
FUNC_TELEPERIOD_RULES_PROCESS | x | x | | | | Process specific rule as teleperiod
|
|
||||||
FUNC_SERIAL | x | 1 | | 2 | 3 | Process serial data
|
|
||||||
FUNC_FREE_MEM | | x | | | | Show free memory for debugging
|
|
||||||
FUNC_BUTTON_PRESSED | x | x | | | | When a button is pressed
|
|
||||||
FUNC_BUTTON_MULTI_PRESSED | x | x | | | | When a button is pressed multiple times
|
|
||||||
FUNC_WEB_ADD_BUTTON | | 1 | 2 | | | Add a Configuration Button to GUI
|
|
||||||
FUNC_WEB_ADD_MAIN_BUTTON | | 1 | 2 | | | Add a main button to GUI
|
|
||||||
FUNC_WEB_ADD_CONSOLE_BUTTON | | 1 | 2 | | | Add a Consoles Button to GUI
|
|
||||||
FUNC_WEB_ADD_MANAGEMENT_BUTTON | | x | | | | Add a Management Button to GUI
|
|
||||||
FUNC_WEB_ADD_HANDLER | | 1 | 2 | | | Add a webserver handler
|
|
||||||
FUNC_WEB_GET_ARG | | 2 | 1 | | 3 | Get webserver setting arguments
|
|
||||||
FUNC_SET_CHANNELS | | 2 | | | 1 |
|
|
||||||
FUNC_SET_SCHEME | | | | | x |
|
|
||||||
FUNC_HOTPLUG_SCAN | | | x | | |
|
|
||||||
FUNC_TIME_SYNCED | | x | | | | Report time is synced
|
|
||||||
FUNC_DEVICE_GROUP_ITEM | | x | | | |
|
|
||||||
FUNC_NETWORK_UP | | 1 | 2 | 3 | 4 | Wifi or ETH network just went up (received even if webserver is not enabled)
|
|
||||||
FUNC_NETWORK_DOWN | | 1 | 2 | 3 | 4 | Wifi or ETH network just went down (received even if webserver is not enabled)
|
|
||||||
|
|
||||||
The numbers represent the sequence of execution
|
|
||||||
|
|
||||||
## Display Call back Ids
|
|
||||||
|
|
||||||
The following table lists all Callback Ids for a Display service.
|
|
||||||
|
|
||||||
Callback Id | Bool | Description
|
|
||||||
------------------------------|------|---------------------
|
|
||||||
FUNC_DISPLAY_INIT_DRIVER | |
|
|
||||||
FUNC_DISPLAY_INIT | |
|
|
||||||
FUNC_DISPLAY_EVERY_50_MSECOND | |
|
|
||||||
FUNC_DISPLAY_EVERY_SECOND | |
|
|
||||||
FUNC_DISPLAY_MODEL | x |
|
|
||||||
FUNC_DISPLAY_MODE | |
|
|
||||||
FUNC_DISPLAY_POWER | |
|
|
||||||
FUNC_DISPLAY_CLEAR | |
|
|
||||||
FUNC_DISPLAY_DRAW_FRAME | |
|
|
||||||
FUNC_DISPLAY_DRAW_HLINE | |
|
|
||||||
FUNC_DISPLAY_DRAW_VLINE | |
|
|
||||||
FUNC_DISPLAY_DRAW_LINE | |
|
|
||||||
FUNC_DISPLAY_DRAW_CIRCLE | |
|
|
||||||
FUNC_DISPLAY_FILL_CIRCLE | |
|
|
||||||
FUNC_DISPLAY_DRAW_RECTANGLE | |
|
|
||||||
FUNC_DISPLAY_FILL_RECTANGLE | |
|
|
||||||
FUNC_DISPLAY_TEXT_SIZE | |
|
|
||||||
FUNC_DISPLAY_FONT_SIZE | |
|
|
||||||
FUNC_DISPLAY_ROTATION | |
|
|
||||||
FUNC_DISPLAY_DRAW_STRING | |
|
|
||||||
FUNC_DISPLAY_ONOFF | |
|
|
||||||
|
|
||||||
## Init sequence
|
|
||||||
|
|
||||||
The following list shows a typical callback init sequence
|
|
||||||
|
|
||||||
```
|
|
||||||
CFG: Loaded from flash at FB, Count 1581
|
|
||||||
xdrv - FUNC_SETTINGS_OVERRIDE
|
|
||||||
xdrv - FUNC_PIN_STATE
|
|
||||||
xsns - FUNC_PIN_STATE
|
|
||||||
xsns - FUNC_MODULE_INIT
|
|
||||||
xdrv - FUNC_MODULE_INIT
|
|
||||||
xlgt - FUNC_MODULE_INIT
|
|
||||||
xdrv - FUNC_PRE_INIT
|
|
||||||
xnrg - FUNC_PRE_INIT
|
|
||||||
xsns - FUNC_PRE_INIT
|
|
||||||
SRC: Restart
|
|
||||||
xdrv - FUNC_SET_POWER
|
|
||||||
xsns - FUNC_SET_POWER
|
|
||||||
xlgt - FUNC_SET_CHANNELS
|
|
||||||
xdrv - FUNC_SET_DEVICE_POWER
|
|
||||||
Project tasmota Wemos 2 Version 7.0.0.3(tasmota)-STAGE
|
|
||||||
xdrv - FUNC_INIT
|
|
||||||
xsns - FUNC_INIT
|
|
||||||
I2C: ADS1115 found at 0x48
|
|
||||||
xdrv - FUNC_LOOP
|
|
||||||
xsns - FUNC_LOOP
|
|
||||||
xdrv - FUNC_EVERY_50_MSECOND
|
|
||||||
xlgt - FUNC_SET_CHANNELS
|
|
||||||
xsns - FUNC_EVERY_50_MSECOND
|
|
||||||
xdrv - FUNC_EVERY_100_MSECOND
|
|
||||||
xsns - FUNC_EVERY_100_MSECOND
|
|
||||||
xdrv - FUNC_EVERY_250_MSECOND
|
|
||||||
xsns - FUNC_EVERY_250_MSECOND
|
|
||||||
xdrv - FUNC_EVERY_SECOND
|
|
||||||
xsns - FUNC_EVERY_SECOND
|
|
||||||
WIF: Attempting connection...
|
|
||||||
WIF: Network (re)scan started...
|
|
||||||
WIF: Attempting connection...
|
|
||||||
WIF: Attempting connection...
|
|
||||||
WIF: Attempting connection...
|
|
||||||
WIF: Network 0, AP1, SSId indebuurt1, Channel 1, BSSId 24:D3:F2:97:C0:A1, RSSI -86, Encryption 1
|
|
||||||
WIF: Network 1, AP2, SSId indebuurt2, Channel 5, BSSId A0:AB:1B:7D:42:AC, RSSI -42, Encryption 1
|
|
||||||
WIF: Network 2, AP-, SSId indebuurt3, Channel 12, BSSId 60:E3:27:58:77:E6, RSSI -84, Encryption 1
|
|
||||||
WIF: Connecting to AP2 indebuurt2 in mode 11N as wemos2...
|
|
||||||
WIF: Attempting connection...
|
|
||||||
WIF: Attempting connection...
|
|
||||||
WIF: Attempting connection...
|
|
||||||
WIF: Connected
|
|
||||||
xdrv - FUNC_WEB_ADD_HANDLER
|
|
||||||
xsns - FUNC_WEB_ADD_HANDLER
|
|
||||||
HTP: Web server active on wemos2 with IP address 192.168.2.191
|
|
||||||
NTP: Drift 0, (UTC) Wed Nov 06 13:57:08 2019, (DST) Sun Mar 31 02:00:00 2019, (STD) Sun Oct 27 03:00:00 2019
|
|
||||||
APP: Boot Count 500
|
|
||||||
MQT: Attempting connection...
|
|
||||||
MQT: Connected
|
|
||||||
MQT: tele/wemos2/LWT = Online (retained)
|
|
||||||
MQT: cmnd/wemos2/POWER =
|
|
||||||
MQT: Subscribe to cmnd/wemos2/#
|
|
||||||
MQT: Subscribe to cmnd/sonoffs/#
|
|
||||||
MQT: Subscribe to cmnd/DVES_15568C_fb/#
|
|
||||||
xdrv - FUNC_MQTT_SUBSCRIBE
|
|
||||||
MQT: tele/wemos2/INFO1 = {"Module":"Generic","Version":"7.0.0.3(tasmota)","FallbackTopic":"cmnd/DVES_15568C_fb/","GroupTopic":"cmnd/sonoffs/"}
|
|
||||||
MQT: tele/wemos2/INFO2 = {"WebServerMode":"Admin","Hostname":"wemos2","IPAddress":"192.168.2.191"}
|
|
||||||
MQT: tele/wemos2/INFO3 = {"RestartReason":"Software/System restart"}
|
|
||||||
MQT: stat/wemos2/RESULT = {"POWER1":"OFF"}
|
|
||||||
MQT: stat/wemos2/POWER1 = OFF
|
|
||||||
MQT: stat/wemos2/RESULT = {"POWER2":"ON"}
|
|
||||||
MQT: stat/wemos2/POWER2 = ON
|
|
||||||
xdrv - FUNC_MQTT_INIT
|
|
||||||
CFG: Saved to flash at FA, Count 1582, Bytes 4096
|
|
||||||
```
|
|
||||||
306
BUILDS.md
306
BUILDS.md
@ -1,306 +0,0 @@
|
|||||||
## Available Features and Sensors
|
|
||||||
|
|
||||||
l = lite, t = tasmota (ESP8266 / ESP32), k = knx, s = sensors, i = ir, d = display
|
|
||||||
|
|
||||||
Note: the `minimal` variant is not listed as it shouldn't be used outside of the [upgrading](https://tasmota.github.io/docs/Upgrading/) process.
|
|
||||||
|
|
||||||
| **Feature or Sensor** | **l** | **t** | **k** | **s** | **i** | **d** | **Remarks** |
|
|
||||||
| ------------------------- | ----- | ----- | ----- | ----- | ----- | ----- | --------------------------- |
|
|
||||||
| MY_LANGUAGE en_GB | x | x / x | x | x | x | x |
|
|
||||||
| USE_IMPROV | x | x / x | x | x | x | x |
|
|
||||||
| USE_UFILESYS | - | - / x | - | - | - | - | Every ESP8266 > 1MB |
|
|
||||||
| USE_ARDUINO_OTA | - | - / - | - | - | - | - |
|
|
||||||
| USE_DOMOTICZ | - | x / x | x | x | x | - |
|
|
||||||
| USE_HOME_ASSISTANT | - | - / - | - | - | - | - |
|
|
||||||
| USE_TASMOTA_DISCOVERY | x | x / x | x | x | x | x |
|
|
||||||
| USE_MQTT_TLS\* | - | - / x | - | - | - | - |
|
|
||||||
| USE_MQTT_CLIENT_CERT | - | - / - | - | - | - | - |
|
|
||||||
| USE_MQTT_AWS_IOT | - | - / - | - | - | - | - |
|
|
||||||
| USE_4K_RSA | - | - / - | - | - | - | - |
|
|
||||||
| USE_TELEGRAM | - | - / - | - | - | - | - |
|
|
||||||
| USE_KNX | - | - / x | x | - | - | - |
|
|
||||||
| USE_TELNET | - | - / - | - | - | - | - |
|
|
||||||
| USE_XYZMODEM | - | - / - | - | - | - | - |
|
|
||||||
| USE_WEBSERVER | x | x / x | x | x | x | x |
|
|
||||||
| USE_WEBSEND_RESPONSE | - | - / - | - | - | - | - |
|
|
||||||
| USE_EMULATION_HUE | x | x / x | - | x | - | - |
|
|
||||||
| USE_EMULATION_WEMO | x | x / x | - | x | - | - |
|
|
||||||
| USE_DISCOVERY | - | - / - | - | - | - | - |
|
|
||||||
| WEBSERVER_ADVERTISE | - | x / - | x | - | - | x |
|
|
||||||
| MQTT_HOST_DISCOVERY | - | - / - | - | - | - | - |
|
|
||||||
| USE_TIMERS | x | x / x | x | x | x | x |
|
|
||||||
| USE_TIMERS_WEB | x | x / x | x | x | x | x |
|
|
||||||
| USE_SUNRISE | x | x / x | x | x | x | x |
|
|
||||||
| USE_RULES | x | x / x | x | x | x | x |
|
|
||||||
| USE_SCRIPT | - | - / - | - | - | - | - |
|
|
||||||
| USE_EXPRESSION | - | x / x | - | - | - | - |
|
|
||||||
| SUPPORT_IF_STATEMENT | - | x / x | - | - | - | - |
|
|
||||||
| USE_HOTPLUG | - | - / - | - | - | - | - |
|
|
||||||
| USE_INFLUXDB | - | - / x | - | - | - | - |
|
|
||||||
| USE_PROMETHEUS | - | - / - | - | - | - | - |
|
|
||||||
| USE_PING | - | - / - | - | - | - | - |
|
|
||||||
| USE_HDMI_CEC | - | - / - | - | - | - | - |
|
|
||||||
| USE_MAGIC_SWITCH | - | - / x | - | - | - | - |
|
|
||||||
| USE_GPIO_VIEWER | - | - / x | - | - | - | - |
|
|
||||||
| | | | | | | |
|
|
||||||
| **Feature or Sensor** | **l** | **t** | **k** | **s** | **i** | **d** | **Remarks** |
|
|
||||||
| ROTARY_V1 | - | x / x | - | x | - | - |
|
|
||||||
| USE_SONOFF_RF | - | x / - | x | x | - | - |
|
|
||||||
| USE_RF_FLASH | - | x / - | x | x | - | - |
|
|
||||||
| USE_SONOFF_SC | - | x / - | x | x | - | - |
|
|
||||||
| USE_TUYA_MCU | x | x / - | x | x | - | x |
|
|
||||||
| USE_ARMTRONIX_DIMMERS | - | x / - | x | - | - | - |
|
|
||||||
| USE_PS_16_DZ | - | x / - | x | - | - | - |
|
|
||||||
| USE_SONOFF_IFAN | - | x / - | x | - | - | - |
|
|
||||||
| USE_BUZZER | - | x / x | x | x | - | - |
|
|
||||||
| USE_ARILUX_RF | - | x / - | x | - | - | - |
|
|
||||||
| USE_SHUTTER | - | x / x | x | - | - | - |
|
|
||||||
| USE_DEEPSLEEP | - | x / x | - | x | - | - |
|
|
||||||
| USE_EXS_DIMMER | - | x / - | x | - | - | - |
|
|
||||||
| USE_DEVICE_GROUPS | - | x / x | - | - | - | - |
|
|
||||||
| USE_PWM_DIMMER | - | x / - | x | - | - | - |
|
|
||||||
| USE_KEELOQ | - | - / - | - | - | - | - |
|
|
||||||
| USE_SONOFF_D1 | - | x / - | x | - | - | - |
|
|
||||||
| USE_SHELLY_DIMMER | - | x / - | - | - | - | - |
|
|
||||||
| USE_AC_ZERO_CROSS_DIMMER | - | x / x | x | x | x | x |
|
|
||||||
| | | | | | | |
|
|
||||||
| **Feature or Sensor** | **l** | **t** | **k** | **s** | **i** | **d** | **Remarks** |
|
|
||||||
| USE_LIGHT | x | x / x | x | x | x | x |
|
|
||||||
| USE_WS2812 | - | x / x | x | x | - | x |
|
|
||||||
| USE_WS2812_DMA | - | - / - | - | - | - | - |
|
|
||||||
| USE_MY92X1 | - | x / - | x | x | - | x |
|
|
||||||
| USE_SM16716 | - | x / - | x | x | - | x |
|
|
||||||
| USE_SM2135 | - | x / - | x | x | - | x |
|
|
||||||
| USE_SM2335 | - | x / - | x | x | - | x |
|
|
||||||
| USE_BP5758D | - | x / - | x | x | - | x |
|
|
||||||
| USE_BP1658CJ | - | x / - | x | x | - | x |
|
|
||||||
| USE_SONOFF_L1 | - | x / - | x | x | - | x |
|
|
||||||
| USE_ELECTRIQ_MOODL | - | x / - | x | x | - | x |
|
|
||||||
| | | | | | | |
|
|
||||||
| USE_ENERGY_SENSOR | - | x / x | x | x | - | - |
|
|
||||||
| USE_ENERGY_DUMMY | - | x / x | x | x | - | - |
|
|
||||||
| USE_PZEM004T | - | x / x | x | x | - | - |
|
|
||||||
| USE_PZEM_AC | - | x / x | x | x | - | - |
|
|
||||||
| USE_PZEM_DC | - | x / x | x | x | - | - |
|
|
||||||
| USE_MCP39F501 | - | x / - | x | x | - | - |
|
|
||||||
| USE_SDM72 | - | - / x | - | x | - | - |
|
|
||||||
| USE_SDM120 | - | - / x | - | x | - | - |
|
|
||||||
| USE_SDM230 | - | - / x | - | - | - | - |
|
|
||||||
| USE_SDM630 | - | - / x | - | x | - | - |
|
|
||||||
| USE_DDS2382 | - | - / x | - | x | - | - |
|
|
||||||
| USE_DDSU666 | - | - / x | - | x | - | - |
|
|
||||||
| USE_SOLAX_X1 | - | - / - | - | - | - | - |
|
|
||||||
| USE_LE01MR | - | - / - | - | - | - | - |
|
|
||||||
| USE_BL09XX | - | x / x | x | x | - | - |
|
|
||||||
| USE_TELEINFO | - | - / - | - | - | - | - |
|
|
||||||
| USE_IEM3000 | - | - / - | - | - | - | - |
|
|
||||||
| USE_WE517 | - | - / x | - | - | - | - |
|
|
||||||
| USE_MODBUS_ENERGY | - | - / x | - | - | - | - |
|
|
||||||
| | | | | | | |
|
|
||||||
| USE_ADC_VCC | x | - / - | - | - | x | - |
|
|
||||||
| USE_COUNTER | - | x / x | x | x | - | x |
|
|
||||||
| USE_DS18x20 | - | x / x | x | x | - | x |
|
|
||||||
| USE_DHT | - | x / x | x | x | - | x |
|
|
||||||
| USE_MAX31855 | - | - / x | - | x | - | - |
|
|
||||||
| USE_MAX31865 | - | - / - | - | - | - | - |
|
|
||||||
| USE_THERMOSTAT | - | - / - | - | - | - | - |
|
|
||||||
| USE_LMT01 | - | - / x | - | x | - | - |
|
|
||||||
| | | | | | | |
|
|
||||||
| **Feature or Sensor** | **l** | **t** | **k** | **s** | **i** | **d** | **Remarks** |
|
|
||||||
| USE_I2C | - | x / x | x | x | - | x |
|
|
||||||
| USE_RTC_CHIPS | - | - / x | - | - | - | - |
|
|
||||||
| -USE_BM8563 | - | - / x | - | - | - | - |
|
|
||||||
| -USE_DS3231 | - | - / - | - | - | - | - |
|
|
||||||
| -USE_PCF85063 | - | - / - | - | - | - | - |
|
|
||||||
| -USE_PCF85363 | - | - / - | - | - | - | - |
|
|
||||||
| -USE_RX8010 | - | - / - | - | - | - | - |
|
|
||||||
| -USE_RX8030 | - | - / - | - | - | - | - |
|
|
||||||
| USE_SHT | - | - / x | - | x | - | - |
|
|
||||||
| USE_HTU | - | - / x | - | x | - | - |
|
|
||||||
| USE_BMP | - | - / x | - | x | - | - |
|
|
||||||
| -USE_BME68X | - | - / x | - | x | - | - |
|
|
||||||
| USE_AMSX915 | - | - / - | - | - | - | - |
|
|
||||||
| USE_SPL06_007 | - | - / - | - | - | - | - |
|
|
||||||
| USE_QMP6988 | - | - / - | - | - | - | - |
|
|
||||||
| USE_BH1750 | - | - / x | - | x | - | - |
|
|
||||||
| USE_VEML6070 | - | - / x | - | x | - | - |
|
|
||||||
| USE_ADS1115 | - | - / x | - | x | - | - |
|
|
||||||
| USE_INA219 | - | - / x | - | x | - | - |
|
|
||||||
| USE_INA226 | - | - / - | - | - | - | - |
|
|
||||||
| USE_INA3221 | - | - / - | - | - | - | - |
|
|
||||||
| USE_SHT3X | - | - / x | - | x | - | - |
|
|
||||||
| USE_TSL2561 | - | - / - | - | - | - | - |
|
|
||||||
| USE_TSL2591 | - | - / - | - | - | - | - |
|
|
||||||
| USE_MGS | - | - / x | - | x | - | - |
|
|
||||||
| USE_SGP30 | - | - / x | - | x | - | - |
|
|
||||||
| USE_SGP40 | - | - / x | - | x | - | - |
|
|
||||||
| USE_SGP4X | - | - / x | - | - | - | - |
|
|
||||||
| USE_SEN5X | - | - / x | - | x | - | - |
|
|
||||||
| USE_SI1145 | - | - / - | - | - | - | - |
|
|
||||||
| USE_LM75AD | - | - / x | - | x | - | - |
|
|
||||||
| USE_APDS9960 | - | - / - | - | - | - | - |
|
|
||||||
| USE_MCP230xx | - | - / - | - | - | - | - |
|
|
||||||
| USE_MCP23XXX_DRV | - | - / - | - | - | - | - |
|
|
||||||
| USE_PCA9632 | - | - / - | - | - | - | - |
|
|
||||||
| USE_PCA9685 | - | - / - | - | - | - | - |
|
|
||||||
| USE_PCA9685_V2 | - | - / - | - | - | - | - |
|
|
||||||
| USE_MPR121 | - | - / - | - | - | - | - |
|
|
||||||
| USE_CCS811 | - | - / - | - | x | - | - |
|
|
||||||
| USE_CCS811_V2 | - | - / x | - | - | - | - |
|
|
||||||
| USE_ENS16x | - | - / - | - | - | - | - |
|
|
||||||
| USE_ENS210 | - | - / - | - | - | - | - |
|
|
||||||
| USE_MPU6050 | - | - / - | - | - | - | - |
|
|
||||||
| USE_MGC3130 | - | - / - | - | - | - | - |
|
|
||||||
| USE_MAX44009 | - | - / - | - | - | - | - |
|
|
||||||
| USE_SCD30 | - | - / x | - | x | - | - |
|
|
||||||
| USE_SCD40 | - | - / x | - | - | - | - |
|
|
||||||
| USE_SPS30 | - | - / - | - | - | - | - |
|
|
||||||
| USE_ADE7880 | - | - / - | - | - | - | - |
|
|
||||||
| USE_ADE7953 | - | x / x | x | x | - | x |
|
|
||||||
| USE_VL53L0X | - | - / x | - | x | - | - |
|
|
||||||
| USE_VL53L1X | - | - / - | - | - | - | - |
|
|
||||||
| USE_MLX90614 | - | - / - | - | - | - | - |
|
|
||||||
| USE_CHIRP | - | - / - | - | - | - | - |
|
|
||||||
| USE_PAJ7620 | - | - / - | - | - | - | - |
|
|
||||||
| USE_PCF8574 | - | - / - | - | - | - | - |
|
|
||||||
| USE_PMSA003I | - | - / - | - | - | - | - |
|
|
||||||
| USE_LOX_O2 | - | - / x | - | x | - | - |
|
|
||||||
| USE_GDK101 | - | - / - | - | - | - | - |
|
|
||||||
| USE_TC74 | - | - / - | - | - | - | - |
|
|
||||||
| USE_PCA9557 | - | - / - | - | - | - | - |
|
|
||||||
| USE_AGS02MA | - | - / - | - | - | - | - |
|
|
||||||
| | | | | | | |
|
|
||||||
| **Feature or Sensor** | **l** | **t** | **k** | **s** | **i** | **d** | **Remarks** |
|
|
||||||
| USE_HIH6 | - | - / x | - | x | - | - |
|
|
||||||
| USE_DHT12 | - | - / x | - | x | - | - |
|
|
||||||
| USE_DS1624 | - | - / x | - | x | - | - |
|
|
||||||
| USE_AHT1x | - | - / - | - | - | - | - |
|
|
||||||
| USE_HDC1080 | - | - / - | - | - | - | - |
|
|
||||||
| USE_WEMOS_MOTOR_V1 | - | - / x | - | x | - | - |
|
|
||||||
| USE_IAQ | - | - / x | - | x | - | - |
|
|
||||||
| USE_AS3935 | - | - / x | - | x | - | - |
|
|
||||||
| USE_VEML6075 | - | - / - | - | - | - | - |
|
|
||||||
| USE_VEML7700 | - | - / - | - | - | - | - |
|
|
||||||
| USE_MCP9808 | - | - / - | - | - | - | - |
|
|
||||||
| USE_MLX90640 | - | - / - | - | - | - | - |
|
|
||||||
| USE_HP303B | - | - / - | - | - | - | - |
|
|
||||||
| USE_EZOCO2 | - | - / - | - | - | - | - |
|
|
||||||
| USE_EZODO | - | - / - | - | - | - | - |
|
|
||||||
| USE_EZOEC | - | - / - | - | - | - | - |
|
|
||||||
| USE_EZOFLO | - | - / - | - | - | - | - |
|
|
||||||
| USE_EZOHUM | - | - / - | - | - | - | - |
|
|
||||||
| USE_EZOO2 | - | - / - | - | - | - | - |
|
|
||||||
| USE_EZOORP | - | - / - | - | - | - | - |
|
|
||||||
| USE_EZOPH | - | - / - | - | - | - | - |
|
|
||||||
| USE_EZOPMP | - | - / - | - | - | - | - |
|
|
||||||
| USE_EZOPRS | - | - / - | - | - | - | - |
|
|
||||||
| USE_EZORGB | - | - / - | - | - | - | - |
|
|
||||||
| USE_EZORTD | - | - / - | - | - | - | - |
|
|
||||||
| USE_SEESAW_SOIL | - | - / - | - | - | - | - |
|
|
||||||
| USE_TOF10120 | - | - / - | - | - | - | - |
|
|
||||||
| USE_AM2320 | - | - / - | - | - | - | - |
|
|
||||||
| USE_T67XX | - | - / - | - | - | - | - |
|
|
||||||
| USE_HM330X | - | - / - | - | - | - | - |
|
|
||||||
| USE_HDC2010 | - | - / - | - | - | - | - |
|
|
||||||
| USE_DS3502 | - | - / - | - | - | - | - |
|
|
||||||
| USE_HYT | - | - / - | - | - | - | - |
|
|
||||||
| USE_LUXV30B | - | - / - | - | - | - | - |
|
|
||||||
| USE_HMC5883L | - | - / - | - | - | - | - |
|
|
||||||
| USE_QMC5883L | - | - / - | - | - | - | - |
|
|
||||||
| USE_MAX17043 | - | - / - | - | - | - | - |
|
|
||||||
| | | | | | | |
|
|
||||||
| **Feature or Sensor** | **l** | **t** | **k** | **s** | **i** | **d** | **Remarks** |
|
|
||||||
| USE_SPI | - | - / x | - | - | - | x |
|
|
||||||
| USE_RC522 | - | - / - | - | - | - | - |
|
|
||||||
| USE_CANSNIFFER | - | - / - | - | - | - | - |
|
|
||||||
| USE_SPI_LORA | - | - / x | - | - | - | - |
|
|
||||||
| USE_MHZ19 | - | - / x | - | x | - | - |
|
|
||||||
| USE_SENSEAIR | - | - / x | - | x | - | - |
|
|
||||||
| USE_PMS5003 | - | - / x | - | x | - | - |
|
|
||||||
| USE_NOVA_SDS | - | - / x | - | x | - | - |
|
|
||||||
| USE_HPMA | - | - / x | - | x | - | - |
|
|
||||||
| USE_SERIAL_BRIDGE | - | x / x | x | x | - | x |
|
|
||||||
| USE_MODBUS_BRIDGE | - | - / x | - | - | - | - |
|
|
||||||
| USE_MP3_PLAYER | - | - / x | - | x | - | - |
|
|
||||||
| USE_AZ7798 | - | - / - | - | - | - | - |
|
|
||||||
| USE_PN532_HSU | - | - / x | - | x | - | - |
|
|
||||||
| USE_RDM6300 | - | - / x | - | x | - | - |
|
|
||||||
| USE_IBEACON | - | - / x | - | x | - | - |
|
|
||||||
| USE_GPS | - | - / - | - | - | - | - |
|
|
||||||
| USE_HM10 | - | - / - | - | x | - | - |
|
|
||||||
| USE_HRXL | - | - / x | - | x | - | - |
|
|
||||||
| USE_TASMOTA_CLIENT | - | - / - | - | - | - | - |
|
|
||||||
| USE_OPENTHERM | - | - / - | - | - | - | - |
|
|
||||||
| USE_MIEL_HVAC | - | - / - | - | - | - | - |
|
|
||||||
| USE_PROJECTOR_CTRL | - | - / - | - | - | - | - |
|
|
||||||
| USE_AS608 | - | - / - | - | - | - | - |
|
|
||||||
| USE_LD2402 | - | - / - | - | - | - | - |
|
|
||||||
| USE_LD2410 | - | - / - | - | - | - | - |
|
|
||||||
| USE_LD2410S | - | - / - | - | - | - | - |
|
|
||||||
| USE_GM861 | - | - / - | - | - | - | - |
|
|
||||||
| USE_TCP_BRIDGE | - | - / - | - | - | - | - | zbbridge / zbbrdgpro |
|
|
||||||
| USE_HC8 | - | - / - | - | - | - | - |
|
|
||||||
| USE_PIPSOLAR | - | - / - | - | - | - | - |
|
|
||||||
| USE_WOOLIIS | - | - / - | - | - | - | - |
|
|
||||||
| USE_C8_CO2_5K | - | - / - | - | - | - | - |
|
|
||||||
| | | | | | | |
|
|
||||||
| USE_NRF24 | - | - / - | - | - | - | - |
|
|
||||||
| USE_MIBLE | - | - / - | - | - | - | - |
|
|
||||||
| USE_ZIGBEE | - | - / - | - | - | - | - |
|
|
||||||
| USE_ZIGBEE_ZNP | - | - / - | - | - | - | - |
|
|
||||||
| USE_ZIGBEE_EZSP | - | - / - | - | - | - | - | Sonoff ZbBridge |
|
|
||||||
| | | | | | | |
|
|
||||||
| USE_IR_REMOTE | - | x / - | x | x | x | x |
|
|
||||||
| USE_IR_RECEIVE | - | x / - | x | x | x | x |
|
|
||||||
| USE_IR_REMOTE_FULL | - | - / - | - | - | x | - | Enable ALL protocols |
|
|
||||||
| | | | | | | |
|
|
||||||
| USE_WIZMOTE | - | - / - | - | - | - | - |
|
|
||||||
| | | | | | | |
|
|
||||||
| USE_SR04 | - | - / - | - | x | - | - |
|
|
||||||
| USE_ME007 | - | - / - | - | - | - | - |
|
|
||||||
| USE_DYP | - | - / - | - | - | - | - |
|
|
||||||
| USE_TM1638 | - | - / x | - | x | - | - |
|
|
||||||
| USE_HX711 | - | - / x | - | x | - | - |
|
|
||||||
| -USE_HX711_M5SCALES | - | - / - | - | - | - | - |
|
|
||||||
| USE_TX2x_WIND_SENSOR | - | - / - | - | - | - | - |
|
|
||||||
| USE_WINDMETER | - | - / - | - | - | - | - |
|
|
||||||
| USE_RC_SWITCH | - | - / x | - | x | - | - |
|
|
||||||
| USE_RF_SENSOR | - | - / x | - | x | - | - | AlectoV2 only |
|
|
||||||
| USE_HRE | - | - / x | - | x | - | - |
|
|
||||||
| USE_A4988_STEPPER | - | - / - | - | - | - | - |
|
|
||||||
| USE_NEOPOOL | - | - / - | - | - | - | - |
|
|
||||||
| USE_FLOWRATEMETER | - | - / - | - | - | - | - |
|
|
||||||
| | | | | | | |
|
|
||||||
| **Feature or Sensor** | **l** | **t** | **k** | **s** | **i** | **d** | **Remarks** |
|
|
||||||
| USE_DISPLAY | - | - / - | - | - | - | x |
|
|
||||||
| USE_DISPLAY_LCD | - | - / - | - | - | - | x |
|
|
||||||
| USE_DISPLAY_MATRIX | - | - / - | - | - | - | x |
|
|
||||||
| USE_DISPLAY_EPAPER_29 | - | - / - | - | - | - | x |
|
|
||||||
| USE_DISPLAY_EPAPER_42 | - | - / - | - | - | - | x |
|
|
||||||
| USE_DISPLAY_RA8876 | - | - / - | - | - | - | x |
|
|
||||||
| USE_DISPLAY_TM1637 | - | - / - | - | - | - | x |
|
|
||||||
| USE_DISPLAY_TM1621_SONOFF | - | - / x | - | - | - | - |
|
|
||||||
| USE_DISPLAY_TM1650 | - | - / - | - | - | - | - |
|
|
||||||
| | | | | | | |
|
|
||||||
| USE_FT5206 | - | - / - | - | - | - | - |
|
|
||||||
| USE_FTC532 | - | - / - | - | - | - | - |
|
|
||||||
| USE_BS814A2 | - | - / - | - | - | - | - |
|
|
||||||
| | | | | | | |
|
|
||||||
| **ESP32 Feature** | **l** | **t** | **k** | **s** | **i** | **d** | **Remarks** |
|
|
||||||
| USE_HALLEFFECT | | / x | | | | |
|
|
||||||
| USE_MI_ESP32 | | / x | | | | | See SetOption115 |
|
|
||||||
| USE_IBEACON_ESP32 | | / - | | | | |
|
|
||||||
| USE_WEBCAM | | / - | | | | |
|
|
||||||
| USE_ETHERNET | | / x | | | | |
|
|
||||||
| USE_I2S_AUDIO | | / - | | | | |
|
|
||||||
| USE_SONOFF_SPM | | / x | | | | |
|
|
||||||
| USE_DISPLAY_TM1621_SONOFF | | / x | | | | |
|
|
||||||
| USE_SHELLY_PRO | | / x | | | | |
|
|
||||||
| USE_ESP32_TWAI | | / x | | | | |
|
|
||||||
| USE_DALI | | / x | | | | |
|
|
||||||
| USE_DINGTIAN_RELAY | | / - | | | | |
|
|
||||||
| USE_MATTER_DEVICE | | / x | | | | | See SetOption151 |
|
|
||||||
|
|
||||||
The following specific display drivers are replaced with uDisplay, see [uDisplay/uTouch documentation](https://tasmota.github.io/docs/Universal-Display-Driver/#migrating-to-udisplay): `USE_DISPLAY_ILI9341`, `USE_DISPLAY_SSD1306`, `USE_DISPLAY_SH1106`, `USE_DISPLAY_SSD1351`, `USE_DISPLAY_ST7789`
|
|
||||||
|
|
||||||
- USE_MQTT_TLS is enabled by default in every ESP32 variants
|
|
||||||
5994
CHANGELOG.md
5994
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@ -1,8 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.16.0)
|
|
||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
|
||||||
|
|
||||||
project(tasmota)
|
|
||||||
|
|
||||||
if(CONFIG_IDF_TARGET_ESP32C2)
|
|
||||||
include(relinker)
|
|
||||||
endif()
|
|
||||||
@ -1,130 +0,0 @@
|
|||||||
|
|
||||||
# Contributor Covenant Code of Conduct
|
|
||||||
|
|
||||||
## Our Pledge
|
|
||||||
|
|
||||||
We as members, contributors, and leaders pledge to make participation in our
|
|
||||||
community a harassment-free experience for everyone, regardless of age, body
|
|
||||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
||||||
identity and expression, level of experience, education, socio-economic status,
|
|
||||||
nationality, personal appearance, race, religion, or sexual identity
|
|
||||||
and orientation.
|
|
||||||
|
|
||||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
||||||
diverse, inclusive, and healthy community.
|
|
||||||
|
|
||||||
## Our Standards
|
|
||||||
|
|
||||||
Examples of behavior that contributes to a positive environment for our
|
|
||||||
community include:
|
|
||||||
|
|
||||||
* Demonstrating empathy and kindness toward other people
|
|
||||||
* Being respectful of differing opinions, viewpoints, and experiences
|
|
||||||
* Giving and gracefully accepting constructive feedback
|
|
||||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
||||||
and learning from the experience
|
|
||||||
* Focusing on what is best not just for us as individuals, but for the
|
|
||||||
overall community
|
|
||||||
|
|
||||||
Examples of unacceptable behavior include:
|
|
||||||
|
|
||||||
* The use of sexualized language or imagery, and sexual attention or
|
|
||||||
advances of any kind
|
|
||||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
||||||
* Public or private harassment
|
|
||||||
* Publishing others' private information, such as a physical or email
|
|
||||||
address, without their explicit permission
|
|
||||||
* Other conduct which could reasonably be considered inappropriate in a
|
|
||||||
professional setting
|
|
||||||
|
|
||||||
## Enforcement Responsibilities
|
|
||||||
|
|
||||||
Community leaders are responsible for clarifying and enforcing our standards of
|
|
||||||
acceptable behavior and will take appropriate and fair corrective action in
|
|
||||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
||||||
or harmful.
|
|
||||||
|
|
||||||
Community leaders have the right and responsibility to remove, edit, or reject
|
|
||||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
||||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
||||||
decisions when appropriate.
|
|
||||||
|
|
||||||
## Scope
|
|
||||||
|
|
||||||
This Code of Conduct applies within all community spaces, and also applies when
|
|
||||||
an individual is officially representing the community in public spaces.
|
|
||||||
Examples of representing our community include using an official e-mail address,
|
|
||||||
posting via an official social media account, or acting as an appointed
|
|
||||||
representative at an online or offline event.
|
|
||||||
|
|
||||||
## Enforcement
|
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
||||||
reported to the community leaders responsible for enforcement at
|
|
||||||
https://sidweb.nl/cms3/en/contact.
|
|
||||||
All complaints will be reviewed and investigated promptly and fairly.
|
|
||||||
|
|
||||||
All community leaders are obligated to respect the privacy and security of the
|
|
||||||
reporter of any incident.
|
|
||||||
|
|
||||||
## Enforcement Guidelines
|
|
||||||
|
|
||||||
Community leaders will follow these Community Impact Guidelines in determining
|
|
||||||
the consequences for any action they deem in violation of this Code of Conduct:
|
|
||||||
|
|
||||||
### 1. Correction
|
|
||||||
|
|
||||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
||||||
unprofessional or unwelcome in the community.
|
|
||||||
|
|
||||||
**Consequence**: A private, written warning from community leaders, providing
|
|
||||||
clarity around the nature of the violation and an explanation of why the
|
|
||||||
behavior was inappropriate. A public apology may be requested.
|
|
||||||
|
|
||||||
### 2. Warning
|
|
||||||
|
|
||||||
**Community Impact**: A violation through a single incident or series
|
|
||||||
of actions.
|
|
||||||
|
|
||||||
**Consequence**: A warning with consequences for continued behavior. No
|
|
||||||
interaction with the people involved, including unsolicited interaction with
|
|
||||||
those enforcing the Code of Conduct, for a specified period of time. This
|
|
||||||
includes avoiding interactions in community spaces as well as external channels
|
|
||||||
like social media. Violating these terms may lead to a temporary or
|
|
||||||
permanent ban.
|
|
||||||
|
|
||||||
### 3. Temporary Ban
|
|
||||||
|
|
||||||
**Community Impact**: A serious violation of community standards, including
|
|
||||||
sustained inappropriate behavior.
|
|
||||||
|
|
||||||
**Consequence**: A temporary ban from any sort of interaction or public
|
|
||||||
communication with the community for a specified period of time. No public or
|
|
||||||
private interaction with the people involved, including unsolicited interaction
|
|
||||||
with those enforcing the Code of Conduct, is allowed during this period.
|
|
||||||
Violating these terms may lead to a permanent ban.
|
|
||||||
|
|
||||||
### 4. Permanent Ban
|
|
||||||
|
|
||||||
**Community Impact**: Demonstrating a pattern of violation of community
|
|
||||||
standards, including sustained inappropriate behavior, harassment of an
|
|
||||||
individual, or aggression toward or disparagement of classes of individuals.
|
|
||||||
|
|
||||||
**Consequence**: A permanent ban from any sort of public interaction within
|
|
||||||
the community.
|
|
||||||
|
|
||||||
## Attribution
|
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
||||||
version 2.0, available at
|
|
||||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
||||||
|
|
||||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
|
||||||
enforcement ladder](https://github.com/mozilla/diversity).
|
|
||||||
|
|
||||||
[homepage]: https://www.contributor-covenant.org
|
|
||||||
|
|
||||||
For answers to common questions about this code of conduct, see the FAQ at
|
|
||||||
https://www.contributor-covenant.org/faq. Translations are available at
|
|
||||||
https://www.contributor-covenant.org/translations.
|
|
||||||
|
|
||||||
253
CODE_OWNERS.md
253
CODE_OWNERS.md
@ -1,253 +0,0 @@
|
|||||||
<picture>
|
|
||||||
<source media="(prefers-color-scheme: dark)" srcset="./tools/logo/TASMOTA_FullLogo_Vector_White.svg">
|
|
||||||
<img alt="Logo" src="./tools/logo/TASMOTA_FullLogo_Vector.svg" align="right" height="76">
|
|
||||||
</picture>
|
|
||||||
|
|
||||||
# Code Owners
|
|
||||||
|
|
||||||
In addition to @arendst the following code is mainly owned by:
|
|
||||||
|
|
||||||
| Code | Owner
|
|
||||||
|------------------------------|---------------------------
|
|
||||||
| Tasmota Drivers |
|
|
||||||
| |
|
|
||||||
| xdrv_01_webserver | @arendst
|
|
||||||
| xdrv_02_mqtt | @arendst
|
|
||||||
| xdrv_03_energy | @arendst
|
|
||||||
| xdrv_04_light | @s-hadinger
|
|
||||||
| xdrv_05_irremote | @s-hadinger
|
|
||||||
| xdrv_06_snfbridge | @arendst
|
|
||||||
| xdrv_07_domoticz | @arendst
|
|
||||||
| xdrv_08_serial_bridge | Dániel Zoltán Tolnai
|
|
||||||
| xdrv_09_timers | @arendst
|
|
||||||
| xdrv_10_rules | @arendst, @barbudor
|
|
||||||
| xdrv_10_scripter | @gemu
|
|
||||||
| xdrv_11_knx | @adrian
|
|
||||||
| xdrv_12_discovery | @arendst, @effelle, @emontnemery
|
|
||||||
| xdrv_13_display | @gemu, @s-hadinger
|
|
||||||
| xdrv_14_mp3 | @gemu, @mike2nl
|
|
||||||
| xdrv_15_pca9685 | Andre Thomas
|
|
||||||
| xdrv_16_tuyamcu | @btsimonh
|
|
||||||
| xdrv_17_rcswitch |
|
|
||||||
| xdrv_18_armtronix_dimmers | @wvdv2002
|
|
||||||
| xdrv_19_pz16dz_dimmer | Joel Stein
|
|
||||||
| xdrv_20_hue | @s-hadinger
|
|
||||||
| xdrv_21_wemo | @s-hadinger
|
|
||||||
| xdrv_22_sonoff_ifan | @arendst
|
|
||||||
| xdrv_23_zigbee | @s-hadinger
|
|
||||||
| xdrv_24_buzzer | @arendst
|
|
||||||
| xdrv_25_stepper | Tim Leuscher
|
|
||||||
| xdrv_26_ariluxrf | @arendst
|
|
||||||
| xdrv_27_shutter | @stefanbode
|
|
||||||
| xdrv_28_pcf8574 | @stefanbode
|
|
||||||
| xdrv_29_deepsleep | @stefanbode
|
|
||||||
| xdrv_30_exs_dimmer | Andreas Schultz
|
|
||||||
| xdrv_31_tasmota_client | Andre Thomas
|
|
||||||
| xdrv_32_hotplug | @BASM
|
|
||||||
| xdrv_33_nrf24l01 | @staars
|
|
||||||
| xdrv_34_wemos_motor | Peter Franck
|
|
||||||
| xdrv_35_pwm_dimmer | Paul C Diem
|
|
||||||
| xdrv_36_keeloq | he-so
|
|
||||||
| xdrv_37_sonoff_d1 | @arendst
|
|
||||||
| xdrv_38_ping | @s-hadinger
|
|
||||||
| xdrv_39_thermostat | Javier Argita
|
|
||||||
| xdrv_40_telegram | @arendst
|
|
||||||
| xdrv_41_tcp_bridge | @s-hadinger
|
|
||||||
| xdrv_42_i2s_audio | @gemu
|
|
||||||
| xdrv_43_mlx90640 | @staars
|
|
||||||
| xdrv_44_miel_hvac | David GWynne
|
|
||||||
| xdrv_45_shelly_dimmer | James Turton
|
|
||||||
| xdrv_46_ccloader | @staars
|
|
||||||
| xdrv_47_ftc532 | Peter Franck
|
|
||||||
| xdrv_48_timeprop | Colin Law, Thomas Herrmann
|
|
||||||
| xdrv_49_pid | Colin Law, Thomas Herrmann
|
|
||||||
| xdrv_50_filesystem | @gemu, @barbudor
|
|
||||||
| xdrv_51_bs814a2 | Peter Franck
|
|
||||||
| xdrv_52_berry | @s-hadinger, @staars (ULP)
|
|
||||||
| xdrv_53_projector_ctrl | Jan Bubík
|
|
||||||
| xdrv_54_lvgl | @s-hadinger
|
|
||||||
| xdrv_55_touch | @gemu, @s-hadinger
|
|
||||||
| xdrv_56_rtc_chips | @arendst, @s-hadinger
|
|
||||||
| xdrv_57_tasmesh | @staars
|
|
||||||
| xdrv_58_range_extender | @sillyfrog
|
|
||||||
| xdrv_59_influxdb | @arendst
|
|
||||||
| xdrv_60_shift595 | Jacek Ziółkowski
|
|
||||||
| xdrv_61_ds3502 | f-reiling
|
|
||||||
| xdrv_62_improv | @arendst
|
|
||||||
| xdrv_63_modbus_bridge | @jeroenst
|
|
||||||
| xdrv_64_pca9632 | Pascal Heinrich
|
|
||||||
| xdrv_65_tuyamcubr | David Gwynne
|
|
||||||
| xdrv_66_tm1638 | @arendst
|
|
||||||
| xdrv_67_mcp23xxx | @arendst
|
|
||||||
| xdrv_68_zerocrossDimmer | @stefanbode
|
|
||||||
| xdrv_69_pca9557 | @cctweaker
|
|
||||||
| xdrv_70_1_hdmi_cec | @s-hadinger
|
|
||||||
| xdrv_71_magic_switch | @barbudor
|
|
||||||
| xdrv_72_pipsolar | @chefpro
|
|
||||||
| xdrv_73_lora | @arendst
|
|
||||||
| xdrv_74_lorawan | @arendst
|
|
||||||
| xdrv_75_dali | @eeak, @arendst
|
|
||||||
| xdrv_76_serial_i2c | @s-hadinger
|
|
||||||
| xdrv_77_wizmote | @arendst
|
|
||||||
| xdrv_78_telnet | @arendst
|
|
||||||
| xdrv_79_esp32_ble | @staars, @btsimonh
|
|
||||||
| xdrv_80_wireguard_client | @s-hadinger
|
|
||||||
| xdrv_81_esp32_webcam | @gemu, @philrich
|
|
||||||
| xdrv_82_esp32_ethernet | @arendst
|
|
||||||
| xdrv_83_esp32_watch | @gemu
|
|
||||||
| xdrv_85_esp32_ble_eq3_trv | @btsimonh
|
|
||||||
| xdrv_86_esp32_sonoff_spm | @arendst
|
|
||||||
| xdrv_87_esp32_sonoff_tm1621 | @arendst
|
|
||||||
| xdrv_88_esp32_shelly_pro | @arendst
|
|
||||||
| xdrv_89_ |
|
|
||||||
| xdrv_90_esp32_dingtian_relay | @barbudor
|
|
||||||
| xdrv_91_esp32_twai | @arendst
|
|
||||||
| xdrv_92_vid6608 | @petrows
|
|
||||||
| xdrv_93_ |
|
|
||||||
| xdrv_94_ |
|
|
||||||
| |
|
|
||||||
| xdrv_119_i2c_ap33772s | @arendst
|
|
||||||
| xdrv_120_xyzmodem | @arendst
|
|
||||||
| xdrv_121_gpioviewer | @arendst
|
|
||||||
| xdrv_122_file_settings_demo | @arendst
|
|
||||||
| xdrv_122_file_json_settings_demo | @arendst
|
|
||||||
| xdrv_127_debug | @arendst
|
|
||||||
| |
|
|
||||||
| Tasmota Sensors |
|
|
||||||
| |
|
|
||||||
| xsns_01_counter | @arendst, @stefanbode
|
|
||||||
| xsns_02_analog | @arendst, @barbudor
|
|
||||||
| xsns_03_energy | @arendst
|
|
||||||
| xsns_04_snfsc | @arendst
|
|
||||||
| xsns_05_ds18x20 | @arendst
|
|
||||||
| xsns_06_dht | @arendst
|
|
||||||
| xsns_07_sht1x | @arendst
|
|
||||||
| xsns_08_htu | Heiko Krupp
|
|
||||||
| xsns_09_bmp | @arendst
|
|
||||||
| xsns_10_bh1750 | @arendst
|
|
||||||
| xsns_11_veml6070 | @mike2nl
|
|
||||||
| xsns_12_ads1115 | @syssi, @stefanbode
|
|
||||||
| xsns_13_ina219 | @stefanbode
|
|
||||||
| xsns_14_sht3x | Stefan Tibus
|
|
||||||
| xsns_15_mhz19 | @arendst
|
|
||||||
| xsns_16_tsl2561 | Joachim Banzhaf
|
|
||||||
| xsns_17_senseair | @arendst
|
|
||||||
| xsns_18_pms5003 | @arendst
|
|
||||||
| xsns_19_mgs | @palich2000
|
|
||||||
| xsns_20_novasds | Norbert Richter
|
|
||||||
| xsns_21_sgp30 | Gerhard Mutz
|
|
||||||
| xsns_22_sr04 | Nuno Ferreira, @arendst
|
|
||||||
| xsns_23_me007 | Mathias Buder
|
|
||||||
| xsns_24_si1145 |
|
|
||||||
| xsns_25_spl06-007_sensor | @rai68
|
|
||||||
| xsns_26_lm75ad | Andre Thomas
|
|
||||||
| xsns_27_apds9960 | Shawn Hymel
|
|
||||||
| xsns_28_qmp6988 | @arendst
|
|
||||||
| xsns_29_mcp230xx | Andre Thomas
|
|
||||||
| xsns_30_mpr121 | Rene 'Renne' Bartsch
|
|
||||||
| xsns_31_ccs811 | Gerhard Mutz
|
|
||||||
| xsns_32_mpu6050 | Oliver Welter
|
|
||||||
| xsns_33_qmc5883l | Helge Scheunemann
|
|
||||||
| xsns_34_hx711 | @arendst
|
|
||||||
| xsns_35_tx20 | Thomas Eckerstorfer, Norbert Richter
|
|
||||||
| xsns_36_mgc3130 | Christian Baars
|
|
||||||
| xsns_37_rfsensor | @arendst
|
|
||||||
| xsns_38_az7798 | @adebeun
|
|
||||||
| xsns_39_max31855 | Markus Past
|
|
||||||
| xsns_40_pn532 | Andre Thomas, @md5sum-as
|
|
||||||
| xsns_41_max44009 | @llagendijk
|
|
||||||
| xsns_42_scd30 | @frogmore42
|
|
||||||
| xsns_43_hre | Jon Little
|
|
||||||
| xsns_44_sps30 | Gerhard Mutz
|
|
||||||
| xsns_45_vl53l0x | Gerhard Mutz, Adrian Scillato
|
|
||||||
| xsns_46_mlx90614 | Gerhard Mutz
|
|
||||||
| xsns_47_max31865 | Alberto Lopez Siemens
|
|
||||||
| xsns_48_chirp | Christian Baars
|
|
||||||
| xsns_49 |
|
|
||||||
| xsns_50_paj7620 | Christian Baars
|
|
||||||
| xsns_51_rdm6300 | Gerhard Mutz
|
|
||||||
| xsns_52_esp32_ibeacon | Gerhard Mutz, @btsimonh
|
|
||||||
| xsns_52_ibeacon | Gerhard Mutz
|
|
||||||
| xsns_53_sml | Gerhard Mutz
|
|
||||||
| xsns_54_ina226 | Stephen Rodgers
|
|
||||||
| xsns_55_hih_series |
|
|
||||||
| xsns_56_hpma | David Hunt
|
|
||||||
| xsns_57_tsl2591 | Markus Bösling
|
|
||||||
| xsns_58_dht12 | Stefan Oskam
|
|
||||||
| xsns_59_ds1624 | Leonid Myravje
|
|
||||||
| xsns_60_gps | Christian Baars, Adrian Scillato
|
|
||||||
| xsns_61_mi_nrf24 | Christian Baars
|
|
||||||
| xsns_62_mi_hm10 | Christian Baars
|
|
||||||
| xsns_62_esp32_mi | Christian Baars
|
|
||||||
| xsns_63_aht1x | Martin Wagner
|
|
||||||
| xsns_64_hrxl | Jon Little
|
|
||||||
| xsns_65_hdc1080 | Luis Teixeira
|
|
||||||
| xsns_66_iaq | Christian Baars
|
|
||||||
| xsns_67_as3935 | Martin Wagner
|
|
||||||
| xsns_68_windmeter | Matteo Albinola
|
|
||||||
| xsns_69_opentherm | Yuriy Sannikov
|
|
||||||
| xsns_70_veml6075 | Martin Wagner
|
|
||||||
| xsns_71_veml7700 | Martin Wagner
|
|
||||||
| xsns_72_mcp9808 | Martin Wagner
|
|
||||||
| xsns_73_hp303b | @rjaakke
|
|
||||||
| xsns_74_lmt01 | @justifiably
|
|
||||||
| xsns_75_prometheus | @marius, @mhansen, @hansmi
|
|
||||||
| xsns_76_dyp | Janusz Kostorz
|
|
||||||
| xsns_77_vl53l1x | Rui Marinho, @Jason2866
|
|
||||||
| xsns_78_ezo | Christopher Tremblay
|
|
||||||
| xsns_79_as608 | @boaschti
|
|
||||||
| xsns_80_mfrc522 | @arendst
|
|
||||||
| xsns_81_seesaw_soil | Wayne Ross, Peter Franck
|
|
||||||
| xsns_82_wiegand | Sigurd Leuther
|
|
||||||
| xsns_83_neopool | Norbert Richter
|
|
||||||
| xsns_84_tof10120 | Cyril Pawelko
|
|
||||||
| xsns_85_mpu6886 | @s-hadinger
|
|
||||||
| xsns_86_tfminiplus | Raphael Breiting
|
|
||||||
| xsns_87_can_sniffer | @kwiatek6324, Marius Bezuidenhout
|
|
||||||
| xsns_87_mcp2515 | Marius Bezuidenhout
|
|
||||||
| xsns_88_am2320 | Lars Wessels
|
|
||||||
| xsns_89_t67xx | Alexander Savchenko
|
|
||||||
| xsns_90_hrg15 | Wouter Breukink
|
|
||||||
| xsns_91_vindriktning | Marcel Ritter
|
|
||||||
| xsns_92_scd40 | @frogmore42, @arnold-n
|
|
||||||
| xsns_93_hm330x | @barbudor
|
|
||||||
| xsns_94_hdc2010 | Luc Boudreau
|
|
||||||
| xsns_95_cm1107 | @maksim
|
|
||||||
| xsns_96_flowratemeter | Norbert Richter
|
|
||||||
| xsns_97_hyt | Thomas Schnittcher, Adjan Kretz
|
|
||||||
| xsns_98_sgp40 | Jean-Pierre Deschamps
|
|
||||||
| xsns_99_luxv30b | Marius Bezuidenhout
|
|
||||||
| xsns_100_ina3221 | @barbudor
|
|
||||||
| xsns_101_hmc5883l | Andreas Achtzehn
|
|
||||||
| xsns_102_ld2410 | @arendst
|
|
||||||
| xsns_103_sen5x | @tyeth
|
|
||||||
| xsns_104_pmsa003i | Jean-Pierre Deschamps
|
|
||||||
| xsns_105_lox_o2 | @ACE1046
|
|
||||||
| xsns_106_gdk101 | @Szewcson
|
|
||||||
| xsns_107_gm861 | @arendst
|
|
||||||
| xsns_108_tc74 | Michael Loftis
|
|
||||||
| xsns_109_sgp4x | Andrew Klaus
|
|
||||||
| xsns_110_max17043 | Vincent de Groot
|
|
||||||
| xsns_111_ens16x | Christoph Friese
|
|
||||||
| xsns_112_ens210 | Christoph Friese
|
|
||||||
| xsns_113_hc8 | Daniel Maier
|
|
||||||
| xsns_114_amsx915 | Bastian Urschel
|
|
||||||
| xsns_115_wooliis | Luca Melette
|
|
||||||
| xsns_117_c8_co2_5k | @jeroenvermeulen
|
|
||||||
| xsns_118_ags02ma | Akshaylal S
|
|
||||||
| |
|
|
||||||
| xsns_127_esp32_sensors | @arendst
|
|
||||||
| |
|
|
||||||
| Libraries |
|
|
||||||
| |
|
|
||||||
| berry | @s-hadinger
|
|
||||||
| ext-printf | @s-hadinger
|
|
||||||
| jsmn | @s-hadinger
|
|
||||||
| unishox | @s-hadinger
|
|
||||||
| matter | @s-hadinger
|
|
||||||
| |
|
|
||||||
| PlatformIO |
|
|
||||||
| |
|
|
||||||
| all | @Jason2866
|
|
||||||
| |
|
|
||||||
|
|
||||||
118
CONTRIBUTING.md
118
CONTRIBUTING.md
@ -1,118 +0,0 @@
|
|||||||
<picture>
|
|
||||||
<source media="(prefers-color-scheme: dark)" srcset="./tools/logo/TASMOTA_FullLogo_Vector_White.svg">
|
|
||||||
<img alt="Logo" src="./tools/logo/TASMOTA_FullLogo_Vector.svg" align="right" height="76">
|
|
||||||
</picture>
|
|
||||||
|
|
||||||
# Contributing
|
|
||||||
|
|
||||||
**Any contribution helps our team and makes Tasmota better for the entire community!**
|
|
||||||
|
|
||||||
Everybody is welcome and invited to contribute to Tasmota Project by:
|
|
||||||
|
|
||||||
* Testing newly released features and reporting issues.
|
|
||||||
* Providing Pull Requests (Features, Proof of Concepts, Language files or Fixes)
|
|
||||||
* Contributing missing documentation for features and devices in our [documentation](https://tasmota.github.io/docs/Contributing)
|
|
||||||
|
|
||||||
This document describes rules that are in effect for this repository, meant for handling issues by contributors in the issue tracker and PRs.
|
|
||||||
|
|
||||||
## Opening New Issues
|
|
||||||
|
|
||||||
**Issue tracker is NOT a general discussion forum!**
|
|
||||||
1. Opening an issue means that a problem exists in the code and should be addressed by the project contributors.
|
|
||||||
2. When opening an issue, it is required to fill out the presented template. The requested information is important! If the template is ignored or insufficient info about the issue is provided, the issue may be closed.
|
|
||||||
3. Questions of type "How do I..." or "Can you please help me with..." or "Can Tasmota do..." WILL NOT be handled here. Such questions should be directed at a discussion forum or to the Tasmota Support Chat. All issues of this type will be closed with a simple reference to this contributing policy.
|
|
||||||
4. Issues about topics already handled in the documentation will be closed in a similar manner.
|
|
||||||
5. Issues for unmerged PRs will be closed. If there is an issue with a PR, the explanation should be added to the PR itself.
|
|
||||||
6. Issues with accompanied investigation that shows the root of the problem should be given priority.
|
|
||||||
7. Duplicate issues will be closed.
|
|
||||||
|
|
||||||
## Triaging of Issues/PR's
|
|
||||||
|
|
||||||
1. Any contributor to the project can participate in the triaging process, if he/she chooses to do so.
|
|
||||||
2. An issue that needs to be closed, either due to not complying with this policy, or for other reasons, should be closed by a contributor.
|
|
||||||
3. Issues that are accepted should be marked with appropriate labels.
|
|
||||||
4. Issues that could impact functionality for many users should be considered severe.
|
|
||||||
5. Issues caused by the SDK or chip should not be marked severe, as there usually isn’t much to be done. Common sense should be applied when deciding. Such issues should be documented in the Wiki, for reference by users.
|
|
||||||
6. Issues with feature requests should be discussed for viability/desirability.
|
|
||||||
7. Feature requests or changes that are meant to address a very specific/limited use case, especially if at the expense of increased code complexity, may be denied, or may be required to be redesigned, generalized, or simplified.
|
|
||||||
8. Feature requests that are not accompanied by a PR:
|
|
||||||
* could be closed immediately (denied).
|
|
||||||
* could be closed after some predetermined period of time (left as candidate for somebody to pick up).
|
|
||||||
9. In some cases, feedback may be requested from the issue reporter, either as additional info for clarification, additional testing, or other. If no feedback is provided, the issue may be closed by a contributor or after 30 days by the STALE bot.
|
|
||||||
|
|
||||||
## Pull requests
|
|
||||||
|
|
||||||
A Pull Request (PR) is the process where code modifications are managed in GitHub.
|
|
||||||
|
|
||||||
The process is straight-forward.
|
|
||||||
|
|
||||||
- Read [How to get faster PR reviews](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#best-practices-for-faster-reviews) by Kubernetes (but skip step 0)
|
|
||||||
- Fork the Tasmota Repository [git repository](https://github.com/arendst/Tasmota).
|
|
||||||
- Write/Change the code in your Fork for a new feature, bug fix, new sensor, optimization, etc.
|
|
||||||
- Ensure tests work.
|
|
||||||
- Create a Pull Request against the [**development**](https://github.com/arendst/Tasmota/tree/development) branch of Tasmota.
|
|
||||||
|
|
||||||
1. All pull requests must be done against the development branch.
|
|
||||||
2. Only relevant files should be touched (Also beware if your editor has auto-formatting feature enabled).
|
|
||||||
3. Only one feature/fix should be added per PR.
|
|
||||||
4. If adding a new functionality (new hardware, new library support) not related to an existing component move it to it's own modules (.ino file).
|
|
||||||
5. PRs that don't compile (fail in CI Tests) or cause coding errors will not be merged. Please fix the issue. Same goes for PRs that are raised against older commit in development - you might need to rebase and resolve conflicts.
|
|
||||||
6. All pull requests should undergo peer review by at least one contributor other than the creator, excepts for the owner.
|
|
||||||
7. All pull requests should consider updates to the documentation.
|
|
||||||
8. Pull requests that address an outstanding issue, particularly an issue deemed to be severe, should be given priority.
|
|
||||||
9. If a PR is accepted, then it should undergo review and updated based on the feedback provided, then merged.
|
|
||||||
10. By submitting a PR, it is needed to use the provided PR template and check all boxes, performing the required tasks and accepting the CLA.
|
|
||||||
11. Pull requests that don't meet the above will be denied and closed.
|
|
||||||
|
|
||||||
--------------------------------------
|
|
||||||
|
|
||||||
## Contributor License Agreement (CLA)
|
|
||||||
|
|
||||||
```
|
|
||||||
By making a contribution to this project, I certify that:
|
|
||||||
|
|
||||||
(a) The contribution was created in whole or in part by me and I
|
|
||||||
have the right to submit it under the GPL-3.0 license; or
|
|
||||||
|
|
||||||
(b) The contribution is based upon previous work that, to the best
|
|
||||||
of my knowledge, is covered under an appropriate open source
|
|
||||||
license and I have the right under that license to submit that
|
|
||||||
work with modifications, whether created in whole or in part
|
|
||||||
by me, under the GPL-3.0 license; or
|
|
||||||
|
|
||||||
(c) The contribution was provided directly to me by some other
|
|
||||||
person who certified (a), (b) or (c) and I have not modified
|
|
||||||
it.
|
|
||||||
|
|
||||||
(d) I understand and agree that this project and the contribution
|
|
||||||
are public and that a record of the contribution (including all
|
|
||||||
personal information I submit with it) is maintained indefinitely
|
|
||||||
and may be redistributed consistent with this project or the open
|
|
||||||
source license(s) involved.
|
|
||||||
```
|
|
||||||
|
|
||||||
This Contributor License Agreement (CLA) was adopted on April 1st, 2019.
|
|
||||||
|
|
||||||
The text of this license is available under the [Creative Commons Attribution-ShareAlike 3.0 Unported License](http://creativecommons.org/licenses/by-sa/3.0/). It is based on the Linux [Developer Certificate Of Origin](http://elinux.org/Developer_Certificate_Of_Origin), but is modified to explicitly use the GPL-3.0 license and not mention sign-off (due to GitHub.com keeps an historial, with your user name, of PRs' commits and all editions on PR's comments).
|
|
||||||
|
|
||||||
To accept the CLA it is required to put a x between [ ] on `[ ] I accept the CLA` in the PR template when submitting it. The [ ] is an opt-in box, so you have to manually accept it.
|
|
||||||
|
|
||||||
**Why a CLA ?**
|
|
||||||
|
|
||||||
_"A Contributor License Agreement (CLA) is strongly recommended when accepting third party contributions to an open development project, such as an open source software project. In order to redistribute contributions, it is necessary to ensure that the project has the necessary rights to do so. A Contributor License Agreement is a lightweight agreement, signed by the copyright holder, that grants the necessary rights for the contribution to be redistributed as part of the project."_ [OSS Watch](http://oss-watch.ac.uk/resources/cla)
|
|
||||||
|
|
||||||
A CLA is a legal document in which you state _you are entitled to contribute the code/documentation/translation to the project_ you’re contributing to and that _you are willing to have it used in distributions and derivative works_. This means that should there be any kind of legal issue in the future as to the origins and ownership of any particular piece of code, then that project has the necessary forms on file from the contributor(s) saying they were permitted to make this contribution.
|
|
||||||
|
|
||||||
CLA is a safety because it also ensures that once you have provided a contribution, you cannot try to withdraw permission for its use at a later date. People can therefore use that software, confident that they will not be asked to stop using pieces of the code at a later date.
|
|
||||||
|
|
||||||
A __license__ grants "outbound" rights to the user of project.
|
|
||||||
|
|
||||||
A __CLA__ enables a contributor to grant "inbound" rights to a project.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<Other>
|
|
||||||
<A table should be maintained for relating maintainers and components. When triaging, this is essential to figure out if someone in particular should be consulted about specific changes.>
|
|
||||||
<A stable release cadence should be established, e.g.: every month.>
|
|
||||||
44
FIRMWARE.md
44
FIRMWARE.md
@ -1,44 +0,0 @@
|
|||||||

|
|
||||||
|
|
||||||
Alternative firmware for [ESP8266](https://en.wikipedia.org/wiki/ESP8266) based devices with **easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX**.
|
|
||||||
_Written for PlatformIO with limited support for Arduino IDE._
|
|
||||||
|
|
||||||
[](https://github.com/arendst/Tasmota/releases/latest)
|
|
||||||
[](https://github.com/arendst/Tasmota/releases/latest)
|
|
||||||
[](LICENSE.txt)
|
|
||||||
[](https://discord.gg/Ks2Kzd4)
|
|
||||||
|
|
||||||
If you like **Tasmota**, give it a star, or fork it and contribute!
|
|
||||||
|
|
||||||
[](https://github.com/arendst/Tasmota/stargazers)
|
|
||||||
[](https://github.com/arendst/Tasmota/network)
|
|
||||||
[](https://paypal.me/tasmota)
|
|
||||||
|
|
||||||
See [CHANGELOG.md](https://github.com/arendst/Tasmota/blob/development/CHANGELOG.md) for changes since last release.
|
|
||||||
|
|
||||||
## Development
|
|
||||||
|
|
||||||
[](https://github.com/arendst/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+ESP32+CI%22)
|
|
||||||
[](https://github.com/arendst/Tasmota/actions?query=workflow%3ABuild_firmware)
|
|
||||||
|
|
||||||
|
|
||||||
Unless your Tasmota powered device exhibits a problem or you need to make use of a feature that is not available in the Tasmota version currently installed on your device, leave your device alone - it works so don't make unnecessary changes! If the release version (i.e., the master branch) exhibits unexpected behaviour for your device and configuration, you should upgrade to the latest development version instead to see if your problem is resolved as some bugs in previous releases or development builds may already have been resolved.
|
|
||||||
|
|
||||||
If new commits have been merged and they compile successfully, new binary files for every variant will be placed here https://github.com/arendst/Tasmota-firmware/tree/main/firmware (this URL address can NOT be used for OTA updates) It is important to note that these binaries are based on the current development codebase. These commits are tested as much as is possible and are typically quite stable. However, it is infeasible to test on the hundreds of different types of devices with all the available configuration options permitted.
|
|
||||||
|
|
||||||
Note that there is a chance, as with any upgrade, that the device may not function as expected. You must always account for the possibility that you may need to flash the device via the serial programming interface if the OTA upgrade fails. Even with the master release, you should always attempt to test the device or a similar prototype before upgrading a device which is in production or is hard to reach. And, as always, make a backup of the device configuration before beginning any firmware update.
|
|
||||||
|
|
||||||
## Disclaimer
|
|
||||||
|
|
||||||
:warning: **DANGER OF ELECTROCUTION** :warning:
|
|
||||||
|
|
||||||
If your device connects to mains electricity (AC power) there is danger of electrocution if not installed properly. If you don't know how to install it, please call an electrician (***Beware:*** certain countries prohibit installation without a licensed electrician present). Remember: _**SAFETY FIRST**_. It is not worth the risk to yourself, your family and your home if you don't know exactly what you are doing. Never tinker or try to flash a device using the serial programming interface while it is connected to MAINS ELECTRICITY (AC power).
|
|
||||||
|
|
||||||
We don't take any responsibility nor liability for using this software nor for the installation or any tips, advice, videos, etc. given by any member of this site or any related site.
|
|
||||||
|
|
||||||
## Quick Install
|
|
||||||
Download one of the binaries https://github.com/arendst/Tasmota-firmware/tree/main/firmware and flash it to your hardware [using our installation guide](https://tasmota.github.io/docs/Getting-Started).
|
|
||||||
|
|
||||||
138
I2CDEVICES.md
138
I2CDEVICES.md
@ -1,138 +0,0 @@
|
|||||||
# I2C devices
|
|
||||||
Tasmota supports several I2C devices. To use them I2C and the device need to be enabled at compile time. I2C and some devices are supported also in the official releases. Devices can be de/-actived on runtime to solve possible address conflicts. (e.g. address 0x27 is used by multiple devices)
|
|
||||||
|
|
||||||
Using command ``I2cDriver`` individual drivers can be enabled or disabled at runtime allowing duplicate I2C addresses at compile time. Use the Index from the table below to control I2C drivers like ``I2cDriver10 0`` for disabling BMP support.
|
|
||||||
|
|
||||||
## Supported I2C devices
|
|
||||||
The following table lists the supported I2C devices
|
|
||||||
|
|
||||||
Index | Define | Driver | Device | Address(es) | Bus2 | Description
|
|
||||||
------|---------------------|----------|----------|-------------|------|-----------------------------------------------
|
|
||||||
1 | USE_PCA9685 | xdrv_15 | PCA9685 | 0x40 - 0x47 | | 16-channel 12-bit pwm driver
|
|
||||||
1 | USE_PCA9685_V2 | xdrv_15 | PCA9685 | 0x40 - 0x47 | | 16-channel 12-bit pwm driver
|
|
||||||
2 | USE_PCF8574 | xdrv_28 | PCF8574 | 0x20 - 0x26 | | 8-bit I/O expander (address range overridable)
|
|
||||||
2 | USE_PCF8574 | xdrv_28 | PCF8574A | 0x39 - 0x3F | | 8-bit I/O expander (address range overridable)
|
|
||||||
3 | USE_DISPLAY_LCD | xdsp_01 | | 0x27, 0x3F | | LCD display
|
|
||||||
4 | REMOVED | | | | | USE_DISPLAY_SSD1306 - REMOVED
|
|
||||||
5 | USE_DISPLAY_MATRIX | xdsp_03 | HT16K33 | 0x70 - 0x77 | | 8x8 led matrix
|
|
||||||
6 | REMOVED | | SH1106 | 0x3C - 0x3D | | USE_DISPLAY_SH1106 - REMOVED
|
|
||||||
7 | USE_ADE7953 | xnrg_07 | ADE7953 | 0x38 | | Energy monitor
|
|
||||||
8 | USE_SHT | xsns_07 | SHT1X | Any | | Temperature and Humidity sensor
|
|
||||||
9 | USE_HTU | xsns_08 | HTU21 | 0x40 | Yes | Temperature and Humidity sensor
|
|
||||||
9 | USE_HTU | xsns_08 | SI7013 | 0x40 | Yes | Temperature and Humidity sensor
|
|
||||||
9 | USE_HTU | xsns_08 | SI7020 | 0x40 | Yes | Temperature and Humidity sensor
|
|
||||||
9 | USE_HTU | xsns_08 | SI7021 | 0x40 | Yes | Temperature and Humidity sensor
|
|
||||||
10 | USE_BMP | xsns_09 | BMP085 | 0x76 - 0x77 | Yes | Pressure and temperature sensor
|
|
||||||
10 | USE_BMP | xsns_09 | BMP180 | 0x76 - 0x77 | Yes | Pressure and temperature sensor
|
|
||||||
10 | USE_BMP | xsns_09 | BMP280 | 0x76 - 0x77 | Yes | Pressure and temperature sensor
|
|
||||||
10 | USE_BMP | xsns_09 | BME280 | 0x76 - 0x77 | Yes | Pressure, temperature and humidity sensor
|
|
||||||
10 | USE_BMP | xsns_09 | BME680 | 0x76 - 0x77 | Yes | Pressure, temperature, humidity and gas sensor
|
|
||||||
11 | USE_BH1750 | xsns_10 | BH1750 | 0x23, 0x5C | Yes | Ambient light intensity sensor
|
|
||||||
12 | USE_VEML6070 | xsns_11 | VEML6070 | 0x38 - 0x39 | | Ultra violet light intensity sensor
|
|
||||||
13 | USE_ADS1115 | xsns_12 | ADS1115 | 0x48 - 0x4B | Yes | 4-channel 16-bit A/D converter
|
|
||||||
14 | USE_INA219 | xsns_13 | INA219 | 0x40 - 0x41, 0x44 - 0x45 | | Low voltage current sensor
|
|
||||||
15 | USE_SHT3X | xsns_14 | SHT3X | 0x44 - 0x45 | Yes | Temperature and Humidity sensor
|
|
||||||
15 | USE_SHT3X | xsns_14 | SHT4X | 0x44 - 0x46 | Yes | Temperature and Humidity sensor
|
|
||||||
15 | USE_SHT3X | xsns_14 | SHTCX | 0x70 | Yes | Temperature and Humidity sensor
|
|
||||||
16 | USE_TSL2561 | xsns_16 | TSL2561 | 0x29, 0x39, 0x49 | | Light intensity sensor
|
|
||||||
17 | USE_MGS | xsns_19 | Grove | 0x04 | | Multichannel gas sensor
|
|
||||||
18 | USE_SGP30 | xsns_21 | SGP30 | 0x58 | | Gas (TVOC) and air quality sensor
|
|
||||||
19 | USE_SI1145 | xsns_24 | SI1145 | 0x60 | Yes | Ultra violet index and light sensor
|
|
||||||
19 | USE_SI1145 | xsns_24 | SI1146 | 0x60 | Yes | Ultra violet index and light sensor
|
|
||||||
19 | USE_SI1145 | xsns_24 | SI1147 | 0x60 | Yes | Ultra violet index and light sensor
|
|
||||||
20 | USE_LM75AD | xsns_26 | LM75AD | 0x48 - 0x4F | Yes | Temperature sensor
|
|
||||||
21 | USE_APDS9960 | xsns_27 | APDS9960 | 0x39 | | Proximity ambient light RGB and gesture sensor
|
|
||||||
22 | USE_MCP230xx | xsns_29 | MCP23008 | 0x20 - 0x26 | | 8-bit I/O expander
|
|
||||||
22 | USE_MCP230xx | xsns_29 | MCP23017 | 0x20 - 0x26 | | 16-bit I/O expander
|
|
||||||
23 | USE_MPR121 | xsns_30 | MPR121 | 0x5A - 0x5D | | Proximity capacitive touch sensor
|
|
||||||
24 | USE_CCS811 | xsns_31 | CCS811 | 0x5A | | Gas (TVOC) and air quality sensor
|
|
||||||
24' | USE_CCS811_V2 | xsns_31 | CCS811 | 0x5A - 0x5B | | Gas (TVOC) and air quality sensor
|
|
||||||
25 | USE_MPU6050 | xsns_32 | MPU6050 | 0x68 - 0x69 | | 3-axis gyroscope and temperature sensor
|
|
||||||
26 | USE_DS3231 | xsns_33 | DS1307 | 0x68 | | Real time clock
|
|
||||||
26 | USE_DS3231 | xsns_33 | DS3231 | 0x68 | | Real time clock
|
|
||||||
27 | USE_MGC3130 | xsns_36 | MGC3130 | 0x42 | | Electric field sensor
|
|
||||||
28 | USE_MAX44009 | xsns_41 | MAX44009 | 0x4A - 0x4B | | Ambient light intensity sensor
|
|
||||||
29 | USE_SCD30 | xsns_42 | SCD30 | 0x61 | | CO2 sensor
|
|
||||||
30 | USE_SPS30 | xsns_44 | SPS30 | 0x69 | | Particle sensor
|
|
||||||
31 | USE_VL53L0X | xsns_45 | VL53L0X | 0x29 | | Time-of-flight (ToF) distance sensor
|
|
||||||
32 | USE_MLX90614 | xsns_46 | MLX90614 | 0x5A | | Infra red temperature sensor
|
|
||||||
33 | USE_CHIRP | xsns_48 | CHIRP | 0x20 | | Soil moisture sensor
|
|
||||||
34 | USE_PAJ7620 | xsns_50 | PAJ7620 | 0x73 | | Gesture sensor
|
|
||||||
35 | USE_INA226 | xsns_54 | INA226 | 0x40 - 0x41, 0x44 - 0x45 | | Low voltage current sensor
|
|
||||||
36 | USE_HIH6 | xsns_55 | HIH6130 | 0x27 | | Temperature and Humidity sensor
|
|
||||||
37 | USE_24C256 | xdrv_10 | 24C256 | 0x50 | | Scripter EEPROM storage
|
|
||||||
38 | USE_DISPLAY_ILI9488 | xdsp_08 | FT6236 | 0x38 | | Touch panel controller
|
|
||||||
39 | USE_DISPLAY_RA8876 | xdsp_10 | FT5316 | 0x38 | | Touch panel controller
|
|
||||||
40 | USE_TSL2591 | xsns_57 | TSL2591 | 0x29 | | Light intensity sensor
|
|
||||||
41 | USE_DHT12 | xsns_58 | DHT12 | 0x5C | | Temperature and humidity sensor
|
|
||||||
42 | USE_DS1624 | xsns_59 | DS1621 | 0x48 - 0x4F | | Temperature sensor
|
|
||||||
42 | USE_DS1624 | xsns_59 | DS1624 | 0x48 - 0x4F | | Temperature sensor
|
|
||||||
43 | USE_AHT1x | xsns_63 | AHT10/15 | 0x38 - 0x39 | | Temperature and humidity sensor
|
|
||||||
43 | USE_AHT2x | xsns_63 | AHT20 | 0x38 | | Temperature and humidity sensor
|
|
||||||
43 | USE_AHT2x | xsns_63 | AM2301B | 0x38 | | Temperature and humidity sensor
|
|
||||||
44 | USE_WEMOS_MOTOR_V1 | xdrv_34 | | 0x2D - 0x30 | | WEMOS motor shield v1.0.0 (6612FNG)
|
|
||||||
45 | USE_HDC1080 | xsns_65 | HDC1080 | 0x40 | | Temperature and Humidity sensor
|
|
||||||
46 | USE_IAQ | xsns_66 | IAQ | 0x5a | Yes | Air quality sensor
|
|
||||||
47 | USE_DISPLAY_SEVENSEG| xdsp_11 | HT16K33 | 0x70 - 0x77 | | Seven segment LED
|
|
||||||
48 | USE_AS3935 | xsns_67 | AS3935 | 0x03 | | Franklin Lightning Sensor
|
|
||||||
49 | USE_VEML6075 | xsns_70 | VEML6075 | 0x10 | | UVA/UVB/UVINDEX Sensor
|
|
||||||
50 | USE_VEML7700 | xsns_71 | VEML7700 | 0x10 | | Ambient light intensity sensor
|
|
||||||
51 | USE_MCP9808 | xsns_72 | MCP9808 | 0x18 - 0x1F | | Temperature sensor
|
|
||||||
52 | USE_HP303B | xsns_73 | HP303B | 0x76 - 0x77 | | Pressure and temperature sensor
|
|
||||||
53 | USE_MLX90640 | xdrv_43 | MLX90640 | 0x33 | | IR array temperature sensor
|
|
||||||
54 | USE_VL53L1X | xsns_77 | VL53L1X | 0x29 | | Time-of-flight (ToF) distance sensor
|
|
||||||
55 | USE_EZOPH | xsns_78 | EZOPH | 0x61 - 0x70 | | pH sensor
|
|
||||||
55 | USE_EZOORP | xsns_78 | EZOORP | 0x61 - 0x70 | | ORP sensor
|
|
||||||
55 | USE_EZORTD | xsns_78 | EZORTD | 0x61 - 0x70 | | Temperature sensor
|
|
||||||
55 | USE_EZOHUM | xsns_78 | EZOHUM | 0x61 - 0x70 | | Humidity sensor
|
|
||||||
55 | USE_EZOEC | xsns_78 | EZOEC | 0x61 - 0x70 | | Electric conductivity sensor
|
|
||||||
55 | USE_EZOCO2 | xsns_78 | EZOCO2 | 0x61 - 0x70 | | CO2 sensor
|
|
||||||
55 | USE_EZOO2 | xsns_78 | EZOO2 | 0x61 - 0x70 | | O2 sensor
|
|
||||||
55 | USE_EZOPRS | xsns_78 | EZOPRS | 0x61 - 0x70 | | Pressure sensor
|
|
||||||
55 | USE_EZOFLO | xsns_78 | EZOFLO | 0x61 - 0x70 | | Flow meter sensor
|
|
||||||
55 | USE_EZODO | xsns_78 | EZODO | 0x61 - 0x70 | | Disolved Oxygen sensor
|
|
||||||
55 | USE_EZORGB | xsns_78 | EZORGB | 0x61 - 0x70 | | Color sensor
|
|
||||||
55 | USE_EZOPMP | xsns_78 | EZOPMP | 0x61 - 0x70 | | Peristaltic Pump
|
|
||||||
56 | USE_SEESAW_SOIL | xsns_81 | SEESOIL | 0x36 - 0x39 | | Adafruit seesaw soil moisture sensor
|
|
||||||
57 | USE_TOF10120 | xsns_84 | TOF10120 | 0x52 | | Time-of-flight (ToF) distance sensor
|
|
||||||
58 | USE_MPU_ACCEL | xsns_85 | MPU_ACCEL| 0x68 | Yes | MPU6886/MPU9250 6-axis MotionTracking sensor from M5Stack
|
|
||||||
59 | USE_BM8563 | xdrv_56 | BM8563 | 0x51 | Yes | BM8563 RTC from M5Stack
|
|
||||||
60 | USE_AM2320 | xsns_88 | AM2320 | 0x5C | | Temperature and Humidity sensor
|
|
||||||
61 | USE_T67XX | xsns_89 | T67XX | 0x15 | | CO2 sensor
|
|
||||||
62 | USE_SCD40 | xsns_92 | SCD40 | 0x62 | | CO2 sensor Sensirion SCD40/SCD41
|
|
||||||
63 | USE_HM330X | xsns_93 | HM330X | 0x40 | | Particule sensor
|
|
||||||
64 | USE_HDC2010 | xsns_94 | HDC2010 | 0x40 | | Temperature and Humidity sensor
|
|
||||||
65 | USE_ADE7880 | xnrg_23 | ADE7880 | 0x38 | | Energy monitor
|
|
||||||
66 | USE_PCF85363 | xsns_99 | PCF85363 | 0x51 | | Real time clock
|
|
||||||
67 | USE_DS3502 | xdrv_61 | DS3502 | 0x28 - 0x2B | | Digital potentiometer
|
|
||||||
68 | USE_HYT | xsns_97 | HYTxxx | 0x28 | Yes | Temperature and Humidity sensor
|
|
||||||
69 | USE_SGP40 | xsns_98 | SGP40 | 0x59 | | Gas (TVOC) and air quality
|
|
||||||
70 | USE_LUXV30B | xsns_99 | LUXV30B | 0x4A | | DFRobot SEN0390 V30B lux sensor
|
|
||||||
71 | USE_QMC5883L | xsns_33 | QMC5883L | 0x0D | | Magnetic Field Sensor
|
|
||||||
72 | USE_INA3221 | xsns_100 | INA3221 | 0x40-0x43 | | 3-channels Voltage and Current sensor
|
|
||||||
73 | USE_HMC5883L | xsns_101 | HMC5883L | 0x1E | | 3-channels Magnetic Field Sensor
|
|
||||||
74 | USE_DISPLAY_TM1650 | xdsp_20 | TM1650 | 0x24 - 0x27, 0x34 - 0x37 | | Four-digit seven-segment LED controller
|
|
||||||
75 | USE_PCA9632 | xdrv_64 | PCA9632 | 0x60 | | 4-channel 4-bit pwm driver
|
|
||||||
76 | USE_SEN5X | xsns_103 | SEN5X | 0x69 | Yes | Gas (VOC/NOx index) and air quality (PPM <1,<2.5,<4,<10)
|
|
||||||
77 | USE_MCP23XXX_DRV | xdrv_67 | MCP23x17 | 0x20 - 0x26 | | 16-bit I/O expander as virtual button/switch/relay
|
|
||||||
78 | USE_PMSA003I | xsns_104 | PMSA003I | 0x12 | | PM2.5 Air Quality Sensor with I2C Interface
|
|
||||||
79 | USE_GDK101 | xsns_106 | GDK101 | 0x18 - 0x1B | | Gamma Radiation Sensor
|
|
||||||
80 | USE_TC74 | xsns_108 | TC74 | 0x48 - 0x4F | | Temperature sensor
|
|
||||||
81 | USE_PCA9557 | xdrv_69 | PCA95xx | 0x18 - 0x1F | | 8-bit I/O expander as virtual button/switch/relay
|
|
||||||
82 | USE_SGP4X | xsns_109 | SGP4X | 0x59 | | Gas (TVOC/NOx index)
|
|
||||||
83 | USE_MAX17043 | xsns_110 | MAX17043 | 0x36 | | Fuel-gauge for 3.7 Volt Lipo battery
|
|
||||||
84 | USE_ENS16x | xsns_111 | ENS16x | 0x52 - 0x53 | | Gas (TVOC, eCO2) and air quality sensor
|
|
||||||
85 | USE_ENS210 | xsns_112 | ENS210 | 0x43 - 0x44 | | Temperature and humidity sensor
|
|
||||||
86 | USE_AMSX915 | xsns_114 | AMS6915 | 0x28 | | Pressure (absolute/differential) and temperature sensor
|
|
||||||
87 | USE_SPL06_007 | xsns_25 | SPL06-007 | 0x76 | | Pressure and temperature sensor
|
|
||||||
88 | USE_QMP6988 | xsns_28 | QMP6988 | 0x56, 0x70 | Yes | Pressure and temperature sensor
|
|
||||||
89 | USE_HX711_M5SCALES | xsns_34 | M5SCALES | 0x26 | Yes | M5Unit (Mini)Scales(HX711 STM32) U177
|
|
||||||
90 | USE_RX8010 | xdrv_56 | RX8010 | 0x32 | Yes | RX8010 RTC from IOTTIMER
|
|
||||||
90 | USE_RX8030 | xdrv_56 | RX8030 | 0x32 | Yes | RX8030 RTC from #23855
|
|
||||||
91 | USE_MS5837 | xsns_116 | MS5837 | 0x76 | | Pressure and temperature sensor
|
|
||||||
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
|
|
||||||
95 | USE_AGS02MA | xsns_118 | AGS02MA | 0x1A | | TVOC Gas sensor
|
|
||||||
|
|
||||||
NOTE: Bus2 supported on ESP32 only.
|
|
||||||
@ -1,4 +1,6 @@
|
|||||||
Copyright 2017 Felix Galindo
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 mgeppert
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
674
LICENSE.txt
674
LICENSE.txt
@ -1,674 +0,0 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
{one line to give the program's name and a brief idea of what it does.}
|
|
||||||
Copyright (C) {year} {name of author}
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
{project} Copyright (C) {year} {fullname}
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
|
||||||
<http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
||||||
97
MODULES.md
97
MODULES.md
@ -1,97 +0,0 @@
|
|||||||
## Supported Modules
|
|
||||||
|
|
||||||
### ESP8266 based
|
|
||||||
The following ESP8266 based hardware modules are supported.
|
|
||||||
|
|
||||||
Module | LCode | Description
|
|
||||||
-------------------|-------|-----------------------
|
|
||||||
01 Sonoff Basic | | Sonoff Basic Wi-Fi Smart Switch
|
|
||||||
02 Sonoff RF | | Sonoff RF Wi-Fi Smart Switch with RF (434MHz) receiver
|
|
||||||
03 Sonoff SV | | Sonoff SV Safe Voltage Wi-Fi Smart Switch
|
|
||||||
04 Sonoff TH | | Sonoff TH10/TH16 Wi-Fi Smart Switch with Sensor connection
|
|
||||||
05 Sonoff Dual | x | Sonoff Dual Wi-Fi Smart Switch
|
|
||||||
06 Sonoff Pow | | Sonoff Pow Wi-Fi Smart Switch with Energy Monitoring
|
|
||||||
07 Sonoff 4CH | | Sonoff 4CH 4-gang Wi-Fi Smart Switch
|
|
||||||
08 Sonoff S2X | | Sonoff S20/S26 Wi-Fi Smart Socket
|
|
||||||
09 Slampher | | Sonoff Slampher Wi-Fi Smart Light Bulb Socket with RF (434MHz) receiver
|
|
||||||
10 Sonoff Touch | x | Sonoff Touch Wi-Fi Light Switch
|
|
||||||
11 Sonoff LED | x | Sonoff Led Wi-Fi Led Pack (Retired)
|
|
||||||
12 1 Channel | | 1 Channel Inching/Self Locking Wi-Fi Switch 5V/12V
|
|
||||||
13 4 Channel | x | 4 Channel Inching/Self Locking Wi-Fi Switch (Retired)
|
|
||||||
14 Motor C/AC | x | Motor Clockwise/Antoclockwise Wi-Fi Switch (Retired)
|
|
||||||
15 ElectroDragon | | Electrodragon Wi-Fi IoT Board
|
|
||||||
16 EXS Relay(s) | x | Electronic Experience Store 1 or 2-gang Wi-Fi Module
|
|
||||||
17 WiOn | | WiOn Wi-Fi Smart Socket
|
|
||||||
18 Generic | x | Any ESP8266/ESP8285 device like WeMos and NodeMCU
|
|
||||||
19 Sonoff Dev | | Sonoff Dev Wi-Fi Development Board
|
|
||||||
20 H801 | x | H801 Wi-Fi 5 Channel LED Controller
|
|
||||||
21 Sonoff SC | x | Sonoff SC Wi-Fi Environmental Monitor
|
|
||||||
22 Sonoff BN-SZ | x | Sonoff BN-SZ01 Wi-Fi Ceiling Led (Retired)
|
|
||||||
23 Sonoff 4CH Pro | x | Sonoff 4CH Pro 4-gang Wi-Fi Smart Switch
|
|
||||||
24 Huafan SS | | HuaFan Wi-Fi Smart Socket
|
|
||||||
25 Sonoff Bridge | x | Sonoff RF (434MHz) transceive to Wi-Fi Bridge
|
|
||||||
26 Sonoff B1 | x | Sonoff B1 Wi-Fi RGBWW Led Bulb
|
|
||||||
27 AiLight | x | Ai-Thinker RGBW Led Bulb
|
|
||||||
28 Sonoff T1 1CH | x | Sonoff T1 1-gang Wi-Fi Light Switch
|
|
||||||
29 Sonoff T1 2CH | x | Sonoff T1 2-gang Wi-Fi Light Switch
|
|
||||||
30 Sonoff T1 3CH | x | Sonoff T1 3-gang Wi-Fi Light Switch
|
|
||||||
31 Supla Espablo | | 2-gang Wi-Fi Module
|
|
||||||
32 Witty Cloud | | Witty Cloud ESP8266 Wi-Fi Development Board
|
|
||||||
33 Yunshan Relay | | ESP8266 Wi-Fi Network Relay Module
|
|
||||||
34 MagicHome | | MagicHome, Flux-light and some Arilux LC10 RGB(W) Led Controller
|
|
||||||
35 Luani HVIO | | Luani ESP8266 Wi-Fi I/O Module
|
|
||||||
36 KMC 70011 | | KMC Wi-Fi Smart Socket with Energy Monitoring
|
|
||||||
37 Arilux LC01 | | Arilux AL-LC01 RGB Led Controller
|
|
||||||
38 Arilux LC11 | | Arilux AL-LC11 RGBWW Led Controller
|
|
||||||
39 Sonoff Dual R2 | x | Sonoff Dual R2 Wi-Fi Smart Switch
|
|
||||||
40 Arilux LC06 | | Arilux AL-LC06 RGB(WW) Led Controller
|
|
||||||
41 Sonoff S31 | | Sonoff S31 Wi-Fi Smart Socket with Energy Monitoring
|
|
||||||
42 Zengge WF017 | | Zengge WF017 Wi-Fi RGB(W) Led Controller
|
|
||||||
43 Sonoff Pow R2 | | Sonoff Pow R2 Wi-Fi Smart Switch with Energy Monitoring
|
|
||||||
44 Sonoff iFan02 | x | Sonoff iFan02 Wi-Fi Smart Ceiling Fan with Light
|
|
||||||
45 BlitzWolf SHP | | BlitzWolf BW-SHP2, BW-SHP6, HomeCube SP1, Gosund SP111, Teckin SP22 Wi-Fi Smart Switch with Energy Monitoring
|
|
||||||
46 Shelly 1 | | Shelly 1 Open Source Wi-Fi Relay Module
|
|
||||||
47 Shelly 2 | | Shelly 2 Wi-Fi 2-gang Relay Module with Energy Monitoring
|
|
||||||
48 Xiaomi Philips | x | Xiaomi Philips Wi-Fi WW Led Bulb
|
|
||||||
49 Neo Coolcam | | Neo Coolcam Wi-Fi Smart Socket
|
|
||||||
50 ESP Switch | | ESP Switch 4-gang Wi-Fi Switch with Leds
|
|
||||||
51 OBI Socket | | OBI Wi-Fi Smart Socket
|
|
||||||
52 Teckin | | Teckin SP22 Wi-Fi Smart Switch with Energy Monitoring
|
|
||||||
53 AplicWDP303075 | | Aplic WDP 303075 CSL Wi-Fi Smart Switch with Energy Monitoring
|
|
||||||
54 TuyaMCU | x | Devices with an MCU using Tuya communication protocol for control
|
|
||||||
55 Gosund SP1 v23 | | Gosund SP1 v2.3 Wi-Fi Smart Switch with Energy Monitoring
|
|
||||||
56 ARMTR Dimmer | x | ARMtronix Wi-Fi dimmer for Incandescent Lights and Led
|
|
||||||
57 SK03 Outdoor | x | SK03 Outdoor Wi-Fi Smart Switch with Energy Monitoring
|
|
||||||
58 PS-16-DZ | x | PS-16-DZ Wi-Fi dimmer for Incandescent Lights and Led
|
|
||||||
59 Teckin US | | Teckin SP20 and ZooZee SA102 Wi-Fi Smart Switch with Energy Monitoring
|
|
||||||
60 Manzoku strip | | Manzoku Wi-Fi Smart Power Strip with four Relays
|
|
||||||
61 OBI Socket 2 | | OBI 2 Wi-Fi Smart Socket
|
|
||||||
62 YTF IR Bridge | x | YTF Universal IR Bridge
|
|
||||||
63 Digoo DG-SP202 | | Digoo DG-SP202 Dual Wi-Fi Smart Switch with Energy Monitoring
|
|
||||||
64 KA10 | | Smanergy KA10 Wi-Fi Smart Wall Switch with Energy Monitoring
|
|
||||||
65 Luminea ZX2820 | | Luminea ZX2820 Wi-Fi Smart Switch with Energy Monitoring
|
|
||||||
66 Mi Desk Lamp | | Mi Desk Lamp with rotary switch and Wi-Fi
|
|
||||||
67 SP10 | | Tuya SP10 Wi-Fi Smart Switch with Energy Monitoring
|
|
||||||
68 WAGA CHCZ02MB | | WAGA life CHCZ02MB Wi-Fi Smart Switch with Energy Monitoring
|
|
||||||
69 SYF05 | | Sunyesmart SYF05 RGBWW Wi-Fi Led Bulb
|
|
||||||
70 Sonoff L1 | x | Sonoff L1 light strip
|
|
||||||
71 Sonoff iFan03 | x | Sonoff iFan03 Wi-Fi Smart Ceiling Fan with Light
|
|
||||||
72 EXS Dimmer | x | EXS Wi-Fi Dimmer v4
|
|
||||||
73 PWM Dimmer | x | Martin Jerry/acenx/Tessan/NTONPOWER SD0x PWM Dimmer Switches
|
|
||||||
74 Sonoff D1 | x | Sonoff D1 Wi-Fi and RF Dimmer
|
|
||||||
75 Sonoff ZbBridge | x | Sonoff Zigbee bridge
|
|
||||||
|
|
||||||
### ESP32 based
|
|
||||||
The following ESP32 based hardware modules are supported.
|
|
||||||
|
|
||||||
Module | LCode | Description
|
|
||||||
-------------------|-------|-----------------------
|
|
||||||
01 ESP32-DevKit | x | Any ESP32 device
|
|
||||||
02 ESP32-Cam | x | ESP32 webcam
|
|
||||||
03 Odroid Go | x | Odroid Go
|
|
||||||
04 ESP32-Solo | x | ESP32-Solo
|
|
||||||
05 WT32-Eth01 | x | WT32-Eth01 ethernet
|
|
||||||
06 TTGO Watch | x | TTGO Watch
|
|
||||||
07 M5Stack Core2 | x | M5Stack Core2
|
|
||||||
|
|
||||||
Over 2800 additional devices are supported using [templates](TEMPLATES.md).
|
|
||||||
176
README.md
176
README.md
@ -1,175 +1,3 @@
|
|||||||

|
# Tasmota
|
||||||
|
|
||||||
Alternative firmware for [ESP8266](https://en.wikipedia.org/wiki/ESP8266) and [ESP32](https://en.wikipedia.org/wiki/ESP32) based devices with **easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX**.
|
Local copy of the https://github.com/arendst/Tasmota#
|
||||||
_Written for PlatformIO._
|
|
||||||
|
|
||||||
[](http://ota.tasmota.com/tasmota/release)
|
|
||||||
[](https://github.com/arendst/Tasmota/releases/latest)
|
|
||||||
[](LICENSE.txt)
|
|
||||||
[](https://discord.gg/Ks2Kzd4)
|
|
||||||
|
|
||||||
<hr></hr>
|
|
||||||
|
|
||||||
**In light of current events we like to support the people behind _PlatformIO Project_, especially Ivan Kravets, and wish them the strength to help stop the war. See [platformio-is-ukrainian-project-please-help-us-stop-the-war](https://community.platformio.org/t/platformio-is-ukrainian-project-please-help-us-stop-the-war/26330) for what you can do.**
|
|
||||||
|
|
||||||
<hr></hr>
|
|
||||||
|
|
||||||
## Easy install
|
|
||||||
|
|
||||||
Easy initial installation of Tasmota can be performed using the [Tasmota WebInstaller](https://tasmota.github.io/install/).
|
|
||||||
|
|
||||||
If you like **Tasmota**, give it a star, or fork it and contribute!
|
|
||||||
|
|
||||||
[](https://github.com/arendst/Tasmota/stargazers)
|
|
||||||
[](https://github.com/arendst/Tasmota/network)
|
|
||||||
[](https://paypal.me/tasmota)
|
|
||||||
|
|
||||||
See [RELEASENOTES.md](https://github.com/arendst/Tasmota/blob/master/RELEASENOTES.md) for release information.
|
|
||||||
|
|
||||||
Firmware binaries can be downloaded from http://ota.tasmota.com/tasmota/release/ or http://ota.tasmota.com/tasmota32/release/ for ESP32 binaries.
|
|
||||||
|
|
||||||
## Development
|
|
||||||
|
|
||||||
[](https://github.com/arendst/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/Tasmota_build_devel.yml)
|
|
||||||
|
|
||||||
See [CHANGELOG.md](CHANGELOG.md) for detailed change information.
|
|
||||||
|
|
||||||
Unless your Tasmota powered device exhibits a problem or lacks a feature that you need, leave your device alone - it works so don’t make unnecessary changes! If the release version (i.e., the master branch) exhibits unexpected behaviour for your device and configuration, you should upgrade to the latest development version instead to see if your problem is resolved as some bugs in previous releases or development builds may already have been resolved.
|
|
||||||
|
|
||||||
Every commit made to the development branch, which is compiling successfully, will post new binary files at http://ota.tasmota.com/tasmota/ (this web address can be used for OTA updates too). It is important to note that these binaries are based on the current development codebase. These commits are tested as much as is possible and are typically quite stable. However, it is infeasible to test on the hundreds of different types of devices with all the available configuration options permitted.
|
|
||||||
|
|
||||||
Note that there is a chance, as with any upgrade, that the device may not function as expected. You must always account for the possibility that you may need to flash the device via the serial programming interface if the OTA upgrade fails. Even with the master release, you should always attempt to test the device or a similar prototype before upgrading a device which is in production or is hard to reach. And, as always, make a backup of the device configuration before beginning any firmware update.
|
|
||||||
|
|
||||||
## Disclaimer
|
|
||||||
|
|
||||||
:warning: **DANGER OF ELECTROCUTION** :warning:
|
|
||||||
|
|
||||||
If your device connects to mains electricity (AC power) there is danger of electrocution if not installed properly. If you don't know how to install it, please call an electrician (***Beware:*** certain countries prohibit installation without a licensed electrician present). Remember: _**SAFETY FIRST**_. It is not worth the risk to yourself, your family and your home if you don't know exactly what you are doing. Never tinker or try to flash a device using the serial programming interface while it is connected to MAINS ELECTRICITY (AC power).
|
|
||||||
|
|
||||||
We don't take any responsibility nor liability for using this software nor for the installation or any tips, advice, videos, etc. given by any member of this site or any related site.
|
|
||||||
|
|
||||||
## Note
|
|
||||||
|
|
||||||
Please do not ask to add new devices unless it requires additional code for new features. If the device is not listed as a module, try using [Templates](https://tasmota.github.io/docs/Templates) first. If it is not listed in the [Tasmota Device Templates Repository](http://templates.blakadder.com) create your own [Template](https://tasmota.github.io/docs/Templates#creating-your-template).
|
|
||||||
|
|
||||||
## Quick Install
|
|
||||||
Download one of the released binaries from http://ota.tasmota.com/tasmota/release/ or http://ota.tasmota.com/tasmota32/release/ and flash it to your hardware [using our installation guide](https://tasmota.github.io/docs/Getting-Started).
|
|
||||||
|
|
||||||
## Important User Compilation Information
|
|
||||||
If you want to compile Tasmota yourself keep in mind the following:
|
|
||||||
|
|
||||||
- For ESP8285 based devices only Flash Mode **DOUT** is supported. Do not use Flash Mode DIO / QIO / QOUT as it might seem to brick your device.
|
|
||||||
- For ESP8285 based devices Tasmota uses a 1M linker script WITHOUT spiffs **1M (no SPIFFS)** for optimal code space.
|
|
||||||
- To make compile time changes to Tasmota use the `user_config_override.h` file. It assures keeping your custom settings when you download and compile a new version. You have to make a copy from the provided `user_config_override_sample.h` file and add your setting overrides.
|
|
||||||
|
|
||||||
## Configuration Information
|
|
||||||
|
|
||||||
Please refer to the installation and configuration articles in our [documentation](https://tasmota.github.io/docs).
|
|
||||||
|
|
||||||
## Migration Information
|
|
||||||
|
|
||||||
See [migration path](https://tasmota.github.io/docs/Upgrading#migration-path) for instructions how to migrate to a major version.
|
|
||||||
|
|
||||||
**Do not upgrade from minimal to minimal version. It will most likely fail at some point and will require flashing via serial.** If you do have to use minimal versions, always OTA to a full version of the same release before applying next minimal version.
|
|
||||||
|
|
||||||
Pay attention to the following version breaks due to dynamic settings updates:
|
|
||||||
|
|
||||||
1. Migrate to **Sonoff-Tasmota 3.9.x**
|
|
||||||
2. Migrate to **Sonoff-Tasmota 4.x**
|
|
||||||
3. Migrate to **Sonoff-Tasmota 5.14**
|
|
||||||
4. Migrate to **Sonoff-Tasmota 6.7.1** (http://ota.tasmota.com/tasmota/release_6.7.1/sonoff.bin) - NOTICE underscore as a dash is not supported in older versions
|
|
||||||
5. Migrate to **Tasmota 7.2.0** (http://ota.tasmota.com/tasmota/release-7.2.0/tasmota.bin)
|
|
||||||
|
|
||||||
--- Major change in parameter storage layout ---
|
|
||||||
|
|
||||||
6. Migrate to **Tasmota 8.5.1** (http://ota.tasmota.com/tasmota/release-8.5.1/tasmota.bin)
|
|
||||||
|
|
||||||
--- Major change in internal GPIO function representation ---
|
|
||||||
|
|
||||||
7. Migrate to **Tasmota 9.1** (http://ota.tasmota.com/tasmota/release-9.1.0/tasmota.bin.gz)
|
|
||||||
8. Upgrade to **latest release** (http://ota.tasmota.com/tasmota/release/tasmota.bin.gz)
|
|
||||||
|
|
||||||
While fallback or downgrading is common practice it was never supported due to Settings additions or changes in newer releases. Starting with release **v9.1.0 Imogen** the internal GPIO function representation has changed in such a way that fallback is only possible to the latest GPIO configuration before installing **v9.1.0**.
|
|
||||||
|
|
||||||
## Support Information
|
|
||||||
|
|
||||||
<img src="https://user-images.githubusercontent.com/5904370/68332933-e6e5a600-00d7-11ea-885d-50395f7239a1.png" width=150 align="right" />
|
|
||||||
|
|
||||||
For a database of supported devices see [Tasmota Device Templates Repository](https://templates.blakadder.com)
|
|
||||||
|
|
||||||
If you're looking for support on **Tasmota** there are some options available:
|
|
||||||
|
|
||||||
### Documentation
|
|
||||||
|
|
||||||
* [Documentation Site](https://tasmota.github.io/docs): For information on how to flash Tasmota, configure, use and expand it
|
|
||||||
* [FAQ and Troubleshooting](https://tasmota.github.io/docs/FAQ/): For information on common problems and solutions.
|
|
||||||
* [Commands Information](https://tasmota.github.io/docs/Commands): For information on all the commands supported by Tasmota.
|
|
||||||
|
|
||||||
### Support's Community
|
|
||||||
|
|
||||||
* [Tasmota Discussions](https://github.com/arendst/Tasmota/discussions): For Tasmota usage questions, Feature Requests and Projects.
|
|
||||||
* [Tasmota Users Chat](https://discord.gg/Ks2Kzd4): For support, troubleshooting and general questions. You have better chances to get fast answers from members of the Tasmota Community.
|
|
||||||
* [Search in Issues](https://github.com/arendst/Tasmota/issues): You might find an answer to your question by searching current or closed issues.
|
|
||||||
* [Software Problem Report](https://github.com/arendst/Tasmota/issues/new?template=Bug_report.md): For reporting problems of Tasmota Software.
|
|
||||||
|
|
||||||
### Unofficial Community Resources
|
|
||||||
* [Tasmota-DE](https://t.me/TasmotaDE): A German-language Telegram group related to Tasmota.
|
|
||||||
|
|
||||||
## Contribute
|
|
||||||
|
|
||||||
You can contribute to Tasmota by
|
|
||||||
- Providing Pull Requests (Features, Proof of Concepts, Language files or Fixes)
|
|
||||||
- Testing new released features and report issues
|
|
||||||
- Donating to acquire hardware for testing and implementing or out of gratitude
|
|
||||||
- Contributing missing [documentation](https://tasmota.github.io/docs) for features and devices
|
|
||||||
|
|
||||||
[](https://paypal.me/tasmota)
|
|
||||||
|
|
||||||
## Credits
|
|
||||||
|
|
||||||
People helping to keep the show on the road:
|
|
||||||
- Sfromis providing extensive user support
|
|
||||||
- Barbudor providing user support and code fixes and additions
|
|
||||||
- David Lang providing initial issue resolution and code optimizations
|
|
||||||
- Heiko Krupp for his IRSend, HTU21, SI70xx and Wemo/Hue emulation drivers
|
|
||||||
- Wiktor Schmidt for Travis CI implementation
|
|
||||||
- Thom Dietrich for PlatformIO optimizations
|
|
||||||
- Marinus van den Broek for his EspEasy groundwork
|
|
||||||
- Pete Ba for more user friendly energy monitor calibration
|
|
||||||
- Lobradov providing compile optimization tips
|
|
||||||
- Flexiti for his initial timer implementation
|
|
||||||
- reloxx13 for his [TasmoAdmin](https://github.com/reloxx13/TasmoAdmin) management tool
|
|
||||||
- Joachim Banzhaf for his TSL2561 library and driver
|
|
||||||
- Andre Thomas for providing many drivers
|
|
||||||
- Gijs Noorlander for his MHZ19, SenseAir and updated PubSubClient drivers
|
|
||||||
- Erik Montnemery for his HomeAssistant Discovery concept and many code tuning tips
|
|
||||||
- Federico Leoni for continued HomeAssistant Discovery support
|
|
||||||
- Aidan Mountford for his HSB support
|
|
||||||
- Daniel Ztolnai for his Serial Bridge implementation
|
|
||||||
- Gerhard Mutz for multiple sensor & display drivers, Sunrise/Sunset, and scripting
|
|
||||||
- Nuno Ferreira for his HC-SR04 driver
|
|
||||||
- Adrian Scillato for his (security)fixes and implementing and maintaining KNX
|
|
||||||
- Gennaro Tortone for implementing and maintaining Eastron drivers
|
|
||||||
- Raymond Mouthaan for managing Wemos Wiki information
|
|
||||||
- Norbert Richter for his [decode-config.py](https://github.com/tasmota/decode-config) tool
|
|
||||||
- Joel Stein, digiblur and Shantur Rathore for their Tuya research and driver
|
|
||||||
- Frogmore42 for providing many issue answers
|
|
||||||
- Jason2866 for platformio support and providing many issue answers
|
|
||||||
- Blakadder for managing the document site and providing template management
|
|
||||||
- Stephan Hadinger for refactoring light driver, enhancing HueEmulation, LVGL, Zigbee and Berry support
|
|
||||||
- tmo for designing the official Tasmota logo
|
|
||||||
- Stefan Bode for his Shutter and Deep sleep drivers
|
|
||||||
- Jacek Ziółkowski for his [TDM](https://github.com/jziolkowski/tdm) management tool and [Tasmotizer](https://github.com/tasmota/tasmotizer) flashing tool
|
|
||||||
- Christian Staars for NRF24L01 and HM-10 Bluetooth sensor support
|
|
||||||
- Paul Diem for UDP Group communication support
|
|
||||||
- Jörg Schüler-Maroldt for his initial ESP32 port
|
|
||||||
- Javier Arigita for his thermostat driver
|
|
||||||
- Simon Hailes for ESP32 Bluetooth extensions
|
|
||||||
- Many more providing Tips, Wips, Pocs, PRs and Donations
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
This program is licensed under GPL-3.0-only
|
|
||||||
159
RELEASENOTES.md
159
RELEASENOTES.md
@ -1,159 +0,0 @@
|
|||||||
<picture>
|
|
||||||
<source media="(prefers-color-scheme: dark)" srcset="./tools/logo/TASMOTA_FullLogo_Vector_White.svg">
|
|
||||||
<img alt="Logo" src="./tools/logo/TASMOTA_FullLogo_Vector.svg" align="right" height="76">
|
|
||||||
</picture>
|
|
||||||
|
|
||||||
# RELEASE NOTES
|
|
||||||
|
|
||||||
## Migration Information
|
|
||||||
|
|
||||||
**This version removes support for direct migration from versions before v8.1.0 (Doris)**
|
|
||||||
|
|
||||||
See [migration path](https://tasmota.github.io/docs/Upgrading#migration-path) for instructions how to migrate to a major version.
|
|
||||||
|
|
||||||
**Do not upgrade from minimal to minimal version. It will most likely fail at some point and will require flashing via serial.** If you do have to use minimal versions, always OTA to a full version of the same release before applying next minimal version.
|
|
||||||
|
|
||||||
Pay attention to the following version breaks due to dynamic settings updates:
|
|
||||||
|
|
||||||
1. Migrate to **Sonoff-Tasmota 3.9.x**
|
|
||||||
2. Migrate to **Sonoff-Tasmota 4.x**
|
|
||||||
3. Migrate to **Sonoff-Tasmota 5.14** (http://ota.tasmota.com/tasmota/release_5.14.0/sonoff.bin) - NOTICE underscore as a dash is not supported in older versions
|
|
||||||
4. Migrate to **Sonoff-Tasmota 6.7.1** (http://ota.tasmota.com/tasmota/release_6.7.1/sonoff.bin) - NOTICE underscore as a dash is not supported in older versions
|
|
||||||
5. Migrate to **Tasmota 7.2.0** (http://ota.tasmota.com/tasmota/release-7.2.0/tasmota.bin)
|
|
||||||
|
|
||||||
--- Major change in parameter storage layout ---
|
|
||||||
|
|
||||||
6. Migrate to **Tasmota 8.5.1** (http://ota.tasmota.com/tasmota/release-8.5.1/tasmota.bin)
|
|
||||||
|
|
||||||
--- Major change in internal GPIO function representation ---
|
|
||||||
|
|
||||||
7. Migrate to **Tasmota 9.1** (http://ota.tasmota.com/tasmota/release-9.1.0/tasmota.bin.gz)
|
|
||||||
8. Upgrade to **latest release** (http://ota.tasmota.com/tasmota/release/tasmota.bin.gz)
|
|
||||||
|
|
||||||
While fallback or downgrading is common practice it was never supported due to Settings additions or changes in newer releases. Starting with release **v9.1.0 Imogen** the internal GPIO function representation has changed in such a way that fallback is only possible to the latest GPIO configuration before installing **v9.1.0**.
|
|
||||||
|
|
||||||
## Supported Core versions
|
|
||||||
|
|
||||||
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.7**.
|
|
||||||
|
|
||||||
Support of ESP8266 Core versions before 2.7.8 and ESP32 Core versions before v3.1.7 have been removed.
|
|
||||||
|
|
||||||
## Initial configuration tools
|
|
||||||
|
|
||||||
For initial configuration this release supports Webserver based **WifiManager** or **Serial** based command interface.
|
|
||||||
|
|
||||||
## Initial installation
|
|
||||||
|
|
||||||
Easy initial installation of Tasmota can be performed using the [Tasmota WebInstaller](https://tasmota.github.io/install/).
|
|
||||||
|
|
||||||
## Provided Binary Downloads
|
|
||||||
|
|
||||||
### ESP8266 or ESP8285 based
|
|
||||||
The following binary downloads have been compiled with ESP8266/Arduino library core version **2.7.8**.
|
|
||||||
|
|
||||||
- **tasmota.bin** = The Tasmota version with most drivers for 1M+ flash. **RECOMMENDED RELEASE BINARY**
|
|
||||||
- **tasmota-4M.bin** = The Tasmota version with most drivers and filesystem for 4M+ flash.
|
|
||||||
- **tasmota-AD.bin** to **tasmota-VN.bin** = The Tasmota version in different languages for 1M+ flash.
|
|
||||||
- **tasmota-lite.bin** = The Lite version without most drivers and sensors for 1M+ flash.
|
|
||||||
- **tasmota-knx.bin** = The Knx version without some features but adds KNX support for 1M+ flash.
|
|
||||||
- **tasmota-sensors.bin** = The Sensors version adds more useful sensors for 1M+ flash.
|
|
||||||
- **tasmota-ir.bin** = The InfraRed Receiver and transmitter version allowing all available protocols provided by library IRremoteESP8266 but without most other features for 1M+ flash.
|
|
||||||
- **tasmota-display.bin** = The Display version without Energy Monitoring but adds display support for 1M+ flash.
|
|
||||||
- **tasmota-zbbridge.bin** = The dedicated Sonoff Zigbee Bridge version for 2M+ flash.
|
|
||||||
- **tasmota-zigbee.bin** = The dedicated cc25xx Zigbee Bridge version for 4M+ flash.
|
|
||||||
|
|
||||||
Above binaries are also available as gzipped version allowing faster uploads.
|
|
||||||
|
|
||||||
Latest released binaries can be downloaded from
|
|
||||||
- https://github.com/arendst/Tasmota-firmware/tree/firmware/release-firmware
|
|
||||||
- http://ota.tasmota.com/tasmota/release
|
|
||||||
|
|
||||||
Historical binaries can be downloaded from
|
|
||||||
- http://ota.tasmota.com/tasmota/release-15.2.0
|
|
||||||
|
|
||||||
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-C5, ESP32-C6, ESP32-P4, ESP32-S2 and ESP32-S3 based
|
|
||||||
The following binary downloads have been compiled with ESP32/Arduino library core version **v3.1.7**.
|
|
||||||
|
|
||||||
- **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.
|
|
||||||
- **tasmota32c2.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C2 with serial and 4M+ flash.
|
|
||||||
- **tasmota32c3.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C3 with USB HWCDC and fallback to serial and 4M+ flash.
|
|
||||||
- **tasmota32c5.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C5 with USB HWCDC and fallback to serial and 4M+ flash.
|
|
||||||
- **tasmota32c6.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C6 with USB HWCDC and fallback to serial and 4M+ flash.
|
|
||||||
- **tasmota32p4.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-P4 with USB HWCDC and fallback to serial and 4M+ flash.
|
|
||||||
- **tasmota32s2.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-S2 with serial and 4M+ flash.
|
|
||||||
- **tasmota32s2cdc.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-S2 with serial over embedded USB CDC only and 4M+ flash.
|
|
||||||
- **tasmota32s3.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-S3 with USB HWCDC and fallback to serial and 4M+ flash.
|
|
||||||
- **tasmota32-AD.bin** to **tasmota32-VN.bin** = The Tasmota version in different languages for 4M+ flash.
|
|
||||||
- **tasmota32-bluetooth.bin** = The Bluetooth version adds BLE support for 4M+ flash.
|
|
||||||
- **tasmota32-display.bin** = The Display version without Energy Monitoring but adds display support for 4M+ flash.
|
|
||||||
- **tasmota32-ir.bin** = The InfraRed Receiver and transmitter version allowing all available protocols provided by library IRremoteESP8266 but without most other features for 4M+ flash.
|
|
||||||
- **tasmota32-lvgl.bin** = The LVGL version adds Light and Versatile Graphics Library (LVGL) display support for 4M+ flash.
|
|
||||||
- **tasmota32-nspanel.bin** = The Sonoff NSPanel Smart Scene Wall Switch version with HASPmota display support.
|
|
||||||
- **tasmota32-webcam.bin** = The Webcam version adds webcam support for 4M+ flash.
|
|
||||||
- **tasmota32-zbbridgepro.bin** - The Sonoff Zigbee Bridge Pro version with CC2652P firmware load support.
|
|
||||||
|
|
||||||
Latest released binaries can be downloaded from
|
|
||||||
- https://github.com/arendst/Tasmota-firmware/tree/firmware/release-firmware
|
|
||||||
- https://ota.tasmota.com/tasmota32/release
|
|
||||||
|
|
||||||
Historical binaries can be downloaded from
|
|
||||||
- https://ota.tasmota.com/tasmota32/release-15.2.0
|
|
||||||
|
|
||||||
The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasmota.com/tasmota32/release/tasmota32.bin``
|
|
||||||
|
|
||||||
## Additional information
|
|
||||||
|
|
||||||
[List](MODULES.md) of embedded modules.
|
|
||||||
|
|
||||||
[Complete list](BUILDS.md) of available feature and sensors.
|
|
||||||
|
|
||||||
## Changelog v15.2.0 Stephan
|
|
||||||
### Added
|
|
||||||
- Support for ESP32-P4 rev.3 [#24146](https://github.com/arendst/Tasmota/issues/24118)
|
|
||||||
- Support for Analog Gauges [#24153](https://github.com/arendst/Tasmota/issues/24153)
|
|
||||||
- Support for MakeSkyBlue Solar Charger Energy Monitor [#24151](https://github.com/arendst/Tasmota/issues/24151)
|
|
||||||
- Support for AGS02MA TVOC sensor [#24109](https://github.com/arendst/Tasmota/issues/24109)
|
|
||||||
- Commands `DaliSend` and `DaliQuery` allow extended commands with prefix for DeviceType defaulting to DT6
|
|
||||||
- ESP8266 GPIOViewer memory map if enabled with `#define GV_USE_ESPINFO`
|
|
||||||
- HostedMCU file update using command `HostedLoad <version>|<filename>`
|
|
||||||
- Scripter array transfer via UFS [#24060](https://github.com/arendst/Tasmota/issues/24060)
|
|
||||||
- DALI DT8 RGBWAF color support using Tasmota light control
|
|
||||||
- NeoPool command `NPReadLSB`, `NPReadMSB`, `NPWriteLSB`, `NWriteMSB` for directly read/write LSB/MSB of 16-bit register [#24083](https://github.com/arendst/Tasmota/issues/24083)
|
|
||||||
- TLS enabled ECDSA by default for ESP8266 [#24009](https://github.com/arendst/Tasmota/issues/24009)
|
|
||||||
- WS2812 and Berry animation support for reverse-order LED strip [#24138](https://github.com/arendst/Tasmota/issues/24138)
|
|
||||||
- Berry `cb.free_cb` for extension manager [#24014](https://github.com/arendst/Tasmota/issues/24014)
|
|
||||||
- Berry `light.get()` direct access to values [#24033](https://github.com/arendst/Tasmota/issues/24033)
|
|
||||||
- Berry `gc_heap` and `gc_time` to `tasmota.memory()` [#24054](https://github.com/arendst/Tasmota/issues/24054)
|
|
||||||
- Berry `tcp.write()` add `offset` and `len` [#24076](https://github.com/arendst/Tasmota/issues/24076)
|
|
||||||
- Berry `tasmota.micros()` to get time in microseconds [#24192](https://github.com/arendst/Tasmota/issues/24192)
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
- ESP32 Platform from 2025.11.30 to 2025.12.30, Framework (Arduino Core) from v3.1.5 to v3.1.7 and IDF from v5.3.4.250826 to v5.3.4.20251205 [#24212](https://github.com/arendst/Tasmota/issues/24212)
|
|
||||||
- LVGL library from v9.3.0 to v9.4.0 [#24028](https://github.com/arendst/Tasmota/issues/24028)
|
|
||||||
- JPEGDEC library from v1.8.3 to v1.8.4 [#24120](https://github.com/arendst/Tasmota/issues/24120)
|
|
||||||
- GPIOViewer from v1.6.3 to v1.7.0
|
|
||||||
- Refactored library UDisplay [#24007](https://github.com/arendst/Tasmota/issues/24007)
|
|
||||||
- Refactored DALI using TasmotaDali library v1.0.0 adding frame receive buffer
|
|
||||||
- Increased filesystem file name size from 48 to 50 characters
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- InfluxDb receives IPAddress as a value regression from v15.0.1.3 [#24031](https://github.com/arendst/Tasmota/issues/24031)
|
|
||||||
- Scripter UDP and switch case [#24060](https://github.com/arendst/Tasmota/issues/24060)
|
|
||||||
- TuyaMCU v1 soft lock when WIFI_SELECT / WIFI_RESET is initiated [#24063](https://github.com/arendst/Tasmota/issues/24063)
|
|
||||||
- PCA9685 V2 driver PWMTO fading logic and overflow [#24159](https://github.com/arendst/Tasmota/issues/24159)
|
|
||||||
- DALI protocol errors
|
|
||||||
- RGBW handling in TasmotaLED and xlgt_01_ws2812_esp32 [#24172](https://github.com/arendst/Tasmota/issues/24172)
|
|
||||||
- ArtNet single light color mapping using `ChannelRemap` [#24058](https://github.com/arendst/Tasmota/issues/24058)
|
|
||||||
- Thermostat temperature unit [#24213](https://github.com/arendst/Tasmota/issues/24213)
|
|
||||||
- TLS fix ECDSA and add `SetOption165 1` to enable ECDSA in addition to RSA [#24000](https://github.com/arendst/Tasmota/issues/24000)
|
|
||||||
- ESP32-P4 Hosted MCU updated to v2.6.6 solving WiFi boot issues [#24146](https://github.com/arendst/Tasmota/issues/24118)
|
|
||||||
- ESP32-Solo1 using pre-compiled Arduino libraries [#24146](https://github.com/arendst/Tasmota/issues/24118)
|
|
||||||
- Extension Manager exception when `OtaUrl` is not defined or invalid
|
|
||||||
- Extension Manager Light Theme support and Extensions input field control
|
|
||||||
- HASPmota exception in `cpicker` (colorwheel) [#24010](https://github.com/arendst/Tasmota/issues/24010)
|
|
||||||
- HASPmota `scale` and `angle` for images (#24089)[#24089](https://github.com/arendst/Tasmota/issues/24089)
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
# Security Policy
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
|
||||||
|
|
||||||
Please report security issues to [Tasmota](https://ota.tasmota.com/tasmota/contact/contact.php)
|
|
||||||
2978
TEMPLATES.md
2978
TEMPLATES.md
File diff suppressed because it is too large
Load Diff
@ -1,49 +0,0 @@
|
|||||||
<?php
|
|
||||||
// mkdir and chmod arduino folder to 777
|
|
||||||
//
|
|
||||||
//var_dump($_FILES);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GZIPs a file on disk (appending .gz to the name)
|
|
||||||
*
|
|
||||||
* From http://stackoverflow.com/questions/6073397/how-do-you-create-a-gz-file-using-php
|
|
||||||
* Based on function by Kioob at:
|
|
||||||
* http://www.php.net/manual/en/function.gzwrite.php#34955
|
|
||||||
*
|
|
||||||
* @param string $source Path to file that should be compressed
|
|
||||||
* @param integer $level GZIP compression level (default: 9)
|
|
||||||
* @return string New filename (with .gz appended) if success, or false if operation fails
|
|
||||||
*/
|
|
||||||
function gzCompressFile($source, $level = 9){
|
|
||||||
$dest = $source . '.gz';
|
|
||||||
$mode = 'wb' . $level;
|
|
||||||
$error = false;
|
|
||||||
if ($fp_out = gzopen($dest, $mode)) {
|
|
||||||
if ($fp_in = fopen($source,'rb')) {
|
|
||||||
while (!feof($fp_in))
|
|
||||||
gzwrite($fp_out, fread($fp_in, 1024 * 512));
|
|
||||||
fclose($fp_in);
|
|
||||||
} else {
|
|
||||||
$error = true;
|
|
||||||
}
|
|
||||||
gzclose($fp_out);
|
|
||||||
} else {
|
|
||||||
$error = true;
|
|
||||||
}
|
|
||||||
if ($error)
|
|
||||||
return false;
|
|
||||||
else
|
|
||||||
return $dest;
|
|
||||||
}
|
|
||||||
|
|
||||||
$image = basename($_FILES["file"]["name"]);
|
|
||||||
$target_file = "arduino/".$image;
|
|
||||||
$hostname = $_SERVER['SERVER_NAME'];
|
|
||||||
|
|
||||||
if (move_uploaded_file($_FILES["file"]["tmp_name"], $target_file)) {
|
|
||||||
gzCompressFile($target_file);
|
|
||||||
echo "The files $image and $image.gz have been uploaded to OTA server $hostname. \n";
|
|
||||||
} else {
|
|
||||||
echo "Sorry, there was an error uploading your file $image to OTA server $hostname. \n";
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
<?php
|
|
||||||
// mkdir and chmod arduino folder to 777
|
|
||||||
//
|
|
||||||
//var_dump($_FILES);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GZIPs a file on disk (appending .gz to the name)
|
|
||||||
*
|
|
||||||
* From http://stackoverflow.com/questions/6073397/how-do-you-create-a-gz-file-using-php
|
|
||||||
* Based on function by Kioob at:
|
|
||||||
* http://www.php.net/manual/en/function.gzwrite.php#34955
|
|
||||||
*
|
|
||||||
* @param string $source Path to file that should be compressed
|
|
||||||
* @param integer $level GZIP compression level (default: 9)
|
|
||||||
* @return string New filename (with .gz appended) if success, or false if operation fails
|
|
||||||
*/
|
|
||||||
function gzCompressFile($source, $level = 9){
|
|
||||||
$dest = $source . '.gz';
|
|
||||||
$mode = 'wb' . $level;
|
|
||||||
$error = false;
|
|
||||||
if ($fp_out = gzopen($dest, $mode)) {
|
|
||||||
if ($fp_in = fopen($source,'rb')) {
|
|
||||||
while (!feof($fp_in))
|
|
||||||
gzwrite($fp_out, fread($fp_in, 1024 * 512));
|
|
||||||
fclose($fp_in);
|
|
||||||
} else {
|
|
||||||
$error = true;
|
|
||||||
}
|
|
||||||
gzclose($fp_out);
|
|
||||||
} else {
|
|
||||||
$error = true;
|
|
||||||
}
|
|
||||||
if ($error)
|
|
||||||
return false;
|
|
||||||
else
|
|
||||||
return $dest;
|
|
||||||
}
|
|
||||||
|
|
||||||
$image = basename($_FILES["file"]["name"]);
|
|
||||||
//$image = $_FILES["file"]["name"]; // Solves an issue where basename returns Array
|
|
||||||
$target_file = "tasmota/".$image;
|
|
||||||
$hostname = $_SERVER['SERVER_NAME'];
|
|
||||||
|
|
||||||
if (move_uploaded_file($_FILES["file"]["tmp_name"], $target_file)) {
|
|
||||||
if (strpos($target_file, "tasmota32") | strpos($target_file, ".gz")) {
|
|
||||||
echo "The file $image has been uploaded to OTA server $hostname. \n";
|
|
||||||
} else {
|
|
||||||
gzCompressFile($target_file);
|
|
||||||
echo "The files $image and $image.gz have been uploaded to OTA server $hostname. \n";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
echo "Sorry, there was an error uploading your file $image to OTA server $hostname. \n";
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DBOARD_HAS_PSRAM -DHAS_PSRAM_FIX -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw -DESP32_4M",
|
|
||||||
"f_cpu": "240000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"flash_mode": "dio",
|
|
||||||
"mcu": "esp32",
|
|
||||||
"variant": "esp32",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"ethernet",
|
|
||||||
"can"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32 >= 4M Flash, PSRAM with fix, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 460800
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 230400
|
|
||||||
},
|
|
||||||
"url": "https://en.wikipedia.org/wiki/ESP32",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DESP32_4M -DCORE32SOLO1",
|
|
||||||
"f_cpu": "160000000L",
|
|
||||||
"f_flash": "40000000L",
|
|
||||||
"flash_mode": "dio",
|
|
||||||
"mcu": "esp32",
|
|
||||||
"chip_variant": "esp32u",
|
|
||||||
"variant": "esp32",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"ethernet",
|
|
||||||
"can"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32-solo-1.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-solo1 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32solo1-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 460800
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 230400
|
|
||||||
},
|
|
||||||
"url": "https://www.espressif.com/sites/default/files/documentation/esp32-solo-1_datasheet_en.pdf",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DBOARD_HAS_PSRAM -DESP32_4M",
|
|
||||||
"f_cpu": "160000000L",
|
|
||||||
"f_flash": "40000000L",
|
|
||||||
"flash_mode": "dio",
|
|
||||||
"mcu": "esp32",
|
|
||||||
"variant": "esp32",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"ethernet",
|
|
||||||
"can"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32 >= 4M Flash PSRAM, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 460800
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 230400
|
|
||||||
},
|
|
||||||
"url": "https://en.wikipedia.org/wiki/ESP32",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DESP32_4M -DESP32C2",
|
|
||||||
"f_cpu": "120000000L",
|
|
||||||
"f_flash": "60000000L",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"mcu": "esp32c2",
|
|
||||||
"variant": "esp32c2",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32c2.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-C2 = 4M Flash, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32c2-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 278528,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 460800
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 230400
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp8684/esp8684-devkitm-1/user_guide.html",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DESP32_2M -DESP32C2",
|
|
||||||
"f_cpu": "120000000L",
|
|
||||||
"f_flash": "60000000L",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"mcu": "esp32c2",
|
|
||||||
"variant": "esp32c2",
|
|
||||||
"partitions": "partitions/esp32_partition_app1245k_fs64k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32c2.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-C2 = 2M Flash, Tasmota 1245kB Code/OTA, 64k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32c2-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "2MB",
|
|
||||||
"maximum_ram_size": 278528,
|
|
||||||
"maximum_size": 2097152,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 460800
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 230400
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp8684/esp8684-devkitm-1/user_guide.html",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DARDUINO_USB_MODE=1 -DESP32_4M -DESP32C3 -DUSE_USB_CDC_CONSOLE",
|
|
||||||
"f_cpu": "160000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"flash_mode": "dio",
|
|
||||||
"mcu": "esp32c3",
|
|
||||||
"variant": "esp32c3",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32c3.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-C3 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32c3-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/hw-reference/esp32c3/user-guide-devkitm-1.html",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DESP32_4M -DESP32C3",
|
|
||||||
"f_cpu": "160000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"flash_mode": "dio",
|
|
||||||
"mcu": "esp32c3",
|
|
||||||
"variant": "esp32c3",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32c3.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-C3 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32c3ser-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 460800
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 230400
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/hw-reference/esp32c3/user-guide-devkitm-1.html",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DARDUINO_USB_MODE=1 -DESP32_4M -DESP32C5 -DUSE_USB_CDC_CONSOLE",
|
|
||||||
"f_cpu": "240000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"mcu": "esp32c5",
|
|
||||||
"variant": "esp32c5",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32c5.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-C5 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32c5-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32c5/esp32-c5-devkitc-1/index.html",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DESP32_4M -DESP32C5",
|
|
||||||
"f_cpu": "240000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"mcu": "esp32c5",
|
|
||||||
"variant": "esp32c5",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32c5.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-C5 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32c5ser-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 460800
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 230400
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32c5/esp32-c5-devkitc-1/index.html",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DARDUINO_USB_MODE=1 -DESP32_4M -DESP32C6 -DUSE_USB_CDC_CONSOLE",
|
|
||||||
"f_cpu": "160000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"mcu": "esp32c6",
|
|
||||||
"variant": "esp32c6",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32c6.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-C6 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32c6-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DESP32_4M -DESP32C6",
|
|
||||||
"f_cpu": "160000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"mcu": "esp32c6",
|
|
||||||
"variant": "esp32c6",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32c6.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-C6 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32c6ser-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 460800
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 230400
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": [
|
|
||||||
"-DARDUINO_TASMOTA -DESP32P4ES -DESP32_16M -DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=1 -DUSE_USB_CDC_CONSOLE"
|
|
||||||
],
|
|
||||||
"f_cpu": "360000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"f_psram": "200000000L",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"mcu": "esp32p4",
|
|
||||||
"chip_variant": "esp32p4_es",
|
|
||||||
"variant": "esp32p4",
|
|
||||||
"partitions": "partitions/esp32_partition_app3904k_fs11584k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"openthread",
|
|
||||||
"ethernet"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32p4.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-P4 ES 16M Flash, Tasmota 3904k Code/OTA, 11584k FS",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": [
|
|
||||||
"-DARDUINO_TASMOTA -DESP32P4R3 -DESP32_16M -DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=1 -DUSE_USB_CDC_CONSOLE"
|
|
||||||
],
|
|
||||||
"f_cpu": "400000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"f_psram": "200000000L",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"mcu": "esp32p4",
|
|
||||||
"chip_variant": "esp32p4",
|
|
||||||
"variant": "esp32p4",
|
|
||||||
"partitions": "partitions/esp32_partition_app3904k_fs11584k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"openthread",
|
|
||||||
"ethernet"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32p4.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-P4 rev.3 16M Flash, Tasmota 3904k Code/OTA, 11584k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32p4r3-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "16MB",
|
|
||||||
"maximum_ram_size": 768000,
|
|
||||||
"maximum_size": 16777216,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 1500000
|
|
||||||
},
|
|
||||||
"url": "https://documentation.espressif.com/esp32-p4_datasheet_en.html",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": [
|
|
||||||
"-DARDUINO_TASMOTA -DESP32P4R3 -DESP32_16M -DBOARD_HAS_PSRAM"
|
|
||||||
],
|
|
||||||
"f_cpu": "400000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"f_psram": "200000000L",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"mcu": "esp32p4",
|
|
||||||
"chip_variant": "esp32p4",
|
|
||||||
"variant": "esp32p4",
|
|
||||||
"partitions": "partitions/esp32_partition_app3904k_fs11584k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"openthread",
|
|
||||||
"ethernet"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32p4.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-P4 rev.3 16M Flash, Tasmota 3904k Code/OTA, 11584k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32p4r3-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "16MB",
|
|
||||||
"maximum_ram_size": 768000,
|
|
||||||
"maximum_size": 16777216,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 1500000
|
|
||||||
},
|
|
||||||
"url": "https://documentation.espressif.com/esp32-p4_datasheet_en.html",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": [
|
|
||||||
"-DARDUINO_TASMOTA -DESP32P4ES -DESP32_16M -DBOARD_HAS_PSRAM"
|
|
||||||
],
|
|
||||||
"f_cpu": "360000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"f_psram": "200000000L",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"mcu": "esp32p4",
|
|
||||||
"chip_variant": "esp32p4_es",
|
|
||||||
"variant": "esp32p4",
|
|
||||||
"partitions": "partitions/esp32_partition_app3904k_fs11584k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"openthread",
|
|
||||||
"ethernet"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32p4.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-P4 ES 16M Flash, Tasmota 3904k Code/OTA, 11584k FS",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DBOARD_HAS_PSRAM -DESP32_4M -DESP32S2",
|
|
||||||
"f_cpu": "240000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"flash_mode": "dio",
|
|
||||||
"mcu": "esp32s2",
|
|
||||||
"variant": "esp32s2",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32s2.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-S2 >= 4M Flash PSRAM, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32s2-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 460800
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 230400
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/hw-reference/esp32s2/user-guide-saola-1-v1.2.html",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DBOARD_HAS_PSRAM -DUSE_USB_CDC_CONSOLE -DESP32_4M -DESP32S2",
|
|
||||||
"f_cpu": "240000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"flash_mode": "dio",
|
|
||||||
"mcu": "esp32s2",
|
|
||||||
"variant": "esp32s2",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32s2.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-S2 >= 4M Flash PSRAM, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32s2cdc-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"before_reset": "usb_reset",
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/hw-reference/esp32s2/user-guide-saola-1-v1.2.html",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino":{
|
|
||||||
"memory_type": "opi_opi"
|
|
||||||
},
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=1 -DUSE_USB_CDC_CONSOLE -DESP32_4M -DESP32S3",
|
|
||||||
"f_cpu": "240000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"flash_mode": "dout",
|
|
||||||
"mcu": "esp32s3",
|
|
||||||
"variant": "esp32s3",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"ethernet"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32s3.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-S3 >= 4M OPI Flash + PSRAM, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32s3-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino":{
|
|
||||||
"memory_type": "opi_opi"
|
|
||||||
},
|
|
||||||
"core": "esp32",
|
|
||||||
"f_cpu": "240000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"f_boot": "120000000L",
|
|
||||||
"boot": "opi",
|
|
||||||
"flash_mode": "dout",
|
|
||||||
"mcu": "esp32s3",
|
|
||||||
"variant": "esp32s3",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=1 -DUSE_USB_CDC_CONSOLE -DESP32_4M -DESP32S3",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"ethernet"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32s3.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-S3 >= 4M OPI Flash + PSRAM, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32s3-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino":{
|
|
||||||
"memory_type": "qio_opi"
|
|
||||||
},
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=1 -DUSE_USB_CDC_CONSOLE -DESP32_4M -DESP32S3",
|
|
||||||
"f_cpu": "240000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"mcu": "esp32s3",
|
|
||||||
"variant": "esp32s3",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"ethernet"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32s3.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-S3 >= 4M Flash OPI PSRAM, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32s3-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino":{
|
|
||||||
"memory_type": "qio_opi"
|
|
||||||
},
|
|
||||||
"core": "esp32",
|
|
||||||
"f_cpu": "240000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"f_boot": "120000000L",
|
|
||||||
"boot": "qio",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"mcu": "esp32s3",
|
|
||||||
"variant": "esp32s3",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=1 -DUSE_USB_CDC_CONSOLE -DESP32_4M -DESP32S3",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"ethernet"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32s3.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-S3 >= 4M QIO Flash + OPI PSRAM, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32s3-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino":{
|
|
||||||
"memory_type": "qio_qspi"
|
|
||||||
},
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=1 -DUSE_USB_CDC_CONSOLE -DESP32_4M -DESP32S3",
|
|
||||||
"f_cpu": "240000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"mcu": "esp32s3",
|
|
||||||
"variant": "esp32s3",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"ethernet"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32s3.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-S3 >= 4M Flash QSPI PSRAM, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32s3-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino":{
|
|
||||||
"memory_type": "qio_qspi"
|
|
||||||
},
|
|
||||||
"core": "esp32",
|
|
||||||
"f_cpu": "240000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"f_boot": "120000000L",
|
|
||||||
"boot": "qio",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"mcu": "esp32s3",
|
|
||||||
"variant": "esp32s3",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=1 -DUSE_USB_CDC_CONSOLE -DESP32_4M -DESP32S3",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"ethernet"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32s3.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-S3 >= 4M QIO Flash + QSPI PSRAM, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32s3-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 2000000
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino":{
|
|
||||||
"memory_type": "opi_opi"
|
|
||||||
},
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DBOARD_HAS_PSRAM -DESP32_4M -DESP32S3",
|
|
||||||
"f_cpu": "240000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"flash_mode": "dout",
|
|
||||||
"mcu": "esp32s3",
|
|
||||||
"variant": "esp32s3",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"ethernet"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32s3.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-S3 >= 4M OPI Flash + PSRAM, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32s3ser-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 460800
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 230400
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino":{
|
|
||||||
"memory_type": "opi_opi"
|
|
||||||
},
|
|
||||||
"core": "esp32",
|
|
||||||
"f_cpu": "240000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"f_boot": "120000000L",
|
|
||||||
"boot": "opi",
|
|
||||||
"flash_mode": "dout",
|
|
||||||
"mcu": "esp32s3",
|
|
||||||
"variant": "esp32s3",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DBOARD_HAS_PSRAM -DESP32_4M -DESP32S3",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"ethernet"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32s3.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-S3 >= 4M OPI Flash + PSRAM, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32s3ser-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 460800
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 230400
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino":{
|
|
||||||
"memory_type": "qio_opi"
|
|
||||||
},
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DBOARD_HAS_PSRAM -DESP32_4M -DESP32S3",
|
|
||||||
"f_cpu": "240000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"mcu": "esp32s3",
|
|
||||||
"variant": "esp32s3",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"ethernet"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32s3.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-S3 >= 4M Flash OPI PSRAM, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32s3ser-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 460800
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 230400
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino":{
|
|
||||||
"memory_type": "qio_opi"
|
|
||||||
},
|
|
||||||
"core": "esp32",
|
|
||||||
"f_cpu": "240000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"f_boot": "120000000L",
|
|
||||||
"boot": "qio",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"mcu": "esp32s3",
|
|
||||||
"variant": "esp32s3",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DBOARD_HAS_PSRAM -DESP32_4M -DESP32S3",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"ethernet"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32s3.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-S3 >= 4M QIO Flash + OPI PSRAM, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32s3ser-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 460800
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 230400
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino":{
|
|
||||||
"memory_type": "qio_qspi"
|
|
||||||
},
|
|
||||||
"core": "esp32",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DBOARD_HAS_PSRAM -DESP32_4M -DESP32S3",
|
|
||||||
"f_cpu": "240000000L",
|
|
||||||
"f_flash": "80000000L",
|
|
||||||
"flash_mode": "qio",
|
|
||||||
"mcu": "esp32s3",
|
|
||||||
"variant": "esp32s3",
|
|
||||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi",
|
|
||||||
"bluetooth",
|
|
||||||
"ethernet"
|
|
||||||
],
|
|
||||||
"debug": {
|
|
||||||
"openocd_target": "esp32s3.cfg"
|
|
||||||
},
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP32-S3 >= 4M Flash QSPI PSRAM, Tasmota 2880k Code/OTA, 320k FS",
|
|
||||||
"upload": {
|
|
||||||
"arduino": {
|
|
||||||
"flash_extra_images": [
|
|
||||||
[
|
|
||||||
"0x10000",
|
|
||||||
"tasmota32s3ser-safeboot.bin"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"flash_size": "4MB",
|
|
||||||
"maximum_ram_size": 327680,
|
|
||||||
"maximum_size": 4194304,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 460800
|
|
||||||
},
|
|
||||||
"download": {
|
|
||||||
"speed": 230400
|
|
||||||
},
|
|
||||||
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino": {
|
|
||||||
"ldscript": "eagle.flash.16m14m.ld"
|
|
||||||
},
|
|
||||||
"core": "esp8266",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01 -DESP8266_16M -DESP8266_16M14M",
|
|
||||||
"f_cpu": "80000000L",
|
|
||||||
"f_flash": "40000000L",
|
|
||||||
"flash_mode": "dout",
|
|
||||||
"mcu": "esp8266",
|
|
||||||
"variant": "generic"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi"
|
|
||||||
],
|
|
||||||
"frameworks": [
|
|
||||||
"arduino"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP8266 Tasmota 1M sketch 1M OTA 14M FS",
|
|
||||||
"upload": {
|
|
||||||
"maximum_ram_size": 81920,
|
|
||||||
"maximum_size": 995326,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"resetmethod": "ck",
|
|
||||||
"speed": 115200
|
|
||||||
},
|
|
||||||
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino": {
|
|
||||||
"ldscript": "eagle.flash.1m.ld"
|
|
||||||
},
|
|
||||||
"core": "esp8266",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01 -DESP8266_1M",
|
|
||||||
"f_cpu": "80000000L",
|
|
||||||
"f_flash": "40000000L",
|
|
||||||
"flash_mode": "dout",
|
|
||||||
"mcu": "esp8266",
|
|
||||||
"variant": "generic"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi"
|
|
||||||
],
|
|
||||||
"frameworks": [
|
|
||||||
"arduino"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP8266 Tasmota 1M sketch NO FS",
|
|
||||||
"upload": {
|
|
||||||
"maximum_ram_size": 81920,
|
|
||||||
"maximum_size": 995326,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"resetmethod": "ck",
|
|
||||||
"speed": 115200
|
|
||||||
},
|
|
||||||
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino": {
|
|
||||||
"ldscript": "eagle.flash.2m1m.ld"
|
|
||||||
},
|
|
||||||
"core": "esp8266",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01 -DESP8266_2M -DESP8266_2M1M",
|
|
||||||
"f_cpu": "80000000L",
|
|
||||||
"f_flash": "40000000L",
|
|
||||||
"flash_mode": "dout",
|
|
||||||
"mcu": "esp8266",
|
|
||||||
"variant": "generic"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi"
|
|
||||||
],
|
|
||||||
"frameworks": [
|
|
||||||
"arduino"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP8266 Tasmota 1M sketch 1M FS",
|
|
||||||
"upload": {
|
|
||||||
"maximum_ram_size": 81920,
|
|
||||||
"maximum_size": 995326,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"resetmethod": "ck",
|
|
||||||
"speed": 115200
|
|
||||||
},
|
|
||||||
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino": {
|
|
||||||
"ldscript": "eagle.flash.2m256.ld"
|
|
||||||
},
|
|
||||||
"core": "esp8266",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01 -DESP8266_2M -DESP8266_2M256",
|
|
||||||
"f_cpu": "80000000L",
|
|
||||||
"f_flash": "40000000L",
|
|
||||||
"flash_mode": "dout",
|
|
||||||
"mcu": "esp8266",
|
|
||||||
"variant": "generic"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi"
|
|
||||||
],
|
|
||||||
"frameworks": [
|
|
||||||
"arduino"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP8266 Tasmota 1M sketch 772k OTA 256k FS",
|
|
||||||
"upload": {
|
|
||||||
"maximum_ram_size": 81920,
|
|
||||||
"maximum_size": 995326,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"resetmethod": "ck",
|
|
||||||
"speed": 115200
|
|
||||||
},
|
|
||||||
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino": {
|
|
||||||
"ldscript": "eagle.flash.4m2m.ld"
|
|
||||||
},
|
|
||||||
"core": "esp8266",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01 -DESP8266_4M -DESP8266_4M2M",
|
|
||||||
"f_cpu": "80000000L",
|
|
||||||
"f_flash": "40000000L",
|
|
||||||
"flash_mode": "dout",
|
|
||||||
"mcu": "esp8266",
|
|
||||||
"variant": "generic"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi"
|
|
||||||
],
|
|
||||||
"frameworks": [
|
|
||||||
"arduino"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP8266 Tasmota 1M sketch 1M OTA 2M FS",
|
|
||||||
"upload": {
|
|
||||||
"maximum_ram_size": 81920,
|
|
||||||
"maximum_size": 995326,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"resetmethod": "ck",
|
|
||||||
"speed": 115200
|
|
||||||
},
|
|
||||||
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino": {
|
|
||||||
"ldscript": "eagle.flash.4m3m.ld"
|
|
||||||
},
|
|
||||||
"core": "esp8266",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01 -DESP8266_4M -DESP8266_4M3M",
|
|
||||||
"f_cpu": "80000000L",
|
|
||||||
"f_flash": "40000000L",
|
|
||||||
"flash_mode": "dout",
|
|
||||||
"mcu": "esp8266",
|
|
||||||
"variant": "generic"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi"
|
|
||||||
],
|
|
||||||
"frameworks": [
|
|
||||||
"arduino"
|
|
||||||
],
|
|
||||||
"name": "Espressif Generic ESP8266 Tasmota 1M sketch 3M FS",
|
|
||||||
"upload": {
|
|
||||||
"maximum_ram_size": 81920,
|
|
||||||
"maximum_size": 995326,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"resetmethod": "ck",
|
|
||||||
"speed": 115200
|
|
||||||
},
|
|
||||||
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
"build": {
|
|
||||||
"arduino": {
|
|
||||||
"ldscript": "eagle.flash.2m256.ld"
|
|
||||||
},
|
|
||||||
"core": "esp8266",
|
|
||||||
"extra_flags": "-DARDUINO_TASMOTA -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01 -DESP8266_2M -DESP8266_2M256",
|
|
||||||
"f_cpu": "160000000L",
|
|
||||||
"f_flash": "40000000L",
|
|
||||||
"flash_mode": "dout",
|
|
||||||
"mcu": "esp8266",
|
|
||||||
"variant": "generic"
|
|
||||||
},
|
|
||||||
"connectivity": [
|
|
||||||
"wifi"
|
|
||||||
],
|
|
||||||
"frameworks": [
|
|
||||||
"arduino"
|
|
||||||
],
|
|
||||||
"name": "Sonoff ZbBridge Tasmota 1M sketch 772k OTA 256k FS",
|
|
||||||
"upload": {
|
|
||||||
"maximum_ram_size": 81920,
|
|
||||||
"maximum_size": 995326,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"resetmethod": "ck",
|
|
||||||
"speed": 115200
|
|
||||||
},
|
|
||||||
"url": "https://templates.blakadder.com/sonoff_ZBBridge.html",
|
|
||||||
"vendor": "Espressif"
|
|
||||||
}
|
|
||||||
@ -1,79 +0,0 @@
|
|||||||
/*
|
|
||||||
esp32x_fixes.h - fix esp32x toolchain
|
|
||||||
|
|
||||||
Copyright (C) 2021 Theo Arends
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Xtensa toolchain declares `int32_t` as `int` but RISC-V toolchain
|
|
||||||
* declares `int32_t` as `long int` which causes compilation errors.
|
|
||||||
*
|
|
||||||
* See:
|
|
||||||
* https://github.com/espressif/esp-idf/issues/6906
|
|
||||||
* https://github.com/espressif/arduino-esp32/issues/5086
|
|
||||||
*
|
|
||||||
* You need to add the following lines in `build_flags`:
|
|
||||||
* -I$PROJECT_DIR/include
|
|
||||||
* -include "esp32x_fixes.h"
|
|
||||||
*/
|
|
||||||
#ifdef __riscv
|
|
||||||
|
|
||||||
#undef __INT32_TYPE__
|
|
||||||
#define __INT32_TYPE__ int
|
|
||||||
|
|
||||||
#undef __UINT32_TYPE__
|
|
||||||
#define __UINT32_TYPE__ unsigned int
|
|
||||||
|
|
||||||
#endif // __riscv
|
|
||||||
|
|
||||||
//alias, deprecated for the chips after esp32s2
|
|
||||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
|
||||||
#define SPI_HOST SPI1_HOST
|
|
||||||
#define HSPI_HOST SPI2_HOST
|
|
||||||
#define VSPI_HOST SPI3_HOST
|
|
||||||
|
|
||||||
#elif CONFIG_IDF_TARGET_ESP32S2
|
|
||||||
// SPI_HOST (SPI1_HOST) is not supported by the SPI Master and SPI Slave driver on ESP32-S2 and later
|
|
||||||
#define SPI_HOST SPI1_HOST
|
|
||||||
#define FSPI_HOST SPI2_HOST
|
|
||||||
#define HSPI_HOST SPI3_HOST
|
|
||||||
#define VSPI_HOST SPI3_HOST
|
|
||||||
|
|
||||||
#elif CONFIG_IDF_TARGET_ESP32S3
|
|
||||||
// SPI_HOST (SPI1_HOST) is not supported by the SPI Master and SPI Slave driver on ESP32-S2 and later
|
|
||||||
#define SPI_HOST SPI1_HOST
|
|
||||||
#define FSPI_HOST SPI2_HOST
|
|
||||||
#define HSPI_HOST SPI3_HOST
|
|
||||||
#define VSPI_HOST SPI3_HOST
|
|
||||||
// SPI_MOSI_DLEN_REG is not defined anymore in esp32s3
|
|
||||||
#define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x)
|
|
||||||
|
|
||||||
#elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C5 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32P4
|
|
||||||
#define SPI_HOST SPI1_HOST
|
|
||||||
#define HSPI_HOST SPI2_HOST
|
|
||||||
#define VSPI_HOST SPI2_HOST /* No SPI3_host on C2/C6 */
|
|
||||||
#define VSPI SPI
|
|
||||||
// SPI_MOSI_DLEN_REG is not defined anymore
|
|
||||||
#define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x)
|
|
||||||
|
|
||||||
#endif // TARGET
|
|
||||||
|
|
||||||
// This trick makes sure that 'lto' optimizer does not inline `delay()
|
|
||||||
// so we can override it with `-Wl,--wrap=delay` linker directive
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C"
|
|
||||||
#endif // _cplusplus
|
|
||||||
void delay(__UINT32_TYPE__ ms) __attribute__((noinline)) __attribute__ ((noclone));
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
/*
|
|
||||||
tasmota_include.h - header to be included in libs for external configuration via Tasmota ifdefs
|
|
||||||
|
|
||||||
Copyright (C) 2021 Theo Arends
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __TASMOTA_INCLUDE__
|
|
||||||
#define __TASMOTA_INCLUDE__
|
|
||||||
|
|
||||||
#include "../tasmota/my_user_config.h"
|
|
||||||
#include "../tasmota/include/tasmota_configurations.h"
|
|
||||||
|
|
||||||
#endif // __TASMOTA_INCLUDE__
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
# TASMESH
|
|
||||||
|
|
||||||
This driver provides the ability to move TASMOTA-devices out of the WLAN by using ESP-NOW to communicate bidirectional with an internal protocol.
|
|
||||||
|
|
||||||
Thus the workload for the WLAN-router is reduced and with the reduced overhead the local 2.4-GHz-band will be freed of some traffic. Power consumption of the nodes will be reduced significantly allowing better battery powered projects with TASMOTA.
|
|
||||||
Automatic payload encryption is applied using the WiFi-password1 as the key. A maximum of 32 bytes of this password is used for the ChaCha20Poly1305 authenticated encryption as the key.
|
|
||||||
|
|
||||||
As ACK/NACK messages seem to be not reliable on both ESP-platforms, the method "send-and-pray" is used.
|
|
||||||
|
|
||||||
|
|
||||||
## Working principle
|
|
||||||
|
|
||||||
An ESP32 is needed as gateway/broker to connect the nodes (typically an ESP8266) to the WLAN. The ESP32 will receive the MQTT-topic of every node and subscribe to it as a proxy.
|
|
||||||
If a MQTT-message in the form of 'cmnd/node_topic/...' is received, the broker will automatically send this to the referring node via ESP-NOW.
|
|
||||||
The broker will automatically send time messages to all nodes.
|
|
||||||
|
|
||||||
The nodes will send their MQTT-messages back to the broker via ESP-NOW.
|
|
||||||
|
|
||||||
## Enabling the driver
|
|
||||||
|
|
||||||
Add ``#define USE_TASMESH`` to your file ``user_config_override.h`` before compilation.
|
|
||||||
|
|
||||||
## Commands
|
|
||||||
|
|
||||||
**WARNING: The MAC address used for ESP-NOW on the broker is the *Soft AP MAC*, not the WiFi MAC.**
|
|
||||||
|
|
||||||
*NOTE: The colons in the mac addresses of the commands are optional.*
|
|
||||||
|
|
||||||
``MeshBroker`` - starts the broker on the ESP32, printing out the MAC and used WiFi-channel to the log. Must be called after WiFi is initialized!! Example 'Rule1 on system#boot do meshbroker endon'
|
|
||||||
|
|
||||||
``MeshChannel 1..13`` - changes the WiFi-channel (on the node) to n (1-13) according to the channel of the (ESP32-)broker.
|
|
||||||
|
|
||||||
``MeshNode AA:BB:CC:DD:EE:FF`` - starts a node and connects the the broker with the given MAC-address, will automatically send MQTT-topic to the broker
|
|
||||||
|
|
||||||
``MeshPeer AA:BB:CC:DD:EE:FF`` - usable to add a known node to another node to be able to send data via the mesh to the broker, that may be out of reach
|
|
||||||
|
|
||||||
``MeshInterval 2..200`` - changes the interval between mesh messages default set to 50 ms
|
|
||||||
|
|
||||||
## Rules
|
|
||||||
|
|
||||||
Rules examples:
|
|
||||||
|
|
||||||
- The broker must be started after wifi is up!!
|
|
||||||
- To start as ESP32 as broker after wifi and mqtt connection, use</br>``rule1 on system#boot do meshbroker endon``
|
|
||||||
- The node may be started as soon as possible. Once started wifi and webserver are disabled by design.
|
|
||||||
- To start the node immediately use</br>``rule1 on system#init do meshnode FA:KE:AD:DR:ES:S1 endon``
|
|
||||||
- To use mesh in combination with deep sleep, you must set a rule to re-initialize the mesh on wake-up.
|
|
||||||
The mesh status and parameters are **NOT** (yet) saved to flash and the mesh is not restarted automatically.
|
|
||||||
- **WARNING**: In case of a system-wide power outage, nodes will be unable to reconnect until after the broker is ready!
|
|
||||||
If all devices power up at the same time, a broker starting after `system#boot` will likely not be ready until *after* a node attempting to join at `system#init`.
|
|
||||||
This will cause the node to fail to mesh and *no retrying is implemented at this time*.
|
|
||||||
To account for this, instead of (or in addition to) using a rule on the nodes, assign all nodes to a common group topic (`GroupTopic2 tasnodes`) and have the broker send a command on that topic after it is ready:</br>`rule2 on mesh#broker=1 do publish cmnd/tasnodes/meshnode FA:KE:AD:DR:ES:S1`
|
|
||||||
- Add a known peer (another node in the mesh) after the node has initialized</br>``rule3 on mesh#node=1 do meshpeer FA:KE:AD:DR:ES:S1 endon``
|
|
||||||
|
|
||||||
## Limitations
|
|
||||||
|
|
||||||
The following limitations apply:
|
|
||||||
- An ESP32 is only supported as a broker
|
|
||||||
- An ESP8266 is only supported as a node
|
|
||||||
- No command persistence is implemented so use rules to start a broker or a node after start up or deep sleep
|
|
||||||
- Although node send queues are implemented there is no node receive queue so MQTT commands send to the node need to be as small as possible limited to a maximum of around 160 characters including the topic
|
|
||||||
- Although broker receive queues are implemented there is no broker send queue so MQTT commands send to the node need to be as small as possible limited to a maximum of around 160 characters including the topic
|
|
||||||
- As there is no direct connection from the node to the MQTT broker it will signal the node as LWT Offline
|
|
||||||
@ -1,334 +0,0 @@
|
|||||||
/**************************************************************************//**
|
|
||||||
* \brief EEPROM 24C128 / 24C256 library for Arduino
|
|
||||||
* \author Copyright (C) 2012 Julien Le Sech - www.idreammicro.com
|
|
||||||
* \version 1.0
|
|
||||||
* \date 20120203
|
|
||||||
*
|
|
||||||
* This file is part of the EEPROM 24C128 / 24C256 library for Arduino.
|
|
||||||
*
|
|
||||||
* 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 3 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 program. If not, see http://www.gnu.org/licenses/
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \file Eeprom24C128_256.cpp
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* Header file inclusions.
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
#include <Arduino.h>
|
|
||||||
#include <Wire.h>
|
|
||||||
|
|
||||||
#include <Eeprom24C128_256.h>
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* Private macro definitions.
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \def EEPROM__PAGE_SIZE
|
|
||||||
* \brief Size of a page in EEPROM memory.
|
|
||||||
* This size is given by EEPROM memory datasheet.
|
|
||||||
******************************************************************************/
|
|
||||||
#define EEPROM__PAGE_SIZE 64
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \def EEPROM__RD_BUFFER_SIZE
|
|
||||||
* \brief Size of input TWI buffer.
|
|
||||||
* This size is equal to BUFFER_LENGTH defined in Wire library (32 bytes).
|
|
||||||
******************************************************************************/
|
|
||||||
#define xBUFFER_LENGTH 24
|
|
||||||
#define EEPROM__RD_BUFFER_SIZE xBUFFER_LENGTH
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \def EEPROM__WR_BUFFER_SIZE
|
|
||||||
* \brief Size of output TWI buffer.
|
|
||||||
* This size is equal to BUFFER_LENGTH - 2 bytes reserved for address.
|
|
||||||
******************************************************************************/
|
|
||||||
#define EEPROM__WR_BUFFER_SIZE (xBUFFER_LENGTH - 2)
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* Public method definitions.
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn Eeprom24C128_256::Eeprom24C128_256(byte deviceAddress)
|
|
||||||
*
|
|
||||||
* \brief Constructor.
|
|
||||||
*
|
|
||||||
* \param deviceAddress EEPROM address on TWI bus.
|
|
||||||
******************************************************************************/
|
|
||||||
Eeprom24C128_256::Eeprom24C128_256
|
|
||||||
(
|
|
||||||
byte deviceAddress
|
|
||||||
){
|
|
||||||
m_deviceAddress = deviceAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn void Eeprom24C128_256::initialize()
|
|
||||||
*
|
|
||||||
* \brief Initialize library and TWI bus.
|
|
||||||
*
|
|
||||||
* If several devices are connected to TWI bus, this method mustn't be
|
|
||||||
* called. TWI bus must be initialized out of this library using
|
|
||||||
* Wire.begin() method.
|
|
||||||
******************************************************************************/
|
|
||||||
void
|
|
||||||
Eeprom24C128_256::initialize()
|
|
||||||
{
|
|
||||||
Wire.begin();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn void Eeprom24C128_256::writeByte(
|
|
||||||
* word address,
|
|
||||||
* byte data)
|
|
||||||
*
|
|
||||||
* \brief Write a byte in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \remarks A delay of 10 ms is required after write cycle.
|
|
||||||
*
|
|
||||||
* \param address Address.
|
|
||||||
* \param data Byte to write.
|
|
||||||
******************************************************************************/
|
|
||||||
void
|
|
||||||
Eeprom24C128_256::writeByte
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
byte data
|
|
||||||
){
|
|
||||||
Wire.beginTransmission(m_deviceAddress);
|
|
||||||
Wire.write(address >> 8);
|
|
||||||
Wire.write(address & 0xFF);
|
|
||||||
Wire.write(data);
|
|
||||||
Wire.endTransmission();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn void Eeprom24C128_256::writeBytes(
|
|
||||||
* word address,
|
|
||||||
* word length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Write bytes in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes to write.
|
|
||||||
* \param[in] p_data Bytes to write.
|
|
||||||
******************************************************************************/
|
|
||||||
void
|
|
||||||
Eeprom24C128_256::writeBytes
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
word length,
|
|
||||||
byte* p_data
|
|
||||||
){
|
|
||||||
// Write first page if not aligned.
|
|
||||||
byte notAlignedLength = 0;
|
|
||||||
byte pageOffset = address % EEPROM__PAGE_SIZE;
|
|
||||||
if (pageOffset > 0)
|
|
||||||
{
|
|
||||||
notAlignedLength = EEPROM__PAGE_SIZE - pageOffset;
|
|
||||||
if (length < notAlignedLength)
|
|
||||||
{
|
|
||||||
notAlignedLength = length;
|
|
||||||
}
|
|
||||||
writePage(address, notAlignedLength, p_data);
|
|
||||||
length -= notAlignedLength;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (length > 0)
|
|
||||||
{
|
|
||||||
address += notAlignedLength;
|
|
||||||
p_data += notAlignedLength;
|
|
||||||
|
|
||||||
// Write complete and aligned pages.
|
|
||||||
word pageCount = length / EEPROM__PAGE_SIZE;
|
|
||||||
for (word i = 0; i < pageCount; i++)
|
|
||||||
{
|
|
||||||
writePage(address, EEPROM__PAGE_SIZE, p_data);
|
|
||||||
address += EEPROM__PAGE_SIZE;
|
|
||||||
p_data += EEPROM__PAGE_SIZE;
|
|
||||||
length -= EEPROM__PAGE_SIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (length > 0)
|
|
||||||
{
|
|
||||||
// Write remaining uncomplete page.
|
|
||||||
writePage(address, length, p_data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn byte Eeprom24C128_256::readByte(word address)
|
|
||||||
*
|
|
||||||
* \brief Read a byte in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \param address Address.
|
|
||||||
*
|
|
||||||
* \return Read byte.
|
|
||||||
******************************************************************************/
|
|
||||||
byte
|
|
||||||
Eeprom24C128_256::readByte
|
|
||||||
(
|
|
||||||
word address
|
|
||||||
){
|
|
||||||
Wire.beginTransmission(m_deviceAddress);
|
|
||||||
Wire.write(address >> 8);
|
|
||||||
Wire.write(address & 0xFF);
|
|
||||||
Wire.endTransmission();
|
|
||||||
Wire.requestFrom(m_deviceAddress, (byte)1);
|
|
||||||
byte data = 0;
|
|
||||||
if (Wire.available())
|
|
||||||
{
|
|
||||||
data = Wire.read();
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn void Eeprom24C128_256::readBytes(
|
|
||||||
* word address,
|
|
||||||
* word length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Read bytes in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes to read.
|
|
||||||
* \patam[in] p_data Byte array to fill with read bytes.
|
|
||||||
******************************************************************************/
|
|
||||||
void
|
|
||||||
Eeprom24C128_256::readBytes
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
word length,
|
|
||||||
byte* p_data
|
|
||||||
){
|
|
||||||
byte bufferCount = length / EEPROM__RD_BUFFER_SIZE;
|
|
||||||
for (byte i = 0; i < bufferCount; i++)
|
|
||||||
{
|
|
||||||
word offset = i * EEPROM__RD_BUFFER_SIZE;
|
|
||||||
readBuffer(address + offset, EEPROM__RD_BUFFER_SIZE, p_data + offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
byte remainingBytes = length % EEPROM__RD_BUFFER_SIZE;
|
|
||||||
word offset = length - remainingBytes;
|
|
||||||
readBuffer(address + offset, remainingBytes, p_data + offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* Private method definitions.
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn void Eeprom24C128_256::writePage(
|
|
||||||
* word address,
|
|
||||||
* byte length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Write page in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes (EEPROM__PAGE_SIZE bytes max).
|
|
||||||
* \param[in] p_data Data.
|
|
||||||
******************************************************************************/
|
|
||||||
void
|
|
||||||
Eeprom24C128_256::writePage
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
byte length,
|
|
||||||
byte* p_data
|
|
||||||
){
|
|
||||||
// Write complete buffers.
|
|
||||||
byte bufferCount = length / EEPROM__WR_BUFFER_SIZE;
|
|
||||||
for (byte i = 0; i < bufferCount; i++)
|
|
||||||
{
|
|
||||||
byte offset = i * EEPROM__WR_BUFFER_SIZE;
|
|
||||||
writeBuffer(address + offset, EEPROM__WR_BUFFER_SIZE, p_data + offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write remaining bytes.
|
|
||||||
byte remainingBytes = length % EEPROM__WR_BUFFER_SIZE;
|
|
||||||
byte offset = length - remainingBytes;
|
|
||||||
writeBuffer(address + offset, remainingBytes, p_data + offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn void Eeprom24C128_256::writeBuffer(
|
|
||||||
* word address,
|
|
||||||
* byte length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Write bytes into memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes (EEPROM__WR_BUFFER_SIZE bytes max).
|
|
||||||
* \param[in] p_data Data.
|
|
||||||
******************************************************************************/
|
|
||||||
void
|
|
||||||
Eeprom24C128_256::writeBuffer
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
byte length,
|
|
||||||
byte* p_data
|
|
||||||
){
|
|
||||||
Wire.beginTransmission(m_deviceAddress);
|
|
||||||
Wire.write(address >> 8);
|
|
||||||
Wire.write(address & 0xFF);
|
|
||||||
for (byte i = 0; i < length; i++)
|
|
||||||
{
|
|
||||||
Wire.write(p_data[i]);
|
|
||||||
}
|
|
||||||
Wire.endTransmission();
|
|
||||||
|
|
||||||
// Write cycle time (tWR). See EEPROM memory datasheet for more details.
|
|
||||||
delay(10);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn void Eeprom24C128_256::readBuffer(
|
|
||||||
* word address,
|
|
||||||
* byte length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Read bytes in memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes (EEPROM__RD_BUFFER_SIZE bytes max).
|
|
||||||
* \param[in] p_data Buffer to fill with read bytes.
|
|
||||||
******************************************************************************/
|
|
||||||
void
|
|
||||||
Eeprom24C128_256::readBuffer
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
byte length,
|
|
||||||
byte* p_data
|
|
||||||
){
|
|
||||||
Wire.beginTransmission(m_deviceAddress);
|
|
||||||
Wire.write(address >> 8);
|
|
||||||
Wire.write(address & 0xFF);
|
|
||||||
Wire.endTransmission();
|
|
||||||
Wire.requestFrom(m_deviceAddress, length);
|
|
||||||
for (byte i = 0; i < length; i++)
|
|
||||||
{
|
|
||||||
if (Wire.available())
|
|
||||||
{
|
|
||||||
p_data[i] = Wire.read();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,212 +0,0 @@
|
|||||||
/**************************************************************************//**
|
|
||||||
* \brief EEPROM 24C128 / 24C256 library for Arduino
|
|
||||||
* \author Copyright (C) 2012 Julien Le Sech - www.idreammicro.com
|
|
||||||
* \version 1.0
|
|
||||||
* \date 20120203
|
|
||||||
*
|
|
||||||
* This file is part of the EEPROM 24C128 / 24C256 library for Arduino.
|
|
||||||
*
|
|
||||||
* 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 3 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 program. If not, see http://www.gnu.org/licenses/
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \headerfile Eeprom24C128_256.h
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
#ifndef Eeprom24C128_256_h
|
|
||||||
#define Eeprom24C128_256_h
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* Header file inclusion.
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
#include <Arduino.h>
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \class Eeprom24C128_256
|
|
||||||
*
|
|
||||||
* \brief EEPROM 24C128 / 24C256 memory driver.
|
|
||||||
*
|
|
||||||
* This driver is mainly designed for 24C128 and 24C256 EEPROM memories. It's
|
|
||||||
* also suitable for 24C512 memories.
|
|
||||||
******************************************************************************/
|
|
||||||
class Eeprom24C128_256
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn Eeprom24C128_256(byte deviceAddress)
|
|
||||||
*
|
|
||||||
* \brief Constructor.
|
|
||||||
*
|
|
||||||
* \param deviceAddress EEPROM address on TWI bus.
|
|
||||||
**********************************************************************/
|
|
||||||
Eeprom24C128_256
|
|
||||||
(
|
|
||||||
byte deviceAddress
|
|
||||||
);
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn void initialize()
|
|
||||||
*
|
|
||||||
* \brief Initialize library abnd TWI bus.
|
|
||||||
*
|
|
||||||
* If several devices are connected to TWI bus, this method mustn't be
|
|
||||||
* called. TWI bus must be initialized out of this library using
|
|
||||||
* Wire.begin() method.
|
|
||||||
**********************************************************************/
|
|
||||||
void
|
|
||||||
initialize();
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn void writeByte(
|
|
||||||
* word address,
|
|
||||||
* byte data)
|
|
||||||
*
|
|
||||||
* \brief Write a byte in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \remarks A delay of 10 ms is required after write cycle.
|
|
||||||
*
|
|
||||||
* \param address Address.
|
|
||||||
* \param data Byte to write.
|
|
||||||
**********************************************************************/
|
|
||||||
void
|
|
||||||
writeByte
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
byte data
|
|
||||||
);
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn void writeBytes(
|
|
||||||
* word address,
|
|
||||||
* word length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Write bytes in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes to write.
|
|
||||||
* \param[in] p_data Bytes to write.
|
|
||||||
**********************************************************************/
|
|
||||||
void
|
|
||||||
writeBytes
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
word length,
|
|
||||||
byte* p_data
|
|
||||||
);
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn byte readByte(word address)
|
|
||||||
*
|
|
||||||
* \brief Read a byte in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \param address Address.
|
|
||||||
*
|
|
||||||
* \return Read byte.
|
|
||||||
**********************************************************************/
|
|
||||||
byte
|
|
||||||
readByte
|
|
||||||
(
|
|
||||||
word address
|
|
||||||
);
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn void readBytes(
|
|
||||||
* word address,
|
|
||||||
* word length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Read bytes in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes to read.
|
|
||||||
* \patam[in] p_data Byte array to fill with read bytes.
|
|
||||||
**********************************************************************/
|
|
||||||
void
|
|
||||||
readBytes
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
word length,
|
|
||||||
byte* p_buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
byte m_deviceAddress;
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn void writePage(
|
|
||||||
* word address,
|
|
||||||
* byte length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Write page in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes (64 bytes max).
|
|
||||||
* \param[in] p_data Data.
|
|
||||||
**********************************************************************/
|
|
||||||
void
|
|
||||||
writePage
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
byte length,
|
|
||||||
byte* p_data
|
|
||||||
);
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn void writeBuffer(
|
|
||||||
* word address,
|
|
||||||
* byte length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Write bytes into memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes (30 bytes max).
|
|
||||||
* \param[in] p_date Data.
|
|
||||||
**********************************************************************/
|
|
||||||
void
|
|
||||||
writeBuffer
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
byte length,
|
|
||||||
byte* p_data
|
|
||||||
);
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn void readBuffer(
|
|
||||||
* word address,
|
|
||||||
* byte length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Read bytes in memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes to read (32 bytes max).
|
|
||||||
* \param[in] p_data Buffer to fill with read bytes.
|
|
||||||
**********************************************************************/
|
|
||||||
void
|
|
||||||
readBuffer
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
byte length,
|
|
||||||
byte* p_data
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // Eeprom24C128_256_h
|
|
||||||
|
|
||||||
@ -1,336 +0,0 @@
|
|||||||
/**************************************************************************//**
|
|
||||||
* \brief EEPROM 24C512 library for Arduino
|
|
||||||
* \author Copyright (C) 2012 Julien Le Sech - www.idreammicro.com
|
|
||||||
* \version 1.0
|
|
||||||
* \date 20120218
|
|
||||||
*
|
|
||||||
* This file is part of the EEPROM 24C512 library for Arduino.
|
|
||||||
*
|
|
||||||
* 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 3 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 program. If not, see http://www.gnu.org/licenses/
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \file Eeprom24C512.cpp
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* Header file inclusions.
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
#include <Arduino.h>
|
|
||||||
#include <Wire.h>
|
|
||||||
|
|
||||||
#include <Eeprom24C512.h>
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* Private macro definitions.
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \def EEPROM__PAGE_SIZE
|
|
||||||
* \brief Size of a page in EEPROM memory.
|
|
||||||
* This size is given by EEPROM memory datasheet.
|
|
||||||
******************************************************************************/
|
|
||||||
#define EEPROM__PAGE_SIZE 128
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \def EEPROM__RD_BUFFER_SIZE
|
|
||||||
* \brief Size of input TWI buffer.
|
|
||||||
* This size is equal to BUFFER_LENGTH defined in Wire library (32 bytes).
|
|
||||||
******************************************************************************/
|
|
||||||
#define EEPROM__RD_BUFFER_SIZE BUFFER_LENGTH
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \def EEPROM__WR_BUFFER_SIZE
|
|
||||||
* \brief Size of output TWI buffer.
|
|
||||||
* This size is equal to BUFFER_LENGTH - 2 bytes reserved for address.
|
|
||||||
******************************************************************************/
|
|
||||||
#define EEPROM__WR_BUFFER_SIZE (BUFFER_LENGTH - 2)
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* Public method definitions.
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn Eeprom24C512::Eeprom24C512(byte deviceAddress)
|
|
||||||
*
|
|
||||||
* \brief Constructor.
|
|
||||||
*
|
|
||||||
* \param deviceAddress EEPROM address on TWI bus.
|
|
||||||
******************************************************************************/
|
|
||||||
Eeprom24C512::Eeprom24C512
|
|
||||||
(
|
|
||||||
byte deviceAddress
|
|
||||||
){
|
|
||||||
m_deviceAddress = deviceAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn void Eeprom24C512::initialize()
|
|
||||||
*
|
|
||||||
* \brief Initialize library and TWI bus.
|
|
||||||
*
|
|
||||||
* If several devices are connected to TWI bus, this method mustn't be
|
|
||||||
* called. TWI bus must be initialized out of this library using
|
|
||||||
* Wire.begin() method.
|
|
||||||
******************************************************************************/
|
|
||||||
void
|
|
||||||
Eeprom24C512::initialize()
|
|
||||||
{
|
|
||||||
Wire.begin();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn void Eeprom24C512::writeByte(
|
|
||||||
* word address,
|
|
||||||
* byte data)
|
|
||||||
*
|
|
||||||
* \brief Write a byte in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \remarks A delay of 10 ms is required after write cycle.
|
|
||||||
*
|
|
||||||
* \param address Address.
|
|
||||||
* \param data Byte to write.
|
|
||||||
******************************************************************************/
|
|
||||||
void
|
|
||||||
Eeprom24C512::writeByte
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
byte data
|
|
||||||
){
|
|
||||||
Wire.beginTransmission(m_deviceAddress);
|
|
||||||
Wire.write(address >> 8);
|
|
||||||
Wire.write(address & 0xFF);
|
|
||||||
Wire.write(data);
|
|
||||||
Wire.endTransmission();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn void Eeprom24C512::writeBytes(
|
|
||||||
* word address,
|
|
||||||
* word length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Write bytes in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes to write.
|
|
||||||
* \param[in] p_data Bytes to write.
|
|
||||||
******************************************************************************/
|
|
||||||
void
|
|
||||||
Eeprom24C512::writeBytes
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
word length,
|
|
||||||
byte* p_data
|
|
||||||
){
|
|
||||||
// Write first page if not aligned.
|
|
||||||
byte notAlignedLength = 0;
|
|
||||||
byte pageOffset = address % EEPROM__PAGE_SIZE;
|
|
||||||
if (pageOffset > 0)
|
|
||||||
{
|
|
||||||
notAlignedLength = EEPROM__PAGE_SIZE - pageOffset;
|
|
||||||
if (length < notAlignedLength)
|
|
||||||
{
|
|
||||||
notAlignedLength = length;
|
|
||||||
}
|
|
||||||
writePage(address, notAlignedLength, p_data);
|
|
||||||
length -= notAlignedLength;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (length > 0)
|
|
||||||
{
|
|
||||||
address += notAlignedLength;
|
|
||||||
p_data += notAlignedLength;
|
|
||||||
|
|
||||||
// Write complete and aligned pages.
|
|
||||||
word pageCount = length / EEPROM__PAGE_SIZE;
|
|
||||||
for (word i = 0; i < pageCount; i++)
|
|
||||||
{
|
|
||||||
writePage(address, EEPROM__PAGE_SIZE, p_data);
|
|
||||||
address += EEPROM__PAGE_SIZE;
|
|
||||||
p_data += EEPROM__PAGE_SIZE;
|
|
||||||
length -= EEPROM__PAGE_SIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (length > 0)
|
|
||||||
{
|
|
||||||
// Write remaining uncomplete page.
|
|
||||||
writePage(address, length, p_data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn byte Eeprom24C512::readByte(word address)
|
|
||||||
*
|
|
||||||
* \brief Read a byte in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \param address Address.
|
|
||||||
*
|
|
||||||
* \return Read byte.
|
|
||||||
******************************************************************************/
|
|
||||||
byte
|
|
||||||
Eeprom24C512::readByte
|
|
||||||
(
|
|
||||||
word address
|
|
||||||
){
|
|
||||||
Wire.beginTransmission(m_deviceAddress);
|
|
||||||
Wire.write(address >> 8);
|
|
||||||
Wire.write(address & 0xFF);
|
|
||||||
Wire.endTransmission();
|
|
||||||
Wire.requestFrom(m_deviceAddress, (byte)1);
|
|
||||||
byte data = 0;
|
|
||||||
if (Wire.available())
|
|
||||||
{
|
|
||||||
data = Wire.read();
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn void Eeprom24C512::readBytes(
|
|
||||||
* word address,
|
|
||||||
* word length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Read bytes in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes to read.
|
|
||||||
* \patam[in] p_data Byte array to fill with read bytes.
|
|
||||||
******************************************************************************/
|
|
||||||
void
|
|
||||||
Eeprom24C512::readBytes
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
word length,
|
|
||||||
byte* p_data
|
|
||||||
){
|
|
||||||
word bufferCount = length / EEPROM__RD_BUFFER_SIZE;
|
|
||||||
for (word i = 0; i < bufferCount; i++)
|
|
||||||
{
|
|
||||||
word offset = i * EEPROM__RD_BUFFER_SIZE;
|
|
||||||
readBuffer(address + offset, EEPROM__RD_BUFFER_SIZE, p_data + offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
byte remainingBytes = length % EEPROM__RD_BUFFER_SIZE;
|
|
||||||
word offset = length - remainingBytes;
|
|
||||||
if (remainingBytes > 0) {
|
|
||||||
readBuffer(address + offset, remainingBytes, p_data + offset);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* Private method definitions.
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn void Eeprom24C512::writePage(
|
|
||||||
* word address,
|
|
||||||
* byte length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Write page in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes (EEPROM__PAGE_SIZE bytes max).
|
|
||||||
* \param[in] p_data Data.
|
|
||||||
******************************************************************************/
|
|
||||||
void
|
|
||||||
Eeprom24C512::writePage
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
byte length,
|
|
||||||
byte* p_data
|
|
||||||
){
|
|
||||||
// Write complete buffers.
|
|
||||||
byte bufferCount = length / EEPROM__WR_BUFFER_SIZE;
|
|
||||||
for (byte i = 0; i < bufferCount; i++)
|
|
||||||
{
|
|
||||||
byte offset = i * EEPROM__WR_BUFFER_SIZE;
|
|
||||||
writeBuffer(address + offset, EEPROM__WR_BUFFER_SIZE, p_data + offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write remaining bytes.
|
|
||||||
byte remainingBytes = length % EEPROM__WR_BUFFER_SIZE;
|
|
||||||
byte offset = length - remainingBytes;
|
|
||||||
writeBuffer(address + offset, remainingBytes, p_data + offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn void Eeprom24C512::writeBuffer(
|
|
||||||
* word address,
|
|
||||||
* byte length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Write bytes into memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes (EEPROM__WR_BUFFER_SIZE bytes max).
|
|
||||||
* \param[in] p_data Data.
|
|
||||||
******************************************************************************/
|
|
||||||
void
|
|
||||||
Eeprom24C512::writeBuffer
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
byte length,
|
|
||||||
byte* p_data
|
|
||||||
){
|
|
||||||
Wire.beginTransmission(m_deviceAddress);
|
|
||||||
Wire.write(address >> 8);
|
|
||||||
Wire.write(address & 0xFF);
|
|
||||||
for (byte i = 0; i < length; i++)
|
|
||||||
{
|
|
||||||
Wire.write(p_data[i]);
|
|
||||||
}
|
|
||||||
Wire.endTransmission();
|
|
||||||
|
|
||||||
// Write cycle time (tWR). See EEPROM memory datasheet for more details.
|
|
||||||
delay(10);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \fn void Eeprom24C512::readBuffer(
|
|
||||||
* word address,
|
|
||||||
* byte length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Read bytes in memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes (EEPROM__RD_BUFFER_SIZE bytes max).
|
|
||||||
* \param[in] p_data Buffer to fill with read bytes.
|
|
||||||
******************************************************************************/
|
|
||||||
void
|
|
||||||
Eeprom24C512::readBuffer
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
byte length,
|
|
||||||
byte* p_data
|
|
||||||
){
|
|
||||||
Wire.beginTransmission(m_deviceAddress);
|
|
||||||
Wire.write(address >> 8);
|
|
||||||
Wire.write(address & 0xFF);
|
|
||||||
Wire.endTransmission();
|
|
||||||
Wire.requestFrom(m_deviceAddress, length);
|
|
||||||
for (byte i = 0; i < length; i++)
|
|
||||||
{
|
|
||||||
if (Wire.available())
|
|
||||||
{
|
|
||||||
p_data[i] = Wire.read();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,211 +0,0 @@
|
|||||||
/**************************************************************************//**
|
|
||||||
* \brief EEPROM 24C512 library for Arduino
|
|
||||||
* \author Copyright (C) 2012 Julien Le Sech - www.idreammicro.com
|
|
||||||
* \version 1.0
|
|
||||||
* \date 20120203
|
|
||||||
*
|
|
||||||
* This file is part of the EEPROM 24C512 library for Arduino.
|
|
||||||
*
|
|
||||||
* 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 3 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 program. If not, see http://www.gnu.org/licenses/
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \headerfile Eeprom24C512.h
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
#ifndef Eeprom24C512_h
|
|
||||||
#define Eeprom24C512_h
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* Header file inclusion.
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
#include <Arduino.h>
|
|
||||||
|
|
||||||
/**************************************************************************//**
|
|
||||||
* \class Eeprom24C512
|
|
||||||
*
|
|
||||||
* \brief EEPROM 24C512 memory driver.
|
|
||||||
*
|
|
||||||
* This driver is designed for 24C512 memory.
|
|
||||||
******************************************************************************/
|
|
||||||
class Eeprom24C512
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn Eeprom24C512(byte deviceAddress)
|
|
||||||
*
|
|
||||||
* \brief Constructor.
|
|
||||||
*
|
|
||||||
* \param deviceAddress EEPROM address on TWI bus.
|
|
||||||
**********************************************************************/
|
|
||||||
Eeprom24C512
|
|
||||||
(
|
|
||||||
byte deviceAddress
|
|
||||||
);
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn void initialize()
|
|
||||||
*
|
|
||||||
* \brief Initialize library abnd TWI bus.
|
|
||||||
*
|
|
||||||
* If several devices are connected to TWI bus, this method mustn't be
|
|
||||||
* called. TWI bus must be initialized out of this library using
|
|
||||||
* Wire.begin() method.
|
|
||||||
**********************************************************************/
|
|
||||||
void
|
|
||||||
initialize();
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn void writeByte(
|
|
||||||
* word address,
|
|
||||||
* byte data)
|
|
||||||
*
|
|
||||||
* \brief Write a byte in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \remarks A delay of 10 ms is required after write cycle.
|
|
||||||
*
|
|
||||||
* \param address Address.
|
|
||||||
* \param data Byte to write.
|
|
||||||
**********************************************************************/
|
|
||||||
void
|
|
||||||
writeByte
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
byte data
|
|
||||||
);
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn void writeBytes(
|
|
||||||
* word address,
|
|
||||||
* word length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Write bytes in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes to write.
|
|
||||||
* \param[in] p_data Bytes to write.
|
|
||||||
**********************************************************************/
|
|
||||||
void
|
|
||||||
writeBytes
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
word length,
|
|
||||||
byte* p_data
|
|
||||||
);
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn byte readByte(word address)
|
|
||||||
*
|
|
||||||
* \brief Read a byte in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \param address Address.
|
|
||||||
*
|
|
||||||
* \return Read byte.
|
|
||||||
**********************************************************************/
|
|
||||||
byte
|
|
||||||
readByte
|
|
||||||
(
|
|
||||||
word address
|
|
||||||
);
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn void readBytes(
|
|
||||||
* word address,
|
|
||||||
* word length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Read bytes in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes to read.
|
|
||||||
* \patam[in] p_data Byte array to fill with read bytes.
|
|
||||||
**********************************************************************/
|
|
||||||
void
|
|
||||||
readBytes
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
word length,
|
|
||||||
byte* p_buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
byte m_deviceAddress;
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn void writePage(
|
|
||||||
* word address,
|
|
||||||
* byte length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Write page in EEPROM memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes (64 bytes max).
|
|
||||||
* \param[in] p_data Data.
|
|
||||||
**********************************************************************/
|
|
||||||
void
|
|
||||||
writePage
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
byte length,
|
|
||||||
byte* p_data
|
|
||||||
);
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn void writeBuffer(
|
|
||||||
* word address,
|
|
||||||
* byte length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Write bytes into memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes (30 bytes max).
|
|
||||||
* \param[in] p_date Data.
|
|
||||||
**********************************************************************/
|
|
||||||
void
|
|
||||||
writeBuffer
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
byte length,
|
|
||||||
byte* p_data
|
|
||||||
);
|
|
||||||
|
|
||||||
/******************************************************************//**
|
|
||||||
* \fn void readBuffer(
|
|
||||||
* word address,
|
|
||||||
* byte length,
|
|
||||||
* byte* p_data)
|
|
||||||
*
|
|
||||||
* \brief Read bytes in memory.
|
|
||||||
*
|
|
||||||
* \param address Start address.
|
|
||||||
* \param length Number of bytes to read (32 bytes max).
|
|
||||||
* \param[in] p_data Buffer to fill with read bytes.
|
|
||||||
**********************************************************************/
|
|
||||||
void
|
|
||||||
readBuffer
|
|
||||||
(
|
|
||||||
word address,
|
|
||||||
byte length,
|
|
||||||
byte* p_data
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // Eeprom24C512_h
|
|
||||||
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
name=EEPROM 24C128_256_521
|
|
||||||
version=
|
|
||||||
author=Julien Le Sech
|
|
||||||
maintainer=Julien Le Sech - www.idreammicro.com
|
|
||||||
sentence=EEPROM 24C128 / 24C256 / 24C512 memory driver.
|
|
||||||
paragraph=EEPROM 24C128 / 24C256 / 24C512 memory driver.
|
|
||||||
category=
|
|
||||||
url=
|
|
||||||
architectures=*
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
name=Ext-printf
|
|
||||||
version=1.0
|
|
||||||
author=Stephan Hadinger
|
|
||||||
maintainer=Stephan <stephan.hadinger@gmail.com>
|
|
||||||
sentence=Extension of snprintf() and vsnprintf()
|
|
||||||
paragraph=This library provides extended types support for snprintf (float, uint64_t)
|
|
||||||
architectures=esp8266, esp32
|
|
||||||
@ -1,304 +0,0 @@
|
|||||||
/*
|
|
||||||
support_buffer.ino - Static binary buffer for Zigbee on Tasmota
|
|
||||||
|
|
||||||
Copyright (C) 2021 Theo Arends and Stephan Hadinger
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct SBuffer_impl {
|
|
||||||
uint16_t size; // size in bytes of the buffer
|
|
||||||
uint16_t len; // current size of the data in buffer. Invariant: len <= size
|
|
||||||
uint8_t buf[]; // the actual data
|
|
||||||
} SBuffer_impl;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef class SBuffer {
|
|
||||||
|
|
||||||
protected:
|
|
||||||
SBuffer(void) {
|
|
||||||
// unused empty constructor except from subclass
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
|
||||||
SBuffer(const size_t size) {
|
|
||||||
_buf = (SBuffer_impl*) new char[size+4]; // add 4 bytes for size and len
|
|
||||||
_buf->size = size;
|
|
||||||
_buf->len = 0;
|
|
||||||
//*((uint32_t*)_buf) = size; // writing both size and len=0 in a single 32 bits write
|
|
||||||
}
|
|
||||||
|
|
||||||
inline size_t getSize(void) const { return _buf->size; }
|
|
||||||
inline size_t size(void) const { return _buf->size; }
|
|
||||||
inline size_t getLen(void) const { return _buf->len; }
|
|
||||||
inline size_t len(void) const { return _buf->len; }
|
|
||||||
inline uint8_t *getBuffer(void) const { return _buf->buf; }
|
|
||||||
inline uint8_t *buf(size_t i = 0) const { return &_buf->buf[i]; }
|
|
||||||
inline char *charptr(size_t i = 0) const { return (char*) &_buf->buf[i]; }
|
|
||||||
|
|
||||||
~SBuffer(void) {
|
|
||||||
delete[] _buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
// increase the internal buffer if needed
|
|
||||||
// do nothing if the buffer is big enough
|
|
||||||
void reserve(const size_t size) {
|
|
||||||
if (size > _buf->size) {
|
|
||||||
// we need to increase the buffer size
|
|
||||||
SBuffer_impl * new_buf = (SBuffer_impl*) new char[size+4]; // add 4 bytes for size and len
|
|
||||||
new_buf->size = size;
|
|
||||||
new_buf->len = _buf->len;
|
|
||||||
memmove(&new_buf->buf, &_buf->buf, _buf->len); // copy buffer
|
|
||||||
delete[] _buf;
|
|
||||||
_buf = new_buf;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void setLen(const size_t len) {
|
|
||||||
uint16_t old_len = _buf->len;
|
|
||||||
_buf->len = (len <= _buf->size) ? len : _buf->size;
|
|
||||||
if (old_len < _buf->len) {
|
|
||||||
memset((void*) &_buf->buf[old_len], 0, _buf->len - old_len);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void set8(const size_t offset, const uint8_t data) {
|
|
||||||
if (offset < _buf->len) {
|
|
||||||
_buf->buf[offset] = data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void set16(const size_t offset, const uint16_t data) {
|
|
||||||
if (offset + 1 < _buf->len) {
|
|
||||||
_buf->buf[offset] = data & 0xFF;
|
|
||||||
_buf->buf[offset+1] = (data >> 8) & 0xFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t add8(const uint8_t data) { // append 8 bits value
|
|
||||||
if (_buf->len < _buf->size) { // do we have room for 1 byte
|
|
||||||
_buf->buf[_buf->len++] = data;
|
|
||||||
}
|
|
||||||
return _buf->len;
|
|
||||||
}
|
|
||||||
size_t add16(const uint16_t data) { // append 16 bits value
|
|
||||||
if (_buf->len < _buf->size - 1) { // do we have room for 2 bytes
|
|
||||||
_buf->buf[_buf->len++] = data;
|
|
||||||
_buf->buf[_buf->len++] = data >> 8;
|
|
||||||
}
|
|
||||||
return _buf->len;
|
|
||||||
}
|
|
||||||
size_t add16BigEndian(const uint16_t data) { // append 16 bits value
|
|
||||||
if (_buf->len < _buf->size - 1) { // do we have room for 2 bytes
|
|
||||||
_buf->buf[_buf->len++] = data >> 8;
|
|
||||||
_buf->buf[_buf->len++] = data;
|
|
||||||
}
|
|
||||||
return _buf->len;
|
|
||||||
}
|
|
||||||
size_t add32(const uint32_t data) { // append 32 bits value
|
|
||||||
if (_buf->len < _buf->size - 3) { // do we have room for 4 bytes
|
|
||||||
_buf->buf[_buf->len++] = data;
|
|
||||||
_buf->buf[_buf->len++] = data >> 8;
|
|
||||||
_buf->buf[_buf->len++] = data >> 16;
|
|
||||||
_buf->buf[_buf->len++] = data >> 24;
|
|
||||||
}
|
|
||||||
return _buf->len;
|
|
||||||
}
|
|
||||||
size_t add32BigEndian(const uint32_t data) { // append 32 bits value
|
|
||||||
if (_buf->len < _buf->size - 3) { // do we have room for 4 bytes
|
|
||||||
_buf->buf[_buf->len++] = data >> 24;
|
|
||||||
_buf->buf[_buf->len++] = data >> 16;
|
|
||||||
_buf->buf[_buf->len++] = data >> 8;
|
|
||||||
_buf->buf[_buf->len++] = data;
|
|
||||||
}
|
|
||||||
return _buf->len;
|
|
||||||
}
|
|
||||||
size_t add64(const uint64_t data) { // append 64 bits value
|
|
||||||
if (_buf->len < _buf->size - 7) { // do we have room for 8 bytes
|
|
||||||
_buf->buf[_buf->len++] = data;
|
|
||||||
_buf->buf[_buf->len++] = data >> 8;
|
|
||||||
_buf->buf[_buf->len++] = data >> 16;
|
|
||||||
_buf->buf[_buf->len++] = data >> 24;
|
|
||||||
_buf->buf[_buf->len++] = data >> 32;
|
|
||||||
_buf->buf[_buf->len++] = data >> 40;
|
|
||||||
_buf->buf[_buf->len++] = data >> 48;
|
|
||||||
_buf->buf[_buf->len++] = data >> 56;
|
|
||||||
}
|
|
||||||
return _buf->len;
|
|
||||||
}
|
|
||||||
|
|
||||||
void replace(const SBuffer &buf2) {
|
|
||||||
uint32_t len = buf2.len();
|
|
||||||
reserve(len);
|
|
||||||
setLen(0); // clear buffer
|
|
||||||
addBuffer(buf2);
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t addBuffer(const SBuffer &buf2) {
|
|
||||||
if (len() + buf2.len() <= size()) {
|
|
||||||
for (uint32_t i = 0; i < buf2.len(); i++) {
|
|
||||||
_buf->buf[_buf->len++] = buf2.buf()[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return _buf->len;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t addBuffer(const uint8_t *buf2, size_t len2) {
|
|
||||||
if ((buf2) && (len() + len2 <= size())) {
|
|
||||||
for (uint32_t i = 0; i < len2; i++) {
|
|
||||||
_buf->buf[_buf->len++] = pgm_read_byte(&buf2[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return _buf->len;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t addBuffer(const char *buf2, size_t len2) {
|
|
||||||
if ((buf2) && (len() + len2 <= size())) {
|
|
||||||
for (uint32_t i = 0; i < len2; i++) {
|
|
||||||
_buf->buf[_buf->len++] = pgm_read_byte(&buf2[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return _buf->len;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t get8(size_t offset) const {
|
|
||||||
if (offset < _buf->len) {
|
|
||||||
return _buf->buf[offset];
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
uint8_t read8(const size_t offset) const {
|
|
||||||
if (offset < len()) {
|
|
||||||
return _buf->buf[offset];
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
uint16_t get16(const size_t offset) const {
|
|
||||||
if (offset < len() - 1) {
|
|
||||||
return _buf->buf[offset] | (_buf->buf[offset+1] << 8);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
uint16_t get16BigEndian(const size_t offset) const {
|
|
||||||
if (offset < len() - 1) {
|
|
||||||
return _buf->buf[offset+1] | (_buf->buf[offset] << 8);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
uint32_t get32(const size_t offset) const {
|
|
||||||
if (offset < len() - 3) {
|
|
||||||
return _buf->buf[offset] | (_buf->buf[offset+1] << 8) |
|
|
||||||
(_buf->buf[offset+2] << 16) | (_buf->buf[offset+3] << 24);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
uint32_t get32BigEndian(const size_t offset) const {
|
|
||||||
if (offset < len() - 3) {
|
|
||||||
return _buf->buf[offset+3] | (_buf->buf[offset+2] << 8) |
|
|
||||||
(_buf->buf[offset+1] << 16) | (_buf->buf[offset] << 24);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int32_t get32IBigEndian(const size_t offset) const {
|
|
||||||
if (offset < len() - 3) {
|
|
||||||
return _buf->buf[offset+3] | (_buf->buf[offset+2] << 8) |
|
|
||||||
(_buf->buf[offset+1] << 16) | (_buf->buf[offset] << 24);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
uint64_t get64(const size_t offset) const {
|
|
||||||
if (offset < len() - 7) {
|
|
||||||
return (uint64_t)_buf->buf[offset] | ((uint64_t)_buf->buf[offset+1] << 8) |
|
|
||||||
((uint64_t)_buf->buf[offset+2] << 16) | ((uint64_t)_buf->buf[offset+3] << 24) |
|
|
||||||
((uint64_t)_buf->buf[offset+4] << 32) | ((uint64_t)_buf->buf[offset+5] << 40) |
|
|
||||||
((uint64_t)_buf->buf[offset+6] << 48) | ((uint64_t)_buf->buf[offset+7] << 56);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t strlen(const size_t offset) const {
|
|
||||||
if (offset >= len()) { return 0; }
|
|
||||||
size_t slen = strnlen((const char*) &_buf->buf[offset], len() - offset);
|
|
||||||
if (slen == (len() - offset)) {
|
|
||||||
return 0; // we didn't find a NULL char
|
|
||||||
} else {
|
|
||||||
return slen;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SBuffer subBuffer(const size_t start, size_t len) const {
|
|
||||||
if (start >= _buf->len) {
|
|
||||||
len = 0;
|
|
||||||
} else if (start + len > _buf->len) {
|
|
||||||
len = _buf->len - start;
|
|
||||||
}
|
|
||||||
|
|
||||||
SBuffer buf2(len);
|
|
||||||
memcpy(buf2.buf(), buf()+start, len);
|
|
||||||
buf2._buf->len = len;
|
|
||||||
return buf2;
|
|
||||||
}
|
|
||||||
|
|
||||||
static SBuffer SBufferFromHex(const char *hex, size_t len) {
|
|
||||||
size_t buf_len = (len + 3) / 2;
|
|
||||||
SBuffer buf2(buf_len);
|
|
||||||
uint8_t val;
|
|
||||||
|
|
||||||
for (; len > 1; len -= 2) {
|
|
||||||
val = asc2byte(*hex++) << 4;
|
|
||||||
val |= asc2byte(*hex++);
|
|
||||||
buf2.add8(val);
|
|
||||||
}
|
|
||||||
return buf2;
|
|
||||||
}
|
|
||||||
|
|
||||||
static SBuffer SBufferFromBytes(const uint8_t *bytes, size_t len2) {
|
|
||||||
SBuffer buf2(len2);
|
|
||||||
buf2.addBuffer(bytes, len2);
|
|
||||||
return buf2;
|
|
||||||
}
|
|
||||||
|
|
||||||
// nullptr accepted
|
|
||||||
static bool equalsSBuffer(const class SBuffer * buf1, const class SBuffer * buf2) {
|
|
||||||
if (buf1 == buf2) { return true; }
|
|
||||||
if (!buf1 && (buf2->len() == 0)) { return true; }
|
|
||||||
if (!buf2 && (buf1->len() == 0)) { return true; }
|
|
||||||
if (!buf1 || !buf2) { return false; } // at least one buf is not empty
|
|
||||||
// we know that both buf1 and buf2 are non-null
|
|
||||||
if (buf1->len() != buf2->len()) { return false; }
|
|
||||||
size_t len = buf1->len();
|
|
||||||
for (uint32_t i=0; i<len; i++) {
|
|
||||||
if (buf1->get8(i) != buf2->get8(i)) { return false; }
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
static uint8_t asc2byte(char chr) {
|
|
||||||
uint8_t rVal = 0;
|
|
||||||
if (isdigit(chr)) { rVal = chr - '0'; }
|
|
||||||
else if (chr >= 'A' && chr <= 'F') { rVal = chr + 10 - 'A'; }
|
|
||||||
else if (chr >= 'a' && chr <= 'f') { rVal = chr + 10 - 'a'; }
|
|
||||||
return rVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void unHex(const char* in, uint8_t *out, size_t len) {
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
SBuffer_impl * _buf;
|
|
||||||
|
|
||||||
} SBuffer;
|
|
||||||
@ -1,533 +0,0 @@
|
|||||||
/*
|
|
||||||
ext_printf.ino - Extended printf for Arduino objects
|
|
||||||
|
|
||||||
Copyright (C) 2021 Stephan Hadinger
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ext_printf.h"
|
|
||||||
#include <Arduino.h>
|
|
||||||
#include <IPAddress.h>
|
|
||||||
#include <SBuffer.hpp>
|
|
||||||
|
|
||||||
/*********************************************************************************************\
|
|
||||||
* va_list extended support
|
|
||||||
*
|
|
||||||
* va_list allows to get the next argument but not to get the address of this argument in the stack.
|
|
||||||
*
|
|
||||||
* We add `va_cur_ptr(va, TYPE)` to get a pointer to the current argument.
|
|
||||||
* This will allow to modify it in place and call back printf with altered arguments
|
|
||||||
\*********************************************************************************************/
|
|
||||||
|
|
||||||
#if defined(__XTENSA__) // this works only for xtensa, other platforms needs va_list to be adapted
|
|
||||||
|
|
||||||
// This code is heavily inspired by the gcc implementation of va_list
|
|
||||||
// https://github.com/gcc-mirror/gcc/blob/master/gcc/config/xtensa/xtensa.c
|
|
||||||
|
|
||||||
// Here is the va_list structure:
|
|
||||||
// struct va_list {
|
|
||||||
// void * __va_stk; // offset 0 - pointer to arguments on the stack
|
|
||||||
// void * __va_reg; // offset 4 - pointer to arguments from registers
|
|
||||||
// uint32_t __va_ndx; // offset 8 - index in bytes of the argument (overshoot by sizeof(T))
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// When `va_start()` is called, the first 6 arguments are passed through registers r2-r7 and
|
|
||||||
// are saved on the stack like local variables
|
|
||||||
|
|
||||||
// The algorightm used by `va_arg()` is the following:
|
|
||||||
// /* Implement `va_arg'. */
|
|
||||||
// /* First align __va_ndx if necessary for this arg:
|
|
||||||
// orig_ndx = (AP).__va_ndx;
|
|
||||||
// if (__alignof__ (TYPE) > 4 )
|
|
||||||
// orig_ndx = ((orig_ndx + __alignof__ (TYPE) - 1)
|
|
||||||
// & -__alignof__ (TYPE)); */
|
|
||||||
// /* Increment __va_ndx to point past the argument:
|
|
||||||
// (AP).__va_ndx = orig_ndx + __va_size (TYPE); */
|
|
||||||
// /* Check if the argument is in registers:
|
|
||||||
// if ((AP).__va_ndx <= __MAX_ARGS_IN_REGISTERS * 4
|
|
||||||
// && !must_pass_in_stack (type))
|
|
||||||
// __array = (AP).__va_reg; */
|
|
||||||
// /* ...otherwise, the argument is on the stack (never split between
|
|
||||||
// registers and the stack -- change __va_ndx if necessary):
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// if (orig_ndx <= __MAX_ARGS_IN_REGISTERS * 4)
|
|
||||||
// (AP).__va_ndx = 32 + __va_size (TYPE);
|
|
||||||
// __array = (AP).__va_stk;
|
|
||||||
// } */
|
|
||||||
// /* Given the base array pointer (__array) and index to the subsequent
|
|
||||||
// argument (__va_ndx), find the address:
|
|
||||||
// __array + (AP).__va_ndx - (BYTES_BIG_ENDIAN && sizeof (TYPE) < 4
|
|
||||||
// ? sizeof (TYPE)
|
|
||||||
// : __va_size (TYPE))
|
|
||||||
// The results are endian-dependent because values smaller than one word
|
|
||||||
// are aligned differently. */
|
|
||||||
|
|
||||||
// So we can simply get the argument address
|
|
||||||
#define MAX_ARGS_IN_REGISTERS 6 // ESP8266 passes 6 arguments by register, then on stack
|
|
||||||
|
|
||||||
// #define va_cur_ptr(va,T) ( (T*) __va_cur_ptr(va,sizeof(T)) ) // we only support 4 bytes aligned arguments, so we don't need this one
|
|
||||||
|
|
||||||
// void * __va_cur_ptr(va_list &va, size_t size) {
|
|
||||||
// size = (size + 3) & 0xFFFFFFFC; // round to upper 4 bytes boundary
|
|
||||||
|
|
||||||
// uintptr_t * va_stk = (uintptr_t*) &va;
|
|
||||||
// uintptr_t * va_reg = 1 + (uintptr_t*) &va;
|
|
||||||
// uintptr_t * va_ndx = 2 + (uintptr_t*) &va;
|
|
||||||
// uintptr_t arr;
|
|
||||||
|
|
||||||
// if (*va_ndx <= MAX_ARGS_IN_REGISTERS * 4) {
|
|
||||||
// arr = *va_reg;
|
|
||||||
// } else {
|
|
||||||
// arr = *va_stk;
|
|
||||||
// }
|
|
||||||
// return (void*) (arr + *va_ndx - size);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// reduced version when arguments are always 4 bytes
|
|
||||||
#define va_cur_ptr4(va,T) ( (T*) __va_cur_ptr4(va) )
|
|
||||||
void * __va_cur_ptr4(va_list &va) {
|
|
||||||
uintptr_t * va_stk = (uintptr_t*) &va;
|
|
||||||
uintptr_t * va_reg = 1 + (uintptr_t*) &va;
|
|
||||||
uintptr_t * va_ndx = 2 + (uintptr_t*) &va;
|
|
||||||
uintptr_t arr;
|
|
||||||
|
|
||||||
if (*va_ndx <= MAX_ARGS_IN_REGISTERS * 4) {
|
|
||||||
arr = *va_reg;
|
|
||||||
} else {
|
|
||||||
arr = *va_stk;
|
|
||||||
}
|
|
||||||
return (void*) (arr + *va_ndx - 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Example of logs with 8 arguments (+1 static argument)
|
|
||||||
// We see that the first 5 are from low in the stack (local variables)
|
|
||||||
// while the last 8 are upper in the stack pushed by caller
|
|
||||||
//
|
|
||||||
// Note 64 bits arguments cannot be split between registers and stack
|
|
||||||
//
|
|
||||||
// >>> Reading a_ptr=0x3FFFFD44 *a_ptr=1
|
|
||||||
// >>> Reading a_ptr=0x3FFFFD48 *a_ptr=2
|
|
||||||
// >>> Reading a_ptr=0x3FFFFD4C *a_ptr=3
|
|
||||||
// >>> Reading a_ptr=0x3FFFFD50 *a_ptr=4
|
|
||||||
// >>> Reading a_ptr=0x3FFFFD54 *a_ptr=5
|
|
||||||
// >>> Reading a_ptr=0x3FFFFD70 *a_ptr=6
|
|
||||||
// >>> Reading a_ptr=0x3FFFFD74 *a_ptr=7
|
|
||||||
// >>> Reading a_ptr=0x3FFFFD78 *a_ptr=8
|
|
||||||
|
|
||||||
#elif defined(__riscv)
|
|
||||||
// #define __va_argsiz_tas(t) (((sizeof(t) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
|
|
||||||
#define va_cur_ptr4(va,T) ( (T*) __va_cur_ptr4(va) )
|
|
||||||
void * __va_cur_ptr4(va_list &va) {
|
|
||||||
uintptr_t * va_ptr = (uintptr_t*) &va;
|
|
||||||
int32_t * cur_ptr = (int32_t*) *va_ptr;
|
|
||||||
return (void*) (cur_ptr - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
#else // __XTENSA__, __riscv
|
|
||||||
#error "ext_printf is not suppoerted on this platform"
|
|
||||||
#endif // __XTENSA__, __riscv
|
|
||||||
|
|
||||||
/*********************************************************************************************\
|
|
||||||
* Genral function to convert u64 to hex
|
|
||||||
\*********************************************************************************************/
|
|
||||||
// Simple function to print a 64 bits unsigned int
|
|
||||||
/*
|
|
||||||
char * U64toHex(uint64_t value, char *str) {
|
|
||||||
// str must be at least 17 bytes long
|
|
||||||
str[16] = 0; // end of string
|
|
||||||
for (uint32_t i=0; i<16; i++) { // 16 digits
|
|
||||||
uint32_t n = value & 0x0F;
|
|
||||||
str[15 - i] = (n < 10) ? (char)n+'0' : (char)n-10+'A';
|
|
||||||
value = value >> 4;
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
char * ToBinary(uint32_t value, char *str, int32_t digits) {
|
|
||||||
if (digits > 32) { digits = 32; }
|
|
||||||
if (digits < 1) { digits = 1; }
|
|
||||||
int32_t digits_to_one = 1; // how many digits until we find the last `1`
|
|
||||||
str[32] = 0; // end of string
|
|
||||||
for (uint32_t i=0; i<32; i++) { // 32 digits in uint32_t
|
|
||||||
if ((value & 1) && (i+1 > digits_to_one)) {
|
|
||||||
digits_to_one = i+1;
|
|
||||||
}
|
|
||||||
str[31 - i] = (char)(value & 1)+'0';
|
|
||||||
value = value >> 1;
|
|
||||||
}
|
|
||||||
// adjust digits to always show the total value
|
|
||||||
if (digits_to_one > digits) { digits = digits_to_one; }
|
|
||||||
if (digits < 32) {
|
|
||||||
memmove(str, str + 32 - digits, digits + 1);
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
char * U64toStr(uint64_t value, char *str) {
|
|
||||||
// str must be at least 24 bytes long
|
|
||||||
uint32_t i = 23;
|
|
||||||
str[--i] = 0; // end of string
|
|
||||||
do {
|
|
||||||
uint64_t m = value;
|
|
||||||
value /= 10;
|
|
||||||
char c = m - 10 * value;
|
|
||||||
str[--i] = c < 10 ? c + '0' : c + 'A' - 10;
|
|
||||||
} while (value);
|
|
||||||
if (i) {
|
|
||||||
memmove(str, str +i, 23 -i);
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
char * U64toHex(uint64_t value, char *str, uint32_t zeroleads) {
|
|
||||||
// str must be at least 17 bytes long
|
|
||||||
str[16] = 0; // end of string
|
|
||||||
for (uint32_t i=0; i<16; i++) { // 16 digits
|
|
||||||
uint32_t n = value & 0x0F;
|
|
||||||
str[15 - i] = (n < 10) ? (char)n+'0' : (char)n-10+'A';
|
|
||||||
value = value >> 4;
|
|
||||||
}
|
|
||||||
if (zeroleads < 16) {
|
|
||||||
uint32_t max_zeroes = 16 - zeroleads;
|
|
||||||
while (max_zeroes) {
|
|
||||||
if (str[0] == '0') {
|
|
||||||
memmove(str, str +1, strlen(str));
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
max_zeroes--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
// see https://stackoverflow.com/questions/6357031/how-do-you-convert-a-byte-array-to-a-hexadecimal-string-in-c
|
|
||||||
// char* ToHex_P(unsigned char * in, size_t insz, char * out, size_t outsz, char inbetween = '\0'); in tasmota_globals.h
|
|
||||||
char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, char inbetween = '\0') {
|
|
||||||
// ToHex_P(in, insz, out, outz) -> "12345667"
|
|
||||||
// ToHex_P(in, insz, out, outz, ' ') -> "12 34 56 67"
|
|
||||||
// ToHex_P(in, insz, out, outz, ':') -> "12:34:56:67"
|
|
||||||
static const char * hex PROGMEM = "0123456789ABCDEF";
|
|
||||||
int between = (inbetween) ? 3 : 2;
|
|
||||||
const unsigned char * pin = in;
|
|
||||||
char * pout = out;
|
|
||||||
for (; pin < in+insz; pout += between, pin++) {
|
|
||||||
pout[0] = pgm_read_byte(&hex[(pgm_read_byte(pin)>>4) & 0xF]);
|
|
||||||
pout[1] = pgm_read_byte(&hex[ pgm_read_byte(pin) & 0xF]);
|
|
||||||
if (inbetween) { pout[2] = inbetween; }
|
|
||||||
if (pout + 3 - out > outsz) { break; } // Better to truncate output string than overflow buffer
|
|
||||||
}
|
|
||||||
pout[(inbetween && insz) ? -1 : 0] = 0; // Discard last inbetween if any input
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************************\
|
|
||||||
* snprintf extended
|
|
||||||
*
|
|
||||||
* New: if the provided buffer is nullptr, a buffer is allocated on the heap (malloc)
|
|
||||||
* and returned as a pointer instead of the length of the output (needs casting)
|
|
||||||
\*********************************************************************************************/
|
|
||||||
|
|
||||||
// get a fresh malloc allocated string based on the current pointer (can be in PROGMEM)
|
|
||||||
// It is the caller's responsibility to free the memory
|
|
||||||
//
|
|
||||||
// Returns nullptr if something went wrong
|
|
||||||
char * copyStr(const char * str) {
|
|
||||||
if (str == nullptr) { return nullptr; }
|
|
||||||
char * cpy = (char*) malloc(strlen_P(str) + 1);
|
|
||||||
if (cpy == nullptr) { return nullptr; } // something went wrong
|
|
||||||
strcpy_P(cpy, str);
|
|
||||||
return cpy;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char ext_invalid_mem[] PROGMEM = "<--INVALID-->";
|
|
||||||
const uint32_t min_valid_ptr = 0x3F000000; // addresses below this line are invalid
|
|
||||||
|
|
||||||
int32_t ext_vsnprintf_P(char * out_buf, size_t buf_len, const char * fmt_P, va_list va) {
|
|
||||||
va_list va_cpy;
|
|
||||||
va_copy(va_cpy, va);
|
|
||||||
|
|
||||||
// iterate on fmt to extract arguments and patch them in place
|
|
||||||
char * fmt_cpy = copyStr(fmt_P);
|
|
||||||
if (fmt_cpy == nullptr) { return 0; } // we couldn't copy the format, abort
|
|
||||||
char * fmt = fmt_cpy;
|
|
||||||
int32_t ret = 0; // return 0 if unsuccessful
|
|
||||||
bool aborted = true; // did something went wrong?
|
|
||||||
|
|
||||||
const uint32_t ALLOC_SIZE = 12;
|
|
||||||
static const char * allocs[ALLOC_SIZE] = {}; // initialized to zeroes
|
|
||||||
uint32_t alloc_idx = 0;
|
|
||||||
static char hex[34]; // buffer used for 64 bits, favor RAM instead of stack to remove pressure
|
|
||||||
|
|
||||||
for (; *fmt != 0; ++fmt) {
|
|
||||||
int32_t decimals = -2; // default to 2 decimals and remove trailing zeros
|
|
||||||
int32_t * decimals_ptr = nullptr;
|
|
||||||
if (alloc_idx >= ALLOC_SIZE) { break; } // buffer is full, don't continue parsing
|
|
||||||
if (*fmt == '%') {
|
|
||||||
fmt++;
|
|
||||||
char * fmt_start = fmt;
|
|
||||||
if (*fmt == '\0') { break; } // end of string
|
|
||||||
if (*fmt == '%') { continue; } // actual '%' char
|
|
||||||
if (*fmt == '*') {
|
|
||||||
decimals = va_arg(va, int32_t); // skip width argument as int
|
|
||||||
decimals_ptr = va_cur_ptr4(va, int32_t); // pointer to value on stack
|
|
||||||
fmt++;
|
|
||||||
// Serial.printf("> decimals=%d, decimals_ptr=0x%08X\n", decimals, decimals_ptr);
|
|
||||||
}
|
|
||||||
if (*fmt < 'A') {
|
|
||||||
decimals = strtol(fmt, nullptr, 10);
|
|
||||||
}
|
|
||||||
while (*fmt < 'A') { // brutal way to munch anything that is not a letter or '-' (or anything else)
|
|
||||||
// while ((*fmt >= '0' && *fmt <= '9') || (*fmt == '.') || (*fmt == '*') || (*fmt == '-' || (*fmt == ' ' || (*fmt == '+') || (*fmt == '#')))) {
|
|
||||||
fmt++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (*fmt == '_') { // extension
|
|
||||||
if (decimals_ptr) {
|
|
||||||
// Serial.printf(">2 decimals=%d, decimals_ptr=0x%08X\n", decimals, decimals_ptr);
|
|
||||||
*decimals_ptr = 0; // if '*' was used, make sure we replace the value with zero for snprintf()
|
|
||||||
*(fmt_start++) = '-'; // in this case replace with `%-*s`
|
|
||||||
*(fmt_start++) = '*';
|
|
||||||
}
|
|
||||||
for (; fmt_start <= fmt; fmt_start++) {
|
|
||||||
*fmt_start = '0';
|
|
||||||
}
|
|
||||||
// *fmt = '0';
|
|
||||||
fmt++;
|
|
||||||
uint32_t cur_val = va_arg(va, uint32_t); // current value
|
|
||||||
const char ** cur_val_ptr = va_cur_ptr4(va, const char*); // pointer to value on stack
|
|
||||||
const char * new_val_str = "";
|
|
||||||
switch (*fmt) {
|
|
||||||
case 'H': // Hex, decimals indicates the length, default 2
|
|
||||||
{
|
|
||||||
if (decimals < 0) { decimals = 0; }
|
|
||||||
if (cur_val < min_valid_ptr) { new_val_str = ext_invalid_mem; }
|
|
||||||
else if (decimals > 0) {
|
|
||||||
char * hex_char = (char*) malloc(decimals*2 + 2);
|
|
||||||
if (hex_char == nullptr) { goto free_allocs; }
|
|
||||||
ToHex_P((const uint8_t *)cur_val, decimals, hex_char, decimals*2 + 2);
|
|
||||||
new_val_str = hex_char;
|
|
||||||
allocs[alloc_idx++] = new_val_str;
|
|
||||||
// Serial.printf("> hex=%s\n", hex_char);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'B': // Pointer to SBuffer
|
|
||||||
{
|
|
||||||
if (cur_val < min_valid_ptr) { new_val_str = ext_invalid_mem; }
|
|
||||||
else {
|
|
||||||
const SBuffer & buf = *(const SBuffer*)cur_val;
|
|
||||||
size_t buf_len = (&buf != nullptr) ? buf.len() : 0;
|
|
||||||
if (buf_len) {
|
|
||||||
char * hex_char = (char*) malloc(buf_len*2 + 2);
|
|
||||||
if (hex_char == nullptr) { goto free_allocs; }
|
|
||||||
ToHex_P(buf.getBuffer(), buf_len, hex_char, buf_len*2 + 2);
|
|
||||||
new_val_str = hex_char;
|
|
||||||
allocs[alloc_idx++] = new_val_str;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
// '%_b' outputs a uint32_t to binary
|
|
||||||
// '%8_b' outputs a uint8_t to binary
|
|
||||||
case 'b': // Binary, decimals indicates the zero prefill
|
|
||||||
{
|
|
||||||
ToBinary(cur_val, hex, decimals);
|
|
||||||
new_val_str = copyStr(hex);
|
|
||||||
if (new_val_str == nullptr) { goto free_allocs; }
|
|
||||||
allocs[alloc_idx++] = new_val_str;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
/*
|
|
||||||
case 'V': // 2-byte values, decimals indicates the length, default 2
|
|
||||||
{
|
|
||||||
if (decimals < 0) { decimals = 0; }
|
|
||||||
if (cur_val < min_valid_ptr) { new_val_str = ext_invalid_mem; }
|
|
||||||
else if (decimals > 0) {
|
|
||||||
uint32_t val_size = decimals*6 + 2;
|
|
||||||
char * val_char = (char*) malloc(val_size);
|
|
||||||
if (val_char == nullptr) { goto free_allocs; }
|
|
||||||
val_char[0] = '\0';
|
|
||||||
for (uint32_t count = 0; count < decimals; count++) {
|
|
||||||
uint32_t value = pgm_read_byte((const uint8_t *)cur_val +1) << 8 | pgm_read_byte((const uint8_t *)cur_val);
|
|
||||||
snprintf_P(val_char, val_size, PSTR("%s%s%d"), val_char, (count)?",":"", value);
|
|
||||||
cur_val += 2;
|
|
||||||
}
|
|
||||||
new_val_str = val_char;
|
|
||||||
allocs[alloc_idx++] = new_val_str;
|
|
||||||
// Serial.printf("> values=%s\n", hex_char);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
*/
|
|
||||||
// case 'D':
|
|
||||||
// decimals = *(int32_t*)cur_val_ptr;
|
|
||||||
// break;
|
|
||||||
|
|
||||||
// `%_I` ouputs an IPv4 32 bits address passed as u32 into a decimal dotted format
|
|
||||||
case 'I': // Input is `uint32_t` 32 bits IP address, output is decimal dotted address
|
|
||||||
{
|
|
||||||
char * ip_str = (char*) malloc(16);
|
|
||||||
if (ip_str == nullptr) { goto free_allocs; }
|
|
||||||
snprintf_P(ip_str, 16, PSTR("%u.%u.%u.%u"), cur_val & 0xFF, (cur_val >> 8) & 0xFF, (cur_val >> 16) & 0xFF, (cur_val >> 24) & 0xFF);
|
|
||||||
new_val_str = ip_str;
|
|
||||||
allocs[alloc_idx++] = new_val_str;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
// `%_f` or `%*_f` outputs a float with optionan number of decimals passed as first argument if `*` is present
|
|
||||||
// positive number of decimals means an exact number of decimals, can be `0` terminate
|
|
||||||
// negative number of decimals will suppress
|
|
||||||
// Ex:
|
|
||||||
// char c[128];
|
|
||||||
// float f = 3.141f;
|
|
||||||
// ext_vsnprintf_P(c; szeof(c), "%_f %*_f %*_f", &f, 4, 1f, -4, %f);
|
|
||||||
// --> c will be "3.14 3.1410 3.141"
|
|
||||||
// Note: float MUST be passed by address, because C alsays promoted float to double when in vararg
|
|
||||||
case 'f': // input is `float`, printed to float with 2 decimals
|
|
||||||
{
|
|
||||||
if (cur_val < min_valid_ptr) { new_val_str = ext_invalid_mem; }
|
|
||||||
else {
|
|
||||||
bool truncate = false;
|
|
||||||
if (decimals < 0) {
|
|
||||||
decimals = -decimals;
|
|
||||||
truncate = true;
|
|
||||||
}
|
|
||||||
float number = *(float*)cur_val;
|
|
||||||
if (isnan(number) || isinf(number)) {
|
|
||||||
new_val_str = "null";
|
|
||||||
} else {
|
|
||||||
uint32_t len = (decimals) ? decimals +2 : 1;
|
|
||||||
dtostrf(*(float*)cur_val, len, decimals, hex);
|
|
||||||
|
|
||||||
if (truncate) {
|
|
||||||
uint32_t last = strlen(hex) - 1;
|
|
||||||
// remove trailing zeros
|
|
||||||
while (hex[last] == '0') {
|
|
||||||
hex[last--] = 0; // remove last char
|
|
||||||
}
|
|
||||||
// remove trailing dot
|
|
||||||
if (hex[last] == '.') {
|
|
||||||
hex[last] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
new_val_str = copyStr(hex);
|
|
||||||
if (new_val_str == nullptr) { goto free_allocs; }
|
|
||||||
allocs[alloc_idx++] = new_val_str;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
// '%_X' outputs a 64 bits unsigned int to uppercase HEX with 16 digits
|
|
||||||
case 'X': // input is `uint64_t*`, printed as 16 hex digits (no prefix 0x)
|
|
||||||
{
|
|
||||||
if (cur_val < min_valid_ptr) { new_val_str = ext_invalid_mem; }
|
|
||||||
else {
|
|
||||||
if ((decimals < 0) || (decimals > 16)) { decimals = 16; }
|
|
||||||
U64toHex(*(uint64_t*)cur_val, hex, decimals);
|
|
||||||
new_val_str = copyStr(hex);
|
|
||||||
if (new_val_str == nullptr) { goto free_allocs; }
|
|
||||||
allocs[alloc_idx++] = new_val_str;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
// '%_U' outputs a 64 bits unsigned int to decimal
|
|
||||||
case 'U': // input is `uint64_t*`, printed as decimal
|
|
||||||
{
|
|
||||||
if (cur_val < min_valid_ptr) { new_val_str = ext_invalid_mem; }
|
|
||||||
else {
|
|
||||||
U64toStr(*(uint64_t*)cur_val, hex);
|
|
||||||
new_val_str = copyStr(hex);
|
|
||||||
if (new_val_str == nullptr) { goto free_allocs; }
|
|
||||||
allocs[alloc_idx++] = new_val_str;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
*cur_val_ptr = new_val_str;
|
|
||||||
*fmt = 's'; // replace `%_X` with `%0s` to display a string instead
|
|
||||||
|
|
||||||
} else {
|
|
||||||
va_arg(va, int32_t); // munch one 32 bits argument and leave it unchanged
|
|
||||||
// we take the hypothesis here that passing 64 bits arguments is always unsupported in ESP8266
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Serial.printf("> format_final=%s\n", fmt_cpy); Serial.flush();
|
|
||||||
if (out_buf != nullptr) {
|
|
||||||
ret = vsnprintf_P(out_buf, buf_len, fmt_cpy, va_cpy);
|
|
||||||
aborted = false; // we completed without malloc error
|
|
||||||
} else {
|
|
||||||
// if there is no output buffer, we allocate one on the heap
|
|
||||||
// first we do a dry-run to know the target size
|
|
||||||
char dummy[2];
|
|
||||||
int32_t target_len = vsnprintf_P(dummy, 1, fmt_cpy, va_cpy);
|
|
||||||
if (target_len >= 0) {
|
|
||||||
// successful
|
|
||||||
char * allocated_buf = (char*) malloc(target_len + 1);
|
|
||||||
if (allocated_buf != nullptr) {
|
|
||||||
allocated_buf[0] = 0; // default to empty string
|
|
||||||
vsnprintf_P(allocated_buf, target_len + 1, fmt_cpy, va_cpy);
|
|
||||||
ret = (int32_t) allocated_buf;
|
|
||||||
aborted = false; // we completed without malloc error
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
va_end(va_cpy);
|
|
||||||
|
|
||||||
free_allocs:
|
|
||||||
if (aborted && out_buf != nullptr) { // if something went wrong, set output string to empty string to avoid corrupt data
|
|
||||||
*out_buf = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
// disallocated all temporary strings
|
|
||||||
for (uint32_t i = 0; i < alloc_idx; i++) {
|
|
||||||
free((void*)allocs[i]); // it is ok to call free() on nullptr so we don't test for nullptr first
|
|
||||||
allocs[i] = nullptr;
|
|
||||||
}
|
|
||||||
free(fmt_cpy); // free the local copy of the format string
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
char * ext_vsnprintf_malloc_P(const char * fmt_P, va_list va) {
|
|
||||||
int32_t ret = ext_vsnprintf_P(nullptr, 0, fmt_P, va);
|
|
||||||
return (char*) ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t ext_snprintf_P(char * out_buf, size_t buf_len, const char * fmt, ...) {
|
|
||||||
va_list va;
|
|
||||||
va_start(va, fmt);
|
|
||||||
|
|
||||||
int32_t ret = ext_vsnprintf_P(out_buf, buf_len, fmt, va);
|
|
||||||
va_end(va);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
char * ext_snprintf_malloc_P(const char * fmt, ...) {
|
|
||||||
va_list va;
|
|
||||||
va_start(va, fmt);
|
|
||||||
|
|
||||||
int32_t ret = ext_vsnprintf_P(nullptr, 0, fmt, va);
|
|
||||||
va_end(va);
|
|
||||||
return (char*) ret;
|
|
||||||
}
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
ext_printf.ino - Extended printf for Arduino objects
|
|
||||||
|
|
||||||
Copyright (C) 2021 Stephan Hadinger
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef EXT_PRINTF_H
|
|
||||||
#define EXT_PRINTF_H
|
|
||||||
|
|
||||||
#include <cstddef>
|
|
||||||
#include <cstdint>
|
|
||||||
#include <cstdarg>
|
|
||||||
|
|
||||||
int32_t ext_vsnprintf_P(char * buf, size_t buf_len, const char * fmt_P, va_list va);
|
|
||||||
int32_t ext_snprintf_P(char * buf, size_t buf_len, const char * fmt, ...);
|
|
||||||
char * ext_snprintf_malloc_P(const char * fmt, ...);
|
|
||||||
char * ext_vsnprintf_malloc_P(const char * fmt_P, va_list va);
|
|
||||||
|
|
||||||
char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, char inbetween);
|
|
||||||
|
|
||||||
// void test_ext_snprintf_P(void);
|
|
||||||
|
|
||||||
#endif // EXT_PRINTF_H
|
|
||||||
@ -1,113 +0,0 @@
|
|||||||
/*
|
|
||||||
ext_printf.ino - Extended printf for Arduino objects
|
|
||||||
|
|
||||||
Copyright (C) 2021 Stephan Hadinger
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ext_printf.h"
|
|
||||||
#include <Arduino.h>
|
|
||||||
|
|
||||||
// DEBUG only
|
|
||||||
|
|
||||||
// String test_string(void) {
|
|
||||||
// String s("This is the string");
|
|
||||||
|
|
||||||
// return s;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// String f_str(void) { return String("foobar"); }
|
|
||||||
// String k_str("foobar");
|
|
||||||
|
|
||||||
// void f1(String s) {
|
|
||||||
// Serial.printf("> %s\n", s.c_str());
|
|
||||||
// }
|
|
||||||
// void f2(void) {
|
|
||||||
// f1(f_str());
|
|
||||||
// }
|
|
||||||
|
|
||||||
// void test_snprintf1(void) {
|
|
||||||
// char c[100];
|
|
||||||
// snprintf_P(c, sizeof(c), PSTR("s1=%s, s2=%s"), k_str.c_str(), f_str().c_str());
|
|
||||||
// }
|
|
||||||
// void test_snprintf2(void) {
|
|
||||||
// char c[100];
|
|
||||||
// ext_snprintf_P(c, sizeof(c), PSTR("s1=%_s, s2=%_S"), &k_str, &f_str, &ResponseAppendTHD);
|
|
||||||
// }
|
|
||||||
void test_ext_snprintf_P(void) {
|
|
||||||
// test_snprintf1();
|
|
||||||
// test_snprintf2();
|
|
||||||
// if (0) {
|
|
||||||
// // testVarArg2("", 1, 2, 3, 4, 5, 6, 7, 8);
|
|
||||||
|
|
||||||
char c[128];
|
|
||||||
float fpi=-3333.1415926535f;
|
|
||||||
float f3 = 3333;
|
|
||||||
float f31 = 3333.1;
|
|
||||||
ext_snprintf_P(c, sizeof(c), "Int1 = %d, ip=%_I", 1, 0x10203040);
|
|
||||||
Serial.printf("--> out=%s\n", c);
|
|
||||||
|
|
||||||
ext_snprintf_P(c, sizeof(c), "Float default=%_f %_f", &f3, &fpi);
|
|
||||||
Serial.printf("--> out=%s\n", c);
|
|
||||||
|
|
||||||
ext_snprintf_P(c, sizeof(c), "Float default=%1_f, int(3)=%4_f, int(3)=%-4_f, int(3)=%-4_f, 6dec=%-8_f", &fpi, &f3, &f3, &f31, &fpi);
|
|
||||||
Serial.printf("--> out=%s\n", c);
|
|
||||||
ext_snprintf_P(c, sizeof(c), "Float default=%*_f, int(3)=%*_f, int(3)=%*_f, int(3)=%*_f, 6dec=%*_f", 1, &fpi, 4, &f3, -4, &f3, -4, &f31, -8, &fpi);
|
|
||||||
Serial.printf("--> out=%s\n", c);
|
|
||||||
|
|
||||||
uint64_t u641 = 0x1122334455667788LL; // 1234605616436508552
|
|
||||||
uint64_t u642 = 0x0123456789ABCDEFLL; // 81985529216486895
|
|
||||||
uint64_t u643 = 0xFEDCBA9876543210LL; // 18364758544493064720
|
|
||||||
ext_snprintf_P(c, sizeof(c), "Int64 0x%_X 0x%_X 0x%_X", &u641, &u642, &u643);
|
|
||||||
Serial.printf("--> out=%s\n", c);
|
|
||||||
ext_snprintf_P(c, sizeof(c), "Int64 decimal %_U %_U %_U", &u641, &u642, &u643);
|
|
||||||
Serial.printf("--> out=%s\n", c);
|
|
||||||
|
|
||||||
// ext_snprintf_P(c, sizeof(c), "Float default=%*_f, int(3)=%*_f, int(3)=%*_f, int(3)=%*_f, 6dec=%*_f", &fpi, &f3, &f3, &f31, &fpi);
|
|
||||||
|
|
||||||
// String string("Foobar");
|
|
||||||
// ext_snprintf_P(c, sizeof(c), "String 0x%08X %_s", &string, &string);
|
|
||||||
// Serial.printf("--> out=%s\n", c);
|
|
||||||
|
|
||||||
// ext_snprintf_P(c, sizeof(c), "StringFunc 0x%08X %_S", &test_string, &test_string);
|
|
||||||
// Serial.printf("--> out=%s\n", c);
|
|
||||||
|
|
||||||
// uint64_t u64 = 0x123456789ABCDEFLL;
|
|
||||||
// testVarArg2("", u64, 2, 3, 4, 5, 6, 7, 8);
|
|
||||||
|
|
||||||
// // Serial.printf("+++ ld=%ld, lld=%lld\n", 1,2,3,4);
|
|
||||||
// // testVarArg("", 1, 2, 3, 4, 5, 6, 7, 8);
|
|
||||||
// }
|
|
||||||
// tprintf("%s", 12, "14");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// void tprintf(const char* format) // base function
|
|
||||||
// {
|
|
||||||
// Serial.printf("%s\n", format);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// template<typename T, typename... Targs>
|
|
||||||
// void tprintf(const char* format, T value, Targs... Fargs) // recursive variadic function
|
|
||||||
// {
|
|
||||||
// for ( ; *format != '\0'; format++ ) {
|
|
||||||
// if ( *format == '%' ) {
|
|
||||||
// Serial.printf("%d", (uint32_t) value);
|
|
||||||
// tprintf(format+1, Fargs...); // recursive call
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// Serial.printf("%s", format);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2015 Ivan Seidel
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
@ -1,345 +0,0 @@
|
|||||||
/*
|
|
||||||
LinkedList.h - V1.1 - Generic LinkedList implementation
|
|
||||||
Works better with FIFO, because LIFO will need to
|
|
||||||
search the entire List to find the last one;
|
|
||||||
|
|
||||||
For instructions, go to https://github.com/ivanseidel/LinkedList
|
|
||||||
|
|
||||||
Created by Ivan Seidel Gomes, March, 2013.
|
|
||||||
Released into the public domain.
|
|
||||||
|
|
||||||
20240118 - Removed sort functions not used by Tasmota (@arendst)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef LinkedList_h
|
|
||||||
#define LinkedList_h
|
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
struct ListNode
|
|
||||||
{
|
|
||||||
T data;
|
|
||||||
ListNode<T> *next;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
class LinkedList{
|
|
||||||
|
|
||||||
protected:
|
|
||||||
int _size;
|
|
||||||
ListNode<T> *root;
|
|
||||||
ListNode<T> *last;
|
|
||||||
|
|
||||||
// Helps "get" method, by saving last position
|
|
||||||
ListNode<T> *lastNodeGot;
|
|
||||||
int lastIndexGot;
|
|
||||||
// isCached should be set to FALSE
|
|
||||||
// everytime the list suffer changes
|
|
||||||
bool isCached;
|
|
||||||
|
|
||||||
ListNode<T>* getNode(int index);
|
|
||||||
|
|
||||||
public:
|
|
||||||
LinkedList();
|
|
||||||
LinkedList(int sizeIndex, T _t); //initiate list size and default value
|
|
||||||
~LinkedList();
|
|
||||||
|
|
||||||
/*
|
|
||||||
Returns current size of LinkedList
|
|
||||||
*/
|
|
||||||
virtual int size();
|
|
||||||
/*
|
|
||||||
Adds a T object in the specified index;
|
|
||||||
Unlink and link the LinkedList correcly;
|
|
||||||
Increment _size
|
|
||||||
*/
|
|
||||||
virtual bool add(int index, T);
|
|
||||||
/*
|
|
||||||
Adds a T object in the end of the LinkedList;
|
|
||||||
Increment _size;
|
|
||||||
*/
|
|
||||||
virtual bool add(T);
|
|
||||||
/*
|
|
||||||
Adds a T object in the start of the LinkedList;
|
|
||||||
Increment _size;
|
|
||||||
*/
|
|
||||||
virtual bool unshift(T);
|
|
||||||
/*
|
|
||||||
Set the object at index, with T;
|
|
||||||
*/
|
|
||||||
virtual bool set(int index, T);
|
|
||||||
/*
|
|
||||||
Remove object at index;
|
|
||||||
If index is not reachable, returns false;
|
|
||||||
else, decrement _size
|
|
||||||
*/
|
|
||||||
virtual T remove(int index);
|
|
||||||
/*
|
|
||||||
Remove last object;
|
|
||||||
*/
|
|
||||||
virtual T pop();
|
|
||||||
/*
|
|
||||||
Remove first object;
|
|
||||||
*/
|
|
||||||
virtual T shift();
|
|
||||||
/*
|
|
||||||
Get the index'th element on the list;
|
|
||||||
Return Element if accessible,
|
|
||||||
else, return false;
|
|
||||||
*/
|
|
||||||
virtual T get(int index);
|
|
||||||
|
|
||||||
/*
|
|
||||||
Clear the entire array
|
|
||||||
*/
|
|
||||||
virtual void clear();
|
|
||||||
|
|
||||||
// add support to array brakets [] operator
|
|
||||||
inline T& operator[](int index);
|
|
||||||
inline T& operator[](size_t& i) { return this->get(i); }
|
|
||||||
inline const T& operator[](const size_t& i) const { return this->get(i); }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
// Initialize LinkedList with false values
|
|
||||||
template<typename T>
|
|
||||||
LinkedList<T>::LinkedList()
|
|
||||||
{
|
|
||||||
root=NULL;
|
|
||||||
last=NULL;
|
|
||||||
_size=0;
|
|
||||||
|
|
||||||
lastNodeGot = root;
|
|
||||||
lastIndexGot = 0;
|
|
||||||
isCached = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clear Nodes and free Memory
|
|
||||||
template<typename T>
|
|
||||||
LinkedList<T>::~LinkedList()
|
|
||||||
{
|
|
||||||
ListNode<T>* tmp;
|
|
||||||
while(root!=NULL)
|
|
||||||
{
|
|
||||||
tmp=root;
|
|
||||||
root=root->next;
|
|
||||||
delete tmp;
|
|
||||||
}
|
|
||||||
last = NULL;
|
|
||||||
_size=0;
|
|
||||||
isCached = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
Actualy "logic" coding
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
ListNode<T>* LinkedList<T>::getNode(int index){
|
|
||||||
|
|
||||||
int _pos = 0;
|
|
||||||
ListNode<T>* current = root;
|
|
||||||
|
|
||||||
// Check if the node trying to get is
|
|
||||||
// immediatly AFTER the previous got one
|
|
||||||
if(isCached && lastIndexGot <= index){
|
|
||||||
_pos = lastIndexGot;
|
|
||||||
current = lastNodeGot;
|
|
||||||
}
|
|
||||||
|
|
||||||
while(_pos < index && current){
|
|
||||||
current = current->next;
|
|
||||||
|
|
||||||
_pos++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if the object index got is the same as the required
|
|
||||||
if(_pos == index){
|
|
||||||
isCached = true;
|
|
||||||
lastIndexGot = index;
|
|
||||||
lastNodeGot = current;
|
|
||||||
|
|
||||||
return current;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
int LinkedList<T>::size(){
|
|
||||||
return _size;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
LinkedList<T>::LinkedList(int sizeIndex, T _t){
|
|
||||||
for (int i = 0; i < sizeIndex; i++){
|
|
||||||
add(_t);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
bool LinkedList<T>::add(int index, T _t){
|
|
||||||
|
|
||||||
if(index >= _size)
|
|
||||||
return add(_t);
|
|
||||||
|
|
||||||
if(index == 0)
|
|
||||||
return unshift(_t);
|
|
||||||
|
|
||||||
ListNode<T> *tmp = new ListNode<T>(),
|
|
||||||
*_prev = getNode(index-1);
|
|
||||||
tmp->data = _t;
|
|
||||||
tmp->next = _prev->next;
|
|
||||||
_prev->next = tmp;
|
|
||||||
|
|
||||||
_size++;
|
|
||||||
isCached = false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
bool LinkedList<T>::add(T _t){
|
|
||||||
|
|
||||||
ListNode<T> *tmp = new ListNode<T>();
|
|
||||||
tmp->data = _t;
|
|
||||||
tmp->next = NULL;
|
|
||||||
|
|
||||||
if(root){
|
|
||||||
// Already have elements inserted
|
|
||||||
last->next = tmp;
|
|
||||||
last = tmp;
|
|
||||||
}else{
|
|
||||||
// First element being inserted
|
|
||||||
root = tmp;
|
|
||||||
last = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
_size++;
|
|
||||||
isCached = false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
bool LinkedList<T>::unshift(T _t){
|
|
||||||
|
|
||||||
if(_size == 0)
|
|
||||||
return add(_t);
|
|
||||||
|
|
||||||
ListNode<T> *tmp = new ListNode<T>();
|
|
||||||
tmp->next = root;
|
|
||||||
tmp->data = _t;
|
|
||||||
root = tmp;
|
|
||||||
|
|
||||||
_size++;
|
|
||||||
isCached = false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
T& LinkedList<T>::operator[](int index) {
|
|
||||||
return getNode(index)->data;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
bool LinkedList<T>::set(int index, T _t){
|
|
||||||
// Check if index position is in bounds
|
|
||||||
if(index < 0 || index >= _size)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
getNode(index)->data = _t;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
T LinkedList<T>::pop(){
|
|
||||||
if(_size <= 0)
|
|
||||||
return T();
|
|
||||||
|
|
||||||
isCached = false;
|
|
||||||
|
|
||||||
if(_size >= 2){
|
|
||||||
ListNode<T> *tmp = getNode(_size - 2);
|
|
||||||
T ret = tmp->next->data;
|
|
||||||
delete(tmp->next);
|
|
||||||
tmp->next = NULL;
|
|
||||||
last = tmp;
|
|
||||||
_size--;
|
|
||||||
return ret;
|
|
||||||
}else{
|
|
||||||
// Only one element left on the list
|
|
||||||
T ret = root->data;
|
|
||||||
delete(root);
|
|
||||||
root = NULL;
|
|
||||||
last = NULL;
|
|
||||||
_size = 0;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
T LinkedList<T>::shift(){
|
|
||||||
if(_size <= 0)
|
|
||||||
return T();
|
|
||||||
|
|
||||||
if(_size > 1){
|
|
||||||
ListNode<T> *_next = root->next;
|
|
||||||
T ret = root->data;
|
|
||||||
delete(root);
|
|
||||||
root = _next;
|
|
||||||
_size --;
|
|
||||||
isCached = false;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}else{
|
|
||||||
// Only one left, then pop()
|
|
||||||
return pop();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
T LinkedList<T>::remove(int index){
|
|
||||||
if (index < 0 || index >= _size)
|
|
||||||
{
|
|
||||||
return T();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(index == 0)
|
|
||||||
return shift();
|
|
||||||
|
|
||||||
if (index == _size-1)
|
|
||||||
{
|
|
||||||
return pop();
|
|
||||||
}
|
|
||||||
|
|
||||||
ListNode<T> *tmp = getNode(index - 1);
|
|
||||||
ListNode<T> *toDelete = tmp->next;
|
|
||||||
T ret = toDelete->data;
|
|
||||||
tmp->next = tmp->next->next;
|
|
||||||
delete(toDelete);
|
|
||||||
_size--;
|
|
||||||
isCached = false;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
T LinkedList<T>::get(int index){
|
|
||||||
ListNode<T> *tmp = getNode(index);
|
|
||||||
|
|
||||||
return (tmp ? tmp->data : T());
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
void LinkedList<T>::clear(){
|
|
||||||
while(size() > 0)
|
|
||||||
shift();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,419 +0,0 @@
|
|||||||
/*
|
|
||||||
LinkedList.h - V1.1 - Generic LinkedList implementation
|
|
||||||
Works better with FIFO, because LIFO will need to
|
|
||||||
search the entire List to find the last one;
|
|
||||||
|
|
||||||
For instructions, go to https://github.com/ivanseidel/LinkedList
|
|
||||||
|
|
||||||
Created by Ivan Seidel Gomes, March, 2013.
|
|
||||||
Released into the public domain.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef LinkedList_h
|
|
||||||
#define LinkedList_h
|
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
struct ListNode
|
|
||||||
{
|
|
||||||
T data;
|
|
||||||
ListNode<T> *next;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
class LinkedList{
|
|
||||||
|
|
||||||
protected:
|
|
||||||
int _size;
|
|
||||||
ListNode<T> *root;
|
|
||||||
ListNode<T> *last;
|
|
||||||
|
|
||||||
// Helps "get" method, by saving last position
|
|
||||||
ListNode<T> *lastNodeGot;
|
|
||||||
int lastIndexGot;
|
|
||||||
// isCached should be set to FALSE
|
|
||||||
// everytime the list suffer changes
|
|
||||||
bool isCached;
|
|
||||||
|
|
||||||
ListNode<T>* getNode(int index);
|
|
||||||
|
|
||||||
ListNode<T>* findEndOfSortedString(ListNode<T> *p, int (*cmp)(T &, T &));
|
|
||||||
|
|
||||||
public:
|
|
||||||
LinkedList();
|
|
||||||
LinkedList(int sizeIndex, T _t); //initiate list size and default value
|
|
||||||
~LinkedList();
|
|
||||||
|
|
||||||
/*
|
|
||||||
Returns current size of LinkedList
|
|
||||||
*/
|
|
||||||
virtual int size();
|
|
||||||
/*
|
|
||||||
Adds a T object in the specified index;
|
|
||||||
Unlink and link the LinkedList correcly;
|
|
||||||
Increment _size
|
|
||||||
*/
|
|
||||||
virtual bool add(int index, T);
|
|
||||||
/*
|
|
||||||
Adds a T object in the end of the LinkedList;
|
|
||||||
Increment _size;
|
|
||||||
*/
|
|
||||||
virtual bool add(T);
|
|
||||||
/*
|
|
||||||
Adds a T object in the start of the LinkedList;
|
|
||||||
Increment _size;
|
|
||||||
*/
|
|
||||||
virtual bool unshift(T);
|
|
||||||
/*
|
|
||||||
Set the object at index, with T;
|
|
||||||
*/
|
|
||||||
virtual bool set(int index, T);
|
|
||||||
/*
|
|
||||||
Remove object at index;
|
|
||||||
If index is not reachable, returns false;
|
|
||||||
else, decrement _size
|
|
||||||
*/
|
|
||||||
virtual T remove(int index);
|
|
||||||
/*
|
|
||||||
Remove last object;
|
|
||||||
*/
|
|
||||||
virtual T pop();
|
|
||||||
/*
|
|
||||||
Remove first object;
|
|
||||||
*/
|
|
||||||
virtual T shift();
|
|
||||||
/*
|
|
||||||
Get the index'th element on the list;
|
|
||||||
Return Element if accessible,
|
|
||||||
else, return false;
|
|
||||||
*/
|
|
||||||
virtual T get(int index);
|
|
||||||
|
|
||||||
/*
|
|
||||||
Clear the entire array
|
|
||||||
*/
|
|
||||||
virtual void clear();
|
|
||||||
|
|
||||||
/*
|
|
||||||
Sort the list, given a comparison function
|
|
||||||
*/
|
|
||||||
virtual void sort(int (*cmp)(T &, T &));
|
|
||||||
|
|
||||||
// add support to array brakets [] operator
|
|
||||||
inline T& operator[](int index);
|
|
||||||
inline T& operator[](size_t& i) { return this->get(i); }
|
|
||||||
inline const T& operator[](const size_t& i) const { return this->get(i); }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
// Initialize LinkedList with false values
|
|
||||||
template<typename T>
|
|
||||||
LinkedList<T>::LinkedList()
|
|
||||||
{
|
|
||||||
root=NULL;
|
|
||||||
last=NULL;
|
|
||||||
_size=0;
|
|
||||||
|
|
||||||
lastNodeGot = root;
|
|
||||||
lastIndexGot = 0;
|
|
||||||
isCached = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clear Nodes and free Memory
|
|
||||||
template<typename T>
|
|
||||||
LinkedList<T>::~LinkedList()
|
|
||||||
{
|
|
||||||
ListNode<T>* tmp;
|
|
||||||
while(root!=NULL)
|
|
||||||
{
|
|
||||||
tmp=root;
|
|
||||||
root=root->next;
|
|
||||||
delete tmp;
|
|
||||||
}
|
|
||||||
last = NULL;
|
|
||||||
_size=0;
|
|
||||||
isCached = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
Actualy "logic" coding
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
ListNode<T>* LinkedList<T>::getNode(int index){
|
|
||||||
|
|
||||||
int _pos = 0;
|
|
||||||
ListNode<T>* current = root;
|
|
||||||
|
|
||||||
// Check if the node trying to get is
|
|
||||||
// immediatly AFTER the previous got one
|
|
||||||
if(isCached && lastIndexGot <= index){
|
|
||||||
_pos = lastIndexGot;
|
|
||||||
current = lastNodeGot;
|
|
||||||
}
|
|
||||||
|
|
||||||
while(_pos < index && current){
|
|
||||||
current = current->next;
|
|
||||||
|
|
||||||
_pos++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if the object index got is the same as the required
|
|
||||||
if(_pos == index){
|
|
||||||
isCached = true;
|
|
||||||
lastIndexGot = index;
|
|
||||||
lastNodeGot = current;
|
|
||||||
|
|
||||||
return current;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
int LinkedList<T>::size(){
|
|
||||||
return _size;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
LinkedList<T>::LinkedList(int sizeIndex, T _t){
|
|
||||||
for (int i = 0; i < sizeIndex; i++){
|
|
||||||
add(_t);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
bool LinkedList<T>::add(int index, T _t){
|
|
||||||
|
|
||||||
if(index >= _size)
|
|
||||||
return add(_t);
|
|
||||||
|
|
||||||
if(index == 0)
|
|
||||||
return unshift(_t);
|
|
||||||
|
|
||||||
ListNode<T> *tmp = new ListNode<T>(),
|
|
||||||
*_prev = getNode(index-1);
|
|
||||||
tmp->data = _t;
|
|
||||||
tmp->next = _prev->next;
|
|
||||||
_prev->next = tmp;
|
|
||||||
|
|
||||||
_size++;
|
|
||||||
isCached = false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
bool LinkedList<T>::add(T _t){
|
|
||||||
|
|
||||||
ListNode<T> *tmp = new ListNode<T>();
|
|
||||||
tmp->data = _t;
|
|
||||||
tmp->next = NULL;
|
|
||||||
|
|
||||||
if(root){
|
|
||||||
// Already have elements inserted
|
|
||||||
last->next = tmp;
|
|
||||||
last = tmp;
|
|
||||||
}else{
|
|
||||||
// First element being inserted
|
|
||||||
root = tmp;
|
|
||||||
last = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
_size++;
|
|
||||||
isCached = false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
bool LinkedList<T>::unshift(T _t){
|
|
||||||
|
|
||||||
if(_size == 0)
|
|
||||||
return add(_t);
|
|
||||||
|
|
||||||
ListNode<T> *tmp = new ListNode<T>();
|
|
||||||
tmp->next = root;
|
|
||||||
tmp->data = _t;
|
|
||||||
root = tmp;
|
|
||||||
|
|
||||||
_size++;
|
|
||||||
isCached = false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
T& LinkedList<T>::operator[](int index) {
|
|
||||||
return getNode(index)->data;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
bool LinkedList<T>::set(int index, T _t){
|
|
||||||
// Check if index position is in bounds
|
|
||||||
if(index < 0 || index >= _size)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
getNode(index)->data = _t;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
T LinkedList<T>::pop(){
|
|
||||||
if(_size <= 0)
|
|
||||||
return T();
|
|
||||||
|
|
||||||
isCached = false;
|
|
||||||
|
|
||||||
if(_size >= 2){
|
|
||||||
ListNode<T> *tmp = getNode(_size - 2);
|
|
||||||
T ret = tmp->next->data;
|
|
||||||
delete(tmp->next);
|
|
||||||
tmp->next = NULL;
|
|
||||||
last = tmp;
|
|
||||||
_size--;
|
|
||||||
return ret;
|
|
||||||
}else{
|
|
||||||
// Only one element left on the list
|
|
||||||
T ret = root->data;
|
|
||||||
delete(root);
|
|
||||||
root = NULL;
|
|
||||||
last = NULL;
|
|
||||||
_size = 0;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
T LinkedList<T>::shift(){
|
|
||||||
if(_size <= 0)
|
|
||||||
return T();
|
|
||||||
|
|
||||||
if(_size > 1){
|
|
||||||
ListNode<T> *_next = root->next;
|
|
||||||
T ret = root->data;
|
|
||||||
delete(root);
|
|
||||||
root = _next;
|
|
||||||
_size --;
|
|
||||||
isCached = false;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}else{
|
|
||||||
// Only one left, then pop()
|
|
||||||
return pop();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
T LinkedList<T>::remove(int index){
|
|
||||||
if (index < 0 || index >= _size)
|
|
||||||
{
|
|
||||||
return T();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(index == 0)
|
|
||||||
return shift();
|
|
||||||
|
|
||||||
if (index == _size-1)
|
|
||||||
{
|
|
||||||
return pop();
|
|
||||||
}
|
|
||||||
|
|
||||||
ListNode<T> *tmp = getNode(index - 1);
|
|
||||||
ListNode<T> *toDelete = tmp->next;
|
|
||||||
T ret = toDelete->data;
|
|
||||||
tmp->next = tmp->next->next;
|
|
||||||
delete(toDelete);
|
|
||||||
_size--;
|
|
||||||
isCached = false;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
T LinkedList<T>::get(int index){
|
|
||||||
ListNode<T> *tmp = getNode(index);
|
|
||||||
|
|
||||||
return (tmp ? tmp->data : T());
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
void LinkedList<T>::clear(){
|
|
||||||
while(size() > 0)
|
|
||||||
shift();
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
void LinkedList<T>::sort(int (*cmp)(T &, T &)){
|
|
||||||
if(_size < 2) return; // trivial case;
|
|
||||||
|
|
||||||
for(;;) {
|
|
||||||
|
|
||||||
ListNode<T> **joinPoint = &root;
|
|
||||||
|
|
||||||
while(*joinPoint) {
|
|
||||||
ListNode<T> *a = *joinPoint;
|
|
||||||
ListNode<T> *a_end = findEndOfSortedString(a, cmp);
|
|
||||||
|
|
||||||
if(!a_end->next ) {
|
|
||||||
if(joinPoint == &root) {
|
|
||||||
last = a_end;
|
|
||||||
isCached = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ListNode<T> *b = a_end->next;
|
|
||||||
ListNode<T> *b_end = findEndOfSortedString(b, cmp);
|
|
||||||
|
|
||||||
ListNode<T> *tail = b_end->next;
|
|
||||||
|
|
||||||
a_end->next = NULL;
|
|
||||||
b_end->next = NULL;
|
|
||||||
|
|
||||||
while(a && b) {
|
|
||||||
if(cmp(a->data, b->data) <= 0) {
|
|
||||||
*joinPoint = a;
|
|
||||||
joinPoint = &a->next;
|
|
||||||
a = a->next;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
*joinPoint = b;
|
|
||||||
joinPoint = &b->next;
|
|
||||||
b = b->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(a) {
|
|
||||||
*joinPoint = a;
|
|
||||||
while(a->next) a = a->next;
|
|
||||||
a->next = tail;
|
|
||||||
joinPoint = &a->next;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
*joinPoint = b;
|
|
||||||
while(b->next) b = b->next;
|
|
||||||
b->next = tail;
|
|
||||||
joinPoint = &b->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
ListNode<T>* LinkedList<T>::findEndOfSortedString(ListNode<T> *p, int (*cmp)(T &, T &)) {
|
|
||||||
while(p->next && cmp(p->data, p->next->data) <= 0) {
|
|
||||||
p = p->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,171 +0,0 @@
|
|||||||
# LinkedList
|
|
||||||
|
|
||||||
This library was developed targeting **`Arduino`** applications. However, works just great with any C++.
|
|
||||||
|
|
||||||
Implementing a buffer for objects takes time. If we are not in the mood, we just create an `array[1000]` with enough size.
|
|
||||||
|
|
||||||
The objective of this library is to create a pattern for projects.
|
|
||||||
If you need to use a List of: `int`, `float`, `objects`, `Lists` or `Wales`. **This is what you are looking for.**
|
|
||||||
|
|
||||||
With a simple but powerful caching algorithm, you can get subsequent objects much faster than usual. Tested without any problems with Lists bigger than 2000 members.
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
1. [Download](https://github.com/ivanseidel/LinkedList/archive/master.zip) the Latest release from gitHub.
|
|
||||||
2. Unzip and modify the Folder name to "LinkedList" (Remove the '-version')
|
|
||||||
3. Paste the modified folder on your Library folder (On your `Libraries` folder inside Sketchbooks or Arduino software).
|
|
||||||
4. Reopen the Arduino software.
|
|
||||||
|
|
||||||
**If you are here, because another Library requires this class, just don't waste time reading bellow. Install and ready.**
|
|
||||||
|
|
||||||
-------------------------
|
|
||||||
|
|
||||||
## Getting started
|
|
||||||
|
|
||||||
### The `LinkedList` class
|
|
||||||
|
|
||||||
In case you don't know what a LinkedList is and what it's used for, take a quick look at [Wikipedia::LinkedList](https://en.wikipedia.org/wiki/Linked_list) before continuing.
|
|
||||||
|
|
||||||
#### To declare a LinkedList object
|
|
||||||
```c++
|
|
||||||
// Instantiate a LinkedList that will hold 'integer'
|
|
||||||
LinkedList<int> myLinkedList = LinkedList<int>();
|
|
||||||
|
|
||||||
// Or just this
|
|
||||||
LinkedList<int> myLinkedList;
|
|
||||||
|
|
||||||
// But if you are instantiating a pointer LinkedList...
|
|
||||||
LinkedList<int> *myLinkedList = new LinkedList<int>();
|
|
||||||
|
|
||||||
// If you want a LinkedList with any other type such as 'MyClass'
|
|
||||||
// Make sure you call delete(MyClass) when you remove!
|
|
||||||
LinkedList<MyClass> *myLinkedList = new LinkedList<MyClass>();
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Getting the size of the linked list
|
|
||||||
```c++
|
|
||||||
// To get the size of a linked list, make use of the size() method
|
|
||||||
int theSize = myList.size();
|
|
||||||
|
|
||||||
// Notice that if it's pointer to the linked list, you should use -> instead
|
|
||||||
int theSize = myList->size();
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Adding elements
|
|
||||||
|
|
||||||
```c++
|
|
||||||
// add(obj) method will insert at the END of the list
|
|
||||||
myList.add(myObject);
|
|
||||||
|
|
||||||
// add(index, obj) method will try to insert the object at the specified index
|
|
||||||
myList.add(0, myObject); // Add at the beginning
|
|
||||||
myList.add(3, myObject); // Add at index 3
|
|
||||||
|
|
||||||
// unshift(obj) method will insert the object at the beginning
|
|
||||||
myList.unshift(myObject);
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Getting elements
|
|
||||||
|
|
||||||
```c++
|
|
||||||
// get(index) will return the element at index
|
|
||||||
// (notice that the start element is 0, not 1)
|
|
||||||
|
|
||||||
// Get the FIRST element
|
|
||||||
myObject = myList.get(0);
|
|
||||||
|
|
||||||
// Get the third element
|
|
||||||
myObject = myList.get(2);
|
|
||||||
|
|
||||||
// Get the LAST element
|
|
||||||
myObject = myList.get(myList.size() - 1);
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Changing elements
|
|
||||||
```c++
|
|
||||||
// set(index, obj) method will change the object at index to obj
|
|
||||||
|
|
||||||
// Change the first element to myObject
|
|
||||||
myList.set(0, myObject);
|
|
||||||
|
|
||||||
// Change the third element to myObject
|
|
||||||
myList.set(2, myObject);
|
|
||||||
|
|
||||||
// Change the LAST element of the list
|
|
||||||
myList.set(myList.size() - 1, myObject);
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Removing elements
|
|
||||||
```c++
|
|
||||||
// remove(index) will remove and return the element at index
|
|
||||||
|
|
||||||
// Remove the first object
|
|
||||||
myList.remove(0);
|
|
||||||
|
|
||||||
// Get and Delete the third element
|
|
||||||
myDeletedObject = myList.remove(2);
|
|
||||||
|
|
||||||
// pop() will remove and return the LAST element
|
|
||||||
myDeletedObject = myList.pop();
|
|
||||||
|
|
||||||
// shift() will remove and return the FIRST element
|
|
||||||
myDeletedObject = myList.shift();
|
|
||||||
|
|
||||||
// clear() will erase the entire list, leaving it with 0 elements
|
|
||||||
// NOTE: Clear wont DELETE/FREE memory from Pointers, if you
|
|
||||||
// are using Classes/Poiners, manualy delete and free those.
|
|
||||||
myList.clear();
|
|
||||||
```
|
|
||||||
|
|
||||||
------------------------
|
|
||||||
|
|
||||||
## Library Reference
|
|
||||||
|
|
||||||
### `ListNode` struct
|
|
||||||
|
|
||||||
- `T` `ListNode::data` - The object data
|
|
||||||
|
|
||||||
- `ListNode<T>` `*next` - Pointer to the next Node
|
|
||||||
|
|
||||||
### `LinkedList` class
|
|
||||||
|
|
||||||
**`boolean` methods returns if succeeded**
|
|
||||||
|
|
||||||
- `LinkedList<T>::LinkedList()` - Constructor.
|
|
||||||
|
|
||||||
- `LinkedList<T>::~LinkedList()` - Destructor. Clear Nodes to minimize memory. Does not free pointer memory.
|
|
||||||
|
|
||||||
- `int` `LinkedList<T>::size()` - Returns the current size of the list.
|
|
||||||
|
|
||||||
- `bool` `LinkedList<T>::add(T)` - Add element T at the END of the list.
|
|
||||||
|
|
||||||
- `bool` `LinkedList<T>::add(int index, T)` - Add element T at `index` of the list.
|
|
||||||
|
|
||||||
- `bool` `LinkedList<T>::unshift(T)` - Add element T at the BEGINNING of the list.
|
|
||||||
|
|
||||||
- `bool` `LinkedList<T>::set(int index, T)` - Set the element at `index` to T.
|
|
||||||
|
|
||||||
- `T` `LinkedList<T>::remove(int index)` - Remove element at `index`. Return the removed element. Does not free pointer memory
|
|
||||||
|
|
||||||
- `T` `LinkedList<T>::pop()` - Remove the LAST element. Return the removed element.
|
|
||||||
|
|
||||||
- `T` `LinkedList<T>::shift()` - Remove the FIRST element. Return the removed element.
|
|
||||||
|
|
||||||
- `T` `LinkedList<T>::get(int index)` - Return the element at `index`.
|
|
||||||
|
|
||||||
- `void` `LinkedList<T>::clear()` - Removes all elements. Does not free pointer memory.
|
|
||||||
|
|
||||||
- **protected** `int` `LinkedList<T>::_size` - Holds the cached size of the list.
|
|
||||||
|
|
||||||
- **protected** `ListNode<T>` `LinkedList<T>::*root` - Holds the root node of the list.
|
|
||||||
|
|
||||||
- **protected** `ListNode<T>` `LinkedList<T>::*last` - Holds the last node of the list.
|
|
||||||
|
|
||||||
- **protected** `ListNode<T>*` `LinkedList<T>::getNode(int index)` - Returns the `index` node of the list.
|
|
||||||
|
|
||||||
### Version History
|
|
||||||
|
|
||||||
* `1.1 (2013-07-20)`: Cache implemented. Getting subsequent objects is now O(N). Before, O(N^2).
|
|
||||||
* `1.0 (2013-07-20)`: Original release
|
|
||||||
|
|
||||||

|
|
||||||
@ -1,81 +0,0 @@
|
|||||||
/*
|
|
||||||
LinkedList Example
|
|
||||||
Link: http://github.com/ivanseidel/LinkedList
|
|
||||||
|
|
||||||
Example Created by
|
|
||||||
Tom Stewart, github.com/tastewar
|
|
||||||
|
|
||||||
Edited by:
|
|
||||||
Ivan Seidel, github.com/ivanseidel
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <LinkedList.h>
|
|
||||||
|
|
||||||
// Let's define a new class
|
|
||||||
class Animal {
|
|
||||||
public:
|
|
||||||
char *name;
|
|
||||||
bool isMammal;
|
|
||||||
};
|
|
||||||
|
|
||||||
char catname[]="kitty";
|
|
||||||
char dogname[]="doggie";
|
|
||||||
char emuname[]="emu";
|
|
||||||
|
|
||||||
LinkedList<Animal*> myAnimalList = LinkedList<Animal*>();
|
|
||||||
|
|
||||||
void setup()
|
|
||||||
{
|
|
||||||
|
|
||||||
Serial.begin(9600);
|
|
||||||
Serial.println("Hello!" );
|
|
||||||
|
|
||||||
// Create a Cat
|
|
||||||
Animal *cat = new Animal();
|
|
||||||
cat->name = catname;
|
|
||||||
cat->isMammal = true;
|
|
||||||
|
|
||||||
// Create a dog
|
|
||||||
Animal *dog = new Animal();
|
|
||||||
dog->name = dogname;
|
|
||||||
dog->isMammal = true;
|
|
||||||
|
|
||||||
// Create a emu
|
|
||||||
Animal *emu = new Animal();
|
|
||||||
emu->name = emuname;
|
|
||||||
emu->isMammal = false; // just an example; no offense to pig lovers
|
|
||||||
|
|
||||||
// Add animals to list
|
|
||||||
myAnimalList.add(cat);
|
|
||||||
myAnimalList.add(emu);
|
|
||||||
myAnimalList.add(dog);
|
|
||||||
}
|
|
||||||
|
|
||||||
void loop() {
|
|
||||||
|
|
||||||
Serial.print("There are ");
|
|
||||||
Serial.print(myAnimalList.size());
|
|
||||||
Serial.print(" animals in the list. The mammals are: ");
|
|
||||||
|
|
||||||
int current = 0;
|
|
||||||
Animal *animal;
|
|
||||||
for(int i = 0; i < myAnimalList.size(); i++){
|
|
||||||
|
|
||||||
// Get animal from list
|
|
||||||
animal = myAnimalList.get(i);
|
|
||||||
|
|
||||||
// If its a mammal, then print it's name
|
|
||||||
if(animal->isMammal){
|
|
||||||
|
|
||||||
// Avoid printing spacer on the first element
|
|
||||||
if(current++)
|
|
||||||
Serial.print(", ");
|
|
||||||
|
|
||||||
// Print animal name
|
|
||||||
Serial.print(animal->name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Serial.println(".");
|
|
||||||
|
|
||||||
while (true); // nothing else to do, loop forever
|
|
||||||
}
|
|
||||||
@ -1,58 +0,0 @@
|
|||||||
/*
|
|
||||||
LinkedList Example
|
|
||||||
Link: http://github.com/ivanseidel/LinkedList
|
|
||||||
|
|
||||||
Example Created by
|
|
||||||
Tom Stewart, github.com/tastewar
|
|
||||||
|
|
||||||
Edited by:
|
|
||||||
Ivan Seidel, github.com/ivanseidel
|
|
||||||
*/
|
|
||||||
#include <LinkedList.h>
|
|
||||||
|
|
||||||
LinkedList<int> myList = LinkedList<int>();
|
|
||||||
|
|
||||||
void setup()
|
|
||||||
{
|
|
||||||
|
|
||||||
Serial.begin(9600);
|
|
||||||
Serial.println("Hello!");
|
|
||||||
|
|
||||||
// Add some stuff to the list
|
|
||||||
int k = -240,
|
|
||||||
l = 123,
|
|
||||||
m = -2,
|
|
||||||
n = 222;
|
|
||||||
myList.add(n);
|
|
||||||
myList.add(0);
|
|
||||||
myList.add(l);
|
|
||||||
myList.add(17);
|
|
||||||
myList.add(k);
|
|
||||||
myList.add(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
void loop() {
|
|
||||||
|
|
||||||
int listSize = myList.size();
|
|
||||||
|
|
||||||
Serial.print("There are ");
|
|
||||||
Serial.print(listSize);
|
|
||||||
Serial.print(" integers in the list. The negative ones are: ");
|
|
||||||
|
|
||||||
// Print Negative numbers
|
|
||||||
for (int h = 0; h < listSize; h++) {
|
|
||||||
|
|
||||||
// Get value from list
|
|
||||||
int val = myList.get(h);
|
|
||||||
|
|
||||||
// If the value is negative, print it
|
|
||||||
if (val < 0) {
|
|
||||||
Serial.print(" ");
|
|
||||||
Serial.print(val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while (true); // nothing else to do, loop forever
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
#######################################
|
|
||||||
# Syntax Coloring
|
|
||||||
#######################################
|
|
||||||
|
|
||||||
#######################################
|
|
||||||
# Datatypes (KEYWORD1)
|
|
||||||
#######################################
|
|
||||||
|
|
||||||
LinkedList KEYWORD1
|
|
||||||
ListNode KEYWORD1
|
|
||||||
|
|
||||||
#######################################
|
|
||||||
# Methods and Functions (KEYWORD2)
|
|
||||||
#######################################
|
|
||||||
|
|
||||||
size KEYWORD2
|
|
||||||
add KEYWORD2
|
|
||||||
unshift KEYWORD2
|
|
||||||
set KEYWORD2
|
|
||||||
remove KEYWORD2
|
|
||||||
pop KEYWORD2
|
|
||||||
shift KEYWORD2
|
|
||||||
get KEYWORD2
|
|
||||||
clear KEYWORD2
|
|
||||||
|
|
||||||
#######################################
|
|
||||||
# Constants (LITERAL1)
|
|
||||||
#######################################
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "LinkedList",
|
|
||||||
"keywords": "pattern",
|
|
||||||
"description": "A fully implemented LinkedList (int, float, objects, Lists or Wales) made to work with Arduino projects",
|
|
||||||
"repository":
|
|
||||||
{
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/ivanseidel/LinkedList.git"
|
|
||||||
},
|
|
||||||
"frameworks": "arduino",
|
|
||||||
"platforms": "*"
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
name=LinkedList
|
|
||||||
version=1.2.3
|
|
||||||
author=Ivan Seidel <ivanseidel@gmail.com>
|
|
||||||
maintainer=Ivan Seidel <ivanseidel@gmail.com>
|
|
||||||
sentence=A fully implemented LinkedList made to work with Arduino projects
|
|
||||||
paragraph=The objective of this library is to create a pattern for projects. If you need to use a List of: int, float, objects, Lists or Wales. This is what you are looking for.
|
|
||||||
category=Data Processing
|
|
||||||
url=https://github.com/ivanseidel/LinkedList
|
|
||||||
architectures=*
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user