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

Axis integration, motion sensors randomly stops reporting #56129

Closed
klim123123 opened this issue Sep 12, 2021 · 11 comments
Closed

Axis integration, motion sensors randomly stops reporting #56129

klim123123 opened this issue Sep 12, 2021 · 11 comments

Comments

@klim123123
Copy link

The problem

I have added AXIS M7011 camera with 3x motion sensors using AXIS integration.
Randomly 1-12h, all 3x motion sensors stopping reporting any motion. On the same time, camera stream works fine.
If i make Reload of integration, motion sensors works again for 1-12 hours.

Later i installed second test HA on another machine and connected AXIS M7011. Motion sensors works for weeks without any problems (same camera).

Please help, how to debug this?

What is version of Home Assistant Core has the issue?

core-2021.9.6

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Axis

Link to integration documentation on our website

https://www.home-assistant.io/integrations/axis

Example YAML snippet

No response

Anything in the logs that might be useful for us?

In log i can see only this connected with AXIS

Logger: aiohttp.server
Source: components/axis/config_flow.py:264
First occurred: 01:33:40 (1 occurrences)
Last logged: 01:33:40

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 89, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 144, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 190, in post
    return await super().post(request)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 63, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 72, in post
    result = await self._flow_mgr.async_init(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 153, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 179, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data, init_done)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 260, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/axis/config_flow.py", line 232, in async_step_init
    return await self.async_step_configure_stream()
  File "/usr/src/homeassistant/homeassistant/components/axis/config_flow.py", line 264, in async_step_configure_stream
    if not video_source["

Additional information

No response

@probot-home-assistant
Copy link

axis documentation
axis source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @Kane610, mind taking a look at this issue as it has been labeled with an integration (axis) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@Kane610
Copy link
Member

Kane610 commented Sep 12, 2021

Can you enable debug logging for axis integration per integration documentation and share logs from startup to when the connection drops?

@klim123123
Copy link
Author

Sorry, if i'm doing something wrong. This is my 1st time.
19:52 restarted integration, motion sensor started working
20:02 first motion
21:00 last motion detected and after there is no more motion in logs.
it was motion at 21:10 and 21:38. but not detected here.
(but detected on other HA with same axis integration)

log.txt

@Kane610
Copy link
Member

Kane610 commented Sep 19, 2021

Your log show there are still events reported

Motion detected
2021-09-12 21:10:52 DEBUG (MainThread) [axis.event_stream] {'topic': 'tnsaxis:CameraApplicationPlatform/VMD/Camera1Profile1', 'operation': 'Changed', 'type': 'active', 'value': '1'}

Motion detection timer ended
2021-09-12 21:10:57 DEBUG (MainThread) [axis.event_stream] {'topic': 'tnsaxis:CameraApplicationPlatform/VMD/Camera1Profile1', 'operation': 'Changed', 'type': 'active', 'value': '0'}

you can see by the value: 1 or 0 what is reported

@Kane610
Copy link
Member

Kane610 commented Sep 19, 2021

Also something happened with the connection at 21:38

2021-09-12 21:38:27 DEBUG (MainThread) [axis.rtsp] Received data ['RTSP/1.0 454 Session Not Found', 'CSeq: 4', 'Server: GStreamer RTSP server', 'Date: Sun, 12 Sep 2021 18:38:26 GMT', ''] from 192.168.1.220

Do you observe the "454 Session Not Found" message at other times when sensors stop reporting?

Are messages such as [axis.rtsp] OPTIONS rtsp://192.168.1.220 repeatng after the 21:12 timestamp?
And are they responded with a [axis.rtsp] Received data ['RTSP/1.0 200 OK', 'CSeq: 4',

@klim123123
Copy link
Author

Sorry, i edited this log by hand, may be missed something. Here is the full new log with axis lines.
https://pastebin.com/U2KifYvm
01:41 restarted plugin
01:23:44 Detected motion
01:24:03 last motion trigger - Cleared (no motion detected)
08:32:45 - no trigger. but it was motion.
08:45:19 - no trigger. but it was motion.

On the same time, it's working fine on second HA.

@Kane610
Copy link
Member

Kane610 commented Sep 26, 2021

Thanks! I guess its related to this Kane610/axis#18 the M7011 is also running 6.50 so I guess its a 6.50 firmware issue. IIRC there has only been two reports of this issue, I don't know if its related to system clock drifting between the camera and hass. You could double check that you're router is handing out proper NTP addresses.

Regardless I will need to look into properly manage this 454 session not found error

I can't promise when I will get to it though

@klim123123
Copy link
Author

In Kane610/axis#18 i see "HA would never contact the camera again no matter how many times I restarted HA or the camera."
But in my case, if i restart integration, it will work again for some time.

On the same time, my second test HA works fine(connected to the same axis camera). I did not restart it for month. No problems with axis intergration and same axis camera.

@Kane610
Copy link
Member

Kane610 commented Oct 1, 2021

@klim123123 as I can't promise when exactly I would fix this I suggest you report this issue to Axis customer support to attack this issue from two sides. Even though I will add support to handle the 454 error the error shouldn't happen in the devices in the first place.

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Dec 30, 2021
@github-actions github-actions bot closed this as completed Jan 6, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants