maximkulkin / esp-homekit

Apple HomeKit accessory server library for ESP-OPEN-RTOS
MIT License
1.11k stars 170 forks source link

It triggers config reset whenever button action triggered in home.app #41

Closed yubik9 closed 5 years ago

yubik9 commented 6 years ago

Could you please advise me what to do?

renssies commented 6 years ago

Could you share your code or which demo you are using?

yubik9 commented 6 years ago

I am using sonoff basic. Nothing has been changed.

RavenSystem commented 6 years ago

Possible hardware issue like this? https://github.com/RavenSystem/esp-homekit-devices/issues/2

Try erasing flash.

yubik9 commented 6 years ago

Manually press btn does not have this issue.

On 15 Apr 2018, 03:36 +1000, José A. Jiménez notifications@github.com, wrote:

Possible hardware issue like this? RavenSystem/esp-homekit-devices#2 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

yubik9 commented 6 years ago

And I erased flash all the times.

On 15 Apr 2018, 03:36 +1000, José A. Jiménez notifications@github.com, wrote:

Possible hardware issue like this? RavenSystem/esp-homekit-devices#2 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

yubik9 commented 6 years ago

Updates:

I tried to upload Sonoff Tasmota. It is working well which verifies that hardware is okay.

maximkulkin commented 6 years ago

Logs please

yubik9 commented 6 years ago

@maximkulkin Is there a way to get a log with Live 240v. I am not able to connect with serial + 3.3v

maximkulkin commented 6 years ago

I just debugged a device on Sonoff Dual R2: what you need to do is to power it through FTDI only, that will allow you debugging various stuff (other than relays themselves, but a) this supposedly work; b) you should be able to hear relays clicking) without being connected to high voltage. FTDI power is enough to power MCU.

yubik9 commented 6 years ago

@maximkulkin for some reason which I don't know why, I am not able to find wifi ap with wifi-config while I am booting from FTDI.

maximkulkin commented 6 years ago

@j105 Logs?

yubik9 commented 6 years ago

@maximkulkin I am not able to reproduce under low voltage mode.

Once I connect it to 240v power, it resets whenever button triggered.

yubik9 commented 6 years ago

Got something after 240v power failure

ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x40100000, len 2292, room 16
tail 4
chksum 0x57
load 0x3ffe8000, len 772, room 4
tail 0
chksum 0x0b
csum 0x0b

rBoot v1.4.0 - richardaburton@gmail.com
Flash Size:   8 Mbit
Flash Mode:   DOUT
Flash Speed:  40 MHz
rBoot Option: Big flash
rBoot Option: RTC data

Booting rom 0.
pp_task_hdl : 3ffeff10, prio:14, stack:512
pm_task_hdl : 3ffef800, prio:1, stack:176
frc2_timer_task_hdl:0x3fff3da8, prio:12, stack:200

ESP-Open-SDK ver: 0.0.1 compiled @ Apr 20 2018 23:51:33
phy ver: 273, pp ver: 8.3

>>> wifi_config: Initializing WiFi config
>>> wifi_config: wifi_config_station_connect: No configuration found
>>> wifi_config: Starting AP mode
>>> wifi_config: wifi_config_softap_start: Starting AP SSID=sonoff-switch-2BCE80
>>> wifi_config: Starting DHCP server
mode : sta(dc:4f:22:2b:ce:80) + softAP(de:4f:22:2b:ce:80)
add if0
add if1
bcn 100
>>> wifi_config: Starting WiFi scan
scandone
>>> wifi_config: Starting DNS server
>>> wifi_config: Staring HTTP server
scandone
reconnect
scandone
add 0
aid 1
cnt

connected with Rice, channel 8
dhcp client start...
Fatal exception (9):
epc1=0x4025bf86
epc2=0x00000000
epc3=0x40203571
excvaddr=0x00000021
depc=0x00000000

