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

Kasa KD110 unexpected EOF, exec: exit status 1 using kasa: protocol #666

Closed
duindain opened this issue Oct 3, 2023 · 11 comments
Closed
Labels
bug Something isn't working

Comments

@duindain
Copy link

duindain commented Oct 3, 2023

I'm trying to get a KD110 doorbell camera stream working but after some troubleshooting this is as far as I've managed to get
The go2rtc logs in Frigate are showing

Using the kasa protocol

go2rtc:
  streams:
    doorcam: 
      - "kasa://192.168.2.26:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd#header=Authorization: Basic ***[Base 64 encoded password the rebase64 encoded email]***"
      - "ffmpeg:doorcam#video=h264#audio=opus"

Logs from Frigate go2rtc panel

2023-10-03 07:27:04.704917922  [INFO] Preparing go2rtc config...
2023-10-03 07:27:04.862217433  [WARN] Using go2rtc binary from '/config/go2rtc' instead of the embedded one
2023-10-03 07:27:04.862221591  [INFO] Starting go2rtc...
2023-10-03 07:27:04.920456907  07:27:04.920 INF go2rtc version 1.7.1 linux/amd64
2023-10-03 07:27:04.920614674  07:27:04.920 INF [api] listen addr=0.0.0.0:1984
2023-10-03 07:27:04.920803279  07:27:04.920 INF [rtsp] listen addr=0.0.0.0:8554
2023-10-03 07:27:04.920898017  07:27:04.920 INF [webrtc] listen addr=0.0.0.0:8555/tcp
2023-10-03 07:27:11.058046652  07:27:11.057 WRN [rtsp] error="streams: unexpected EOF, exec: exit status 1" stream=doorcam
2023-10-03 07:27:14.705443818  [INFO] Starting go2rtc healthcheck service...
2023-10-03 07:27:16.171171378  07:27:16.171 WRN [rtsp] error="streams: unexpected EOF, exec: exit status 1" stream=doorcam
2023-10-03 07:30:55.918648675  07:30:55.918 WRN github.com/AlexxIT/go2rtc/internal/rtsp/rtsp.go:225 > error="write tcp 127.0.0.1:8554->127.0.0.1:55400: write: broken pipe"

Using httpx protocol

go2rtc:
  streams:
    doorcam: 
      - "httpx://192.168.2.26:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd#header=Authorization: Basic ***[Base 64 encoded password the rebase64 encoded email]***"
      - "ffmpeg:doorcam#video=h264#audio=opus"

Logs from Frigate go2rtc panel

2023-10-03 11:01:00.637870061  [INFO] Preparing go2rtc config...
2023-10-03 11:01:00.787348335  [WARN] Using go2rtc binary from '/config/go2rtc' instead of the embedded one
2023-10-03 11:01:00.787352763  [INFO] Starting go2rtc...
2023-10-03 11:01:00.842915217  11:01:00.842 INF go2rtc version 1.7.1 linux/amd64
2023-10-03 11:01:00.843092070  11:01:00.843 INF [api] listen addr=0.0.0.0:1984
2023-10-03 11:01:00.843282649  11:01:00.843 INF [rtsp] listen addr=0.0.0.0:8554
2023-10-03 11:01:00.843390602  11:01:00.843 INF [webrtc] listen addr=0.0.0.0:8555/tcp
2023-10-03 11:01:10.637929906  [INFO] Starting go2rtc healthcheck service...
2023-10-03 11:01:17.207386753  11:01:17.207 WRN [rtsp] error="streams: 503 Service Unavailable, exec: exit status 1" stream=doorcam
2023-10-03 11:01:27.426669962  11:01:27.426 WRN [rtsp] error="streams: 503 Service Unavailable, exec: exit status 1" stream=doorcam
2023-10-03 11:01:47.869354151  11:01:47.869 WRN [rtsp] error="streams: 503 Service Unavailable, exec: exit status 1" stream=doorcam
2023-10-03 11:02:08.310245649  11:02:08.310 WRN [rtsp] error="streams: 503 Service Unavailable, exec: exit status 1" stream=doorcam
2023-10-03 11:02:18.529978830  11:02:18.529 WRN [rtsp] error="streams: 503 Service Unavailable, exec: exit status 1" stream=doorcam
2023-10-03 11:02:33.861532181  11:02:33.861 WRN [rtsp] error="streams: 503 Service Unavailable, exec: exit status 1" stream=doorcam
2023-10-03 11:02:33.861601962  11:02:33.861 WRN github.com/AlexxIT/go2rtc/internal/rtsp/rtsp.go:225 > error="write tcp 127.0.0.1:8554->127.0.0.1:60722: write: broken pipe"
2023-10-03 11:02:54.311966193  11:02:54.311 WRN [rtsp] error="streams: 503 Service Unavailable, exec: exit status 1" stream=doorcam

I originally was trying to resolve this on the Frigate github with this issue blakeblackshear/frigate#8020
theres more details there, the camera stream works correctly if I use scrypted in home assistant with ffmpeg camera plugin with this command
-headers "Authorization: Basic ***[Base 64 encoded password the rebase64 encoded email]***" -f h264 -i https://192.168.2.26:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd

I've tried to not use the audio config by removing it but that didn't help unfortunately

