TP-Link Tapo C200 control script

Post here to indicate any hardware you have used and which is known to work with ZoneMinder. Not for questions.
Post Reply
oparm
Posts: 1
Joined: Sun May 09, 2021 8:01 pm

TP-Link Tapo C200 control script

Post by oparm »

Hello everyone,

I created a control script for the Tapo C200. It works quite well :)

https://github.com/oparm/zoneminder-tapo-c200

The script is simple to use I think but if you have issues, questions or remarks, feel free to post here or create an issue directly on github.

Enjoy
zackfuchtel
Posts: 1
Joined: Mon Jul 19, 2021 9:48 am

Re: TP-Link Tapo C200 control script

Post by zackfuchtel »

Hello,

tried to use, but not working for me. Got this error:

Code: Select all

zmcontrol_1[1034123].ERR [ZoneMinder::Control::TapoC200:169] [Invalid credentials for https://172.31.100.250:443, exiting]
zmcontrol_1[960770].FAT [ZoneMinder::Control:68] [0 not object from ZoneMinder::Control::TapoC200:170]
Double checked multiple times, the password is correct. Perl modules are loaded. Zoneminder is v1.36.3 on AlmaLinux 8.4. As I asume, Zoneminder cannot load/read the TapoC200.pm or its values correct?

Thanks for help.
pat2
Posts: 157
Joined: Fri Sep 16, 2016 6:35 pm

Re: TP-Link Tapo C200 control script

Post by pat2 »

thanks a lot for the script. It works!

I use it on Ubuntu 16.04. On 16.04 it is not possible to install the seccond library you suggested

sudo apt install libjson-pp-perl libjson-parse-perl

I commented in your script

#use JSON::Parse 'parse_json';

it worked!
thanks
---------------------------------------------------------------------------
ZM 1.36.36 - 14 cameras on Orange Pi 5 (arm64) - Ubuntu Jammy 22.04
Shadow
Posts: 6
Joined: Sat Feb 04, 2023 9:42 pm

Re: TP-Link Tapo C200 control script

Post by Shadow »

Hello, I have 3 cameras, and like 6 devices in zoneminder because they keep changing between 2 ip . All camera seem to change between 2 ip numbers, is it possible to turn on all privacy in one click and turn priivacy on in one click?

Thanks,
Shadow
dougmccrary
Posts: 1322
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: TP-Link Tapo C200 control script

Post by dougmccrary »

Shadow, you should start a new thread. Even if your cameras are Tapos. Mention what network equipment you have.
gabrielhopkins
Posts: 1
Joined: Sat Jun 24, 2023 9:54 pm

Re: TP-Link Tapo C200 control script

Post by gabrielhopkins »

Thank you very much - this works great!!
Ramblin
Posts: 19
Joined: Sat Oct 14, 2023 10:49 am
Location: Kitchener, Ontario, Canada

Re: TP-Link Tapo C200 control script

Post by Ramblin »

Thank you!

I can confirm that this works with TapoC520WS

It requires the addition of the libraries you mentioned for JSON and JSON::Parse but once that was done, it worked.

As for @pat2 who said they could not install the second library using "apt install libjson-parse-perl" , there is always the option of installing via cpan

Code: Select all

cpan JSON
cpan JSON::Parse
Using cpan requires make so if you do not already have it,

Code: Select all

apt install build-essential
I cannot Zoom the Tapo C520WS but I can use the Wake, Sleep (Privacy Mode), Pan and Tilt and that is all I need.

Thanks again for sharing.

For anyone interested, there is a stand-alone, python-based module called pytapo
https://github.com/JurajNyiri/pytapo
that also allows you to download the files from a camera's MicroSD card WITHOUT first storing them on the cloud (ie keeping it secure on your premises only). See the sample script in the "Experiments" folder.
Ramblin
Posts: 19
Joined: Sat Oct 14, 2023 10:49 am
Location: Kitchener, Ontario, Canada

Re: TP-Link Tapo C200 control script

Post by Ramblin »

This used to also work on Tapo cameras
- C320WS Hardware V1
- C320WS Hardware V2
- C520WS Hardware V1

Until the last firmware update for Tapo cameras and this module now no longer works.

The pytapo (python) module mentioned above had the same issue but they solved it with a code update adding in another encryption protocol.

I cannot convert the pytapo / python changes into this / perl module but if anyone is good enough at both languages, maybe they could?

You can use the ONVIF solution in Zonminder to control the Tapo pan/tilt cameras but are limited to the ONVIF-supported options.
subir_paul
Posts: 1
Joined: Tue May 28, 2024 6:24 pm

Re: TP-Link Tapo C200 control script

Post by subir_paul »

I installed the control script for zoneminder from github. But it not working. I am using tapo c200 camera. Hear are my debug log -

5/28/24, 11:59:15 PM GMT+5:30 zmcontrol_1 43444 INF Token expired for https://192.168.0.109:443, retrying : {"method":"do","motor":{"move":{"x_coord":"15","y_coord":"0"}}} zmcontrol.pl -

this shows for every time I try to control.
Peppe1945
Posts: 3
Joined: Thu Aug 08, 2024 7:35 am

Re: TP-Link Tapo C200 control script

Post by Peppe1945 »

tbl
Posts: 1
Joined: Sun Aug 11, 2024 12:36 pm

Re: TP-Link Tapo C200 control script

Post by tbl »

Hi all,
I'm new to this forum but I do have the same issue in regards to "Token expired" when trying to PTZ control my new tapo c200.
Firmware version on cam is 1.3.14.

I'm already using the updated (last update 4 days ago) from https://github.com/fabriziopicconi/zoneminder-tapo-c500

In the logs, when activating debug:
11.08.2024 14:03:55.921401 zmcontrol_18[5592].INF [main:116] [Starting control server 18/TapoC200]
11.08.2024 14:03:55.927813 zmcontrol_18[5592].INF [main:127] [Control server 18/TapoC200 starting at 24/08/11 14:03:55]
11.08.2024 14:03:56.378306 zmcontrol_18[5592].INF [ZoneMinder::Control::TapoC200:116] [Tapo C200 Controller opened]
...
11.08.2024 14:04:18.218324 zmcontrol_18[5592].INF [ZoneMinder::Control::TapoC200:134] [Move Con Right]
11.08.2024 14:04:18.221731 zmcontrol_18[5592].INF [ZoneMinder::Control::TapoC200:134] [Send command seq:[] for https://<IP>:443/stok=/ds, {"method":"do","motor":{"move":{"x_coord":"10","y_coord":"0"}}}]
11.08.2024 14:04:18.428948 zmcontrol_18[5592].INF [ZoneMinder::Control::TapoC200:134] [Token expired for https://<IP>:443, retrying : {"method":"do","motor":{"move":{"x_coord":"10","y_coord":"0"}}}]
11.08.2024 14:04:18.817104 zmcontrol_18[5592].INF [ZoneMinder::Control::TapoC200:134] [Send command seq:[] for https://<IP>:443/stok=/ds, {"method":"do","motor":{"move":{"x_coord":"10","y_coord":"0"}}}]
11.08.2024 14:04:19.020423 zmcontrol_18[5592].INF [ZoneMinder::Control::TapoC200:134] [Move Con Stop]
11.08.2024 14:04:19.023440 zmcontrol_18[5592].INF [ZoneMinder::Control::TapoC200:134] [Send command seq:[1] for https://<IP>:443/stok=/ds, {"method":"do","motor":{"stop":"null"}}]
11.08.2024 14:04:19.213652 zmcontrol_18[5592].INF [ZoneMinder::Control::TapoC200:134] [Token expired for https://<IP>:443, retrying : {"method":"do","motor":{"stop":"null"}}]
11.08.2024 14:04:19.591785 zmcontrol_18[5592].INF [ZoneMinder::Control::TapoC200:134] [Send command seq:[] for https://<IP>:443/stok=/ds, {"method":"do","motor":{"stop":"null"}}]
gyzod
Posts: 10
Joined: Wed Jun 15, 2022 8:52 pm

Re: TP-Link Tapo C200 control script

Post by gyzod »

Hello,

I can confirm this repo stills works for latest firmware on a fresh C200. I had to install those 2 packages :

apt install libbytes-random-secure-perl
apt install libcrypt-cbc-perl

The control address port is :443

The credentials is really admin user and your TPlink account password.

Thanks
Post Reply