excsave1=0x3ffeec68
Registers:
a0 3ffeec68 a1 3fff0810 a2  3ffeca24 a3  00000000
a4  ffffffe0 a5  3ffec208 a6  00000000 a7  3ffec338
a8  00000000 a9  00000000 a10 00000001 a11 00000001
a12 3feffe00 a13 3ffec1b0 SAR 0000001c

Stack: SP=0x3fff0810
0x3fff0810: 4025bbb3 3feffe00 3ffeb148 40204a73
0x3fff0820: 4025b45d 3feffe00 3ffec1b0 ffffffe0
0x3fff0830: 3ffec3d8 3fff131c 00000000 00000000
0x3fff0840: 00000000 00000000 00000000 00000000
0x3fff0850: 00000000 00000000 00000000 a5a5a5a5
0x3fff0860: 00000050 fffffffc 00000000 00000000
0x3fff0870: 3fff0868 00000000 00000000 3fff0880
0x3fff0880: ffffffff 3fff0880 3fff0880 00000000

Free Heap: 41012
_heap_start 0x3fff1c28 brk 0x3fff6c58 supervisor sp 0x40000000 sp-brk 37800 bytes
arena (total_size) 20528 fordblks (free_size) 3212 uordblocks (used_size) 17316

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x40100000, len 2292, room 16
tail 4
chksum 0x57
load 0x3ffe8000, len 772, room 4
tail 0
tail 0
chksum 0x0b
csum 0x0b

rBoot v1.4.0 - richardaburton@gmail.com
Flash Size:   8 Mbit
Flash Mode:   DOUT
Flash Speed:  40 MHz
rBoot Option: Big flash
rBoot Option: RTC data

Booting rom 0.
pp_task_hdl : 3ffeff10, prio:14, stack:512
pm_task_hdl : 3ffef800, prio:1, stack:176
frc2_timer_task_hdl:0x3fff3da8, prio:12, stack:200

ESP-Open-SDK ver: 0.0.1 compiled @ Apr 20 2018 23:51:33
phy ver: 273, pp ver: 8.3

>>> wifi_config: Initializing WiFi config
>>> wifi_config: wifi_config_station_connect: No configuration found
>>> wifi_config: Starting AP mode
>>> wifi_config: wifi_config_softap_start: Starting AP SSID=sonoff-switch-2BCE80
>>> wifi_config: Starting DHCP server
mode : sta(dc:4f:22:2b:ce:80) + softAP(de:4f:22:2b:ce:80)
add if0
add if1
bcn 100
>>> wifi_config: Starting WiFi scan
scandone
>>> wifi_config: Starting DNS server
>>> wifi_config: Staring HTTP server
scandone
reconnect
scandone
add 0
aid 1
cnt
Fatal exception (0):
epc1=0x40203523
epc2=0x00000000
epc3=0x40203579
excvaddr=0x4023667d
depc=0x00000000
excsave1=0x4020356d
Registers:
a0 4020356d a1 3fff3010 a2  00000001 a3  3fff13d8
a4  00000001 a5  00000000 a6  3fff1388 a7  00000000
a8  00000000 a9  00000000 a10 00000000 a11 00000000
a12 3ffeec20 a13 3fff137c SAR 00000000

Stack: SP=0x3fff3010
0x3fff3010: 00000000 00000000 00000000 00000000
0x3fff3020: 00000000 00000000 00000000 00000000
0x3fff3030: 00000000 a5a5a5a5 00000808 fffffffc
0x3fff3040: a5a5a5a5 a5a5a5a5 a5a5a5a5 a5a5a5a5

Free Heap: 41632
_heap_start 0x3fff1c28 brk 0x3fff6c58 supervisor sp 0x40000000 sp-brk 37800 bytes

arena (total_size) 20528 fordblks (free_size) 3832 uordblocks (used_size) 16696

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x40100000, len 2292, room 16
tail 4
chksum 0x57
load 0x3ffe8000, len 772, room 4
tail 0
chksum 0x0b
csum 0x0b

rBoot v1.4.0 - richardaburton@gmail.com
Flash Size:   8 Mbit
Flash Mode:   DOUT
Flash Speed:  40 MHz
rBoot Option: Big flash
rBoot Option: RTC data

