Compare commits

..

No commits in common. "v14.3.0" and "master" have entirely different histories.

6357 changed files with 359 additions and 2496158 deletions

23
.gitattributes vendored
View File

@ -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

View File

@ -1,81 +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)
- [ ] 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)**

View File

@ -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.

View File

@ -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.0.240926
- [ ] 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
View File

@ -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

View File

@ -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.

View File

@ -1,283 +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
# 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.x'
#- name: Install clang compiler
#run: |
#sudo apt-get install -f clang
- name: Make Berry and Tasmota Berry code
run: |
cd lib/libesp32/berry
make
cd ../berry_tasmota
../berry/berry -s -g solidify_all.be
- name: Matter Berry Code
run: |
cd lib/libesp32/berry_matter
../berry/berry -s -g solidify_all.be
- name: Berry Animate Code
run: |
cd lib/libesp32/berry_animate
../berry/berry -s -g solidify_all.be
- name: LVGL Berry Code
run: |
cd lib/libesp32_lvgl/lv_binding_berry
../../libesp32/berry/berry -s -g solidify_all.be
- name: HASPmota Berry Code
run: |
cd lib/libesp32_lvgl/lv_haspmota
../../libesp32/berry/berry -s -g solidify_all.be
- uses: jason2866/upload-artifact@v2.0.3
with:
name: '["berry_tasmota", "berry_matter", "berry_animate", "berry_lvgl", "berry_haspmota", "berry_header"]'
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.x'
- uses: jason2866/download-artifact@v3.0.4
with:
name: |
berry_tasmota
berry_matter
berry_animate
berry_lvgl
berry_haspmota
berry_header
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
- 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
- tasmota32c2-safeboot
- tasmota32c3-safeboot
- tasmota32c3ser-safeboot
- tasmota32s2-safeboot
- tasmota32s2cdc-safeboot
- tasmota32s3-safeboot
- tasmota32s3ser-safeboot
- tasmota32c6-safeboot
- tasmota32c6ser-safeboot
steps:
- uses: actions/checkout@v4
with:
ref: development
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install wheel
pip install -U 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
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: jason2866/upload-artifact@v2.0.3
with:
name: firmware_safeboot
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.x'
- name: Install dependencies
run: |
pip install wheel
pip install -U 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
run: platformio run -e ${{ matrix.variant }}
- name: Upload firmware artifacts
uses: jason2866/upload-artifact@v2.0.3
with:
name: firmware
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
- tasmota32c6
- 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.x'
- name: Install dependencies
run: |
pip install wheel
pip install -U platformio
cp ./platformio_override_sample.ini ./platformio_override.ini
- name: Download safeboot firmwares
uses: jason2866/download-artifact@v3.0.4
with:
name: firmware_safeboot
path: ./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
run: platformio run -e ${{ matrix.variant }}
- name: Upload firmware artifacts
uses: jason2866/upload-artifact@v2.0.3
with:
name: firmware
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, 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.x'
- name: Install dependencies
run: |
pip install wheel
pip install -U platformio
cp ./platformio_override_sample.ini ./platformio_override.ini
- name: Download safeboot firmwares
uses: jason2866/download-artifact@v3.0.4
with:
name: firmware_safeboot
path: ./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
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
- name: Upload language firmware artifacts
uses: jason2866/upload-artifact@v2.0.3
with:
name: firmware
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"}'

View File

