Giter Club home page Giter Club logo

phpreolinkcameraapi's Introduction

Reolink IP camera API client class

A PHP class which provides access to Reolink's IP cameras.

This class can be installed manually or using composer/packagist for easy inclusion in your projects.

Requirements

  • a Reolink camera (tested with RLC-420-5MP, Build No. build 19061408, Hardware No. IPC_51516M5M, Configuration Version v2.0.0.0, Firmware Version v2.0.0.448_19061408)
  • a web server with PHP installed (tested with PHP cli Version 7.3.11-1~deb10u1)
  • network connectivity between this web server and the camera and port (normally TCP port 80)

Installation

You can use Composer, Git or simply Download the Release to install the API client class.

Composer

The preferred method is via composer. Follow the installation instructions if you do not already have composer installed.

Once composer is installed, simply execute this command from the shell in your project directory:

composer require mm28ajos/php-reolink-camera-api

Or you can manually add the package to your composer.json file:

{
    "require": {
        "mm28ajos/php-reolink-camera-api": "^1.0"
    }
}

Finally, be sure to include the autoloader in your code:

require_once('vendor/autoload.php');

Git

Execute the following git command from the shell in your project directory:

git clone https://github.com/mm28ajos/PHPReolinkCameraAPI.git

When git is done cloning, include the file containing the class like so in your code:

require_once('path/to/src/Client.php');

Download the Release

If you prefer not to use composer or git, you can simply download the package, uncompress the zip file, then include the file containing the class in your code like so:

require_once('path/to/src/Client.php');

Example usage

A basic example how to use the class:

/**
 * load the class using the composer autoloader
 */
require_once('vendor/autoload.php');

/**
 * initialize the Reolink API connection class, log in to the controller and request disable the motion detection e-mail alert
 * (this example assumes you have already assigned the correct values to the variables used)
 */
$reolink_connection = new \Reolink_API\Client($user, $password, $camera_ip);
$login            = $reolink_connection->login();
if ($login)
{
  $results          = $reolink_connection->toggleMotionEmail(false); // returns a PHP boolean to signale the success/failure of toggeling the motion e-mail alert
  $logout            = $reolink_connection->$logout();
}

Please refer to the examples/ directory for some more detailed examples which you can use as a starting point for your own PHP code.

API Requests Implementation:

GET:

  • Login
  • Logout
  • Display -> OSD
  • Recording -> Encode (Clear and Fluent Stream)
  • Recording -> Advance (Scheduling)
  • Network -> General
  • Network -> Advanced
  • Network -> DDNS
  • Network -> NTP
  • Network -> E-mail
  • Network -> FTP
  • Network -> Push
  • Network -> WIFI
  • Alarm -> Motion
  • System -> General
  • System -> DST
  • System -> Information
  • System -> Maintenance
  • System -> Performance
  • System -> Reboot
  • User -> Online User
  • User -> Add User
  • User -> Manage User
  • Device -> HDD/SD Card
  • Zoom
  • Focus
  • Image (Brightness, Contrass, Saturation, Hue, Sharp, Mirror, Rotate)
  • Near Infrared Light
  • Advanced Image (Anti-flicker, Exposure, White Balance, DayNight, Backlight, 3D-NR)
  • Image Data -> "Snap" Frame from Video Stream

SET:

  • Display -> OSD
  • Recording -> Encode (Clear and Fluent Stream)
  • Recording -> Advance (Scheduling)
  • Network -> General
  • Network -> Advanced
  • Network -> DDNS
  • Network -> NTP
  • Network -> E-mail
  • Network -> FTP
  • Network -> Push
  • Network -> WIFI
  • Alarm -> Motion
  • System -> General
  • System -> DST
  • System -> Reboot
  • User -> Online User
  • User -> Add User
  • User -> Manage User
  • Device -> HDD/SD Card
  • Zoom
  • Focus
  • Image (Brightness, Contrass, Saturation, Hue, Sharp, Mirror, Rotate)
  • Near Infrared Light
  • Advanced Image (Anti-flicker, Exposure, White Balance, DayNight, Backlight, 3D-NR)

Contribute

If you would like to contribute code (improvements), please open an issue and include your code there or else create a pull request.

Credits

This class is based on the initial work by the following developer:

The Readme is based on:

Important Note

All of the functions in this API client class are not officially supported by Reolink and as such, may not be supported in future versions of the Reolink cameras.

phpreolinkcameraapi's People

Contributors

butu avatar mm28ajos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.