Booting rom 0.
pp_task_hdl : 3ffeff10, prio:14, stack:512
pm_task_hdl : 3ffef800, prio:1, stack:176
frc2_timer_task_hdl:0x3fff3da8, prio:12, stack:200

ESP-Open-SDK ver: 0.0.1 compiled @ Apr 20 2018 23:51:33
phy ver: 273, pp ver: 8.3

>>> wifi_config: Initializing WiFi config
>>> wifi_config: wifi_config_station_connect: No configuration found
>>> wifi_config: Starting AP mode
>>> wifi_config: wifi_config_softap_start: Starting AP SSID=sonoff-switch-2BCE80
>>> wifi_config: Starting DHCP server
mode : sta(dc:4f:22:2b:ce:80) + softAP(de:4f:22:2b:ce:80)
add if0
add if1
bcn 100
>>> wifi_config: Starting WiFi scan
scandone
>>> wifi_config: Starting DNS server
>>> wifi_config: Staring HTTP server
scandone
reconnect
scandone

add 0
aid 1
cnt

connected with Rice, channel 8
dhcp client start...
ip:10.0.0.12,mask:255.255.255.0,gw:10.0.0.1
Fatal exception (0):
epc1=0x40203571
epc2=0x40100070
epc3=0x40203523
excvaddr=0x40235b2c
depc=0x40100050
excsave1=0x40100ded

Stack: SP=0x3fff3010
0x3fff3010: 00000000 00000000 00000000 00000000
0x3fff3020: 00000000 00000000 00000000 00000000
0x3fff3030: 00000000 a5a5a5a5 00000808 fffffffc
0x3fff3040: a5a5a5a5 a5a5a5a5 a5a5a5a5 a5a5a5a5

Free Heap: 41000
_heap_start 0x3fff1c28 brk 0x3fff6c58 supervisor sp 0x40000000 sp-brk 37800 bytes
arena (total_size) 20528 fordblks (free_size) 3200 uordblocks (used_size) 17328

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x40100000, len 2292, room 16
tail 4
chksum 0x57
load 0x3ffe8000, len 772, room 4
tail 0
chksum 0x0b
csum 0x0b

rBoot v1.4.0 - richardaburton@gmail.com
Flash Size:   8 Mbit
Flash Mode:   DOUT
Flash Speed:  40 MHz
rBoot Option: Big flash
rBoot Option: RTC data

Booting rom 0.

pp_task_hdl : 3ffeff10, prio:14, stack:512
pm_task_hdl : 3ffef800, prio:1, stack:176
frc2_timer_task_hdl:0x3fff3da8, prio:12, stack:200

ESP-Open-SDK ver: 0.0.1 compiled @ Apr 20 2018 23:51:33
phy ver: 273, pp ver: 8.3

>>> wifi_config: Initializing WiFi config
>>> wifi_config: wifi_config_station_connect: No configuration found
>>> wifi_config: Starting AP mode
>>> wifi_config: wifi_config_softap_start: Starting AP SSID=sonoff-switch-2BCE80
>>> wifi_config: Starting DHCP server
mode : sta(dc:4f:22:2b:ce:80) + softAP(de:4f:22:2b:ce:80)
add if0
add if1
bcn 100
>>> wifi_config: Starting WiFi scan
scandone
>>> wifi_config: Starting DNS server
>>> wifi_config: Staring HTTP server
scandone
reconnect
scandone
add 0
aid 1
cnt
Fatal exception (9):
epc1=0x402021d6
epc2=0x40100070
epc3=0x4025ca14
excvaddr=0x00000019
depc=0x40100050
excsave1=0x40100c44
Registers:
a0 40100c44 a1 3fff0800 a2  3fff12fc a3  00000065
a4  00000000 a5  0000000f a6  000005f5 a7  3ffec880
a8  00000000 a9  00000000 a10 00000001 a11 00000001
a12 00000000 a13 3fff12fc SAR 00000019