@ -1,236 +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
# 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
- tasmota32c2-safeboot
- tasmota32c3-safeboot
- tasmota32c3ser-safeboot
- tasmota32s2-safeboot
- tasmota32s2cdc-safeboot
- tasmota32s3-safeboot
- tasmota32s3ser-safeboot
- tasmota32c6-safeboot
- tasmota32c6ser-safeboot
steps:
- uses: actions/checkout@v4
with:
ref: master
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install wheel
pip install -U 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
run: platformio run -e ${{ matrix.variant }}
- name: Upload safeboot firmware artifacts
uses: jason2866/upload-artifact@v2.0.3
with:
name: firmware_safeboot
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.x'
- name: Install dependencies
run: |
pip install wheel
pip install -U 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
run: platformio run -e ${{ matrix.variant }}
- name: Upload firmware artifacts
uses: jason2866/upload-artifact@v2.0.3
with:
name: firmware
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
- tasmota32c6
- 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.x'
- name: Install dependencies
run: |
pip install wheel
pip install -U platformio
cp ./platformio_override_sample.ini ./platformio_override.ini
- name: Download safeboot firmwares
uses: jason2866/download-artifact@v3.0.4
with:
name: firmware_safeboot
path: ./firmware
- name: Display downloaded files
run: |
ls -R ./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
run: platformio run -e ${{ matrix.variant }}
- name: Upload firmware artifacts
uses: jason2866/upload-artifact@v2.0.3
with:
name: firmware
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, 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.x'
- name: Install dependencies
run: |
pip install wheel
pip install -U platformio
cp ./platformio_override_sample.ini ./platformio_override.ini
- name: Download safeboot firmwares
uses: jason2866/download-artifact@v3.0.4
with:
name: firmware_safeboot
path: ./firmware
- name: Display downloaded files
run: |
ls -R ./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
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
- name: Upload language firmware artifacts
uses: jason2866/upload-artifact@v2.0.3
with:
name: firmware
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 Tasmota firmwares
uses: jason2866/download-artifact@v3.0.4
with:
name: firmware
path: ./mv_firmware
- name: Download safeboot firmwares
uses: jason2866/download-artifact@v3.0.4
with:
name: firmware_safeboot
path: ./mv_firmware
- name: Display structure of downloaded files
run: ls -R ./mv_firmware/
- name: Zip all map.gz files in one file -> map_all.zip
run: 7z a -mx=9 -tzip -xr'!.*' map_all.zip mv_firmware/map
- name: Release
uses: jason2866/action-gh-release@v1.2
#if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ github.run_number }}
files: |
./mv_firmware/firmware/*
map_all.zip
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"}'

View File

@ -1,162 +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-2019
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.x'
- name: Install dependencies
run: |
pip install wheel
#python -m pip install --upgrade pip
pip install -U platformio
#platformio upgrade --dev
#platformio update
- name: Run PlatformIO
run: platformio run -e ${{ matrix.variant }}
- uses: jason2866/upload-artifact@v2.0.3
with:
name: firmware
path: ./build_output
os-check-mac:
runs-on: macos-14
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.12'
- name: Install dependencies
run: |
pip install wheel
#python -m pip install --upgrade pip
pip install -U platformio
#platformio upgrade --dev
#platformio update
- name: Run PlatformIO
run: platformio run -e ${{ matrix.variant }}
- uses: jason2866/upload-artifact@v2.0.3
with:
name: firmware
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
- tasmota32c6
- 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
- tasmota32c6-safeboot
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install wheel
#python -m pip install --upgrade pip
pip install -U platformio
#platformio upgrade --dev
#platformio update
cp ./platformio_override_sample.ini ./platformio_override.ini
- name: Run PlatformIO
run: platformio run -e ${{ matrix.variant }}
- uses: jason2866/upload-artifact@v2.0.3
with:
name: firmware
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, 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.x'
- name: Install dependencies
run: |
pip install wheel
#python -m pip install --upgrade pip
pip install -U platformio
#platformio upgrade --dev
#platformio update
- name: Run PlatformIO
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
- uses: jason2866/upload-artifact@v2.0.3
with:
name: firmware
path: ./build_output

View File

@ -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'

View File

@ -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);
}

View File

@ -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"

399
.gitignore vendored
View File

@ -1,52 +1,361 @@
## OS specific ########
.DS_Store
# ---> C++
# 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*
## Compilation artefacts ########
*.pyc
*.d
*.o
*.gcno
*.gcda
dependencies.lock
# KDE directory preferences
.directory
## Project files ######
managed_components
.platformio
.pio
.clang_complete
.gcc-flags.json
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
# ---> 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
.dummy
sdkconfig.*
data
unpacked_fs
unpacked_boards
tasmota/user_config_override.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
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
## Visual Studio Code specific ######
.vscode
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/settings.json
.vscode/extensions.json
*.bak
*.code-workspace
# Translations
*.mo
*.pot
## Python virtual environments for Platformio ##
venv
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
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
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/

3
.gitpod.Dockerfile vendored
View File

@ -1,3 +0,0 @@
FROM gitpod/workspace-python-3.11
USER gitpod

View File

@ -1,9 +0,0 @@
tasks:
- command: pip install -U platformio && pip install --upgrade pip && platformio run -t clean -e tasmota
image:
file: .gitpod.Dockerfile
vscode:
extensions:
- shardulm94.trailing-spaces

View File

@ -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"
]
}

74
.vscode/settings.json vendored
View File

@ -1,74 +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"
}
]
}

171
API.md
View File

@ -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
```

292
BUILDS.md
View File

@ -1,292 +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_AWS_IOT | - | - / - | - | - | - | - |
| USE_4K_RSA | - | - / - | - | - | - | - |
| USE_TELEGRAM | - | - / - | - | - | - | - |
| USE_KNX | - | - / x | x | - | - | - |
| 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_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_DS3231 | - | - / - | - | - | - | - |
| -USE_BM8563 | - | - / x | - | - | - | - |
| -USE_PCF85363 | - | - / - | - | - | - | - |
| -USE_RX8010 | - | - / - | - | - | - | - |
| 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 | - | - / - | - | - | - | - |
| | | | | | | |
| **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_LD2410 | - | - / - | - | - | - | - |
| USE_GM861 | - | - / - | - | - | - | - |
| USE_TCP_BRIDGE | - | - / - | - | - | - | - | zbbridge / zbbrdgpro |
| USE_HC8 | - | - / - | - | - | - | - |
| USE_PIPSOLAR | - | - / - | - | - | - | - |
| USE_WOOLIIS | - | - / - | - | - | - | - |
| | | | | | | |
| 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_SR04 | - | - / - | - | x | - | - |
| USE_ME007 | - | - / - | - | - | - | - |
| USE_DYP | - | - / - | - | - | - | - |
| USE_TM1638 | - | - / x | - | x | - | - |
| USE_HX711 | - | - / x | - | x | - | - |
| 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_DALI | | / - | | | | |
| 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

File diff suppressed because it is too large Load Diff

View File

@ -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()

View File

@ -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.

View File

@ -1,248 +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 |
| xdrv_75_dali | @eeak, @arendst
| xdrv_76 |
| xdrv_77 |
| xdrv_78 |
| xdrv_79_esp32_ble | @staars, @btsimonh
| 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_ |
| xdrv_92_ |
| xdrv_93_ |
| xdrv_94_ |
| |
| 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_127_esp32_sensors | @arendst
| |
| Libraries |
| |
| berry | @s-hadinger
| ext-printf | @s-hadinger
| jsmn | @s-hadinger
| unishox | @s-hadinger
| matter | @s-hadinger
| |
| PlatformIO |
| |
| all | @Jason2866
| |

View File

@ -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 isnt 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_ youre 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.>

2489
Doxyfile

File diff suppressed because it is too large Load Diff

View File

@ -1,44 +0,0 @@
![Tasmota logo](/tools/logo/TASMOTA_FullLogo_Vector.svg#gh-light-mode-only)![Tasmota logo](/tools/logo/TASMOTA_FullLogo_Vector_White.svg#gh-dark-mode-only)
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._
[![GitHub version](https://img.shields.io/github/release/arendst/Tasmota.svg)](https://github.com/arendst/Tasmota/releases/latest)
[![GitHub download](https://img.shields.io/github/downloads/arendst/Tasmota/total.svg)](https://github.com/arendst/Tasmota/releases/latest)
[![License](https://img.shields.io/github/license/arendst/Tasmota.svg)](LICENSE.txt)
[![Chat](https://img.shields.io/discord/479389167382691863.svg)](https://discord.gg/Ks2Kzd4)
If you like **Tasmota**, give it a star, or fork it and contribute!
[![GitHub stars](https://img.shields.io/github/stars/arendst/Tasmota.svg?style=social&label=Star)](https://github.com/arendst/Tasmota/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/arendst/Tasmota.svg?style=social&label=Fork)](https://github.com/arendst/Tasmota/network)
[![donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](https://paypal.me/tasmota)
See [CHANGELOG.md](https://github.com/arendst/Tasmota/blob/development/tasmota/CHANGELOG.md) for changes since last release.
## Development
[![Dev Version](https://img.shields.io/badge/development%20version-v14.3.x.x-blue.svg)](https://github.com/arendst/Tasmota)
[![Download Dev](https://img.shields.io/badge/download-development-yellow.svg)](http://ota.tasmota.com/tasmota/)
[![Tasmota CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+CI%22)
[![Tasmota ESP32 CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20ESP32%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+ESP32+CI%22)
[![Build_firmware](https://github.com/arendst/Tasmota/workflows/Build_firmware/badge.svg)](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).

View File

@ -1,132 +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
NOTE: Bus2 supported on ESP32 only.

View File

@ -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:

View File

@ -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>.

View File

@ -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 2500 additional devices are supported using [templates](TEMPLATES.md).

174
README.md
View File

@ -1,173 +1,3 @@
![Tasmota logo](/tools/logo/TASMOTA_FullLogo_Vector.svg#gh-light-mode-only)![Tasmota logo](/tools/logo/TASMOTA_FullLogo_Vector_White.svg#gh-dark-mode-only)
# 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**.
_Written for PlatformIO._
[![GitHub version](https://img.shields.io/github/release/arendst/Tasmota.svg)](http://ota.tasmota.com/tasmota/release)
[![GitHub download](https://img.shields.io/github/downloads/arendst/Tasmota/total.svg)](https://github.com/arendst/Tasmota/releases/latest)
[![License](https://img.shields.io/github/license/arendst/Tasmota.svg)](LICENSE.txt)
[![Discord](https://img.shields.io/discord/479389167382691863.svg?logo=discord&logoColor=white&color=5865F2&label=Discord)](https://discord.gg/Ks2Kzd4)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/arendst/Tasmota)
<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!
[![GitHub stars](https://img.shields.io/github/stars/arendst/Tasmota.svg?style=social&label=Star)](https://github.com/arendst/Tasmota/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/arendst/Tasmota.svg?style=social&label=Fork)](https://github.com/arendst/Tasmota/network)
[![donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](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
[![Dev Version](https://img.shields.io/badge/development%20version-v14.3.x.x-blue.svg)](https://github.com/arendst/Tasmota)
[![Download Dev](https://img.shields.io/badge/download-development-yellow.svg)](http://ota.tasmota.com/tasmota/)
[![Tasmota CI](https://github.com/arendst/Tasmota/actions/workflows/build_all_the_things.yml/badge.svg)](https://github.com/arendst/Tasmota/actions/workflows/build_all_the_things.yml)
[![Build_development](https://github.com/arendst/Tasmota/actions/workflows/Tasmota_build_devel.yml/badge.svg)](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 dont 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.
## 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
[![donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](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
Local copy of the https://github.com/arendst/Tasmota#

View File

@ -1,209 +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.0.240926**.
Support of ESP8266 Core versions before 2.7.8 and ESP32 Core versions before v3.1.0.240926 have been removed.
## Support of TLS
In addition to TLS using fingerprints now also user supplied CA certs, AWS IoT and Azure IoT is supported. Read [full documentation](https://tasmota.github.io/docs/AWS-IoT)
## 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-14.3.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-C6, ESP32-S2 and ESP32-S3 based
The following binary downloads have been compiled with ESP32/Arduino library core version **v3.1.0.240926**.
- **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.
- **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.
- **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-C2 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.
- **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-14.3.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 v14.3.0 Robert
### Added
- Command ``SetOption69 1`` to enable Serial Bridge inverted Receive [#22000](https://github.com/arendst/Tasmota/issues/22000)
- Command ``DaliWeb 1`` to enable light control for DALI broadcast address
- Command ``DaliSend <address>|<address+256>,<command>`` to send command (address+256 is repeat) on DALI bus
- Command ``DaliQuery <address>|<address+256>,<command>`` to send command (address+256 is repeat) on DALI bus and wait up to DALI_TIMEOUT ms for response
- HX711 optional calibration precision option on command ``Sensor34 2 <weight in gram> <precision>`` where `<precision>` is 1 to 20 [#13983](https://github.com/arendst/Tasmota/issues/13983)
- ESP8266 support for one-wire M1601 temperature sensor on DS18x20 GPIO [#21376](https://github.com/arendst/Tasmota/issues/21376)
- ESP8266 support for I2C CLK on GPIO16 [#22199](https://github.com/arendst/Tasmota/issues/22199)
- Support for I2C M5Unit (Mini)Scales using HX711 driver
- Support for DALI on ESP8266
- Support for RX8010 RTC as used in IOTTIMER [#21376](https://github.com/arendst/Tasmota/issues/21376)
- Support for BL0906 up to 6 channel energy monitor as used in Athom EM2/EM6 [#22167](https://github.com/arendst/Tasmota/issues/22167)
- Support for Sonoff SPM v1.3.0 [#13447](https://github.com/arendst/Tasmota/issues/13447)
- Energy command ``PowerSet 60,230`` to calibrate both Current and Power with known resistive load of 60W at 230V using calibrated Voltage
- Energy command ``CurrentSet 60,230`` to calibrate both Power and Current with known resistive load of 60W at 230V using calibrated Voltage
- ESP8266 experimental support for second I2C bus
- MQTT warning if trying to connect without TLS on a port that normally uses TLS [#22175](https://github.com/arendst/Tasmota/issues/22175)
- Energy Log level 4 message when (Calculated) Apparent Power is less than Active Power indicating wrong calibration [#20653](https://github.com/arendst/Tasmota/issues/20653)
- Support nexus protocol and calculation of separation limit to rc-switch library [#21886](https://github.com/arendst/Tasmota/issues/21886)
- KNX additional KnxTx functions and define KNX_USE_DPT9 [#22071](https://github.com/arendst/Tasmota/issues/22071)
- SML multi TRX line [#22056](https://github.com/arendst/Tasmota/issues/22056)
- Misubishi Electric HVAC Heat/Dry/Cool Auto operation mode [#22216](https://github.com/arendst/Tasmota/issues/22216)
- Misubishi Electric HVAC Bridge to HomeBridge/Homekit locally [#22236](https://github.com/arendst/Tasmota/issues/22236)
- Misubishi Electric HVAC Air Direction Control [#22241](https://github.com/arendst/Tasmota/issues/22241)
- Misubishi Electric HVAC prohibit function [#22269](https://github.com/arendst/Tasmota/issues/22269)
- Misubishi Electric HVAC compressor map and operation power and energy [#22290](https://github.com/arendst/Tasmota/issues/22290)
- Zigbee Koenkk firmware 20240710 for Sonoff Zigbee ZBPro [#22076](https://github.com/arendst/Tasmota/issues/22076)
- Berry Zigbee improvements to prepare Matter [#22083](https://github.com/arendst/Tasmota/issues/22083)
- Berry virtual Energy driver [#22134](https://github.com/arendst/Tasmota/issues/22134)
- Berry improve `int64` constructor [#22172](https://github.com/arendst/Tasmota/issues/22172)
- Berry Serial `config` to change parity on-the-fly for RS-485 [#22285](https://github.com/arendst/Tasmota/issues/22285)
- LVGL port `colorwheel` from LVGL 8 [#22244](https://github.com/arendst/Tasmota/issues/22244)
- HASPmota `cpicker` and `msgbox` [#22244](https://github.com/arendst/Tasmota/issues/22244)
- Matter support for Zigbee Temperature, Humidity and Pressure sensors [#22084](https://github.com/arendst/Tasmota/issues/22084)
- Matter support for Zigbee Occupancy and Light 0/1/2 (OnOff / Dimmer / White Color Temperature) [#22110](https://github.com/arendst/Tasmota/issues/22110)
### Breaking Changed
- Berry make `energy` modules changes from #21887 backwards compatible [#22046](https://github.com/arendst/Tasmota/issues/22046)
### Changed
- ESP8266 platform update from 2024.06.00 to 2024.09.00 and Framework (Arduino Core) from v2.7.7 to v2.7.8 [#22199](https://github.com/arendst/Tasmota/issues/22199)
- ESP32 platform update from 2024.08.10 to 2024.09.30 and Framework (Arduino Core) from v3.0.4 to v3.1.0.240926 [#22203](https://github.com/arendst/Tasmota/issues/22203)
- ESP32 LVGL library from v9.1.0 to v9.2.0 [#22031](https://github.com/arendst/Tasmota/issues/22031)
- GPIOViewer from v1.5.5 to v1.5.6
- Add command entered to command error and command unknown message
- Refactored I2C drivers HTU21, BH1750, SHT3x, iAQ and HYT
- Energy BL09xx command ``CurrentSet`` input changed from Ampere to milliAmpere
- Command ``DaliDimmer`` range from 0..254 to 0..100
- Energy force Apparent Power equals Active Power when (Calculated) Apparent Power is less than Active Power [#20653](https://github.com/arendst/Tasmota/issues/20653)
- Refactor and fix PID sensor (PID_USE_LOCAL_SENSOR) read race condition [#22162](https://github.com/arendst/Tasmota/issues/22162)
- SCD30 Lowered I2C clock from 100k to 50k [#15438](https://github.com/arendst/Tasmota/issues/15438)
- HASPmota `delete` instead of `delete()` [#22245](https://github.com/arendst/Tasmota/issues/22245)
### Fixed
- DALI received data decoding
- Compilation exception when metrics not found [#22170](https://github.com/arendst/Tasmota/issues/22170)
- Crash when calling TasmotaSerial destructor when initialized with incorrect arguments [#22036](https://github.com/arendst/Tasmota/issues/22036)
- Energy calculation [#20653](https://github.com/arendst/Tasmota/issues/20653)
- SML trx pin error [#22119](https://github.com/arendst/Tasmota/issues/22119)
- Shutter timing registers overflow [#21966](https://github.com/arendst/Tasmota/issues/21966)
- Shutter missing HOLD on shutterbutton [#22108](https://github.com/arendst/Tasmota/issues/22108)
- Shutter remaining issues on shutterinvert [#22120](https://github.com/arendst/Tasmota/issues/22120)
- PZEM continue energy monitoring when one phase fails [#21968](https://github.com/arendst/Tasmota/issues/21968)
- BearSSL panic on ESP8266 in rare conditions [#22017](https://github.com/arendst/Tasmota/issues/22017)
- ModbusBridge request and response logic [#22075](https://github.com/arendst/Tasmota/issues/22075)
- Sonoff WTS01 temperature sensor shows incorrect negative temperature [#19373](https://github.com/arendst/Tasmota/issues/19373)
- Autoconf prevent 'init.bat' from stopping on empty lines [#22158](https://github.com/arendst/Tasmota/issues/22158)
- Zigbee extend timeout for MCU reboot from 5s to 10s [#22009](https://github.com/arendst/Tasmota/issues/22009)
- Zigbee avoid disabling console serial on ESP32 and improved log messages [#22082](https://github.com/arendst/Tasmota/issues/22082)
- Zigbee flashing CC2562P with latest firmware [#22117](https://github.com/arendst/Tasmota/issues/22117)
- ESP32 Range Extender compile error with core 3.x [#22205](https://github.com/arendst/Tasmota/issues/22205)
- ESP32 DALI compile error with core 3.x [#22214](https://github.com/arendst/Tasmota/issues/22214)
- ESP32 Ethernet using EthClockMode 3 [#22248](https://github.com/arendst/Tasmota/issues/22248)
- ESP32 disable SPI DMA for uDisplay (broken since esp-idf 5.3 (core 3.1.0)) [#22264](https://github.com/arendst/Tasmota/issues/22264)
- Berry avoid `readbytes()` from crashing when file is too large [#22057](https://github.com/arendst/Tasmota/issues/22057)
- Berry energy missing attributes [#22116](https://github.com/arendst/Tasmota/issues/22116)
- Berry I2C to prepare M5Stack I2C STM32 based devices [#22143](https://github.com/arendst/Tasmota/issues/22143)
- Berry improve `persist` dirty data handling [#22246](https://github.com/arendst/Tasmota/issues/22246)
- ESP32-S3 uDisplay force cache writes to RGB display [#22222](https://github.com/arendst/Tasmota/issues/22222)
- LVGL Added OpenHASP icons to font `montserrat-28` [#22048](https://github.com/arendst/Tasmota/issues/22048)
- LVGL compilation of lv_menu [#22188](https://github.com/arendst/Tasmota/issues/22188)
- HASPmota broken `changed` event [#22194](https://github.com/arendst/Tasmota/issues/22194)
- HASPmota error when page '1' is not defined [#22220](https://github.com/arendst/Tasmota/issues/22220)
- Matter fixed UI bug when no endpoints configured [#22008](https://github.com/arendst/Tasmota/issues/22008)
- Matter fix when Rules are disabled [#22016](https://github.com/arendst/Tasmota/issues/22016)
- Matter fail to report Shutter status if no shutter is configured in Tasmota [#22049](https://github.com/arendst/Tasmota/issues/22049)
- Matter fix Waterleak broken after Berry solidification optimisation #21885 [#22052](https://github.com/arendst/Tasmota/issues/22052)
### Removed
- ESP8266 Analog input support using energy driver as only one channel is available
- Berry remove reuse of methods for interface-like code reuse #21500 [#22055](https://github.com/arendst/Tasmota/issues/22055)
- Berry Zigbee removed test code [#22263](https://github.com/arendst/Tasmota/issues/22263)

View File

@ -1,5 +0,0 @@
# Security Policy
## Reporting a Vulnerability
Please report security issues to [Tasmota](https://ota.tasmota.com/tasmota/contact/contact.php)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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";
}
?>

View File

@ -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";
}
?>

View File

@ -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"
}

View File

@ -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"
}

View File

@ -1,46 +0,0 @@
{
"build": {
"core": "esp32",
"extra_flags": "-DARDUINO_TASMOTA -DESP32_4M -DCORE32SOLO1",
"f_cpu": "240000000L",
"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-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"
}

View File

@ -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/esp32c6/esp32-c6-devkitc-1/index.html",
"vendor": "Espressif"
}

View File

@ -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/esp32c6/esp32-c6-devkitc-1/index.html",
"vendor": "Espressif"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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_ESP32C6
#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));

View File

@ -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__

View File

@ -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

View File

@ -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();
}
}
}

View File

@ -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

View File

@ -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();
}
}
}

View File

@ -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

View File

@ -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=*

View File

@ -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

View File

@ -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;

View File

@ -1,500 +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 * 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;
}
*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;
}

View File

@ -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

View File

@ -1,110 +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;
uint64_t u642 = 0x0123456789ABCDEFLL;
uint64_t u643 = 0xFEDCBA9876543210LL;
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), "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);
// }
// }

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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
![LinkedList](https://d2weczhvl823v0.cloudfront.net/ivanseidel/LinkedList/trend.png)

View File

@ -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
}

View File

@ -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
}

View File

@ -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)
#######################################

View File

@ -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": "*"
}

View File

@ -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=*

View File

@ -1,14 +0,0 @@
{
"name": "TasmotaLList",
"version": "1.0",
"description": "Simple yet powerful linked-list",
"license": "MIT",
"homepage": "https://github.com/arendst/Tasmota",
"frameworks": "arduino",
"platforms": "espressif32, espressif8266",
"authors":
{
"name": "Stephan Hadinger",
"maintainer": true
}
}

View File

@ -1,241 +0,0 @@
/*
LList.h - Lightweight Linked List for simple objects - optimized for low code size and low memory
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/>.
*/
#ifndef __LLIST__
#define __LLIST__
#include <cstddef>
/*********************************************************************************************\
*
* private class for Linked List element
*
\*********************************************************************************************/
template <typename T>
class LList;
template <typename T>
class LList_elt {
public:
LList_elt() : _next(nullptr), _val() {}
inline T & val(void) { return _val; }
inline LList_elt<T> * next(void) { return _next; }
inline void next(LList_elt<T> * next) { _next = next; }
friend class LList<T>;
protected:
LList_elt<T> * _next;
T _val;
};
/*********************************************************************************************\
*
* Lightweight Linked List - optimized for low code size
*
\*********************************************************************************************/
template <typename T>
class LList {
public:
LList() : _head(nullptr) {}
~LList() { reset(); }
// remove elements
T * removeHead(void); // remove first element
void reset(void); // remove all elements
const T * remove(const T * val);
// read the list
inline bool isEmpty(void) const { return (_head == nullptr) ? true : false; }
size_t length(void) const;
inline T * head(void) { return _head ? &_head->_val : nullptr; }
inline const T * head(void) const { return _head ? &_head->_val : nullptr; }
const T * at(size_t index) const ;
// non-const variants
// not very academic cast but reduces code size
inline T * at(size_t index) { return (T*) ((const LList<T>*)this)->at(index); }
// adding elements
T & addHead(void);
T & addHead(const T &val);
T & addToLast(void);
T & insertAt(size_t index);
// add an element allocated externally
// memory is free by us now -- don't free it!
T & addHead(LList_elt<T> * elt);
T & addToLast(LList_elt<T> * elt);
// iterator
// see https://stackoverflow.com/questions/8164567/how-to-make-my-custom-type-to-work-with-range-based-for-loops
class iterator {
public:
iterator(LList_elt<T> *_cur): cur(_cur), next(nullptr) { if (cur) { next = cur->_next; } }
iterator operator++() { cur = next; if (cur) { next = cur->_next;} return *this; }
bool operator!=(const iterator & other) const { return cur != other.cur; }
T & operator*() const { return cur->_val; }
private:
LList_elt<T> *cur;
LList_elt<T> *next; // we need to keep next pointer in case the current attribute gets deleted
};
iterator begin() { return iterator(this->_head); } // start with 'head'
iterator end() { return iterator(nullptr); } // end with null pointer
// const iterator
class const_iterator {
public:
const_iterator(const LList_elt<T> *_cur): cur(_cur), next(nullptr) { if (cur) { next = cur->_next; } }
const_iterator operator++() { cur = next; if (cur) { next = cur->_next;} return *this; }
bool operator!=(const_iterator & other) const { return cur != other.cur; }
const T & operator*() const { return cur->_val; }
private:
const LList_elt<T> *cur;
const LList_elt<T> *next; // we need to keep next pointer in case the current attribute gets deleted
};
const_iterator begin() const { return const_iterator(this->_head); } // start with 'head'
const_iterator end() const { return const_iterator(nullptr); } // end with null pointer
protected:
LList_elt<T> * _head;
};
template <typename T>
size_t LList<T>::length(void) const {
size_t count = 0;
for (auto & elt : *this) { (void)elt; count++; }
return count;
}
template <typename T>
const T * LList<T>::at(size_t index) const {
size_t count = 0;
for (const auto & elt : *this) {
if (index == count++) { return &elt; }
}
return nullptr;
}
template <typename T>
void LList<T>::reset(void) {
while (_head) {
LList_elt<T> * next = _head->next();
delete _head;
_head = next;
}
}
template <typename T>
T * LList<T>::removeHead(void) {
if (_head) {
T * orginal_head = &_head->_val;
LList_elt<T> * next = _head->next();
delete _head;
_head = next;
return orginal_head;
}
return nullptr;
}
template <typename T>
const T * LList<T>::remove(const T * val) {
if (nullptr == val) { return val; }
// find element in chain and find pointer before
LList_elt<T> **curr_ptr = &_head;
while (*curr_ptr) {
LList_elt<T> * curr_elt = *curr_ptr;
if ( &(curr_elt->_val) == val) {
*curr_ptr = curr_elt->_next; // update previous pointer to next element
delete curr_elt;
break; // stop iteration now
}
curr_ptr = &((*curr_ptr)->_next); // move to next element
}
return val;
}
template <typename T>
T & LList<T>::addHead(void) {
LList_elt<T> * elt = new LList_elt<T>(); // create element
elt->next(_head); // insert at the head
_head = elt;
return elt->_val;
}
template <typename T>
T & LList<T>::addHead(const T &val) {
LList_elt<T> * elt = new LList_elt<T>(); // create element
elt->next(_head); // insert at the head
elt->_val = val;
_head = elt;
return elt->_val;
}
template <typename T>
T & LList<T>::addHead(LList_elt<T> * elt) {
elt->next(_head); // insert at the head
_head = elt;
return elt->_val;
}
template <typename T>
T & LList<T>::addToLast(void) {
LList_elt<T> **curr_ptr = &_head;
while (*curr_ptr) {
curr_ptr = &((*curr_ptr)->_next);
}
LList_elt<T> * elt = new LList_elt<T>(); // create element
*curr_ptr = elt;
return elt->_val;
}
template <typename T>
T & LList<T>::insertAt(size_t index) {
if (0 == index) {
return addHead(); // insert at the head
}
index--;
LList_elt<T> **curr_ptr = &_head;
size_t count = 0;
while (*curr_ptr) {
if (count == index) {
LList_elt<T> * elt = new LList_elt<T>(); // create element
elt->next((*curr_ptr)->next());
(*curr_ptr)->next(elt);
return elt->_val;
}
curr_ptr = &((*curr_ptr)->_next);
count++;
}
return addToLast();
}
template <typename T>
T & LList<T>::addToLast(LList_elt<T> * elt) {
LList_elt<T> **curr_ptr = &_head;
while (*curr_ptr) {
curr_ptr = &((*curr_ptr)->_next);
}
*curr_ptr = elt;
elt->_next = nullptr;
return elt->_val;
}
#endif // __LLIST__

