external switch does not work after reboot

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
martin.g
Normal user
Posts: 5
Joined: 14 Sep 2020, 19:00

external switch does not work after reboot

#1 Post by martin.g » 14 Sep 2020, 19:23

Hi,

I've a strange behaviour. I've flashed a shelly1 v3 with espeasy (20200829 and also tested 20190827). The shelly is used as garage door opener.
After the configuration all works fine. Then I discovered that after an reboot or after ca. 10 minutes uptime, the physical switch (connected on gpio-5) is not working anymore. When I press the button, is nothing happening. The device status is not changing and the log file is empty. If I go in the settings of the device 2 (physical input switch gpio-5) and confirm the settings, without changing anything, all is working fine. Without problems. Unfortunately the problem returns after ca. 10minutes or system reboot.
The problem is only present on gpio-5. The reed sensor on gpio-3 and the virtual switch on gpio-16 are working without problems.

What I'm doing wrong?

thank you in advanced

Martin

There are the following devices configured:

1. (reed sensor input)
Switch input switch
internal PullUp
gpio-3
switch
normal switch

2. (physical input switch)
switch input switch
gpio-5
switch
normal switch

3. (relay)
switch input switch
gpio-4
switch
normal switch

4. (virtual switch)
switch input switch
gpio-16
switch
normal switch

The following rules are configured:

