Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zigbee2tasmota crash with presence sensor (RTCGQ01LM) #8089

Closed
13 of 15 tasks
plutec opened this issue Apr 6, 2020 · 8 comments · Fixed by #8096
Closed
13 of 15 tasks

Zigbee2tasmota crash with presence sensor (RTCGQ01LM) #8089

plutec opened this issue Apr 6, 2020 · 8 comments · Fixed by #8096
Assignees
Labels
bug Type - Confirmated Bug

Comments

@plutec
Copy link

plutec commented Apr 6, 2020

PROBLEM DESCRIPTION

Tasmota crash (Hardware Watchdog appears) when presence sensor RTCGQ01LM (mijiia with no luminance) detects any movement

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

  • Read the Contributing Guide and Policy and the Code of Conduct
  • Searched the problem in issues
  • Searched the problem in the docs
  • Searched the problem in the forum
  • Searched the problem in the chat
  • Device used (e.g., Sonoff Basic): Sonoff Basic + CC2530
  • Tasmota binary firmware version number used: Tasmota 8.2.0.1
    • Pre-compiled
    • Self-compiled
      • IDE / Compiler used: PlatformIO (Visual Studio Code)
  • Flashing tools used: esptool
  • Provide the output of command: Backlog Template; Module; GPIO 255:
  Configuration output here:
20:15:15 CMD: Backlog Template; Module; GPIO 255
20:15:15 MQT: stat/Z2T_1/RESULT = {"NAME":"Zigbee","GPIO":[0,0,0,0,0,0,0,0,0,166,0,165,0],"FLAG":0,"BASE":18}
20:15:15 MQT: stat/Z2T_1/RESULT = {"Module":{"1":"Sonoff Basic"}}
20:15:15 MQT: stat/Z2T_1/RESULT = {"GPIO0":{"17":"Button1"},"GPIO1":{"165":"Zigbee Tx"},"GPIO2":{"0":"None"},"GPIO3":{"166":"Zigbee Rx"},"GPIO4":{"0":"None"},"GPIO5":{"0":"None"},"GPIO9":{"0":"None"},"GPIO10":{"0":"None"},"GPIO12":{"21":"Relay1"},"GPIO13":{"56":"Led1i"},"GPIO14":{"0":"None"},"GPIO15":{"0":"None"},"GPIO16":{"0":"None"}}
  • If using rules, provide the output of this command: Backlog Rule1; Rule2; Rule3:
  Rules output here:
20:15:54 MQT: stat/Z2T_1/RESULT = {"Rule1":"OFF","Once":"OFF","StopOnError":"OFF","Free":511,"Rules":""}
20:15:54 MQT: stat/Z2T_1/RESULT = {"Rule2":"OFF","Once":"OFF","StopOnError":"OFF","Free":511,"Rules":""}
20:15:54 MQT: stat/Z2T_1/RESULT = {"Rule3":"OFF","Once":"OFF","StopOnError":"OFF","Free":511,"Rules":""}
  • Provide the output of this command: Status 0:
  STATUS 0 output here:
