AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
7.27k stars 524 forks source link

Fix support Tapo C210 firmware v1.3.9 #733

Closed mickaelmarin closed 1 year ago

mickaelmarin commented 1 year ago

Hi,

All is in the title, since firmware update of camera the authentication not work anymore.

I use this in the go2rtc.yaml file:

streams:
  camera.salon:
    - rtsp://<user>:<pass>@192.168.1.152/stream1
    - tapo://<cloud password md5 hash upercase>@192.168.1.152

thanks

seydx commented 1 year ago

Factory reset camera / readd to tapo app, there is a bug in camera for some users where it does not properly load the new password hash.

See https://github.com/JurajNyiri/pytapo/issues/80

JurajNyiri commented 1 year ago

While above is true, there might be more work needed on go2rtc, see https://github.com/JurajNyiri/pytapo/pull/76 .

Also, use sha256 hash not md5 anymore.

mickaelmarin commented 1 year ago

thanks @JurajNyiri, after replace md5 by sha256 it work

AlexxIT commented 1 year ago

I need remote access to this camera to fix it.

kksligh commented 1 year ago

Confirming that I also used the sha256 hash instead of the md5 - stopped the errors and the camera works with sounds - however, the 2 way audio no longer works.

I have 2 of the same Tapo C211 cameras, with the exact same config, but one has Firmware: 1.3.9 Build 231019 (not working) and the other has Firmware: 1.3.7 Build 230823 (working)

I'm willing to help in any way you need.

mickaelmarin commented 1 year ago

I have tapo c210 with 1.3.9 firmware un two way audio work. You need to add microphone in the media setting of webrtc-camera card.

media: video,audio,microphone

the conf of stream in go2rtc.yaml:

streams:
  camera.salon:
    - tapo://admin:<cloud password sha256 hash upercase>@192.168.1.152
AlexxIT commented 1 year ago

So this method worked for you?

streams:
  # cloud password without username
  camera1: tapo://cloud-password@192.168.1.123
  # admin username and UPPERCASE MD5 cloud-password hash
  camera2: tapo://admin:MD5-PASSWORD-HASH@192.168.1.123
  # Tapo C210 with firmware 1.3.9+
  camera3: tapo://admin:SHA256-PASSWORD-HASH@192.168.1.123

PS. I still need to understand the difference of which password to use for the camera1 example

mickaelmarin commented 1 year ago

yes for me with tapo c210 1.3.9 firmware the method below work:

streams:
  camera.salon:
    - tapo://admin:<cloud password sha256 hash upercase>@192.168.1.152

I use homeassistant latest and the webrtc v3.5.0 HACS integretion. With the custom webrtc-camera card I have no problem(2audio work perfect). In the webrtc-card I used rtsp://admin:<my password defined in go2rtc.yaml>@<ip of my homeassistant rpi4>/camera.salon

The only limitation is I can't turnoff the microphone directly from homeassistant, I need to go in browser settings to forbiden the microphone for the site. Honestly it is a detail!!!!

kksligh commented 1 year ago

can you provide your card code? 2 way is not working for me and i have all these settings exactly.

mickaelmarin commented 1 year ago

This is the conf, for ptz I added cam as onvif integration and use that for ptz

  - type: custom:webrtc-camera
    ui: true
    url: rtsp://(go2rtc user):(go2rtc pass)@(rpi4 ip where go2rtc run)/camera.salon
    mode: webrtc
    mse: false
    media: video,audio,microphone
    ptz:
      service: onvif.ptz
      data_left:
        entity_id: camera.cam1_onvif_mainstream
        pan: LEFT
        distance: 0.15
      data_right:
        entity_id: camera.cam1_onvif_mainstream
        pan: RIGHT
        distance: 0.15
      data_up:
        entity_id: camera.cam1_onvif_mainstream
        tilt: UP
        distance: 0.15
      data_down:
        entity_id: camera.cam1_onvif_mainstream
        tilt: DOWN
        distance: 0.15

If you have a problem when you add camera as tapo intregration you should restart your camera. At the begening not work but after restart my cam and add cam to tapo integration with local user user pass and the cloud pass everything work. I think firmware of cam is little buggy.

kksligh commented 1 year ago

OK - the audio comes through, but I dont see any way to cut the mic on or off - as soon as it loads, it starts. How are you working around that? Also, any idea how I can get this to work with Frigate Card?

mickaelmarin commented 1 year ago

For now the only solution for me is using firefox/chrome/edge on android (not the HA app) and from there you can block the microphone or not.

AlexxIT commented 1 year ago
  1. url params in card should be stream name, example camera.salon
  2. Example how to make mic optional right in the webrtc integration docs
kksligh commented 1 year ago

what do you mean optional? Currently, it just starts with the mic open and there's no way to turn it off. Is there configuration to have the mic off upon the stream load and toggle on/off? I've tried this with the Frigate card mic button, and for some reason the two way audio doesnt work at all anymore.

AlexxIT commented 1 year ago

https://github.com/AlexxIT/go2rtc/releases/tag/v1.8.3