@AlexxIT AlexxIT added the bug Something isn't working label Oct 5, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Oct 5, 2023

I need access to stream (19443 port)
https://github.com/AlexxIT/go2rtc/wiki/Tunnel-RTSP-camera-to-Intenet

@duindain
Copy link
Author

duindain commented Oct 7, 2023

Hi @AlexxIT I sent you a message on telegram so i could securely send you the link, not sure if its you yet as you didnt respond yet :)

@AlexxIT
Copy link
Owner

AlexxIT commented Oct 7, 2023

Haven't seen any messages. Maybe you sent to someone else

@duindain
Copy link
Author

duindain commented Oct 7, 2023

Resolved by @AlexxIT looks like it was not happy with the authentication header and Alex was able to have it working correctly using username:base64encodedpassword in the url

Its now working in Frigate correctly, ty

@duindain duindain closed this as completed Oct 7, 2023
@alexanderjacuna
Copy link

@duindain So would this be the correct syntax for the Kasa doorbell? I have the Kasa KD110 and trying to get this thing to work with Frigate. Curious what your's ended up looking like in the end.

go2rtc:
  streams:
    doorbell:
      kasa: kasa://user:[email protected]:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd

@duindain
Copy link
Author

duindain commented Oct 12, 2023

My current config for that camera is

go2rtc:
  streams:
    doorcam: 
      - "kasa://user%40hotmail.com:[email protected]:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd"
      - "ffmpeg:doorcam#video=h264#audio=copy"

Camera config


cameras:
  doorcam:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/doorcam?video=copy&audio=copy
          roles:
            - detect   
            - record
    detect:
      width: 1920
      height: 1080

Its working well for the stream, the audio doesn't work, I've tried a few combinations for that so far without luck

I also needed to add the override for updated go2rtc in my docker-compose.yml another volume

  • /home/user/Software/Scripts/docker/frigate/config/go2rtc:/config/go2rtc

And that file is the latest go2rtc which i can see in the logs in frigate and docker is being applied for the kasa protocol to work

@AlexxIT
Copy link
Owner

AlexxIT commented Oct 13, 2023

You don't need video in second (ffmpeg) line

@duindain
Copy link
Author

Yep
"ffmpeg:doorcam#audio=copy"
seems to not affect the stream

@alexanderjacuna
Copy link

alexanderjacuna commented Oct 14, 2023

Not sure I am doing this correctly. Going off of @duindain 's example the error log is reporting an unsupported scheme. I have tried setting my email to use both "[email protected]" and "user%40gmail.com" with the same results.

2023-10-14 06:38:06.182969452  [2023-10-14 06:38:06] frigate.app                    INFO    : Camera processor started for doorcam: 1216
2023-10-14 06:38:06.182972424  [2023-10-14 06:38:06] frigate.app                    INFO    : Capture process started for doorcam: 1218
2023-10-14 06:38:06.200064733  [2023-10-14 06:38:06] detector.coral                 INFO    : Starting detection process: 1213
2023-10-14 06:38:06.200276474  [2023-10-14 06:38:06] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as pci:0
2023-10-14 06:38:06.200367366  [2023-10-14 06:38:06] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2023-10-14 06:38:06.206809509  06:38:06.206 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: kasa://user%40gmail.com:[email protected]:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd" url=kasa://user%40gmail.com:[email protected]:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd
2023-10-14 06:38:06.211272346  06:38:06.211 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: kasa://user%40gmail.com:[email protected]:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd" url=kasa://user%40gmail.com:[email protected]:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd
2023-10-14 06:38:11.317079239  [2023-10-14 06:38:11] frigate.video                  ERROR   : doorcam: Unable to read frames from ffmpeg process.
2023-10-14 06:38:11.317088678  [2023-10-14 06:38:11] frigate.video                  ERROR   : doorcam: ffmpeg process is not running. exiting capture thread...
2023-10-14 06:38:11.320394019  06:38:11.320 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="exec: exit status 1" url=ffmpeg:doorcam#video=h264#audio=copy
2023-10-14 06:38:11.320535166  06:38:11.320 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: kasa://user%40gmail.com:[email protected]:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd" url=kasa://user%40gmail.com:[email protected]:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd
2023-10-14 06:38:11.325823765  06:38:11.325 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="unsupported scheme: kasa://user%40gmail.com:[email protected]:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd" url=kasa://user%40gmail.com:[email protected]:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd

Below is my config.yml

mqtt:
  enabled: False

timestamp_style:
  format: "%Y/%m/%d %H:%M:%S"

detectors:
  coral:
    type: edgetpu
    device: pci:0

objects:
  track:
    - person

record:
  enabled: True

snapshots:
  enabled: True

rtmp:
  enabled: False

go2rtc:
  streams:
    doorcam: 
      - "kasa://user%40gmail.com:[email protected]:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd"
      - "ffmpeg:doorcam#video=h264#audio=copy"

cameras:
  doorcam:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/doorcam?video=copy&audio=copy
          roles:
            - detect
            - record
    detect:
      width: 1920
      height: 1080

@alexanderjacuna
Copy link

I'll open up another issue as this seems like a different issue that then original.

@AlexxIT
Copy link
Owner

AlexxIT commented Oct 14, 2023

Unsupported scheme is about old version of go2rtc without this source support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants