Skip to content
This repository has been archived by the owner on Nov 5, 2020. It is now read-only.

Trying to work with a WyzeCam -- user/pass supported? #1

Closed
walthowd opened this issue Apr 7, 2020 · 6 comments
Closed

Trying to work with a WyzeCam -- user/pass supported? #1

walthowd opened this issue Apr 7, 2020 · 6 comments

Comments

@walthowd
Copy link

walthowd commented Apr 7, 2020

Trying to get this going with a Wyze Cam using their RTSP firmware.

Here is my conf:

server:
  # supported protocols
  protocols: [ tcp, udp ]
  # port of the RTSP TCP listener
  rtspPort: 8554
  # port of the RTP UDP listener
  rtpPort: 8050
  # port of the RTCP UDP listener
  rtcpPort: 8051

streams:
  # name of the stream
  nursery:
    # url of the source stream
    url: 'rtsp://user:password@192.168.1.79/live'
    # whether to receive this stream in udp or tcp
    useTcp: no 

And here is the ouput I get:

/opt/rtsp-proxy$ ./rtsp-simple-proxy conf.yml 
2020/04/07 16:05:05 rtsp-simple-proxy v0.2.10
2020/04/07 16:05:05 [UDP/RTP listener] opened on :8050
2020/04/07 16:05:05 [UDP/RTCP listener] opened on :8051
2020/04/07 16:05:05 [TCP listener] opened on :8554
2020/04/07 16:05:05 [STREAM nursery] initializing with protocol udp
2020/04/07 16:05:05 [STREAM nursery] ERR: SETUP returned code 404
2020/04/07 16:05:10 [STREAM nursery] initializing with protocol udp
2020/04/07 16:05:10 [STREAM nursery] ERR: SETUP returned code 404

The same RTSP url works fine in VLC. I've also tried the URL without quotes and double-quotes. Also tried TCP mode.

Any tips?

@aler9
Copy link
Owner

aler9 commented Apr 9, 2020

Hi, the RTSP protocol is not implemented in the same way in all the cameras, servers, etc, but it differs slightly, mainly in cameras, since cameras have very low computational power and must use lightweight implementations. Your camera probably uses a RTSP format that this library can't deal with yet, while VLC uses the LIVE555 library to open RTSP streams, that is more versatile and probably is able to communicate with your camera.

To solve this problem, it would be helpful to have a network dump, that you can generate in this way:

  1. install Wireshark
  2. open Wireshark and start capturing packets on the Network interface you use to communicate with your camera
  3. open the RTSP stream with VLC
  4. stop the Wireshark capture and save it in .pcap format
  5. repeat the process, but this time use rtsp-simple-proxy

Attach both files.

Thanks

@walthowd
Copy link
Author

walthowd commented Apr 9, 2020

Thank you, attached are the PCAP captures. One with VLC and two with rtsp-simple-proxy (one in UDP mode and one in TCP mode)

wyze-rtsp-streams.zip

Peeking in them a bit, it does look like Wyze is using LIVE555 library on the cameras to provide the stream -- and for some reason it really is 404'ing when trying to get the URI.

@aler9
Copy link
Owner

aler9 commented Apr 10, 2020

Hi, this should be fixed in fa01182 and v0.2.11: the proxy was ignoring the control attribute, sent by the camera, that dictates how to build the SETUP request, that was obviously failing.
Let me know if it worked. Thanks.

@walthowd
Copy link
Author

Thank you, that's quite an extensive bit of hacking to churn out in such a short time, wow!

It does get a bit farther but still fails with a RTSP code of 454.

A PCAP is attached.

wyze-rtsp-stream-from-rtsp-simple-proxy-release-0-2-11.zip

@aler9
Copy link
Owner

aler9 commented Apr 10, 2020

Hi, this should be fixed in a4bd1df and v0.2.12: the problem was that the proxy didn't supported session headers with timeouts, like the one your camera was sending in the SETUP reply:

Session: C540B07E;timeout=65

so the proxy was sending this wrong header in all subsequent requests:

Session: C540B07E;timeout=65

while it now sends the correct one:

Session: C540B07E

Thank you, that's quite an extensive bit of hacking to churn out in such a short time, wow!

well, this is my job so i try to do it the best i can :)

let me know if it finally works.

@walthowd
Copy link
Author

It's.....WORKING!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants