No control using /dev/ttyS0

Forum for questions and support relating to the 1.24.x releases only.
Locked
pprimm
Posts: 1
Joined: Fri Jan 27, 2012 8:41 pm

No control using /dev/ttyS0

Post by pprimm »

ZoneMinder v1.24.4, Ubuntu Linux 11.10, Kernel and CPU: Linux 3.0.0-15-generic on x86_6

monitor setup for control is:
Control Type: Pelco-D
Control Device: /dev/ttyS0
Control Address: 2
Auto Stop Timeout: 0.25
no track or return

If I attach a terminal to the serial port and do the following:

Code: Select all

$ stty -F /dev/ttyS0 9600
$ echo "command" > /dev/ttyS0
I see "command" on the serial port output...so I know serial port is good on /dev/ttyS0

I may be barking up the wrong tree, but I've found that /usr/bin/zmcontrol.pl does not continue after line 200
I added line 199 to output value of $message
If I uncomment the Debug statement, it is never reached.

Code: Select all

188        while( 1 )
189        {
190            my $nfound = select( my $rout = $rin, undef, undef, $timeout );
191            if ( $nfound > 0 )
192            {
193                if ( vec( $rout, fileno(SERVER), 1 ) )
194                {
195                    my $paddr = accept( CLIENT, SERVER );
196                    my $message = <CLIENT>;
197
198                    next if ( !$message );
199                    Info( $message );
200                    my $params = jsonDecode( $message );
201                    #Debug( Dumper( $params ) );
202
203                    my $command = $params->{command};
204                    $control->$command( $params );
205                    close( CLIENT );
206                }
207                else
208                {
209                    Fatal( "Bogus descriptor" );
200                }
201            }
The previous code produces the following log entries:

Code: Select all

/var/log/zm/zmcontrol.log
01/27/12 14:07:08.227570 zmcontrol[29239].INF [Starting control server 1/PelcoD]
01/27/12 14:07:08.228560 zmcontrol[29240].INF [Control server 1/PelcoD starting at 12/01/27 14:07:08]
01/27/12 14:07:09.228698 zmcontrol[29240].INF [{"autostop":1,"tiltstep":null,"tiltspeed":null,"ycoord":null,"panspeed":26,"step":null,"panstep":null,"speed":null,"xcoord":null,"preset":null,"command":"moveConRight"}]
1) How is jsonDecode() resolved?
2) When I get this working, how is the baud rate set?

Thank you in advance for any assistance yo may be able to provide.
Locked