View File

@ -1,9 +0,0 @@
# TasmotaSerial
Implementation of software serial with hardware serial fallback library for the ESP8266
Implementation of dual UART hardware serial for the ESP32
Implementation of single UART hardware serial for the ESP32-S2
Allows for several instances to be active at the same time.
Please note that due to the fact that the ESP always have other activities ongoing, there will be some inexactness in interrupt timings. This may lead to bit errors when having heavy data traffic.

View File

@ -1,27 +0,0 @@
#include <TasmotaSerial.h>
TasmotaSerial swSer(14, 12);
void setup() {
Serial.begin(115200);
swSer.begin();
Serial.println("\nTasmota serial test started");
for (char ch = ' '; ch <= 'z'; ch++) {
swSer.write(ch);
}
swSer.println("");
}
void loop() {
while (swSer.available() > 0) {
Serial.write(swSer.read());
}
while (Serial.available() > 0) {
swSer.write(Serial.read());
}
}

View File

@ -1,31 +0,0 @@
#######################################
# Syntax Coloring Map for TasmotaSerial
# (esp8266 and esp32)
#######################################
#######################################
# Datatypes (KEYWORD1)
#######################################
TasmotaSerial KEYWORD1
#######################################
# Methods and Functions (KEYWORD2)
#######################################
begin KEYWORD2
end KEYWORD2
hardwareSerial KEYWORD2
peek KEYWORD2
write KEYWORD2
read KEYWORD2
available KEYWORD2
flush KEYWORD2
rxRead KEYWORD2
getLoopReadMetric KEYWORD2
getUart KEYWORD2
#######################################
# Constants (LITERAL1)
#######################################