20:16:09 CMD: Status 0
20:16:09 MQT: stat/Z2T_1/STATUS = {"Status":{"Module":1,"FriendlyName":["Z2T_1"],"Topic":"Z2T_1","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0}}
20:16:10 MQT: stat/Z2T_1/STATUS1 = {"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://thehackbox.org/tasmota/release/tasmota.bin","RestartReason":"Hardware Watchdog","Uptime":"0T00:01:37","StartupUTC":"2020-04-06T19:14:32","Sleep":50,"CfgHolder":4617,"BootCount":49,"BCResetTime":"2020-04-02T17:00:29","SaveCount":91,"SaveAddress":"F7000"}}
20:16:10 MQT: stat/Z2T_1/STATUS2 = {"StatusFWR":{"Version":"8.2.0.1(tasmota)","BuildDateTime":"2020-04-02T22:05:30","Boot":7,"Core":"STAGE","SDK":"2.2.2-dev(38a443e)","Hardware":"ESP8266EX","CR":"358/699"}}
20:16:10 MQT: stat/Z2T_1/STATUS3 = {"StatusLOG":{"SerialLog":0,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["myssid",""],"TelePeriod":300,"Resolution":"558180C0","SetOption":["00008009","2805C8000100060000005A00000000000000","00000000","00000000"]}}
20:16:10 MQT: stat/Z2T_1/STATUS4 = {"StatusMEM":{"ProgramSize":618,"Free":384,"Heap":22,"ProgramFlashSize":1024,"FlashSize":1024,"FlashChipId":"146085","FlashMode":3,"Features":["00000809","8FD0E397","047683A0","000000CD","010013C0","C000F981","00000004"],"Drivers":"1,2,3,4,6,7,8,9,10,12,16,18,19,20,21,22,23,24,26,27,29,30,35,37","Sensors":"1,2,3,4,5,6"}}
20:16:10 MQT: stat/Z2T_1/STATUS5 = {"StatusNET":{"Hostname":"Z2T_1-5363","IPAddress":"192.168.0.89","Gateway":"192.168.0.1","Subnetmask":"255.255.255.0","DNSServer":"192.168.0.1","Mac":"XX:XX:XX:XX:XX:XX","Webserver":2,"WifiConfig":4,"WifiPower":17.0}}
20:16:10 MQT: stat/Z2T_1/STATUS6 = {"StatusMQT":{"MqttHost":"XXX.XX.XX.XX","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_02D4F3","MqttUser":"DVES_USER","MqttCount":1,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30}}
20:16:10 MQT: stat/Z2T_1/STATUS7 = {"StatusTIM":{"UTC":"2020-04-06T19:16:10","Local":"2020-04-06T20:16:10","StartDST":"2020-03-29T02:00:00","EndDST":"2020-10-25T03:00:00","Timezone":"+01:00","Sunrise":"06:16","Sunset":"19:28"}}
20:16:10 MQT: stat/Z2T_1/STATUS10 = {"StatusSNS":{"Time":"2020-04-06T20:16:10"}}
20:16:10 MQT: stat/Z2T_1/STATUS11 = {"StatusSTS":{"Time":"2020-04-06T20:16:10","Uptime":"0T00:01:38","UptimeSec":98,"Heap":20,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER":"OFF","Wifi":{"AP":1,"SSId":"myssid","BSSId":"XX:XX:XX:XX:XX:XX","Channel":6,"RSSI":62,"Signal":-69,"LinkCount":1,"Downtime":"0T00:00:07"}}}
  • Provide the output of the Console log output when you experience your issue; if applicable:
    (Please use weblog 4 for more debug information)

    Console output here:
    After enable weblog 4, I force the detection with the sensor and the console restart with the following content:

20:20:30 MQT: stat/Z2T_1/POWER = OFF
20:20:31 APP: Boot Count 51
20:20:31 CFG: Saved to flash at F4, Count 94, Bytes 4096
20:20:33 ZIG: ZbZNPSent 410000
20:20:34 MQT: tele/Z2T_1/STATE = {"Time":"2020-04-06T20:20:34","Uptime":"0T00:00:13","UptimeSec":13,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER":"OFF","Wifi":{"AP":1,"SSId":"myssid","BSSId":"XX:XX:XX:XX:XX:XX","Channel":6,"RSSI":66,"Signal":-67,"LinkCount":1,"Downtime":"0T00:00:07"}}
20:20:35 ZIG: Bytes follow_read_metric = 0
20:20:35 ZIG: {"ZbZNPReceived":"4180020200020603"}
20:20:35 MQT: tele/Z2T_1/RESULT = {"ZbState":{"Status":1,"Message":"CC2530 booted","RestartReason":"Watchdog","MajorRel":2,"MinorRel":6}}
20:20:35 ZIG: checking device configuration
20:20:35 ZIG: ZbZNPSent 2108000F00
20:20:35 ZIG: Bytes follow_read_metric = 0
20:20:35 ZIG: {"ZbZNPReceived":"6108000155"}
20:20:35 ZIG: ZbZNPSent 2102
20:20:35 ZIG: Bytes follow_read_metric = 0
20:20:35 ZIG: {"ZbZNPReceived":"61020200020603901534010200000000"}
20:20:35 MQT: tele/Z2T_1/RESULT = {"ZbState":{"Status":50,"MajorRel":2,"MinorRel":6,"MaintRel":3,"Revision":20190608}}
20:20:35 ZIG: ZbZNPSent 260483
20:20:35 ZIG: Bytes follow_read_metric = 0
20:20:35 ZIG: {"ZbZNPReceived":"6604008302631A"}
20:20:35 ZIG: ZbZNPSent 26042D
20:20:35 ZIG: Bytes follow_read_metric = 0
20:20:35 ZIG: {"ZbZNPReceived":"6604002D08CCCCCCCCCCCCCCCC"}
20:20:35 ZIG: ZbZNPSent 260484
20:20:35 ZIG: Bytes follow_read_metric = 0
20:20:35 ZIG: {"ZbZNPReceived":"660400840400080000"}
20:20:35 ZIG: ZbZNPSent 260462
20:20:35 ZIG: Bytes follow_read_metric = 0
20:20:35 ZIG: {"ZbZNPReceived":"660400621001030507090B0D0F00020406080A0C0D"}
20:20:35 ZIG: ZbZNPSent 260463
20:20:35 ZIG: Bytes follow_read_metric = 0
20:20:35 ZIG: {"ZbZNPReceived":"660400630100"}
20:20:35 MQT: tele/Z2T_1/RESULT = {"ZbState":{"Status":3,"Message":"Configured, starting coordinator"}}
20:20:35 ZIG: ZbZNPSent 25406400
20:20:36 ZIG: Bytes follow_read_metric = 0
20:20:36 ZIG: {"ZbZNPReceived":"654000"}
20:20:36 ZIG: Bytes follow_read_metric = 0
20:20:36 ZIG: {"ZbZNPReceived":"45C009"}
20:20:36 ZIG: ZbZNPSent 2700
20:20:36 ZIG: Bytes follow_read_metric = 0
20:20:36 ZIG: {"ZbZNPReceived":"670000FF82FE1E004B120000000709037B340F50EA46"}
20:20:36 MQT: tele/Z2T_1/RESULT = {"ZbState":{"Status":51,"IEEEAddr":"0x00124B001EFE82FF","ShortAddr":"0x0000","DeviceType":7,"DeviceState":9,"NumAssocDevices":3,"AssocDevicesList":["0x347B","0x500F","0x46EA"]}}
20:20:36 ZIG: ZbZNPSent 250200000000
20:20:36 ZIG: Bytes follow_read_metric = 0
20:20:36 ZIG: {"ZbZNPReceived":"650200"}
20:20:36 ZIG: Bytes follow_read_metric = 0
20:20:36 ZIG: {"ZbZNPReceived":"4582000000000000408F000050A0000100A00000"}
20:20:36 ZIG: ZbZNPSent 250500000000
20:20:36 ZIG: Bytes follow_read_metric = 0
20:20:36 ZIG: {"ZbZNPReceived":"650500"}
20:20:36 ZIG: Bytes follow_read_metric = 0
20:20:36 ZIG: {"ZbZNPReceived":"4585000000000000"}
20:20:36 ZIG: ZbZNPSent 2400010401050000000000
20:20:36 ZIG: Bytes follow_read_metric = 0
20:20:36 ZIG: {"ZbZNPReceived":"640000"}
20:20:36 ZIG: ZbZNPSent 24000B0401050000000000
20:20:36 ZIG: Bytes follow_read_metric = 0
20:20:36 ZIG: {"ZbZNPReceived":"640000"}
20:20:36 ZIG: ZbZNPSent 250500000000
20:20:36 ZIG: Bytes follow_read_metric = 0
20:20:36 ZIG: {"ZbZNPReceived":"650500"}
20:20:36 ZIG: Bytes follow_read_metric = 0
20:20:36 ZIG: {"ZbZNPReceived":"45850000000000020B01"}
20:20:36 ZIG: ZbZNPSent 25360200000000
20:20:36 ZIG: Bytes follow_read_metric = 0
20:20:36 ZIG: {"ZbZNPReceived":"653600"}
20:20:36 ZIG: Bytes follow_read_metric = 0
20:20:36 ZIG: {"ZbZNPReceived":"45CB00"}
20:20:36 ZIG: Bytes follow_read_metric = 0
20:20:36 ZIG: {"ZbZNPReceived":"45B6000000"}
20:20:36 MQT: tele/Z2T_1/RESULT = {"ZbState":{"Status":0,"Message":"Started"}}
20:20:36 ZIG: Zigbee started
20:20:36 ZIG: Zigbee signature in Flash: 3167697A - 121
20:20:36 ZIG: Zigbee devices data in Flash (121 bytes)
20:20:49 WIF: Checking connection...

In the MQTT, subscribed to all topics appears this:

tele/Z2T_1/SENSOR {"ZbReceived":{"0x46EA":{"Occupancy":1,"Endpoint":1,"LinkQuality":123}}}
# Restart after this
tele/Z2T_1/LWT Online
cmnd/Z2T_1/POWER (null)
tele/Z2T_1/INFO1 {"Module":"Sonoff Basic","Version":"8.2.0.1(tasmota)","FallbackTopic":"cmnd/DVES_02D4F3_fb/","GroupTopic":"cmnd/tasmotas/"}
tele/Z2T_1/INFO2 {"WebServerMode":"Admin","Hostname":"Z2T_1-5363","IPAddress":"192.168.0.89"}
tele/Z2T_1/INFO3 {"RestartReason":{"Exception":0,"Reason":"Exception","EPC":["fe29e818","00000000","00000000"],"EXCVADDR":"00000000","DEPC":"00000000","CallChain":["40221e9f","4010102e","402297d9","4020e3c1","402343c4","40249634","40100b19"]}}
stat/Z2T_1/RESULT {"POWER":"OFF"}
stat/Z2T_1/POWER OFF
tele/Z2T_1/RESULT {"ZbState":{"Status":1,"Message":"CC2530 booted","RestartReason":"Watchdog","MajorRel":2,"MinorRel":6}}
tele/Z2T_1/STATE {"Time":"2020-04-06T20:22:44","Uptime":"0T00:00:13","UptimeSec":13,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER":"OFF","Wifi":{"AP":1,"SSId":"myssid","BSSId":"XX:XX:XX:XX:XX:XX","Channel":6,"RSSI":66,"Signal":-67,"LinkCount":1,"Downtime":"0T00:00:07"}}
tele/Z2T_1/RESULT {"ZbState":{"Status":50,"MajorRel":2,"MinorRel":6,"MaintRel":3,"Revision":20190608}}
tele/Z2T_1/RESULT {"ZbState":{"Status":3,"Message":"Configured, starting coordinator"}}
tele/Z2T_1/RESULT {"ZbState":{"Status":51,"IEEEAddr":"0x00124B001EFE82FF","ShortAddr":"0x0000","DeviceType":7,"DeviceState":9,"NumAssocDevices":3,"AssocDevicesList":["0x347B","0x500F","0x46EA"]}}
tele/Z2T_1/RESULT {"ZbState":{"Status":0,"Message":"Started"}}

TO REPRODUCE

Steps to reproduce the behavior:
Pair the sensor and move your hand in front of it.

EXPECTED BEHAVIOUR

A clear and concise description of what you expected to happen.
The expected behaviour is don't restart the sonoff and after some period of time detect the "no presence" with "Occupancy":0

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

Add any other context about the problem here.

(Please, remember to close the issue when the problem has been addressed)

@ascillato
Copy link
Contributor

ascillato commented Apr 6, 2020

Hi,

"Exception":0 is more likely to be a power issue. All sonoff basic are known to have a very limited power supply. If you are using the 3.3v of the sonoff basic, that is your issue. A sonoff basic can't handle more power than itself.

Please, change your sonoff basic for a nodeMCU with a good power supply, or supply 3.3v to your sensors with another power supply.

@ascillato2 ascillato2 added awaiting feedback Action - Waiting for response or more information troubleshooting Type - Troubleshooting labels Apr 6, 2020
@s-hadinger
Copy link
Collaborator

Someone already reported the exact same crash, but I cannot reproduce. It was reported that commenting our in xdrv_23_zigbee_8_parsers.ino line 537:

      // zigbee_devices.setTimer(shortaddr, 0 /* groupaddr */, OCCUPANCY_TIMEOUT, cluster, endpoint, Z_CAT_VIRTUAL_ATTR, 0, &Z_OccupancyCallback);

solved the crash. Unfortunately it does not generate the "Occupancy":0 event.

Can you share your compile options?

@plutec
Copy link
Author

plutec commented Apr 7, 2020

I was making some tests with Zigbee, so the only change I did was to uncomment "#define USE_ZIGBEE" in "my_user_config.h"

@plutec
Copy link
Author

plutec commented Apr 7, 2020

I will try with another power source this evening

@plutec
Copy link
Author

plutec commented Apr 7, 2020

I just tested it with another big power supply and the behaviour is the same.

Also, I checked with another presence sensor (aqara with luminance sensor) and also the Hardware watchdog appears.

@plutec
Copy link
Author

plutec commented Apr 7, 2020

I got another different message (in MQTT):

tele/Z2T_1/INFO3 {"RestartReason":{"Exception":0,"Reason":"Exception","EPC":["faf0fa2c","00000000","00000000"],"EXCVADDR":"00000000","DEPC":"00000000","CallChain":["40221e9f","4010102e","402297d9","4020e3c1","402343c4","40249634","40100b19"]}}

@s-hadinger
Copy link
Collaborator

Thanks for your patience. Good news is I can reproduce the crash now. I will investigate.

@ascillato2 ascillato2 added bug Type - Confirmated Bug and removed awaiting feedback Action - Waiting for response or more information troubleshooting Type - Troubleshooting labels Apr 8, 2020
s-hadinger added a commit to s-hadinger/Tasmota that referenced this issue Apr 8, 2020
@s-hadinger
Copy link
Collaborator

Fixed in PR #8096

arendst added a commit that referenced this issue Apr 8, 2020
Fix Zigbee crash with Occupancy sensor (#8089)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type - Confirmated Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants