Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge #405

Merged
merged 6 commits into from
Oct 28, 2023
Merged

Merge #405

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ data
unpacked_fs
unpacked_boards
tasmota/user_config_override.h
variants
variants3
build
build_output/*
firmware.map
Expand Down
2 changes: 1 addition & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ 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 | | | | Immediatly after I2C init
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
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file.
- I2C bus2 support to LM75AD temperature sensor
- Command ``GpioRead`` to show input state (#19810)
- ESP32 core v3 auto TasConsole USB or Serial connection by @staars
- Support for Winsen XH03x dust particle sensors using USE_PMS5003 and PMS_MODEL_ZH03X (#19850)

### Breaking Changed

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ To accept the CLA it is required to put a x between [ ] on `[ ] I accept the CLA

**Why a CLA ?**

_"A Contributor Licence 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 Licence 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 Contributor License Agreement (CLA) is strongly recommended when accepting third party contributions to an open development project, such as an open source software project. In order to redistribute contributions, it is necessary to ensure that the project has the necessary rights to do so. A Contributor License Agreement is a lightweight agreement, signed by the copyright holder, that grants the necessary rights for the contribution to be redistributed as part of the project."_ [OSS Watch](http://oss-watch.ac.uk/resources/cla)

A CLA is a legal document in which you state _you are entitled to contribute the code/documentation/translation to the project_ you’re contributing to and that _you are willing to have it used in distributions and derivative works_. This means that should there be any kind of legal issue in the future as to the origins and ownership of any particular piece of code, then that project has the necessary forms on file from the contributor(s) saying they were permitted to make this contribution.

Expand Down
2 changes: 1 addition & 1 deletion FIRMWARE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ See [CHANGELOG.md](/~https://github.com/arendst/Tasmota/blob/development/tasmota/C

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 successfuly, 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.
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.

Expand Down
1 change: 1 addition & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- I2C bus2 support to HYTxxx temperature and humidity sensor
- I2C bus2 support to SI1145/6/7 Ultra violet index and light sensor
- I2C bus2 support to LM75AD temperature sensor
- Support for Winsen XH03x dust particle sensors using USE_PMS5003 and PMS_MODEL_ZH03X [#19850](/~https://github.com/arendst/Tasmota/issues/19850)
- Experimental support for ESP32-C2 and ESP32-C6 using Arduino core v3
- ESP32 core v3 auto TasConsole USB or Serial connection by @staars

Expand Down
2 changes: 1 addition & 1 deletion boards/esp32-fix.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32-safeboot.bin"
"tasmota32-safeboot.bin"
]
]
},
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32-safeboot.bin"
"tasmota32-safeboot.bin"
]
]
},
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32_solo1.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32solo1-safeboot.bin"
"tasmota32solo1-safeboot.bin"
]
]
},
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32c2.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32c2-safeboot.bin"
"tasmota32c2-safeboot.bin"
]
]
},
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32c2_2M.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32c2-safeboot.bin"
"tasmota32c2-safeboot.bin"
]
]
},
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32c3.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32c3-safeboot.bin"
"tasmota32c3-safeboot.bin"
]
]
},
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32c3cdc.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32c3cdc-safeboot.bin"
"tasmota32c3cdc-safeboot.bin"
]
]
},
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32c6.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32c6-safeboot.bin"
"tasmota32c6-safeboot.bin"
]
]
},
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32c6cdc.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32c6cdc-safeboot.bin"
"tasmota32c6cdc-safeboot.bin"
]
]
},
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32s2.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32s2-safeboot.bin"
"tasmota32s2-safeboot.bin"
]
]
},
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32s2cdc.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32s2cdc-safeboot.bin"
"tasmota32s2cdc-safeboot.bin"
]
]
},
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32s3-qio_opi.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32s3-safeboot.bin"
"tasmota32s3-safeboot.bin"
]
]
},
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32s3-qio_qspi.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32s3-safeboot.bin"
"tasmota32s3-safeboot.bin"
]
]
},
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32s3cdc-qio_opi.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32s3cdc-safeboot.bin"
"tasmota32s3cdc-safeboot.bin"
]
]
},
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32s3cdc-qio_qspi.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"flash_extra_images": [
[
"0x10000",
"variants/tasmota/tasmota32s3cdc-safeboot.bin"
"tasmota32s3cdc-safeboot.bin"
]
]
},
Expand Down
2 changes: 1 addition & 1 deletion info/xdrv_57_tasmesh.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Automatic payload encryption is applied using the WiFi-password1 as the key. A m
As ACK/NACK messages seem to be not reliable on both ESP-platforms, the method "send-and-pray" is used.


## Working priciple
## 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.
Expand Down
6 changes: 6 additions & 0 deletions lib/libesp32/berry/src/be_lexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ static void skip_comment(blexer *lexer)
{
next(lexer); /* skip '#' */
if (lgetc(lexer) == '-') { /* mult-line comment */
int lno = lexer->linenumber;
int mark, c = 'x'; /* skip first '-' (#- ... -#) */
do {
mark = c == '-';
Expand All @@ -269,6 +270,11 @@ static void skip_comment(blexer *lexer)
}
c = next(lexer);
} while (!(mark && c == '#') && c != EOS);
if (c == EOS) {
char tmp[64];
sprintf(tmp, "unterminated comment block started in line %d", lno);
be_lexerror(lexer, tmp);
}
next(lexer); /* skip '#' */
} else { /* line comment */
while (!is_newline(lgetc(lexer)) && lgetc(lexer)) {
Expand Down
2 changes: 1 addition & 1 deletion pio-tools/espupload.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

Provides:
Uploads binary file to OTA server.
Usually initated from http-uploader.py
Usually initiated from http-uploader.py

Requirements:
- Python
Expand Down
2 changes: 1 addition & 1 deletion pio-tools/name-firmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def bin_map_copy(source, target, env):
# copy firmware.bin and map to final destination
shutil.copy(firsttarget, bin_file)
if env["PIOPLATFORM"] == "espressif32":
# the map file is needed later for fimrmware-metrics.py
# the map file is needed later for firmware-metrics.py
shutil.copy(tasmotapiolib.get_source_map_path(env), map_file)
if("safeboot" not in firmware_name):
shutil.copy(factory, one_bin_file)
Expand Down
30 changes: 25 additions & 5 deletions pio-tools/post_esp32.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# - 0x1000 | ~\.platformio\packages\framework-arduinoespressif32\tools\sdk\esp32\bin\bootloader_dout_40m.bin
# - 0x8000 | ~\Tasmota\.pio\build\<env name>\partitions.bin
# - 0xe000 | ~\.platformio\packages\framework-arduinoespressif32\tools\partitions\boot_app0.bin
# - 0x10000 | ~\.platformio/packages/framework-arduinoespressif32/variants/tasmota/\<env name>-safeboot.bin
# - 0x10000 | ~\Tasmota\<variants_dir>/<env name>-safeboot.bin
# - 0xe0000 | ~\Tasmota\.pio\build\<env name>/firmware.bin
# - 0x3b0000| ~\Tasmota\.pio\build\<env name>/littlefs.bin

Expand All @@ -37,6 +37,13 @@
sys.path.append(join(platform.get_package_dir("tool-esptoolpy")))
import esptool

variants_dir = env.BoardConfig().get("build.variants_dir", "")
variant = env.BoardConfig().get("build.variant", "")
sections = env.subst(env.get("FLASH_EXTRA_IMAGES"))
chip = env.get("BOARD_MCU")
mcu_build_variant = env.BoardConfig().get("build.variant", "").lower()

# Copy safeboots firmwares in place when running in Github
github_actions = os.getenv('GITHUB_ACTIONS')
extra_flags = ''.join([element.replace("-D", " ") for element in env.BoardConfig().get("build.extra_flags", "")])
build_flags = ''.join([element.replace("-D", " ") for element in env.GetProjectOption("build_flags")])
Expand All @@ -45,16 +52,31 @@
FRAMEWORK_DIR = platform.get_package_dir("framework-arduino-solo1")
if github_actions and os.path.exists("./firmware/firmware"):
shutil.copytree("./firmware/firmware", "/home/runner/.platformio/packages/framework-arduino-solo1/variants/tasmota")
if variants_dir:
shutil.copytree("./firmware/firmware", variants_dir, dirs_exist_ok=True)
elif "CORE32ITEAD" in extra_flags or "FRAMEWORK_ARDUINO_ITEAD" in build_flags:
FRAMEWORK_DIR = platform.get_package_dir("framework-arduino-ITEAD")
if github_actions and os.path.exists("./firmware/firmware"):
shutil.copytree("./firmware/firmware", "/home/runner/.platformio/packages/framework-arduino-ITEAD/variants/tasmota")
if variants_dir:
shutil.copytree("./firmware/firmware", variants_dir, dirs_exist_ok=True)
else:
FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32")
if github_actions and os.path.exists("./firmware/firmware"):
shutil.copytree("./firmware/firmware", "/home/runner/.platformio/packages/framework-arduinoespressif32/variants/tasmota")
if variants_dir:
shutil.copytree("./firmware/firmware", variants_dir, dirs_exist_ok=True)

# Copy pins_arduino.h to variants folder
if variants_dir:
mcu_build_variant_path = join(FRAMEWORK_DIR, "variants", mcu_build_variant, "pins_arduino.h")
custom_variant_build = join(env.subst("$PROJECT_DIR"), variants_dir , mcu_build_variant, "pins_arduino.h")
os.makedirs(join(env.subst("$PROJECT_DIR"), variants_dir , mcu_build_variant), exist_ok=True)
shutil.copy(mcu_build_variant_path, custom_variant_build)

variants_dir = join(FRAMEWORK_DIR, "variants", "tasmota")
if not variants_dir:
variants_dir = join(FRAMEWORK_DIR, "variants", "tasmota")
env.BoardConfig().update("build.variants_dir", variants_dir)

def esp32_detect_flashsize():
uploader = env.subst("$UPLOADER")
Expand Down Expand Up @@ -195,9 +217,7 @@ def esp32_create_combined_bin(source, target, env):


new_file_name = env.subst("$BUILD_DIR/${PROGNAME}.factory.bin")
sections = env.subst(env.get("FLASH_EXTRA_IMAGES"))
firmware_name = env.subst("$BUILD_DIR/${PROGNAME}.bin")
chip = env.get("BOARD_MCU")
tasmota_platform = esp32_create_chip_string(chip)

if "-DUSE_USB_CDC_CONSOLE" in env.BoardConfig().get("build.extra_flags") and "cdc" not in tasmota_platform:
Expand Down Expand Up @@ -274,8 +294,8 @@ def esp32_create_combined_bin(source, target, env):
)
print("Will use custom upload command for flashing operation to add file system defined for this build target.")

#print('Using esptool.py arguments: %s' % ' '.join(cmd))
if("safeboot" not in firmware_name):
#print('Using esptool.py arguments: %s' % ' '.join(cmd))
esptool.main(cmd)


Expand Down
1 change: 1 addition & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ platform_packages = ${core.platform_packages}
framework = arduino
board = esp8266_1M
board_build.filesystem = littlefs
board_build.variants_dir = variants/tasmota
custom_unpack_dir = unpacked_littlefs
build_unflags = ${core.build_unflags}
build_flags = ${core.build_flags}
Expand Down
2 changes: 1 addition & 1 deletion platformio_tasmota32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ lib_ignore = ${esp32_defaults.lib_ignore}
ccronexpr

[core32]
platform = /~https://github.com/tasmota/platform-espressif32/releases/download/2023.10.05/platform-espressif32.zip
platform = /~https://github.com/tasmota/platform-espressif32/releases/download/2023.10.06/platform-espressif32.zip
platform_packages =
build_unflags = ${esp32_defaults.build_unflags}
build_flags = ${esp32_defaults.build_flags}
3 changes: 2 additions & 1 deletion platformio_tasmota_core3_env_sample.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
; tasmota32c6cdc-safeboot

[core32_30]
platform = /~https://github.com/tasmota/platform-espressif32/releases/download/2023.10.11/platform-espressif32.zip
platform = /~https://github.com/tasmota/platform-espressif32/releases/download/2023.10.12/platform-espressif32.zip
platform_packages =

build_unflags = ${core32.build_unflags}
Expand Down Expand Up @@ -50,6 +50,7 @@ framework = ${common.framework}
platform = ${core32_30.platform}
platform_packages = ${core32_30.platform_packages}
board_build.filesystem = ${common.board_build.filesystem}
board_build.variants_dir = variants/tasmota_ard3
custom_unpack_dir = ${common.custom_unpack_dir}
board = esp32
monitor_speed = 115200
Expand Down
1 change: 1 addition & 0 deletions platformio_tasmota_env32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ platform = ${core32.platform}
platform_packages = ${core32.platform_packages}
board_build.filesystem = ${common.board_build.filesystem}
custom_unpack_dir = ${common.custom_unpack_dir}
board_build.variants_dir = ${common.board_build.variants_dir}
board = esp32
monitor_speed = ${common.monitor_speed}
monitor_echo = ${common.monitor_echo}
Expand Down
2 changes: 1 addition & 1 deletion tasmota/tasmota.ino
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ bool tasconsole_serial = false;

#if ARDUINO_USB_MODE
//#warning **** TasConsole ARDUINO_USB_MODE ****
TASCONSOLE TasConsole{HWCDCSerial}; // ESP32C3/C6/S3 embedded USB using JTAG interface
TASCONSOLE TasConsole{HWCDCSerial}; // ESP32C3/C6/S3 embedded USB using JTAG interface
//#warning **** TasConsole uses HWCDC ****
#else // No ARDUINO_USB_MODE
#include "USB.h"
Expand Down
Loading