View File

@ -1,17 +0,0 @@
{
"name": "TasmotaSerial",
"version": "3.6.0",
"keywords": [
"serial", "io", "TasmotaSerial"
],
"description": "Implementation of software serial with hardware serial fallback for ESP8266 and ESP32.",
"repository":
{
"type": "git",
"url": "https://github.com/arendst/Tasmota/lib/TasmotaSerial"
},
"frameworks": "arduino",
"platforms": [
"espressif8266", "espressif32"
]
}

View File

@ -1,9 +0,0 @@
name=TasmotaSerial
version=3.6.0
author=Theo Arends
maintainer=Theo Arends <theo@arends.com>
sentence=Implementation of software serial with hardware serial fallback for ESP8266 and ESP32.
paragraph=
category=Signal Input/Output
url=
architectures=esp8266,esp32

View File

@ -1,636 +0,0 @@
/*
TasmotaSerial.cpp - Implementation of software serial with hardware serial fallback for Tasmota
Copyright (C) 2021 Theo Arends
This library 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 <Arduino.h>
// The Arduino standard GPIO routines are not enough,
// must use some from the Espressif SDK as well
extern "C" {
#include "gpio.h"
}
#include <TasmotaSerial.h>
#ifdef ESP8266
void IRAM_ATTR callRxRead(void *self) { ((TasmotaSerial*)self)->rxRead(); };
// As the Arduino attachInterrupt has no parameter, lists of objects
// and callbacks corresponding to each possible GPIO pins have to be defined
TasmotaSerial *tms_obj_list[16];
#endif // ESP8266
#ifdef ESP32
#include "driver/uart.h"
#include "driver/gpio.h"
#include "esp_rom_gpio.h"
static uint32_t tasmota_serial_uart_bitmap = 0; // Assigned UARTs
#endif // ESP32
TasmotaSerial::TasmotaSerial(int receive_pin, int transmit_pin, int hardware_fallback, int nwmode, int buffer_size, bool invert) {
m_valid = false;
m_hardserial = false;
m_hardswap = false;
m_overflow = false;
m_invert = invert;
m_data_bits = 8;
m_stop_bits = 1;
m_nwmode = nwmode;
serial_buffer_size = buffer_size;
m_rx_pin = receive_pin;
m_tx_pin = transmit_pin;
m_tx_enable_pin = -1;
m_in_pos = 0;
m_out_pos = 0;
#ifdef ESP8266
if (!((isValidGPIOpin(receive_pin)) && (isValidGPIOpin(transmit_pin) || transmit_pin == 16))) {
return;
}
if (hardware_fallback && (((3 == m_rx_pin) && (1 == m_tx_pin)) || ((3 == m_rx_pin) && (-1 == m_tx_pin)) || ((-1 == m_rx_pin) && (1 == m_tx_pin)))) {
m_hardserial = true;
}
else if ((2 == hardware_fallback) && (((13 == m_rx_pin) && (15 == m_tx_pin)) || ((13 == m_rx_pin) && (-1 == m_tx_pin)) || ((-1 == m_rx_pin) && (15 == m_tx_pin)))) {
m_hardserial = true;
m_hardswap = true;
}
else {
if ((m_rx_pin < 0) && (m_tx_pin < 0)) { return; }
if (m_rx_pin > -1) {
m_buffer = (uint8_t*)malloc(serial_buffer_size);
if (m_buffer == NULL) return;
// Use getCycleCount() loop to get as exact timing as possible
m_bit_time = ESP.getCpuFreqMHz() * 1000000 / TM_SERIAL_BAUDRATE;
m_bit_start_time = m_bit_time + m_bit_time/3 - 500; // pre-compute first wait
pinMode(m_rx_pin, INPUT);
tms_obj_list[m_rx_pin] = this;
attachInterruptArg(m_rx_pin, callRxRead, this, (m_nwmode) ? CHANGE : FALLING);
}
if (m_tx_pin > -1) {
pinMode(m_tx_pin, OUTPUT);
digitalWrite(m_tx_pin, HIGH);
}
}
#endif // ESP8266
#ifdef ESP32
if ((receive_pin >= 0) && !GPIO_IS_VALID_GPIO(receive_pin)) { return; }
if ((transmit_pin >= 0) && !GPIO_IS_VALID_OUTPUT_GPIO(transmit_pin)) { return; }
m_hardserial = true;
TSerial = nullptr;
#endif // ESP32
m_valid = true;
}
void TasmotaSerial::end(void) {
#ifdef ESP8266
if (m_hardserial) {
// Serial.end(); // Keep active for logging
} else {
if (m_rx_pin > -1) {
detachInterrupt(m_rx_pin);
tms_obj_list[m_rx_pin] = NULL;
if (m_buffer) {
free(m_buffer);
}
}
}
#endif // ESP8266
#ifdef ESP32
// Serial.printf("TSR: Freeing UART%d\n", m_uart);
TSerial->end();
bitClear(tasmota_serial_uart_bitmap, m_uart);
#endif // ESP32
}
TasmotaSerial::~TasmotaSerial(void) {
if (m_valid) {
end();
}
}
bool TasmotaSerial::isValidGPIOpin(int pin) {
#ifdef ESP8266
return (pin >= -1 && pin <= 5) || (pin >= 12 && pin <= 15);
#endif
#ifdef ESP32
return GPIO_IS_VALID_OUTPUT_GPIO(pin);
#endif
}
void TasmotaSerial::setTransmitEnablePin(int tx_enable_pin) {
#ifdef ESP8266
if ((tx_enable_pin > -1) && (isValidGPIOpin(tx_enable_pin) || (16 == tx_enable_pin))) {
#endif
#ifdef ESP32
if ((tx_enable_pin > -1) && isValidGPIOpin(tx_enable_pin)) {
#endif
m_tx_enable_pin = tx_enable_pin;
pinMode(m_tx_enable_pin, OUTPUT);
digitalWrite(m_tx_enable_pin, LOW);
}
}
#ifdef ESP32
bool TasmotaSerial::freeUart(void) {
for (uint32_t i = SOC_UART_HP_NUM -1; i >= 0; i--) {
if (0 == bitRead(tasmota_serial_uart_bitmap, i)) {
m_uart = uart_port_t(i);
bitSet(tasmota_serial_uart_bitmap, m_uart);
return true;
}
}
return false;
}
void TasmotaSerial::Esp32Begin(void) {
TSerial->begin(m_speed, m_config, m_rx_pin, m_tx_pin, m_invert);
// For low bit rate, below 9600, set the Full RX threshold at 10 bytes instead of the default 120
if (m_speed <= 9600) {
// At 9600, 10 chars are ~10ms
uart_set_rx_full_threshold(m_uart, 10);
} else if (m_speed < 115200) {
// At 19200, 120 chars are ~60ms
// At 76800, 120 chars are ~15ms
uart_set_rx_full_threshold(m_uart, 120);
} else {
// At 115200, 256 chars are ~20ms
// Zigbee requires to keep frames together, i.e. 256 bytes max
uart_set_rx_full_threshold(m_uart, 256);
}
// For bitrate below 115200, set the Rx time out to 6 chars instead of the default 10
if (m_speed < 115200) {
// At 76800 the timeout is ~1ms
uart_set_rx_timeout(m_uart, 6);
}
}
#endif
size_t TasmotaSerial::setRxBufferSize(size_t size) {
if (size != serial_buffer_size) {
if (m_hardserial) {
if (size > 256) { // Default hardware serial Rx buffer size
#ifdef ESP8266
serial_buffer_size = size;
Serial.setRxBufferSize(serial_buffer_size);
#endif // ESP8266
#ifdef ESP32
if (TSerial) {
// RX Buffer can't be resized when Serial is already running
serial_buffer_size = size;
TSerial->flush();
TSerial->end();
delay(10); // Allow time to cleanup queues - if not used hangs ESP32
TSerial->setRxBufferSize(serial_buffer_size);
Esp32Begin();
}
#endif // ESP32
}
}
else if (m_buffer) {
uint8_t *m_buffer_temp = (uint8_t*)malloc(size); // Allocate new buffer
if (m_buffer_temp) { // If succesful de-allocate old buffer
free(m_buffer);
m_buffer = m_buffer_temp;
serial_buffer_size = size;
}
}
}
return serial_buffer_size;
}
bool TasmotaSerial::begin(uint32_t speed, uint32_t config) {
if (!m_valid) { return false; }
if (m_hardserial) {
if (serial_buffer_size < 256) {
serial_buffer_size = 256;
}
#ifdef ESP8266
Serial.flush();
Serial.begin(speed, (SerialConfig)config, SERIAL_FULL, m_tx_pin, m_invert);
if (m_hardswap) {
Serial.swap();
}
if (serial_buffer_size > 256) {
Serial.setRxBufferSize(serial_buffer_size);
}
#endif // ESP8266
#ifdef ESP32
if (TSerial == nullptr) { // Allow for dynamic change in baudrate or config
if (freeUart()) { // We prefer UART1 and UART2 and keep UART0 for debugging
#if ARDUINO_USB_MODE
TSerial = new HardwareSerial(m_uart);
#else
if (0 == m_uart) {
Serial.flush();
Serial.end();
delay(10); // Allow time to cleanup queues - if not used hangs ESP32
TSerial = &Serial;
} else {
TSerial = new HardwareSerial(m_uart);
}
#endif // ARDUINO_USB_MODE
if (serial_buffer_size > 256) { // RX Buffer can't be resized when Serial is already running (HardwareSerial.cpp)
TSerial->setRxBufferSize(serial_buffer_size);
}
} else {
m_valid = false;
return m_valid; // As we currently only support hardware serial on ESP32 it's safe to exit here
}
}
m_speed = speed;
m_config = config;
Esp32Begin();
// Serial.printf("TSR: Using UART%d\n", m_uart);
#endif // ESP32
} else {
// #define UART_NB_BIT_5 0B00000000
// #define UART_NB_BIT_6 0B00000100
// #define UART_NB_BIT_7 0B00001000
// #define UART_NB_BIT_8 0B00001100
m_data_bits = 5 + ((config &0x0C) >> 2);
// Software serial fakes two stop bits if either stop bits is 2 or parity is not None
// #define UART_NB_STOP_BIT_0 0B00000000
// #define UART_NB_STOP_BIT_1 0B00010000
// #define UART_NB_STOP_BIT_15 0B00100000
// #define UART_NB_STOP_BIT_2 0B00110000
m_stop_bits = 1 + ((config &0x30) >> 5);
// #define UART_PARITY_NONE 0B00000000
// #define UART_PARITY_EVEN 0B00000010
// #define UART_PARITY_ODD 0B00000011
if ((1 == m_stop_bits) && (config &0x03)) {
m_stop_bits++;
}
// Use getCycleCount() loop to get as exact timing as possible
m_bit_time = ESP.getCpuFreqMHz() * 1000000 / speed;
m_bit_start_time = m_bit_time + m_bit_time/3 - (ESP.getCpuFreqMHz() > 120 ? 700 : 500); // pre-compute first wait
m_high_speed = (speed >= 9600);
m_very_high_speed = (speed >= 50000);
}
return m_valid;
}
void TasmotaSerial::setReadChunkMode(bool mode) {
m_very_high_speed = mode;
}
bool TasmotaSerial::hardwareSerial(void) {
#ifdef ESP8266
return m_hardserial;
#endif // ESP8266
#ifdef ESP32
return (0 == m_uart); // We prefer UART1 and UART2 and keep UART0 for debugging
#endif // ESP32
}
bool TasmotaSerial::overflow(void) {
if (m_hardserial) {
#ifdef ESP8266
return Serial.hasOverrun(); // Returns then clear overrun flag
#endif // ESP8266
#ifdef ESP32
return false; // Not implemented
#endif // ESP32
} else {
bool res = m_overflow;
m_overflow = false;
return res;
}
}
void TasmotaSerial::flush(void) {
if (m_hardserial) {
#ifdef ESP8266
Serial.flush();
#endif // ESP8266
#ifdef ESP32
TSerial->flush(); // Flushes Tx only https://github.com/espressif/arduino-esp32/pull/4263
while (TSerial->available()) { TSerial->read(); }
#endif // ESP32
} else {
m_in_pos = 0;
m_out_pos = 0;
}
}
int TasmotaSerial::peek(void) {
if (m_hardserial) {
#ifdef ESP8266
return Serial.peek();
#endif // ESP8266
#ifdef ESP32
return TSerial->peek();
#endif // ESP32
} else {
if ((-1 == m_rx_pin) || (m_in_pos == m_out_pos)) return -1;
return m_buffer[m_out_pos];
}
}
int TasmotaSerial::read(void) {
if (m_hardserial) {
#ifdef ESP8266
return Serial.read();
#endif // ESP8266
#ifdef ESP32
return TSerial->read();
#endif // ESP32
} else {
if ((-1 == m_rx_pin) || (m_in_pos == m_out_pos)) {
return -1;
}
uint32_t ch = m_buffer[m_out_pos];
m_out_pos = (m_out_pos +1) % serial_buffer_size;
return ch;
}
}
size_t TasmotaSerial::read(char* buffer, size_t size) {
if (m_hardserial) {
#ifdef ESP8266
return Serial.read(buffer, size);
#endif // ESP8266
#ifdef ESP32
return TSerial->read(buffer, size);
#endif // ESP32
} else {
if ((-1 == m_rx_pin) || (m_in_pos == m_out_pos)) {
return 0;
}
size_t count = 0;
for( ; size && (m_in_pos != m_out_pos) ; --size, ++count) {
*buffer++ = m_buffer[m_out_pos];
m_out_pos = (m_out_pos +1) % serial_buffer_size;
}
return count;
}
}
int TasmotaSerial::available(void) {
if (m_hardserial) {
#ifdef ESP8266
return Serial.available();
#endif // ESP8266
#ifdef ESP32
return TSerial->available();
#endif // ESP32
} else {
int avail = m_in_pos - m_out_pos;
if (avail < 0) avail += serial_buffer_size;
// if (!avail) {
// optimistic_yield(10000);
// }
return avail;
}
}
#define TM_SERIAL_WAIT_SND { while (ESP.getCycleCount() < (wait + start)) if (!m_high_speed) optimistic_yield(1); wait += m_bit_time; } // Watchdog timeouts
#define TM_SERIAL_WAIT_SND_FAST { while (ESP.getCycleCount() < (wait + start)); wait += m_bit_time; }
#define TM_SERIAL_WAIT_RCV { while (ESP.getCycleCount() < (wait + start)); wait += m_bit_time; }
#define TM_SERIAL_WAIT_RCV_LOOP { while (ESP.getCycleCount() < (wait + start)); }
void IRAM_ATTR TasmotaSerial::_fast_write(uint8_t b) {
uint32_t wait = m_bit_time;
uint32_t start = ESP.getCycleCount();
// Start bit;
digitalWrite(m_tx_pin, LOW);
TM_SERIAL_WAIT_SND_FAST;
for (uint32_t i = 0; i < m_data_bits; i++) {
digitalWrite(m_tx_pin, (b & 1) ? HIGH : LOW);
TM_SERIAL_WAIT_SND_FAST;
b >>= 1;
}
// Stop bit(s)
digitalWrite(m_tx_pin, HIGH);
for (uint32_t i = 0; i < m_stop_bits; i++) {
TM_SERIAL_WAIT_SND_FAST;
}
}
size_t TasmotaSerial::write(uint8_t b) {
if (!m_hardserial && (-1 == m_tx_pin)) { return 0; }
if (m_tx_enable_pin > -1) {
digitalWrite(m_tx_enable_pin, HIGH);
}
size_t size = 0;
if (m_hardserial) {
#ifdef ESP8266
size = Serial.write(b);
#endif // ESP8266
#ifdef ESP32
size = TSerial->write(b);
#endif // ESP32
} else {
if (m_high_speed) {
cli(); // Disable interrupts in order to get a clean transmit
_fast_write(b);
sei();
} else {
uint32_t wait = m_bit_time;
//digitalWrite(m_tx_pin, HIGH); // already in HIGH mode
uint32_t start = ESP.getCycleCount();
// Start bit;
digitalWrite(m_tx_pin, LOW);
TM_SERIAL_WAIT_SND;
for (uint32_t i = 0; i < m_data_bits; i++) {
digitalWrite(m_tx_pin, (b & 1) ? HIGH : LOW);
TM_SERIAL_WAIT_SND;
b >>= 1;
}
// Stop bit(s)
digitalWrite(m_tx_pin, HIGH);
// re-enable interrupts during stop bits, it's not an issue if they are longer than expected
for (uint32_t i = 0; i < m_stop_bits; i++) {
TM_SERIAL_WAIT_SND;
}
}
size = 1;
}
if (m_tx_enable_pin > -1) {
flush(); // Must wait for all data sent
digitalWrite(m_tx_enable_pin, LOW);
}
return size;
}
#ifdef ESP32
// Add ability to change parity on the fly, for RS-485
// See https://github.com/arendst/Tasmota/discussions/22272
int32_t TasmotaSerial::setConfig(uint32_t config) {
uint32_t data_bits_before = (m_config & 0xc) >> 2;
uint32_t parity_before = m_config & 0x3;
uint32_t stop_bits_before = (m_config & 0x30) >> 4;
uint32_t data_bits = (config & 0xc) >> 2;
uint32_t parity = config & 0x3;
uint32_t stop_bits = (config & 0x30) >> 4;
esp_err_t err;
if (data_bits_before != data_bits) {
if (err = uart_set_word_length(m_uart, (uart_word_length_t) data_bits)) {
return (int32_t) err;
}
}
if (parity_before != parity) {
if (err = uart_set_parity(m_uart, (uart_parity_t) parity)) {
return (int32_t) err;
}
}
if (stop_bits_before != stop_bits) {
if (err = uart_set_stop_bits(m_uart, (uart_stop_bits_t) stop_bits)) {
return (int32_t) err;
}
}
m_config = config;
return 0; // no error
}
#endif
#ifdef ESP8266
void IRAM_ATTR TasmotaSerial::rxRead(void) {
if (!m_nwmode) {
uint32_t start = ESP.getCycleCount();
// Advance the starting point for the samples but compensate for the
// initial delay which occurs before the interrupt is delivered
uint32_t wait = m_bit_start_time;
// Decide to read as much data as buffer can hold or a single byte
// The first option may keep interrupt busy too long resulting in Hardware Watchdog
// The second option may receive ocasional invalid data
// User control by function setReadChunkMode()
int32_t loop_read = m_very_high_speed ? serial_buffer_size : 1;
uint32_t bit_mask = 0x01 << (m_data_bits -1);
while (loop_read-- > 0) { // try to receive all consecutive bytes in a row
uint32_t rec = 0;
for (uint32_t i = 0; i < m_data_bits; i++) {
TM_SERIAL_WAIT_RCV;
rec >>= 1;
if (digitalRead(m_rx_pin)) rec |= bit_mask;
}
// Store the received value in the buffer unless we have an overflow
uint32_t next = (m_in_pos + 1) % serial_buffer_size;
if (next != m_out_pos) {
m_buffer[m_in_pos] = rec;
m_in_pos = next;
} else {
// Buffer overrun - exit
m_overflow = true;
loop_read = 0;
}
TM_SERIAL_WAIT_RCV_LOOP; // wait for stop bit
if (2 == m_stop_bits) {
wait += m_bit_time;
TM_SERIAL_WAIT_RCV_LOOP;
}
wait += m_bit_time / 4;
if (loop_read <= 0) { break; } // exit now if not very high speed or buffer full
bool start_of_next_byte = false;
for (uint32_t i = 0; i < 12; i++) {
TM_SERIAL_WAIT_RCV_LOOP; // wait for 1/4 bits
wait += m_bit_time / 4;
if (!digitalRead(m_rx_pin)) {
// this is the start bit of the next byte
wait += m_bit_time; // we have advanced in the first 1/4 of bit, and already added 1/4 of bit so we're roughly centered. Just skip start bit.
start_of_next_byte = true;
m_bit_follow_metric++;
break; // exit loop
}
}
if (!start_of_next_byte) {
break; // exit now if no sign of next byte
}
}
// Must clear this bit in the interrupt register,
// it gets set even when interrupts are disabled
GPIO_REG_WRITE(GPIO_STATUS_W1TC_ADDRESS, 1 << m_rx_pin);
} else {
// Currently supports 8-bit data only
uint32_t diff;
uint32_t level;
#define LASTBIT 9
GPIO_REG_WRITE(GPIO_STATUS_W1TC_ADDRESS, 1 << m_rx_pin);
level = digitalRead(m_rx_pin);
if (!level && !ss_index) {
// start condition
ss_bstart = ESP.getCycleCount() - (m_bit_time / 4);
ss_byte = 0;
ss_index++;
//digitalWrite(1, LOW);
} else {
// now any bit changes go here
// calc bit number
diff = (ESP.getCycleCount() - ss_bstart) / m_bit_time;
//digitalWrite(1, level);
if (!level && diff > LASTBIT) {
// start bit of next byte, store and restart
// leave irq at change
for (uint32_t i = ss_index; i <= LASTBIT; i++) {
ss_byte |= (1 << i);
}
//stobyte(0,ssp->ss_byte>>1);
uint32_t next = (m_in_pos + 1) % serial_buffer_size;
if (next != m_out_pos) {
m_buffer[m_in_pos] = ss_byte >> 1;
m_in_pos = next;
}
ss_bstart = ESP.getCycleCount() - (m_bit_time / 4);
ss_byte = 0;
ss_index = 1;
return;
}
if (diff >= LASTBIT) {
// bit zero was 0,
//stobyte(0,ssp->ss_byte>>1);
uint32_t next = (m_in_pos + 1) % serial_buffer_size;
if (next != m_out_pos) {
m_buffer[m_in_pos] = ss_byte >> 1;
m_in_pos = next;
}
ss_byte = 0;
ss_index = 0;
} else {
// shift in
for (uint32_t i = ss_index; i < diff; i++) {
if (!level) ss_byte |= (1 << i);
}
ss_index = diff;
}
}
}
}
#endif // ESP8266

View File

@ -1,124 +0,0 @@
/*
TasmotaSerial.h - Implementation of software serial with hardware serial fallback for Tasmota
Copyright (C) 2021 Theo Arends
This library 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 TasmotaSerial_h
#define TasmotaSerial_h
/*********************************************************************************************\
* TasmotaSerial supports up to 115200 baud with default buffer size of 64 bytes using optional no iram
*
* Based on EspSoftwareSerial v3.4.3 by Peter Lerup (https://github.com/plerup/espsoftwareserial)
\*********************************************************************************************/
#define TM_SERIAL_BAUDRATE 9600 // Default baudrate
#define TM_SERIAL_BUFFER_SIZE 64 // Receive buffer size
#include <inttypes.h>
#include <Stream.h>
#ifdef ESP32
#include <HardwareSerial.h>
// IDF 5.2 has changed counting UART channels, SOC_UART_NUM includes now LP UARTS too for ESP32-C6 and -P4
#ifndef SOC_UART_HP_NUM
#define SOC_UART_HP_NUM SOC_UART_NUM // Set new define SOC_UART_HP_NUM in pre IDF 5.2 to SOC_UART_NUM
#endif
#endif
class TasmotaSerial : public Stream {
public:
TasmotaSerial(int receive_pin, int transmit_pin, int hardware_fallback = 0, int nwmode = 0, int buffer_size = TM_SERIAL_BUFFER_SIZE, bool invert = false);
virtual ~TasmotaSerial();
void setTransmitEnablePin(int tx_enable_pin);
void clearTransmitEnablePin(void) { m_tx_enable_pin = -1; }
size_t setRxBufferSize(size_t size);
size_t getRxBufferSize() { return serial_buffer_size; }
bool begin(uint32_t speed = TM_SERIAL_BAUDRATE, uint32_t config = SERIAL_8N1);
void end(void);
bool hardwareSerial(void);
int peek(void);
size_t write(uint8_t byte) override;
int read(void) override;
size_t read(char* buffer, size_t size);
size_t read(uint8_t* buffer, size_t size) {
return read(reinterpret_cast<char*>(buffer), size);
}
void setReadChunkMode(bool mode);
int available(void) override;
void flush(void) override;
void rxRead(void);
uint32_t getLoopReadMetric(void) const { return m_bit_follow_metric; }
#ifdef ESP32
uint32_t getUart(void) const { return m_uart; }
HardwareSerial *getesp32hws(void) { return TSerial; }
int32_t setConfig(uint32_t config);
#endif
bool isValid(void) { return m_valid; }
bool overflow(void);
using Print::write;
private:
bool isValidGPIOpin(int pin);
size_t txWrite(uint8_t byte);
void _fast_write(uint8_t b); // IRAM minimized version
#ifdef ESP32
bool freeUart(void);
void Esp32Begin(void);
#endif
// Member variables
int m_rx_pin;
int m_tx_pin;
int m_tx_enable_pin;
uint32_t m_data_bits;
uint32_t m_stop_bits;
uint32_t ss_byte;
uint32_t ss_bstart;
uint32_t ss_index;
uint32_t m_bit_time;
uint32_t m_bit_start_time;
uint32_t m_bit_follow_metric = 0;
uint32_t m_in_pos;
uint32_t m_out_pos;
uint32_t serial_buffer_size = TM_SERIAL_BUFFER_SIZE;
bool m_valid;
bool m_nwmode;
bool m_hardserial;
bool m_hardswap;
bool m_overflow;
bool m_high_speed = false;
bool m_very_high_speed = false; // above 100000 bauds
bool m_invert;
uint8_t *m_buffer = nullptr;
#ifdef ESP32
uint32_t m_speed;
uint32_t m_config;
HardwareSerial *TSerial;
uart_port_t m_uart = uart_port_t(0);
#endif
};
#endif // TasmotaSerial_h

