kroo / wyzecam

Python package for streaming video from wyze cameras over the local network
https://kroo.github.io/wyzecam/
MIT License
178 stars 15 forks source link

Stopped working after updating firmware #89

Open gluedots opened 3 years ago

gluedots commented 3 years ago

🐛 Bug Report

Was working great until I updated the firmware.

Now I get: wyzecam.tutk.tutk.TutkError: IOTC_ER_CAN_NOT_FIND_DEVICE

🔬 How To Reproduce

Steps to reproduce the behavior:

Update camera firmware in app

Code sample

Environment

python --version

Screenshots

📈 Expected behavior

📎 Additional context

github-actions[bot] commented 3 years ago

Hello @gluedots, thank you for your interest in our work!

If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

kroo commented 3 years ago

thanks @gluedots; to confirm, which version of the firmware is your camera on now?

gluedots commented 3 years ago

It's a v2 on 4.9.7.798

mrlt8 commented 3 years ago

I believe this is due to DTLS being enabled on the newer firmware to patch the recent security vulnerability in tutk.

You can see which of the cameras have DTLS enabled with:

import wyzecam
auth_info = wyzecam.login(email,password)
for device in wyzecam.api.get_homepage_object_list(auth_info)["device_list"]:
    print(f"{device['nickname']:15} v.{device['firmware_ver']} DTLS: {device['device_params']['dtls']}")
mrlt8 commented 3 years ago

This should generate the authkey, but I think you'd still need tutk 3.1.10+ to make the connection...

key = self.camera.enr + self.camera.mac.upper()
hash = hashlib.sha256(key.encode())
bArr = bytearray(hash.digest())[0:6]
authKey = base64.standard_b64encode(bArr).decode().replace('+', 'Z').replace('/', '9').replace('=', 'A').encode()
a904guy commented 3 years ago

Where can you get tutk 3.1.10+ .dll and .so files?

nuwandavek commented 3 years ago

Did anyone solve this?

mrlt8 commented 3 years ago

Yes, see my post above.

Here's a working example.

You'll need to supply your own libIOTCAPIs_ALL v3.1.10 or higher.

kylepaulsen commented 2 years ago

Just want to confirm if libIOTCAPIs_ALL v3.1.10+ is freely available or if it requires a paid license or maybe shady browsing. Where can we get this? @mrlt8 How did you get your copy?

mrlt8 commented 2 years ago

Depending on your target platform, there are a few libraries floating around.

I believe you will need an SDK license key for v4+.

You could always contact tutk directly, but you will need to fill out a couple of forms and sign some NDAs.

greeshmasmenon commented 1 year ago

Can someone share a copy of the library? I have searched quite a bit and unable to connect to the latest firmware update. I see DTLS:1 in the device. Any idea on how to solve it?