Skip to main content

Python package for communicating with wyze cameras over the local network

Project description

wyzecam

Build status Python Version Dependencies Status

Code style: black Security: bandit Pre-commit Semantic Versions License

Python package for communicating with wyze cameras over the local network.

Features

  • Send local commands (via WyzeIOTC class)
  • Support for all wyze camera types (including wyzecam v3!)
  • Uses the tutk protocol for communicating over the local network.

Usage

import wyzecam
import cv2
import os

path_to_libiotc = "./libIOTCAPIs_ALL.dylib"  # see instructions
cred = wyzecam.login(os.environ["WYZE_EMAIL"], os.environ["WYZE_PASSWORD"])
account = wyzecam.get_user_info(cred)
cams = wyzecam.get_camera_list(cred)

cam = cams[0]

with wyzecam.WyzeIOTC(path_to_libiotc) as wyze_iotc:
  with wyze_iotc.connect_and_auth(account, cam) as sess:
    session_info = sess.session_check()
    print(f"{sess.state}, session_info = {session_info}")
    for frame, frame_info, video_stats in sess.recv_video_frame_ndarray_with_stats():
      cv2.imshow('Video Feed', frame)
      cv2.waitKey(1)
      if cv2.waitKey(1) & 0xFF == ord('q'):
        break

Installation

pip install -U wyzecam

You will then need a copy of the shared library libIOTCAPIs_ALL. You will need to download this SDK, unzip it, then convert the appropriate copy of the library to a shared library, and copy the resultant .so or .dylib file to somewhere convenient.

On Mac:

unzip TUTK_IOTC_Platform_14W42P1.zip
cd Lib/MAC/
g++ -fpic -shared -Wl,-all_load libIOTCAPIs_ALL.a -o libIOTCAPIs_ALL.dylib
cp libIOTCAPIs_ALL.dylib  zg

On Linux:

unzip TUTK_IOTC_Platform_14W42P1.zip
cd Lib/Linux/x64/
g++ -fpic -shared -Wl,-whole-archive libAVAPIs.a libIOTCAPIs.a -o libIOTCAPIs_ALL.so
cp libIOTCAPIs_ALL.so /usr/local/lib/

Note: you will need to pick the appropriate architecture.

🛡 License

License

This project is licensed under the terms of the MIT license. See LICENSE for more details.

📃 Citation

@misc{wyzecam,
  author = {kroo},
  title = {Python package for communicating with wyze cameras over the local network},
  year = {2021},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/kroo/wyzecam}}
}

Credits

Special thanks to the work by folks at nblavoie/wyzecam-api, without which this project would have been much harder.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wyzecam-1.0.0.tar.gz (27.1 kB view hashes)

Uploaded Source

Built Distribution

wyzecam-1.0.0-py3-none-any.whl (27.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page