Tsar
(Christian)
January 5, 2022, 7:33am
1
I’m integrated my foscam camera’s like this
# FI9826W/FI9826P
- platform: foscam
name: camera_gang
ip: 192.168.1.102
port: 2002
username: !secret camera_gang_login
password: !secret camera_gang_psw
# FI9900P
- platform: foscam
name: camera_garage
ip: 192.168.1.103
port: 2003
username: !secret camera_garage_login
password: !secret camera_garage_psw
...
Added these to a card and it works fine
But when changing the camera view to “live” I get an error
I think the problem is the port…why is he using 554 instead of 2003 ?
Port 554 is the RTSP port used for streaming video. This is the default port, but apparently the foscam integration also tries to fetch the port from the camera itself.
The port that you configured when setting up the camera (here: 2003) is the port of the camera’s web UI (HTTP).
Tsar
(Christian)
January 5, 2022, 8:22am
3
And how can I resolve this, maybe replacing the port 2003 with 554 ?
Tsar:
how can I resolve this
Not sure. The error message indicates that the camera’s RTSP stream is not available, so that’s where I would start trouble-shooting, for example:
Try open that URL (of course with username and password) in VLC, just to see if there is a stream or not.
If there is no stream, check the camera’s configuration and make sure that RTSP is enabled and the port configured is actually 554.
Are you by any chance running Home Assistant 2021.2?
opened 02:21AM - 04 Feb 21 UTC
closed 09:39PM - 05 Feb 21 UTC
integration: foscam
**The problem**
I have four FOSCAM cameras, (two R2Ms, one C2M and one FI9853… EP which is PoE). All four cameras were migrated properly during the first boot of 2021.02.00, and the preview (thumbnails) for all four appear in Lovelace. When clicking on the FI9853EP, the video panel opens and after a few seconds the video is displayed. However, after clicking on one of the thumbnails from the R2Ms or the CM2 to see the actual live stream, the UI changes to show the video, but the actual video does not appear, even after two minutes. Going to the LOG, I can see an error message like the one below for each time I clicked on the R2Ms or CM2 preview:
2021-02-03 20:43:01 ERROR (stream_worker) [libav.tcp] Connection to tcp://192.168.1.10:554?timeout=5000000 failed: Connection refused
2021-02-03 20:43:01 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream rtsp://USER:PASSWORD@IPADDRESS:554/videoMain
No change was done to the cameras, or network. I can connect to the cameras web UI, and their video is working correctly. My expectation is that once the thumbnail is clicked, live video should start in a couple of seconds, especially because these cameras have the "preload" option checked.
Thanks in advance for your help!
**What is version of Home Assistant Core has the issue?**
2021.02.00
**What was the last working version of Home Assistant Core?**
2021.01.05
**What type of installation are you running?**
Home Assistant OS
**Integration causing the issue**
FOSCAM
**Link to integration documentation on our website**
https://www.home-assistant.io/integrations/foscam
**Example YAML snippet**
```yaml
# - platform: foscam
# name: Family
# ip: 192.168.1.12
# rtsp_port: 88
# username: !secret cameras_username3
# password: !secret cameras_password3
# This YAML is no longer in use, as per the instructions, these lines were commented after migrating to 2021.02.00
```
**Anything in the logs that might be useful for us?**
```txt
# Put your logs below this line
2021-02-03 20:43:01 ERROR (stream_worker) [libav.tcp] Connection to tcp://192.168.1.10:554?timeout=5000000 failed: Connection refused
2021-02-03 20:43:01 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream rtsp://USER:[email protected] :554/videoMain
```
After the migration to 2021.02.0, cameras showed their thumbnails properly (image obscured for privacy):
![image](https://user-images.githubusercontent.com/32140109/106835505-71171400-6665-11eb-831b-311436f3c55b.png)
But after I clicked on them to see the actual live video, the error message above appears in the log, and nothing is displayed:
![image](https://user-images.githubusercontent.com/32140109/106835658-b63b4600-6665-11eb-8f24-c2e6e70ae8f0.png)
Also, I think configuration of foscam
was moved to the UI, so maybe changes made to your yaml configuration won’t be applied.
Tsar
(Christian)
January 5, 2022, 12:13pm
6
I opened a stream in VLC using rtsp://username:pwd@IP address: RTSP port/videoMain
And yes, I have a stream…using port 2003
I saw indeed the depreciation of declaring the foscam’s in yaml, so I deleted everything and did it via the UI like this
And yes, problem solved !
The only thing is now that in the modus “live” the image is not always smooth, sometimes there are a few seconds in between the images.
That’s configuration stuff of the camera…any suggestions on that ?
2 Likes