Stack: SP=0x3fff0800
0x3fff0800: 4025ba20 00000010 00000004 4025ba5d
0x3fff0810: 3ffeaec0 4025b3fe 3feffe00 3ffec1b0
0x3fff0820: ffffffe0 3ffeca24 00000000 4025b2bf
0x3fff0830: 3ffec440 3fff131c 00000000 00000000

0x3fff0840: 00000000 00000000 00000000 00000000
0x3fff0850: 00000000 00000000 00000000 a5a5a5a5
0x3fff0860: 00000050 fffffffc 00000000 00000000
0x3fff0870: 3fff0868 00000000 00000000 3fff0880

Free Heap: 41680
_heap_start 0x3fff1c28 brk 0x3fff6c58 supervisor sp 0x40000000 sp-brk 37800 bytes
arena (total_size) 20528 fordblks (free_size) 3880 uordblocks (used_size) 16648

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x40100000, len 2292, room 16
tail 4
chksum 0x57
load 0x3ffe8000, len 772, room 4
tail 0
chksum 0x0b
csum 0x0b

rBoot v1.4.0 - richardaburton@gmail.com
Flash Size:   8 Mbit
Flash Mode:   DOUT
Flash Speed:  40 MHz
rBoot Option: Big flash
rBoot Option: RTC data

Booting rom 0.
pp_task_hdl : 3ffeff10, prio:14, stack:512
pm_task_hdl : 3ffef800, prio:1, stack:176
frc2_timer_task_hdl:0x3fff3da8, prio:12, stack:200

ESP-Open-SDK ver: 0.0.1 compiled @ Apr 20 2018 23:51:33
phy ver: 273, pp ver: 8.3

>>> wifi_config: Initializing WiFi config
>>> wifi_config: wifi_config_station_connect: No configuration found
>>> wifi_config: Starting AP mode
>>> wifi_config: wifi_config_softap_start: Starting AP SSID=sonoff-switch-2BCE80
>>> wifi_config: Starting DHCP server

mode : sta(dc:4f:22:2b:ce:80) + softAP(de:4f:22:2b:ce:80)
add if0
add if1
bcn 100
>>> wifi_config: Starting WiFi scan
scandone
>>> wifi_config: Starting DNS server
>>> wifi_config: Staring HTTP server
scandone
reconnect
scandone
add 0
aid 1
cnt

connected with Rice, channel 8
dhcp client start...
Fatal exception (0):
epc1=0x4025bf93
epc2=0x40100070
epc3=0x40203571
excvaddr=0x40235e21
depc=0x40100050
excsave1=0x3ffeb148
Registers:
a0 3ffeb148 a1 3fff0810 a2  3ffeca24 a3  00000000
a4  ffffffe0 a5  3ffec208 a6  00000000 a7  3ffec338
a8  00000000 a9  00000000 a10 00000001 a11 00000001
a12 3ffec339 a13 3ffec1b0 SAR 0000001b
yubik9 commented 6 years ago

@maximkulkin Tried to comment out the reset part. It works.

Which is this line

https://github.com/maximkulkin/esp-homekit-demo/blob/master/examples/sonoff_basic/main.c#L114

yubik9 commented 6 years ago

Might be something to do with button_event_long_press

yubik9 commented 6 years ago

Or Oc

Roman1us commented 6 years ago

Same problem, but it random happens. I think this is same issue maximkulkin/esp-homekit-demo#30

RavenSystem commented 6 years ago

@j105 @Roman1us Can you try this firmware to check if problem persists? https://github.com/RavenSystem/esp-homekit-devices/releases

yubik9 commented 6 years ago

@RavenSystem Same issue after couple of clicks triggered by Home.app

Comment out the reset part. It is working til now.

pcsaito commented 6 years ago

I’m had random resets too, since I commented out the long press code it never happened again.

yubik9 commented 6 years ago

@pcsaito If you place some LED ON codes there, you will see those codes are triggered occasionally

maximkulkin commented 5 years ago

I think this was already fixed