From cc7ad4afcaeff7f191d9056c6a7ce8bc07e0a637 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 4 Jan 2022 17:41:47 +0100 Subject: [PATCH] Add experimental ADE7953 (Shelly EM) reset on restart (#14261) --- CHANGELOG.md | 3 +++ RELEASENOTES.md | 1 + tasmota/xnrg_07_ade7953.ino | 11 ++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73cdab574..25ff22862 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - Development ## [2022.01.1] +### Added +- Experimental ADE7953 (Shelly EM) reset on restart (#14261) + ### Changed - PubSubClient library from v2.8.12 to v2.8.13 - From Semantic Versioning (SemVer) to Calendar Versioning (CalVer) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 6767ab925..2563a54b2 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -106,6 +106,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo - PWM Dimmer two button support [#13993](https://github.com/arendst/Tasmota/issues/13993) - Device Group Send full status item [#14045](https://github.com/arendst/Tasmota/issues/14045) - Support for MAX7219 Dot Matrix displays [#14091](https://github.com/arendst/Tasmota/issues/14091) +- Experimental ADE7953 (Shelly EM) reset on restart [#14261](https://github.com/arendst/Tasmota/issues/14261) - ESP32 support for TuyaMcu - ESP32 Berry features diff --git a/tasmota/xnrg_07_ade7953.ino b/tasmota/xnrg_07_ade7953.ino index a09e4f257..6205612be 100644 --- a/tasmota/xnrg_07_ade7953.ino +++ b/tasmota/xnrg_07_ade7953.ino @@ -236,7 +236,16 @@ void Ade7953DrvInit(void) if (PinUsed(GPIO_ADE7953_IRQ, GPIO_ANY)) { // Irq on GPIO16 is not supported... uint32_t pin_irq = Pin(GPIO_ADE7953_IRQ, GPIO_ANY); pinMode(pin_irq, INPUT); // Related to resetPins() - Must be set to input - Ade7953.model = GetPin(pin_irq) - AGPIO(GPIO_ADE7953_IRQ); // 0 .. 1 ; + Ade7953.model = GetPin(pin_irq) - AGPIO(GPIO_ADE7953_IRQ); // 0 (Shelly 2.5), 1 (Shelly EM) + + if (1 == Ade7953.model) { // Shelly EM + pinMode(16, OUTPUT); // Reset pin ADE7953 + digitalWrite(16, 0); + delay(1); + digitalWrite(16, 1); + pinMode(16, INPUT); + } + delay(100); // Need 100mS to init ADE7953 if (I2cSetDevice(ADE7953_ADDR)) { if (HLW_PREF_PULSE == Settings->energy_power_calibration) {