Skip to content

Commit

Permalink
Merge branch 'arendst:development' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz914 authored Oct 13, 2024
2 parents d70092e + 0c7e8c6 commit b934a8c
Show file tree
Hide file tree
Showing 17 changed files with 182 additions and 127 deletions.
14 changes: 10 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ All notable changes to this project will be documented in this file.
- Support for Sonoff SPM v1.3.0 (#13447)
- LVGL port `colorwheel` from LVGL 8 (#22244)
- HASPmota `cpicker` and `msgbox` (#22244)
- Support for DALI 1 on ESP8266
- Command ``DaliWeb 1`` to enable light control for broadcast address
- Support for DALI on ESP8266
- Command ``DaliWeb 1`` to enable light control for DALI broadcast address

### Breaking Changed

Expand All @@ -23,11 +23,13 @@ All notable changes to this project will be documented in this file.
- ESP32 Range Extender compile error with core 3.0.0 (#22205)
- HASPmota error when page '1' is not defined (#22220)
- ESP32-S3 uDisplay force cache writes to RGB display (#22222)
- ESP32 Dali compile error with core 3.x (#22214)
- Dali received data decoding
- ESP32 DALI compile error with core 3.x (#22214)
- DALI received data decoding
- ESP32 Ethernet using EthClockMode 3 (#22248)
- ESP32 disable SPI DMA for uDisplay (broken since esp-idf 5.3 (core 3.1.0)) (#22264)

### Removed
- Berry Zigbee removed test code (#22263)

## [14.2.0.5] 20240926
### Added
Expand All @@ -52,6 +54,10 @@ All notable changes to this project will be documented in this file.
- ESP8266 experimental support for second I2C bus
- Berry improve `int64` constructor (#22172)
- MQTT warning if trying to connect without TLS on a port that normally uses TLS (#22175)
- Misubishi Electric HVAC Heat/Dry/Cool ISEE operation mode (#22216)
- Misubishi Electric HVAC Bridge to HomeBridge/Homekit locally (#22236)
- Misubishi Electric HVAC Air Direction Control (#22241)
- Misubishi Electric HVAC prohibit function (#22269)

### Changed
- Refactored I2C drivers HTU21, BH1750, SHT3x, iAQ and HYT
Expand Down
14 changes: 10 additions & 4 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
## Changelog v14.2.0.6
### 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 broadcast address
- Command ``DaliWeb 1`` to enable light control for DALI broadcast address
- 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 1 on ESP8266
- 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)
Expand All @@ -134,6 +134,10 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- 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 ISEE 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)
- 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)
Expand Down Expand Up @@ -161,7 +165,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- HASPmota `delete` instead of `delete()` [#22245](https://github.com/arendst/Tasmota/issues/22245)

### Fixed
- Dali received data decoding
- 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)
Expand All @@ -177,8 +181,9 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- 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 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)
Expand All @@ -196,3 +201,4 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
### 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)
12 changes: 9 additions & 3 deletions lib/lib_display/UDisplay/uDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ uDisplay::uDisplay(char *lp) : Renderer(800, 600) {
if (wire_n == 1) {
wire = &Wire;
} else {
#ifdef ESP32
#if SOC_HP_I2C_NUM > 1
wire = &Wire1;
#else
wire = &Wire;
Expand Down Expand Up @@ -599,6 +599,12 @@ uDisplay::uDisplay(char *lp) : Renderer(800, 600) {
case 'B':
lvgl_param.flushlines = next_val(&lp1);
lvgl_param.data = next_val(&lp1);
// temporary fix to disable DMA due to a problem in esp-idf 5.3
#ifdef ESP32
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
lvgl_param.use_dma = false;
#endif
#endif
break;
case 'M':
rotmap_xmin = next_val(&lp1);
Expand Down Expand Up @@ -630,7 +636,7 @@ uDisplay::uDisplay(char *lp) : Renderer(800, 600) {
if (ut_mode == 1) {
ut_wire = &Wire;
} else {
#ifdef ESP32
#if SOC_HP_I2C_NUM > 1
ut_wire = &Wire1;
#else
ut_wire = &Wire;
Expand Down Expand Up @@ -1070,7 +1076,7 @@ Renderer *uDisplay::Init(void) {
if (wire_n == 0) {
wire = &Wire;
}
#ifdef ESP32
#if SOC_HP_I2C_NUM > 1
if (wire_n == 1) {
wire = &Wire1;
}
Expand Down
10 changes: 5 additions & 5 deletions lib/lib_i2c/BM8563_RTC/src/BM8563.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ typedef struct
class BM8563 {
public:
BM8563();
#ifdef ESP32
void setBus(uint32_t _bus) { myWire = _bus ? &Wire1 : &Wire; };
#else
void setBus(uint32_t _bus) { myWire = &Wire; };
#endif
#if SOC_HP_I2C_NUM > 1
void setBus(uint32_t _bus) { myWire = _bus ? &Wire1 : &Wire; };
#else
void setBus(uint32_t _bus) { myWire = &Wire; };
#endif

void begin(void);
void GetBm8563Time(void);
Expand Down
6 changes: 3 additions & 3 deletions lib/lib_i2c/MPU_accel/src/MPU_accel.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ class MPU_accel {
uint32_t model = 6886; // MPU model number
public:
MPU_accel(void) {};
#ifdef ESP32
#if SOC_HP_I2C_NUM > 1
void setBus(uint32_t _bus) { myWire = _bus ? &Wire1 : &Wire; };
#else
#else
void setBus(uint32_t _bus) { myWire = &Wire; };
#endif
#endif
int Init(void);
uint32_t getModel(void) const { return model; }
void getAccelAdc(int16_t* ax, int16_t* ay, int16_t* az);
Expand Down
4 changes: 2 additions & 2 deletions lib/libesp32/berry_tasmota/src/be_zigbee.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ class be_class_zb_coord_ntv (scope: global, name: zb_coord_ntv, strings: weak) {
abort, ctype_func(zc_abort)
test_attr, func(zigbee_test_attr)
test_msg, func(zigbee_test_msg)
// test_attr, func(zigbee_test_attr)
// test_msg, func(zigbee_test_msg)
}
@const_object_info_end */

Expand Down
7 changes: 7 additions & 0 deletions tasmota/include/tasmota_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ const char WIFI_HOSTNAME[] = WIFI_DEFAULT_HOSTNAME; // Override by user_confi
#define ARDUINO_CORE_RELEASE ARDUINO_ESP32_RELEASE
#endif // ARDUINO_ESP32_RELEASE

#ifdef USE_I2C_BUS2 // If defined for ESP8266 undefine first
#undef USE_I2C_BUS2
#endif // USE_I2C_BUS2
#if SOC_HP_I2C_NUM > 1
#define USE_I2C_BUS2 // Redefine based on hardware support
#endif // SOC_HP_I2C_NUM

// Hardware has no ESP32
#undef USE_EXS_DIMMER
#undef USE_ARMTRONIX_DIMMERS
Expand Down
2 changes: 1 addition & 1 deletion tasmota/include/tasmota_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ enum UserSelectablePins {
GPIO_ADE7953_RST, // ADE7953 Reset
GPIO_NRG_MBS_TX, GPIO_NRG_MBS_RX, // Generic Energy Modbus device
GPIO_ADE7953_CS, // ADE7953 SPI Chip Select
GPIO_DALI_RX, GPIO_DALI_TX, // Dali
GPIO_DALI_RX, GPIO_DALI_TX, // DALI
GPIO_BP1658CJ_CLK, GPIO_BP1658CJ_DAT,// BP1658CJ
GPIO_DINGTIAN_CLK, GPIO_DINGTIAN_SDI, GPIO_DINGTIAN_Q7, GPIO_DINGTIAN_PL, GPIO_DINGTIAN_RCK, // Dingtian relay board - 595's & 165's pins
GPIO_LD2410_TX, GPIO_LD2410_RX, // HLK-LD2410
Expand Down
2 changes: 1 addition & 1 deletion tasmota/include/tasmota_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ typedef union {
uint32_t influxdb_sensor : 1; // bit 10 (v11.0.0.5) - CMND_IFXSENSOR - Enable sensor support in addition to teleperiod support
uint32_t ex_serbridge_console : 1; // bit 11 (v11.1.0.4) - (v14.1.0.2) Replaced by CMND_SSERIALMODE
uint32_t telegram_disable_af : 1; // bit 12 (v14.0.0.2) - CMND_TMSTATE 6/7 - Disable Telegram auto-fingerprint fix
uint32_t dali_web : 1; // bit 13 (v14.2.0.6) - CMND_DALIWEB - Enable Dali web controls
uint32_t dali_web : 1; // bit 13 (v14.2.0.6) - CMND_DALIWEB - Enable DALI web controls
uint32_t spare14 : 1; // bit 14
uint32_t spare15 : 1; // bit 15
uint32_t spare16 : 1; // bit 16
Expand Down
11 changes: 5 additions & 6 deletions tasmota/tasmota_support/support_a_i2c.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
#endif // USE_I2C_BUS2_ESP8266
#endif // ESP8266

#ifdef ESP32
#if CONFIG_SOC_HP_I2C_NUM > 1
#define USE_I2C_BUS2
#endif // CONFIG_SOC_HP_I2C_NUM
#endif // ESP32

const uint8_t I2C_RETRY_COUNTER = 3;

struct I2Ct {
Expand Down Expand Up @@ -69,7 +63,12 @@ bool I2cBegin(int sda, int scl, uint32_t bus, uint32_t frequency) {
#endif // USE_I2C_BUS2_ESP8266
#endif // ESP8266
#ifdef ESP32
#ifdef USE_I2C_BUS2
TwoWire& myWire = (0 == bus) ? Wire : Wire1;
#else
if (bus > 0) { return false; }
TwoWire& myWire = Wire;
#endif
static bool reinit = false;
if (reinit) { myWire.end(); }
result = myWire.begin(sda, scl, frequency);
Expand Down
6 changes: 3 additions & 3 deletions tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino
Original file line number Diff line number Diff line change
Expand Up @@ -13160,7 +13160,7 @@ uint32_t script_i2c(uint8_t sel, uint16_t val, uint32_t val1) {
switch (sel) {
case 0:
glob_script_mem.script_i2c_addr = val;
#ifdef ESP32
#if defined(ESP32) && defined(USE_I2C_BUS2)
if (val1 == 0) glob_script_mem.script_i2c_wire = &Wire;
else glob_script_mem.script_i2c_wire = &Wire1;
#else
Expand Down Expand Up @@ -13209,15 +13209,15 @@ uint32_t script_i2c(uint8_t sel, uint16_t val, uint32_t val1) {
glob_script_mem.script_i2c_wire->endTransmission();
break;
case 14:
#ifdef ESP32
#if defined(ESP32) && defined(USE_I2C_BUS2)
Wire1.end();
Wire1.begin(val & 0x7f, val1);
glob_script_mem.script_i2c_wire = &Wire1;
TasmotaGlobal.i2c_enabled_2 = true;
if (val & 128) {
XsnsCall(FUNC_INIT);
}
#endif
#endif
break;
}
return rval;
Expand Down
44 changes: 22 additions & 22 deletions tasmota/tasmota_xdrv_driver/xdrv_13_display.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2442,6 +2442,28 @@ void Draw_RGB_Bitmap(char *file, uint16_t xp, uint16_t yp, uint8_t scale, bool i
#ifdef ESP32
#ifdef JPEG_PICTS
#define JPG_DEFSIZE 150000
void Draw_jpeg(uint8_t *mem, uint16_t jpgsize, uint16_t xp, uint16_t yp, uint8_t scale) {
if (mem[0] == 0xff && mem[1] == 0xd8) {
uint16_t xsize;
uint16_t ysize;
get_jpeg_size(mem, jpgsize, &xsize, &ysize);
//AddLog(LOG_LEVEL_INFO, PSTR("Pict size %d - %d - %d"), xsize, ysize, jpgsize);
scale &= 3;
uint8_t fac = 1 << scale;
xsize /= fac;
ysize /= fac;
renderer->setAddrWindow(xp, yp, xp + xsize, yp + ysize);
uint8_t *rgbmem = (uint8_t *)special_malloc(xsize * ysize * 2);
if (rgbmem) {
//jpg2rgb565(mem, jpgsize, rgbmem, JPG_SCALE_NONE);
jpg2rgb565(mem, jpgsize, rgbmem, (jpg_scale_t)scale);
renderer->pushColors((uint16_t*)rgbmem, xsize * ysize, true);
free(rgbmem);
}
renderer->setAddrWindow(0, 0, 0, 0);
}
}

void Draw_JPG_from_URL(char *url, uint16_t xp, uint16_t yp, uint8_t scale) {
uint8_t *mem = 0;
WiFiClient http_client;
Expand Down Expand Up @@ -2484,28 +2506,6 @@ void Draw_JPG_from_URL(char *url, uint16_t xp, uint16_t yp, uint8_t scale) {
}
if (mem) free(mem);
}

void Draw_jpeg(uint8_t *mem, uint16_t jpgsize, uint16_t xp, uint16_t yp, uint8_t scale) {
if (mem[0] == 0xff && mem[1] == 0xd8) {
uint16_t xsize;
uint16_t ysize;
get_jpeg_size(mem, jpgsize, &xsize, &ysize);
//AddLog(LOG_LEVEL_INFO, PSTR("Pict size %d - %d - %d"), xsize, ysize, jpgsize);
scale &= 3;
uint8_t fac = 1 << scale;
xsize /= fac;
ysize /= fac;
renderer->setAddrWindow(xp, yp, xp + xsize, yp + ysize);
uint8_t *rgbmem = (uint8_t *)special_malloc(xsize * ysize * 2);
if (rgbmem) {
//jpg2rgb565(mem, jpgsize, rgbmem, JPG_SCALE_NONE);
jpg2rgb565(mem, jpgsize, rgbmem, (jpg_scale_t)scale);
renderer->pushColors((uint16_t*)rgbmem, xsize * ysize, true);
free(rgbmem);
}
renderer->setAddrWindow(0, 0, 0, 0);
}
}
#endif // JPEG_PICTS
#endif // ESP32

Expand Down
2 changes: 2 additions & 0 deletions tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_wire.ino
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ TwoWire & getWire(bvm *vm) {
be_pop(vm, 1);
if (1 == bus && TasmotaGlobal.i2c_enabled) {
return Wire;
#ifdef USE_I2C_BUS2
} else if (2 == bus && TasmotaGlobal.i2c_enabled_2) {
return Wire1;
#endif // USE_I2C_BUS2
} else {
be_raise(vm, "configuration_error", "I2C bus not initiliazedd");
return *(TwoWire*)nullptr;
Expand Down
Loading

0 comments on commit b934a8c

Please sign in to comment.