Setup no name cheap IP wireless camera

Hi Guys.
Trying to connect cheap IP camera. Using generic camera intergration

Details about camera

Bosiwo 1080P Outdoor Security Camera,Compatible with Alexa,IP66 Waterproof WiFi Bullet Camera, Wireless IP Camera System with 82ft Night Vision,Motion

So, far no luck - I can see following error in logs.

2023-03-26 22:14:28.286 ERROR (stream_worker) [homeassistant.components.stream.stream.test_stream] Error from stream worker: Error opening stream (ERRORTYPE_111, Connection refused) rtsp://****:****@192.168.178.35

I have found this page https://www.makeuseof.com/how-to-control-cctv-camera-home-assistant/ and I was trying different end points to set up my camera. So far does not work :frowning:

Any Idea?

Have you considered reading the manual for the cam, and eventually describing in details, what you have done, and how , i.e config etc.
From the info provided i would say, wrong username, wrong password wrong IP, wrong port, wrong network

But most likely Wrong url, … Read the manual for the cam if you dont have one, google for it …

Hi, I can not find manual I know this brand could be clone of anything else. What I find is just how to connect to mobile app. I can connect using mobile app MIPC. I was trying to find anything useful in this app, just IP found, not even port. I guess port is 80 as I can login to app using browser.
Password/user are correct as I am using the same in mobile app. I guess URL is wrong, but not sure how can I google it to find out.

Regards

try with default rtsp port

trying but still the same issue;

2023-03-27 00:07:03.482 ERROR (stream_worker) [homeassistant.components.stream.stream.test_stream] Error from stream worker: Error opening stream (ERRORTYPE_111, Connection refused) rtsp://****:****@192.168.178.35:554

Read “Lesson learned 4”

Try the link below, it show how to connect to a “bosiwo” IP camera.

rtsp://username:[email protected]:554/live/ch00_0

https://camlytics.com/camera/chinese

1 Like

Thank you - looks like I can scrap this camera

2023-03-27 00:23:56.822 ERROR (stream_worker) [homeassistant.components.stream.stream.test_stream] Error from stream worker: Error opening stream (ERRORTYPE_111, Connection refused) rtsp://****:****@192.168.178.35:554/live/ch00_0

You can have it as an “external”, always good with alternativs if main system is unavailable, i have a D-Link that also seems locked to their APP, didn’t bother to investigate it further, so i just have it in the APP, And it actually works in Google-Home(D-Link - linked to Google-Home)

PS: And check your mobile-app, if there is somewhere something like a username/password for external ( I.E Camera-Account )

Camera Account is different from APP Account , As Camera Account is used for external access

Have you try ONVIF integration port 8000

Try nmap to see if it can guess the OS, which might give you a clue.

Other than that, stop buying crap!

I finally got my MIPC camera integrated as a feed in Home Assistant.

In my case, the camera didn’t expose a static URL that I could use as the stream URL. Luckily some genius created a GitHub repository that is able to get a temporary stream URI.

Even better, this repo can be installed by pip install:

  python -m pip install mipc_camera_client

Requirements

For this to work, you’ll need the following information:

  • Your camera’s IP. (Maybe check your router.)
  • The username for your camera.
  • This is the password for logging into the camera.

I was able to log into my camera at port 80. Hopefully, once you know the IP address of your camera, you’ll be able to set and test the username and password. Otherwise, try “admin” and “admin”.

The solution

Using go2rtc

To set this up, I add the following to my go2rtc config. (go2rtc can be installed via Add-ons).

streams:
  my_stream_name: echo:bash /config/get_dynamic_stream.sh

This configures a dynamic stream called “my_stream_name” and the value is retrieved dynamically by running a “get_dynamic_stream.sh” shell script (that I placed in my ~/config folder).

The Bash script

Installing the mipc_camera_client package takes time, so this script first assumes the package is installed.

Here’s the get_dynamic_stream.sh

!/bin/bash

# First attempt to run the script
python /config/get_dynamic_stream.py
if [ $? -eq 0 ]; then
    # The script succeeded!
    exit 0
else
    # If the script failed, install the package and try again
    python -m pip install mipc_camera_client >/dev/null 2>&1
    python /config/get_dynamic_stream.py
fi

If it’s can’t run the application successfully, it installs assumes the package needs to be installed and it installs the package and tries to run the Python script again.

The Python script

get_dynamic_stream.py looks like this:

from mipc_camera_client import MipcCameraClient

my_camera_ip = "" # Replace with your camera's IP. (Maybe check your router.)
my_camera_username = "" # The username for your camera. (This was on a sticker under my camera.)
my_camera_password = "" # (This is the password I used to log into my camera)

c = MipcCameraClient(my_camera_ip)
c.login(my_camera_username, my_camera_password)

uri = "ffmpeg:"  + c.get_rtmp_stream()

print(uri)

This is a pretty simple script that simply provides this 3rd-party package with the details it needs to perform its job.

Adding the camera feed to a dashboard

To display the camera feed on a dashboard, I used WebRTC Camera. (The link has details for installing the component in Home Assistant). Specifically, I’m using the webrtc-camera card.

cards:
  - type: custom:webrtc-camera
    url: my_stream_name

Specifically, the “URL” here is a documented feature of go2rtc, where it will look up “my_stream_name” in go2rtc config.

Conclusion

Here, we’re configuring a dynamic stream for a MIPC compatible camera using a couple of components:

  • The dashboard references a named stream in the go2rtc configuration.
  • go2rtc dynamically retrieves the stream URI by executing a bash script.
  • the bash script installs the prerequisite python package and runs the python code.
  • the python code programmatically retrieves the URI using a 3rd party python package.

Magic!

Good luck!