https://github.com/tomafrench/nc450-python-api
:camera:
https://github.com/tomafrench/nc450-python-api
Last synced: 9 months ago
JSON representation
:camera:
- Host: GitHub
- URL: https://github.com/tomafrench/nc450-python-api
- Owner: TomAFrench
- Created: 2018-07-27T13:42:14.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-20T18:52:34.000Z (over 6 years ago)
- Last Synced: 2025-03-12T05:03:11.522Z (10 months ago)
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TP-Link NC450 camera API for Python
This repository provides a Python API using the `requests` module for controlling TP-Link NC450 cameras.
Author: Tom French
## Installation
This API can be installed in a python3 virtual environment by the commands:
```bash
cd /path/to/repo
python3 -m venv .
source bin/activate
pip3 install -r requirements.txt
```
The API may then be imported as any other python module.
## Example
The API can be used to connect to an NC450 camera at the ip address `ip_addr` with login details `username` and `password`
```py
from tplink import NC450
camera = NC450(ip_addr, username, password)
camera.login()
#Turn camera to right for 2 seconds
camera.turn('e',2)
#Turn on camera led
camera.set_led_status(1)
#Recentre camera
camera.turn('c')
#logout
camera.logout()
```
## NC450 URLS
MJEG stream:
```
HD: http://[id_address]:8080/stream/video/mjpeg?resolution=HD&&Username=[username]&&Password=[password]
VGA: http://[id_address]:8080/stream/video/mjpeg?resolution=VGA&&Username=[username]&&Password=[password]
```
Snapshot:
```
HD: http://[id_address]:8080/stream/snapshot.jpg?resolution=HD&&Username=[username]&&Password=[password]&&attachment=1
VGA: http://[id_address]:8080/stream/snapshot.jpg?resolution=VGA&&Username=[username]&&Password=[password]&&attachment=1
```
SnapshotIE2:
```
HD: http://[id_address]:8080/stream/snapshot.jpg?resolution=HD&&Username=[username]&&Password=[password]&&tempid=[tempid],
VGA: http://[id_address]:8080/stream/snapshot.jpg?resolution=VGA&&Username=[username]&&Password=[password]&&tempid=[tempid]
```