on MQTT#Connected do
publish Shelly_Garage_Door/GET/Status/State,[status#State]
publish Shelly_Garage_Door/GET/Switch/State,[Switch#State]
endon

on System#Boot do
gpio,4,0
gpio,16,0
endon

on Switch#State=1 do
Pulse,4,1,100
endon
on Switch#State=0 do
Pulse,4,1,100
endon

on VirtualSwitch#State=1 do
Pulse,4,1,100
endon

TD-er
Core team member
Posts: 3174
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: external switch does not work after reboot

#2 Post by TD-er » 14 Sep 2020, 21:45

Can you try to send continuous pings from another node to that Shelly one and see if the problem is still occuring?

martin.g
Normal user
Posts: 5
Joined: 14 Sep 2020, 19:00

Re: external switch does not work after reboot

#3 Post by martin.g » 15 Sep 2020, 08:49

Hi TD-er,

I've an continuous ping running. Thats no network issue. The shelly is connected through MQTT to ioBroker. I can change the state of the virtual switch gpio-16 without problems.
Just the physical switch on GPIO-5 has problems.
Also in the Webinterface of espeasy I can't see any device state change of GPIO-5.
I forgot to mention that the espeasy webinterface is asking me every 3 seconds the authentication window. Is this normal?

thank you in advanced

best regards

Martin

TD-er
Core team member
Posts: 3174
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: external switch does not work after reboot

#4 Post by TD-er » 15 Sep 2020, 09:55

If it is asking for authorization that often, then please also check to see if it is rebooting.
It is for sure not normal :)

Just a rule of thumb here, if it is annoying, it probably isn't intended nor normal :)

GPIO5 is also the default of one of the I2C pins.
So please check you did assign other pins for the I2C (or set "no pin" if possible there)

martin.g
Normal user
Posts: 5
Joined: 14 Sep 2020, 19:00

Re: external switch does not work after reboot

#5 Post by martin.g » 15 Sep 2020, 10:06

Hi,

the shelly is not rebooting. I've actually a uptime about 15 hours.
I2C SDA and SCL are set to "None"

The strange thing is, that if I edit the device with GPIO-5 and submit without changing anything, all is working fine.

best regards

Martin

TD-er
Core team member
Posts: 3174
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: external switch does not work after reboot

#6 Post by TD-er » 15 Sep 2020, 10:10

Hmm that sounds like it may have had a settings file that was not written fully.
Did you see a red error message when saving the settings?

Is there enough free space on the file system?
SPIFFS may act strange sometimes when it encounters a full or highly fragmented file system.

martin.g
Normal user
Posts: 5
Joined: 14 Sep 2020, 19:00

Re: external switch does not work after reboot

#7 Post by martin.g » 15 Sep 2020, 10:23

Hi,

no, there is no red error message.
I've flashed the shelly several times, to exclude a firmware bug. Could this be the problem?

This is my system info:

Unit Number: 0
Uptime: 0 days 15 hours 37 minutes
Load: 15.20% (LC=3766)
CPU Eco Mode: false
Free Mem: 20776 (18088 - sendContentBlocking)
Free Stack: 3568 (1168 - LoadTaskSettings)
Heap Max Free Block: 18752
Heap Fragmentation: 10%
Boot: Manual reboot (3)
Reset Reason: Software/System restart
Last Task: Const Interval timer, id: 3
SW WD count: 0
Network ❔
Wifi: 802.11N (RSSI -84 dB)
IP Config: DHCP
IP / Subnet: 192.168.0.205 / 255.255.255.0
Gateway: 192.168.0.1
Client IP: 192.168.0.103
DNS: 192.168.0.1 / 8.8.8.8
Allowed IP Range: 192.168.0.0 - 192.168.0.255
STA MAC: BC:DD:C2:77:C2:AC
AP MAC: BE:DD:C2:77:C2:AC
SSID: wlan (64:70:02:62:CD:44)
Channel: 4
Connected: 15h37m
Last Disconnect Reason: (1) Unspecified
Number Reconnects: 0
WiFi Settings
Force WiFi B/G: false
Restart WiFi Lost Conn: false
Force WiFi No Sleep: false
Periodical send Gratuitous ARP: false
Connection Failure Threshold: 0
Firmware
Build:⋄ 20103 - Mega
System Libraries:⋄ ESP82xx Core 2_5_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.1.2 PUYA support
Git Build:⋄ mega-20190827
Plugins:⋄ 4 [Normal] [Shelly 1]
Build Md5: d078a3385d33a9b7f81492dd4a6bc430
Md5 check: passed.
Build Time:⋄ Aug 27 2019 02:39:19
Binary Filename:⋄ ESP_Easy_mega-20190827_hard_core_252_Shelly_1_2M256.bin
System Status
Syslog Log Level: Debug
Serial Log Level: None
Web Log Level: None
ESP Board
ESP Chip ID: 7848620 (0x77C2AC)
ESP Chip Frequency: 80 MHz
ESP Board Name: PLATFORMIO_ESP12E
Storage
Flash Chip ID: Vendor: 0xEF Device: 0x4015
Flash Chip Real Size: 2048 kB
Flash IDE Size: 2048 kB
Flash IDE Speed: 40 MHz
Flash IDE Mode: DIO
Flash Writes: 22 daily / 22 boot
Sketch Size: 672 kB (1116 kB free)
SPIFFS Size: 209 kB (126 kB free)
Page size: 256
Block size: 4096
Number of blocks: 52
Maximum open files: 5
Maximum path length: 32

TD-er
Core team member
Posts: 3174
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: external switch does not work after reboot

#8 Post by TD-er » 15 Sep 2020, 18:06

Well it does seem to work stable now.
Before you try to save a new setting, can you maybe reboot first? At reboot (before loading the settings) the filesystem garbage collector is called, which may clear blocks no longer used.
I've seen strange things with small SPIFFS file systems and lots of edits.
Just to make sure you don't loose anything, maybe it is a good idea to download the current (working) settings file first before changing it or even try to reboot.

Right now I don't know what may have caused the strange issues

User avatar
Ath
Normal user
Posts: 188
Joined: 10 Jun 2018, 12:06
Location: NL

Re: external switch does not work after reboot

#9 Post by Ath » 15 Sep 2020, 19:31

I am wondering why such an old release of ESPEasy is being used, there have been many releases since, so it could be worth trying a more recent release.

TD-er
Core team member
Posts: 3174
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: external switch does not work after reboot

#10 Post by TD-er » 15 Sep 2020, 22:55

Ah you're right.
I didn't look at the build date, even though that's the main reason I put the date stamp in there :)

martin.g
Normal user
Posts: 5
Joined: 14 Sep 2020, 19:00

Re: external switch does not work after reboot

#11 Post by martin.g » 16 Sep 2020, 11:39

Hi,

I've just tested this old build, to exclude a firmware bug. Also with build 20200829 I had the same problem.
Now I discovered the reason.. There was a problem with the controller. The shelly was integrated with mqtt to iobroker. The problem was in iobroker a SET object gpio-5 to 0. I've deleted this object.
Now all works fine with lease 20200913.

Thank you for your help

best regards

Martin

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests