oparm / zoneminder-tapo-c200

ZoneMinder Tapo C200 camera control script
MIT License
37 stars 12 forks source link

JSON:Parse.pm #2

Open Graxo opened 3 years ago

Graxo commented 3 years ago

Hi, i followed you guide, the controls show up. But when i press a button i get the following error: 2021-05-31 17:10:07 zmcontrol_1 4592 FAT Can't load ZoneMinder::Control::TapoC200Can't locate JSON/Parse.pm in @INC (you may need to install the JSON::Parse module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/ZoneMinder/Control/TapoC200.pm line 38.BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Control/TapoC200.pm line 38.Compilation failed in require at /usr/share/perl/5.26/Module/Load.pm line 77.Can't locate ZoneMinder/Control/TapoC200 in @INC (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl/5.26/Module/Load.pm line 77.

Graxo commented 3 years ago

I have tryed to install the following: sudo apt-get install perl build-essential curl libjson-perl sudo cpan JSON

And rebooted my server, didnt resolve it.

oparm commented 3 years ago

Hello,

You are right I forgot to mention in the README the dependencies needed, it is fixed in 45c3013c8cc0ed2f10ca7dea1c7a1ff6c9fadf39

You should be good after : sudo apt install libjson-pp-perl libjson-parse-perl sudo systemctl restart zoneminder

Graxo commented 3 years ago

Hello,

You are right I forgot to mention in the README the dependencies needed, it is fixed in 45c3013

You should be good after : sudo apt install libjson-pp-perl libjson-parse-perl sudo systemctl restart zoneminder

root@zoneminder:# sudo apt install libjson-pp-perl libjson-parse-perl Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package libjson-parse-perl

Do you also know the mirror for this?

Graxo commented 3 years ago

This did the trick: Run the following (Ubuntu 18.04): cpan JSON::Parse

oparm commented 3 years ago

Nice. I only tested on Ubuntu 20.04 :)

martin-gudmundson commented 3 years ago

I didn't even need that dependency. Commenting out the line use JSON::Parse 'parse_json'; worked for me on Ubuntu 18.04

p637 commented 3 years ago

Thanks a lot, Martin!

Used the same suggestion for Ubuntu 16.04!. It worked! thanks

EDIT: it worked too the suggestion of Graxo, thanks!

czar2tsar commented 2 years ago

Some tricks/advice if you want to install on a machine running FreeNAS/TrueNAS in a jail 1) For the dependencies, go into the Jail's shell and cd /usr/local/lib/perl5/5.32/ pkg install p5-JASON-XS cpan JSON::Parse

pkg install gets you PP, the cpan gets you parse. 2) The location for the controller files is different than Ubuntu. Put the TapoC200.pm file in here: /usr/local/lib/perl5/site_perl/ZoneMinder/Control/

Other than that, works awesome, thank you very much for writing this!