sinricpro / esp8266-esp32-sdk

Library for https://sinric.pro - simple way to connect your device to Alexa, Google Home, SmartThings and cloud
https://sinric.pro
Other
236 stars 125 forks source link

Activity log #113

Closed sgrizzi closed 3 years ago

sgrizzi commented 3 years ago

Hi, I am just noticing that my system is turning two smart switches on and off without me taking any action. The system has been working absolutely fine for over a months. Is there a possibility to get a detailed log to understand what is going on? What I can find on the port is not detailed enough. The system is behaving weird right now, in front of me... with no action being taken. Thanks. Best regards, Gabriele

kakopappa commented 3 years ago

What’s in the Portal Activity log?

Make sure your device doesn’t have a connectivity issues + you have turned on restore device state to true in your sketch. If you have done this, then device will auto on/off everyone it connects the server

On Wed, 16 Dec 2020 at 8:19 PM sgrizzi notifications@github.com wrote:

Hi, I am just noticing that my system is turning two smart switches on and off without me taking any action. The system has been working absolutely fine for over a months. Is there a possibility to get a detailed log to understand what is going on? What I can find on the port is not detailed enough. The system is behaving weird right now, in front of me... with no action being taken. Thanks. Best regards, Gabriele

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sinricpro/esp8266-esp32-sdk/issues/113, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZAZZUPEQAI4FEKMFSWW6TSVCXVRANCNFSM4U57EAOQ .

sgrizzi commented 3 years ago

Hi, here below are the last two entries in the activity log. No new data since yesterday night when I had to switch off and the on the system. No connectivity issues. Restore state is on and works fine. The system as been connected with no interruptions since yesterday night. I could see the output led's turn on and off in front of my eyes... not really randomly... as if someone was indeed triggering them.

IP ADDRESS LOCATION APP NAME ACTIVITY TIMESTAMP
79.30.95.134 Terno d'Isola , IT portal Device returned an error. : Device returned an error while processing the request! 2020-12-16 00:34:46
79.30.95.134 Terno d'Isola , IT portal Device returned an error. : Device returned an error while processing the request! 2020-12-16 00:34:45
sgrizzi commented 3 years ago

Right now the system has become stable again. It is a bit worrying ... a detailed log would be relevant to understand what has occurred. Is there any chance to get any detailed view?

kakopappa commented 3 years ago

I have a feeling your code must be crashing and restarting the ESP which restores the state again from the server and that’s why you are experiencing this issue

  1. according to the log you have posted, your device doesn’t return true/false after execution the on/off status correctly or function is returning false. You should fix that first

https://github.com/sinricpro/esp8266-esp32-sdk/blob/26df87c1609dadc4a1a7cb6ec0b18f08116b28e0/examples/Switch/Switch/Switch.ino#L67

  1. consider implementing remotedebug to check the Arduino Serial Log remotely

https://github.com/JoaoLopesF/RemoteDebug

Post your device id or email so I can check the server logs.

sgrizzi commented 3 years ago

Hi Aruna, the issue reported by the activity log was due to a bad error cause by me – I inadvertently erased the software in the ESP32! Shame on me. I re-flashed the right code and the system was up and running quicky. The software has been tested rather thoroughly (I hope…) and has been working fine for over a month – I am also monitoring the serial output log and I do not see anything abnormal. My email is gabriele.rizzi@smartsol.it. If you could check logs of between today between 12am and 2pm CET, that would be great!

Regards, Gabriele

kakopappa commented 3 years ago

It seems you have a connection/reset issues. especially "vertical single" device, it has connected 762 times to the server followed by temperature V1(303 times), switch1 (248 times), switch2 (273 times)

sgrizzi commented 3 years ago

Hi Aruna, thanks.

Over what time frame have you seen these data? Could you send me a copy of the logs?

Vertical single is/has been the most used command, also for testing purposes. So are switch 1 and 2, even though for a shorter timeframe. Temperature is transmitted regularly – every two minutes unless it changes more frequently (unlikely).

Rgds, Gabriele

sgrizzi commented 3 years ago

Hi Aruna, just to further clarify my remarks. If you have counted 762 actions of "vertical single" over a month or so, then that can well be, as this device was the most used one in the development and initial testing phase. When this was up and running, then temperature and switch 1&2 were added, and this would also be in line with the number of actions you detected of the relevant devices. More recently additional devices were added to the system for a total of 18 devices. As of the beginning of December the full system has been running stable and tested randomly during the day - clearly, as part of the testing and additional development work, the ESP32 was turned on and off "consciously" in the last two weeks. Never did I notice weird behaviour apart from today, when the led's connected to the output of the switches started to turn on and off, not really randomly but as if someone was indeed switching them on and off. I was just staring at the system doing nothing. The ESP32 was connected and running properly. When I tried to control the system with my local Bluetooth interface, the ESP32 was working fine, and, for example, I could turn off the switches myself -and trigger other commands with Alexa-... then led's started to turn on again by themselves as before. After ca. 2pm the system went back to normal again and it is still working fine now. As you can imagine it would indeed be quite relevant for me to see a log of what has happened in the last few hours before 2pm today CET, whether the switch on/switch off commands were generated locally by my ESP32, or arrived from Alexa, or elsewhere... Led's were kind of toggling, nothing to do with a device restore action - at least not like those I have seen and tested so far.

kakopappa commented 3 years ago

@sgrizzi sorry about the late response and the inconvenience caused.

Going forward we will improve the "Activity Log" section with more details. To begin with, I noticed it's missing connected/disconnected status from each device and restore device status event when the status gets restored upon connecting to the server (if enabled).

In this next version update, this will be addressed.

image

sgrizzi commented 3 years ago

Hi Aruna, thanks for your feedback. For your information, as per now, my setup has been stable and has not displayed any unexpected problems. I would still be eager to analyze what did happen 6 days ago...

Yes, a more extensive and detailed activity log would definitely help!

I noticed from the activity log that when my setup is restarting, eg. after power fail, I get many errors notified, even though eventually the ESP32 works absolutely fine. It is just a problem I see in the startp phase.

My ESP is hosting 18 devices and in the startup phase I just add them one after the other SinricPro.add(DOORBELL_ID); SinricPro.add(DOORBELL2_ID); SinricPro.add(DOORBELL3_ID); ..... The 15-entry activity log gets full with these "errors". I am just wondering if the errors might be due to my code rushing all the add requests packed to the server. Would I need to include a delay between on "add" and the following one? if so, how much delay should I add to be safe?

kakopappa commented 3 years ago

@sgrizzi I have updated the server

  1. To show 200 log activities now instead of 15 for the last 3 days
  2. Connecting/Disconnecting and restoring state will be logged in to the activity log
sgrizzi commented 3 years ago
@kakopappa 1) great, 200 entries in the log are quite useful, but I am now missing the timestamp! The headings include IP ADDRESS LOCATION APP NAME ACTIVITY

but the timestamp is no longer there. Can I retrieve it somehow? 2) very good. Can you please let me know if I can just send "add requests" for the 18 devices, just one after the other, or I need to add a delay in between? Rgds, Gabriele

kakopappa commented 3 years ago

The timestamp is already there. here's what I am seeing..

image

try logging in incognito?

sgrizzi commented 3 years ago

yes, true. I found it. It is on the very far right but the horizontal scroll bar was not visible - you can see it when you scroll down the bottom of the log. Great improvenet with the log, thanks! If you have a moment, please also drop me a line on question 2.... I also have another question on different topic and I will open a separate issue.