View File

@ -1,7 +0,0 @@
name=UdpListener
version=1.0
author=Ivan Grokhotkov, Stephan Hadinger
maintainer=Stephan <stephan.hadinger@gmail.com>
sentence=UdpListener optimized for static and limite memory allocation, to reduce memory footprint of receiving SSDP request, as a replacement for WifiUdp.
paragraph=This class only handles receiving UDP Multicast packets. For sending packets, use WifiUdp.
architectures=esp8266,esp32

View File

@ -1,209 +0,0 @@
/*
UdpListener.h - webserver for Tasmota
Copyright (C) 2021 Theo Arends & 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/>.@
*/
// adapted from:
/*
UdpContext.h - UDP connection handling on top of lwIP
Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
This file is part of the esp8266 core for Arduino environment.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* This is a stripped down version of Udp handler to avoid overflowing
* memory when lots of multicast SSDP packets arrive.
* The pbuf is freed immediately upon arrival of the packet.
*
* Packet data are kept in a statically area in RAM and keeps
* only the <n> first bytes (200 by default) of each packet.
* The number of packets treated is limited (3 by default), any
* new packet arriving is dropped.
*
* This class does only receiving multicast packets for LWIP2
*/
#ifndef UDPMULTICASTLISTENER_H
#define UDPMULTICASTLISTENER_H
#ifdef ESP8266
// #include <Arduino.h>
extern "C" {
#include <lwip/udp.h>
#include <lwip/igmp.h>
}
template <size_t PACKET_SIZE>
struct UdpPacket {
IPAddress srcaddr;
IPAddress dstaddr;
int16_t srcport;
netif* input_netif;
size_t len;
uint8_t buf[PACKET_SIZE];
};
template <size_t PACKET_SIZE>
class UdpListener
{
public:
typedef std::function<void(void)> rxhandler_t;
UdpListener(size_t packet_number)
: _pcb(0)
, _packet_number(packet_number)
, _buffers(nullptr)
, _udp_packets(0)
, _udp_ready(false)
, _udp_index(0)
{
_packet_number = packet_number;
_buffers = new UdpPacket<PACKET_SIZE>[_packet_number];
_pcb = udp_new();
}
~UdpListener()
{
udp_remove(_pcb);
_pcb = 0;
delete[] _buffers;
_buffers = nullptr;
}
void reset(void)
{
_udp_packets = 0;
_udp_index = 0;
}
bool listen(const IPAddress& addr, uint16_t port)
{
if (!_buffers) { return false; }
udp_recv(_pcb, &_s_recv, (void *) this);
err_t err = udp_bind(_pcb, addr, port);
return err == ERR_OK;
}
void disconnect()
{
udp_disconnect(_pcb);
}
bool next()
{
if (!_buffers) { return false; }
if (_udp_packets > 0) {
if (!_udp_ready) {
// we just consume the first packet
_udp_ready = true;
} else {
_udp_packets--;
_udp_index = (_udp_index + 1) % _packet_number; // advance to next buffer index in ring
if (_udp_packets == 0) {
_udp_ready = false;
}
}
} else {
_udp_ready = false;
}
return _udp_ready;
}
UdpPacket<PACKET_SIZE> * read(void)
{
if (!_buffers) { return nullptr; }
if (_udp_ready) { // we have a packet ready to consume
return &_buffers[_udp_index];
} else {
return nullptr;
}
}
private:
void _recv(udp_pcb *upcb, pbuf *pb,
const ip_addr_t *srcaddr, u16_t srcport)
{
if (!_buffers) { pbuf_free(pb); return; }
// Serial.printf(">>> _recv: _udp_packets = %d, _udp_index = %d, tot_len = %d\n", _udp_packets, _udp_index, pb->tot_len);
if (_udp_packets >= _packet_number) {
// we don't have slots anymore, drop packet
pbuf_free(pb);
return;
}
uint8_t next_slot = (_udp_index + _udp_packets) % _packet_number;
size_t packet_len = pb->tot_len;
if (packet_len > PACKET_SIZE) { packet_len = PACKET_SIZE; }
uint8_t * dst = &_buffers[next_slot].buf[0];
void* buf = pbuf_get_contiguous(pb, dst, PACKET_SIZE, packet_len, 0);
if (buf) {
if (buf != dst)
memcpy(dst, buf, packet_len);
_buffers[next_slot].len = packet_len;
_buffers[next_slot].srcaddr = srcaddr;
_buffers[next_slot].dstaddr = ip_current_dest_addr();
_buffers[next_slot].srcport = srcport;
_buffers[next_slot].input_netif = ip_current_input_netif();
_udp_packets++; // we have one packet ready
}
pbuf_free(pb); // free memory immediately
}
static void _s_recv(void *arg,
udp_pcb *upcb, pbuf *p,
const ip_addr_t *srcaddr, u16_t srcport)
{
reinterpret_cast<UdpListener*>(arg)->_recv(upcb, p, srcaddr, srcport);
}
private:
udp_pcb* _pcb;
uint8_t _packet_number;
UdpPacket<PACKET_SIZE> * _buffers;
// how many packets are ready.
int8_t _udp_packets; // number of udp packets ready to consume
bool _udp_ready; // is a packet currenlty consumed after a call to next()
// ring buffer ranges from 0..(_packet_number-1)
int8_t _udp_index; // current index in the ring buffer
};
#endif // ESP8266
#endif //UDPMULTICASTLISTENER_H

