Unable to use any control script - "FAT [Can't Connect: ..."

Forum for questions and support relating to the 1.26.x releases only.
Locked
DanCoco
Posts: 7
Joined: Tue Aug 19, 2014 11:09 pm

Unable to use any control script - "FAT [Can't Connect: ..."

Post by DanCoco »

I have a ZoneMinder system using many TRENDnet TV-IP672PI cameras (and one TV-IP672WI wireless version). I can get the video to display just fine, however, when configuring the control options, I run into problems.

I am using the following script: http://www.zoneminder.com/wiki/index.ph ... rol_Script

ZoneMinder Version: 1.26.5
OS: Ubuntu 14.04.1 LTS

I enabled OPT_CONTROL in the options, then added the script to /usr/share/perl5/ZoneMinder/Control/ where the other scripts are located. Named the file "TVIP672PI.pm"

(I tried chmod to 755 for the above file with no changes in results.)

I opened the monitor for one of the TVIP672PI cameras and chose edit, and created a new control. I then selected this control from the dropdown.

When using any of the controls on the monitor, I receive the following error:
ControlResponseErrorWeb.JPG
ControlResponseErrorWeb.JPG (53.72 KiB) Viewed 4314 times
/var/log/syslog contains the following entry:

(First two lines occur at button press, third line occurs after error displays)
Aug 19 19:05:24 CharZoneMinder01 zmcontrol[20181]: INF [Starting control server 6/TVIP672PI]
Aug 19 19:05:24 CharZoneMinder01 zmcontrol[20184]: INF [Control server 6/TVIP672PI starting at 14/08/19 19:05:24]
Aug 19 19:05:34 CharZoneMinder01 zmcontrol[20181]: FAT [Can't connect: No such file or directory]

I changed the control script to use in the control tab of the monitor to one included with ZM when I installed it and still receive the same error this time referencing the other script I chose.

Aug 19 17:00:15 CharZoneMinder01 zmcontrol[15899]: INF [Starting control server 6/FI8608W_Y2k]
Aug 19 17:00:15 CharZoneMinder01 zmcontrol[15903]: INF [Control server 6/FI8608W_Y2k starting at 14/08/19 17:00:15]
Aug 19 17:00:25 CharZoneMinder01 zmcontrol[15899]: FAT [Can't connect: No such file or directory]

Is there any way I can find out where ZM is looking for these scripts?
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Unable to use any control script - "FAT [Can't Connect:

Post by knight-of-ni »

Looks like you found the correct control script folder, which is a good first step.

I often forget where it is myself so I'll just do this to remind me:
sudo locate PanasonicIP.pm
The golden rule for zoneminder ptz control scripts is that the filename of the control script, must match the Perl package name exactly.

You put the script into right folder, but you should have named it "TVIP672.pm" rather than "TVIP672PI.pm" to match the package name:
package ZoneMinder::Control::TVIP672;
Once you've made that change, test the script from the command line like so:

Code: Select all

perl TVIP672.pm
If there are no problems with the script, it should immediately return with no output.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
DanCoco
Posts: 7
Joined: Tue Aug 19, 2014 11:09 pm

Re: Unable to use any control script - "FAT [Can't Connect:

Post by DanCoco »

Thanks! The rename worked. Now I'm getting 401 Unauthorized errors in the log when I press one of the controls. I have some other things to do today so I'll update this later with progress or the fix depending what I find.
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Unable to use any control script - "FAT [Can't Connect:

Post by knight-of-ni »

Sounds like you need to add the username & password of your camera into the Monitor Config under the Control Tab.
There isn't a field explicitly labeled "username" or "password" in this case. You'll have to take a close look at the script itself and figure out what field(s) it is trying to use.... or find a set of instructions in the wiki which tell you.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
DanCoco
Posts: 7
Joined: Tue Aug 19, 2014 11:09 pm

Re: Unable to use any control script - "FAT [Can't Connect:

Post by DanCoco »

Yeah it specifies control device for password and control address then defines the username in the script. It also uses a Realm variable that appears to be included on the line used to pass the user/pass combo to the camera which might be the issue. Just got back so I'm going to look into that now.
DanCoco
Posts: 7
Joined: Tue Aug 19, 2014 11:09 pm

Re: Unable to use any control script - "FAT [Can't Connect:

Post by DanCoco »

EDIT: This is the 401 error received with different results for cmd: based on which button was pressed:

Code: Select all

ERR [Error check failed: '401 Unauthorized' cmd:'set_relative_pos&posX=-3&posY=0']
Got it working on the TV-IP672PI cameras. This did not fix the 401 error I am getting on the TV-IP672WI camera. One noted difference is that I have updated the firmware on the wireless camera (TV-IP672WI) to 1.1.2 and have not updated the firmware on the TV-IP672PI cameras running 1.1.0. (One other change with the new firmware is that I am not able to use jpeg.cgi anymore and changed to ffmpeg to monitor)

Here's the fix for any future Googlers out there.

Two changes need to be made from the instructions in the TV-IP672PI control script mentioned in the OP.
Changing the $REALM variable on the script and changing the control Device and Control Address entries.

In the script, it specifies the following variables need to be set on the script:

Code: Select all

#
#  ********  YOU MUST CHANGE THE FOLLOWING LINES TO MATCH YOUR CAMERA!  **********
#  
#  I assume that "TV-IP672WI" would work for the TV-IP672WI, but can't test since I don't own one.
#  
#  TV-IP672PI works for the PI version, of course.
#
#  Finally, the username is the username you'd like to authenticate as.
#
our $REALM = "TV-IP672PI";
our $USERNAME = "admin";

The problem was resolved by setting the $REALM variable to nothing instead of entering the exact model number as indicated in the comments. The below settings allowed me to login and control the camera. The $USERNAME variable also works properly to define the appropriate username. These cameras do not require the admin login to control motion on the Web GUI so like I have done, it is probably a good idea to define a separate user for ZoneMinder to use.

Code: Select all

our $REALM = "";
our $USERNAME = "ZoneMinder";

Now go into the console and edit your monitor. Click the Control tab. Make sure Control Device is blank and Control address contains the username, password, IP and port in the following syntax:

Code: Select all

username:password@CameraIPorHostname:WebPort

i.e. "ZoneMinder:password@192.168.1.2:80"

When I find the fix for the TV-IP672WI camera I will post another update.
Locked