mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 20:56:35 +00:00
Fix Shelly Pro ethernet stability
This commit is contained in:
parent
cef18060a0
commit
90a9ebc3e1
@ -559,6 +559,7 @@ void setup(void) {
|
|||||||
bitWrite(Settings->rule_enabled, i, 0); // Disable rules causing boot loop
|
bitWrite(Settings->rule_enabled, i, 0); // Disable rules causing boot loop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Settings->flag4.network_wifi = 1; // Enable wifi if disabled
|
||||||
}
|
}
|
||||||
if (RtcReboot.fast_reboot_count > Settings->param[P_BOOT_LOOP_OFFSET] +2) { // Restarted 4 times
|
if (RtcReboot.fast_reboot_count > Settings->param[P_BOOT_LOOP_OFFSET] +2) { // Restarted 4 times
|
||||||
Settings->rule_enabled = 0; // Disable all rules
|
Settings->rule_enabled = 0; // Disable all rules
|
||||||
|
@ -85,6 +85,18 @@ void ShellyProPreInit(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ShellyProInit(void) {
|
||||||
|
int pin_lan_reset = 5; // GPIO5 = LAN8720 nRST
|
||||||
|
// delay(30); // (t-purstd) This pin must be brought low for a minimum of 25 mS after power on
|
||||||
|
digitalWrite(pin_lan_reset, 0);
|
||||||
|
pinMode(pin_lan_reset, OUTPUT);
|
||||||
|
delay(1); // (t-rstia) This pin must be brought low for a minimum of 100 uS
|
||||||
|
digitalWrite(pin_lan_reset, 1);
|
||||||
|
|
||||||
|
AddLog(LOG_LEVEL_INFO, PSTR("HDW: Shelly Pro %d%s initialized"),
|
||||||
|
TasmotaGlobal.devices_present, (PinUsed(GPIO_ADE7953_CS))?"PM":"");
|
||||||
|
}
|
||||||
|
|
||||||
void ShellyProPower(void) {
|
void ShellyProPower(void) {
|
||||||
SPro.power = XdrvMailbox.index &3;
|
SPro.power = XdrvMailbox.index &3;
|
||||||
ShellyProUpdate();
|
ShellyProUpdate();
|
||||||
@ -147,6 +159,9 @@ bool Xdrv88(uint8_t function) {
|
|||||||
case FUNC_LED_LINK:
|
case FUNC_LED_LINK:
|
||||||
ShellyProLedLink();
|
ShellyProLedLink();
|
||||||
break;
|
break;
|
||||||
|
case FUNC_INIT:
|
||||||
|
ShellyProInit();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -370,8 +370,8 @@ void Ade7953Init(void) {
|
|||||||
Ade7953Write(0x0FE, 0x00AD); // Unlock register 0x120
|
Ade7953Write(0x0FE, 0x00AD); // Unlock register 0x120
|
||||||
Ade7953Write(0x120, 0x0030); // Configure optimum setting
|
Ade7953Write(0x120, 0x0030); // Configure optimum setting
|
||||||
#ifdef USE_ESP32_SPI
|
#ifdef USE_ESP32_SPI
|
||||||
int32_t value = Ade7953Read(0x702); // Silicon version
|
// int32_t value = Ade7953Read(0x702); // Silicon version
|
||||||
AddLog(LOG_LEVEL_DEBUG, PSTR("ADE: Chip%d version %d"), chip +1, value);
|
// AddLog(LOG_LEVEL_DEBUG, PSTR("ADE: Chip%d version %d"), chip +1, value);
|
||||||
#endif // USE_ESP32_SPI
|
#endif // USE_ESP32_SPI
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user