View File

@ -1,165 +0,0 @@
/*
* Copyright (C) 2019 Siara Logics (cc)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @author Arundale R.
*
*/
// Pre-compute c_95[] and l_95[]
#include <time.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdint.h>
typedef unsigned char byte;
enum {SHX_SET1 = 0, SHX_SET1A, SHX_SET1B, SHX_SET2, SHX_SET3, SHX_SET4, SHX_SET4A};
char us_vcodes[] = {0, 2, 3, 4, 10, 11, 12, 13, 14, 30, 31};
char us_vcode_lens[] = {2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5};
char us_sets[][11] =
{{ 0, ' ', 'e', 0, 't', 'a', 'o', 'i', 'n', 's', 'r'},
{ 0, 'l', 'c', 'd', 'h', 'u', 'p', 'm', 'b', 'g', 'w'},
{'f', 'y', 'v', 'k', 'q', 'j', 'x', 'z', 0, 0, 0},
{ 0, '9', '0', '1', '2', '3', '4', '5', '6', '7', '8'},
{'.', ',', '-', '/', '?', '+', ' ', '(', ')', '$', '@'},
{';', '#', ':', '<', '^', '*', '"', '{', '}', '[', ']'},
{'=', '%', '\'', '>', '&', '_', '!', '\\', '|', '~', '`'}};
// {{ 0, ' ', 'e', 0, 't', 'a', 'o', 'i', 'n', 's', 'r'},
// { 0, 'l', 'c', 'd', 'h', 'u', 'p', 'm', 'b', 'g', 'w'},
// {'f', 'y', 'v', 'k', 'q', 'j', 'x', 'z', 0, 0, 0},
// { 0, '9', '0', '1', '2', '3', '4', '5', '6', '7', '8'},
// {'.', ',', '-', '/', '=', '+', ' ', '(', ')', '$', '%'},
// {'&', ';', ':', '<', '>', '*', '"', '{', '}', '[', ']'},
// {'@', '?', '\'', '^', '#', '_', '!', '\\', '|', '~', '`'}};
unsigned int c_95[95] ;
unsigned char l_95[95] ;
void init_coder() {
for (int i = 0; i < 7; i++) {
for (int j = 0; j < 11; j++) {
char c = us_sets[i][j];
if (c != 0 && c != 32) {
int ascii = c - 32;
//int prev_code = c_95[ascii];
//int prev_code_len = l_95[ascii];
switch (i) {
case SHX_SET1: // just us_vcode
c_95[ascii] = (us_vcodes[j] << (16 - us_vcode_lens[j]));
l_95[ascii] = us_vcode_lens[j];
//checkPreus_vcodes(c, prev_code, prev_code_len, c_95[ascii], l_95[ascii]);
if (c >= 'a' && c <= 'z') {
ascii -= ('a' - 'A');
//prev_code = c_95[ascii];
//prev_code_len = l_95[ascii];
c_95[ascii] = (2 << 12) + (us_vcodes[j] << (12 - us_vcode_lens[j]));
l_95[ascii] = 4 + us_vcode_lens[j];
}
break;
case SHX_SET1A: // 000 + us_vcode
c_95[ascii] = 0 + (us_vcodes[j] << (13 - us_vcode_lens[j]));
l_95[ascii] = 3 + us_vcode_lens[j];
//checkPreus_vcodes(c, prev_code, prev_code_len, c_95[ascii], l_95[ascii]);
if (c >= 'a' && c <= 'z') {
ascii -= ('a' - 'A');
//prev_code = c_95[ascii];
//prev_code_len = l_95[ascii];
c_95[ascii] = (2 << 12) + 0 + (us_vcodes[j] << (9 - us_vcode_lens[j]));
l_95[ascii] = 4 + 3 + us_vcode_lens[j];
}
break;
case SHX_SET1B: // 00110 + us_vcode
c_95[ascii] = (6 << 11) + (us_vcodes[j] << (11 - us_vcode_lens[j]));
l_95[ascii] = 5 + us_vcode_lens[j];
//checkPreus_vcodes(c, prev_code, prev_code_len, c_95[ascii], l_95[ascii]);
if (c >= 'a' && c <= 'z') {
ascii -= ('a' - 'A');
//prev_code = c_95[ascii];
//prev_code_len = l_95[ascii];
c_95[ascii] = (2 << 12) + (6 << 7) + (us_vcodes[j] << (7 - us_vcode_lens[j]));
l_95[ascii] = 4 + 5 + us_vcode_lens[j];
}
break;
case SHX_SET2: // 0011100 + us_vcode
c_95[ascii] = (28 << 9) + (us_vcodes[j] << (9 - us_vcode_lens[j]));
l_95[ascii] = 7 + us_vcode_lens[j];
break;
case SHX_SET3: // 0011101 + us_vcode
c_95[ascii] = (29 << 9) + (us_vcodes[j] << (9 - us_vcode_lens[j]));
l_95[ascii] = 7 + us_vcode_lens[j];
break;
case SHX_SET4: // 0011110 + us_vcode
c_95[ascii] = (30 << 9) + (us_vcodes[j] << (9 - us_vcode_lens[j]));
l_95[ascii] = 7 + us_vcode_lens[j];
break;
case SHX_SET4A: // 0011111 + us_vcode
c_95[ascii] = (31 << 9) + (us_vcodes[j] << (9 - us_vcode_lens[j]));
l_95[ascii] = 7 + us_vcode_lens[j];
}
//checkPreus_vcodes(c, prev_code, prev_code_len, c_95[ascii], l_95[ascii]);
}
}
}
c_95[0] = 16384;
l_95[0] = 3;
}
int main(int argv, char *args[]) {
init_coder();
printf("uint16_t c_95[95] PROGMEM = {");
for (uint8_t i = 0; i<95; i++) {
if (i) { printf(", "); }
printf("0x%04X", c_95[i]);
}
printf(" };\n");
printf("uint8_t l_95[95] PROGMEM = {");
for (uint8_t i = 0; i<95; i++) {
if (i) { printf(", "); }
printf("%6d", l_95[i]);
}
printf(" };\n");
printf("\n\n");
printf("uint16_t c_95[95] PROGMEM = {");
for (uint8_t i = 0; i<95; i++) {
if (i) { printf(", "); }
printf("%5d", c_95[i]);
}
printf(" };\n");
printf("uint8_t l_95[95] PROGMEM = {");
for (uint8_t i = 0; i<95; i++) {
if (i) { printf(", "); }
printf("%5d", l_95[i]);
}
printf(" };\n");
printf("uint16_t cl_95[95] PROGMEM = {");
for (uint8_t i = 0; i<95; i++) {
if (i) { printf(", "); }
printf("0x%04X + %2d", c_95[i], l_95[i]);
}
printf(" };\n");
}

Some files were not shown because too many files have changed in this diff Show More