softScheck / tplink-smartplug

TP-Link WiFi SmartPlug Client and Wireshark Dissector
Apache License 2.0
1.15k stars 297 forks source link

Tplink KC100 spot ipcam #73

Open WhitecastlePT opened 4 years ago

WhitecastlePT commented 4 years ago

Tried to use this for KC100. I detected that port 9999 is also open in this device. But i can´t get it to work with the provided commands.

If i wanted to get the video stream from this cam without the need of the app. Think its possible ?

joshgetter commented 4 years ago

@WhitecastlePT - I was able to get local streaming to work following this walkthrough on Medium. I'm just having problems trying to control the camera (power on/off) via port 9999. Overall not a huge deal though.

WhitecastlePT commented 4 years ago

@WhitecastlePT - I was able to get local streaming to work following this walkthrough on Medium. I'm just having problems trying to control the camera (power on/off) via port 9999. Overall not a huge deal though.

Can you tell me what did you used to see the stream outside Kasa'a app ?

joshgetter commented 4 years ago

@WhitecastlePT - the last portion of the walkthrough contains the following snippet: curl -vv -k -u admin:YWRtaW4= --ignore-content-length "https://192.168.10.40:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd&deviceId= CAFEDEADBEAFCAFEDEADBEAFCAFEDEADBEAFCAFE" --output - | ffmpeg -y -i - test.mp4

Using this snippet (on a linux machine with Ffmpeg installed) I made the following modifications:

  1. Update the credentials The -u admin:YWRtaW4= portion of the command needs to be updated with your TP Link Kasa account credentials. Say my username is name@example.com and my password is mypassword. You need to Base64 encode the password. So mypassword becomes bXlwYXNzd29yZA==. This portion of the command now becomes -u name@example.com:bXlwYXNzd29yZA==
  2. I updated the referenced IP address to the IP address of the camera.
  3. I removed the &deviceId= CAFEDEADBEAFCAFEDEADBEAFCAFEDEADBEAFCAFE parameter from the request (since I didn't know what the deviceId was).

My final command was then: curl -vv -k -u name@example.com:bXlwYXNzd29yZA== --ignore-content-length "https://<CAMERAIPADDRESS>:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd" --output - | ffmpeg -y -i - test.mp4

This command will use cURL to make a request to the camera, and then pipe it out to FFmpeg which will write to the file test.mp4. After terminating the command I was able to open test.mp4 in VLC.

WhitecastlePT commented 4 years ago

Ok, only need to discover deviceID aswell...thx ;)

joshgetter commented 4 years ago

Oh perhaps I wasn't clear you can leave the deviceID parameter out. Hope it works for you!

WhitecastlePT commented 4 years ago

Sorry didn´t read the part "I removed the &deviceId=" sorry 👍

pepperagusa commented 10 months ago

Thanks @WhitecastlePT. This seems to stream the feed to an mp4 file. What about streaming a live view in the browser? Would that be possible?