Netatmo outdoor camera stops working after a couple hours

I’ve tried by both deactivating the glance card and reinstalling the integration.
The issue will come back in just a few hours after restart.

This is what I have in the logs:

2022-01-30 19:00:01 WARNING (stream_worker) [libav.https] HTTP error 403 Forbidden
2022-01-30 19:00:01 WARNING (stream_worker) [libav.hls] keepalive request failed for 'https://prodvpn-eu-5.netatmo.net/restricted/...'  with error: 'Server returned 403 Forbidden (access denied)' when parsing playlist

2022-01-30 19:00:01 WARNING (stream_worker) [libav.https] HTTP error 403 Forbidden
2022-01-30 19:00:01 WARNING (stream_worker) [libav.hls] Failed to reload playlist 0
2022-01-30 19:00:02 WARNING (stream_worker) [libav.https] HTTP error 403 Forbidden
2022-01-30 19:00:02 WARNING (stream_worker) [libav.hls] Failed to reload playlist 0

2022-01-30 19:00:02 ERROR (stream_worker) [homeassistant.components.stream] Error from stream worker: Stream ended; no additional packets

2022-01-30 19:00:02 WARNING (stream_worker) [libav.hls] keepalive request failed for 'https://prodvpn-eu-2.netatmo.net/restricted/...' with error: 'Server returned 403 Forbidden (access denied)' when parsing playlist

I have https enabled through let’s encrypt, with ip-ban enabled (but I use to have the same configuration even before, when everything worked). Here’s what that looks like in my configuration file

http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  ip_ban_enabled: true
  login_attempts_threshold: 5

That “Server returned 403 Forbidden (access denied)” made me think that it could be related to this but, as said, I’ve been using this configuration since the beginning and I can’t see any banned ip.

Is there a way to show the cameras via some integrations, rather than using the stream component?

I strongly suggest to integrate the cameras into your lovelace dashboard using the Picture Entity Card.

That’s what I’ve been using then.
The issue didn’t fix even with the new HA update.
I’ll try to reboot my cameras again, hoping to be luckier, as I don’t know what to do anymore

I also get this kind of error in the logs:

2022-02-03 15:08:33 WARNING (stream_worker) [libav.mpegts] Packet corrupt (stream = 0, dts = 2777368698)
2022-02-03 15:08:33 WARNING (stream_worker) [libav.mpegts] .

Can you tell me a bit more about your setup? What hardware do you run HA on? What kind of installation?

I run it on a Raspberry Pi 4, with 8GB RAM and 32GB Micro SD (SanDisk MAX Endurance).
I’ve installed it following the instruction for Raspberry Pi installation here: Raspberry Pi - Home Assistant
Something I didn’t say explicitly is that, when I reboot the cameras, both my router and HA instance will reboot as well (as they’re all attached to my house’s power). Does that matter?

Even after other reboots and with HA updated to the last current version, the cameras are still not working.
This is the situation in the logs:

Logger: libav.mpegts
Source: components/stream/worker.py:349
First occurred: 19:32:31 (938 occurrences)
Last logged: 19:49:27

Packet corrupt (stream = 0, dts = 6594887066)
.
Packet corrupt (stream = 0, dts = 6595067066)
Packet corrupt (stream = 0, dts = 6595247066)
Packet corrupt (stream = 0, dts = 6595427066)
Logger: libav.mp4
Source: components/stream/worker.py:225
First occurred: 19:36:41 (3 occurrences)
Last logged: 19:44:36

dimensions not set
Logger: libav.hls
Source: components/stream/worker.py:448
First occurred: 19:34:48 (13 occurrences)
Last logged: 19:44:36

Error when loading first segment 'https://prodvpn-eu-5.netatmo.net/restricted/...'
skipping 14 segments ahead, expired from playlists
keepalive request failed for 'https://prodvpn-eu-5.netatmo.net/restricted/...' with error: 'I/O error' when opening url, retrying with new connection
keepalive request failed for 'https://prodvpn-eu-5.netatmo.net/restricted/...' with error: 'I/O error' when opening url, retrying with new connection
Could not find codec parameters for stream 0 (Video: h264 ([27][0][0][0] / 0x001B), none): unspecified size Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Logger: libav.tls
Source: components/stream/worker.py:448
First occurred: 19:34:48 (3 occurrences)
Last logged: 19:44:07

The specified session has been invalidated for some reason.
Logger: homeassistant.components.stream.stream.camera.netatmo_ingresso
Source: components/stream/__init__.py:340
Integration: Stream (documentation, issues)
First occurred: 19:34:07 (6 occurrences)
Last logged: 19:42:56

Error from stream worker: Error demuxing stream: [Errno 1414092869] Immediate exit requested: 'https://prodvpn-eu-5.netatmo.net/restricted/...'; last error log: [tls] The specified session has been invalidated for some reason.
Error from stream worker: Stream ended; no additional packets
Error from stream worker: Error opening stream (EXIT, Immediate exit requested) https://prodvpn-eu-5.netatmo.net/restricted/...
Logger: libav.hls
Source: components/stream/worker.py:349
First occurred: 19:32:39 (9 occurrences)
Last logged: 19:42:48

keepalive request failed for 'https://prodvpn-eu-5.netatmo.net/restricted/...' with error: 'I/O error' when opening url, retrying with new connection
skipping 14 segments ahead, expired from playlists
keepalive request failed for 'https://prodvpn-eu-5.netatmo.net/restricted/...' with error: 'I/O error' when opening url, retrying with new connection
skipping 25 segments ahead, expired from playlists
keepalive request failed for 'https://prodvpn-eu-5.netatmo.net/restricted/...' with error: 'I/O error' when opening url, retrying with new connection```
Logger: libav.tls
Source: components/stream/worker.py:349
First occurred: 19:33:35 (3 occurrences)
Last logged: 19:42:48

The specified session has been invalidated for some reason.
Logger: libav.h264
Source: components/stream/worker.py:448
First occurred: 19:35:17 (4 occurrences)
Last logged: 19:41:25

error while decoding MB 86 17, bytestream -5
error while decoding MB 96 54, bytestream -5
Invalid NAL unit 0, skipping.
error while decoding MB 83 36, bytestream -5
Logger: libav.extract_extradata
Source: components/stream/worker.py:448
First occurred: 19:41:25 (1 occurrences)
Last logged: 19:41:25

Invalid NAL unit 0, skipping.
Logger: libav.hls
Source: components/stream/worker.py:372
First occurred: 19:38:25 (2 occurrences)
Last logged: 19:38:25

skipping 18 segments ahead, expired from playlists
keepalive request failed for 'https://prodvpn-eu-5.netatmo.net/restricted/...' with error: 'I/O error' when opening url, retrying with new connection
Logger: libav.tls
Source: components/stream/worker.py:372
First occurred: 19:38:25 (1 occurrences)
Last logged: 19:38:25

The specified session has been invalidated for some reason.

Not sure if this could be of any help

Any clue on what the problem could be?

Unfortunately not. Right now I’m out of idea, sorry.

1 Like

Hello, have you encountered anyone with a similar issue in this period and managed to fix it?
If that is not the case, I was wondering if it’s possible to show the cameras without using the default stream worker component, to check if the issue persists.

I have a Xiaomi camera and I’m going through this problem too. From what I understood, the stream_address expires and keeps changing. That’s why you get

2022-01-30 19:00:01 WARNING (stream_worker) [libav.https] HTTP error 403 Forbidden
2022-01-30 19:00:01 WARNING (stream_worker) [libav.hls] Failed to reload playlist 0

After some time the stream address expires. In my case, the Xiaomi integration refresh the link after 4.5 minutes and updates the stream_address state in the camera entity. But the dashboard/camera card doesn’t see this update, and keeps trying to pull the stream from the expired source, thus throwing this 403 error. I still don’t know how to fix it.

In my case, I managed to restart the cameras without turning off the router as well (that was a pain in the butt, as this kind of cameras doesn’t have a switch and are directly attached to the home electrical system) and it solved the problem.
The issue eventually came back once, but I’ve fixed it in the same way.