I don't see anything glaringly wrong with the serial port handling, It is difficult to be sure without seeing the tpj4.cfg file though. Have you tried terminating the commands with a \n instead of \r? Or without the \r? Sometimes things expect unusual command terminators.
As an aside:
$FrameNum = substr($ResultUnpacked, 6,2); $FrameHex = '0x' . $FrameNum; $FrameNum = eval $FrameHex;
could be more succinctly written as:
$FrameNum = hex substr($ResultUnpacked, 6,2);
Also, you should probably drop the '0x.' from your $Ack pack $FrameNum field. It doesn't do anything. It is just being silently ignored.
my $Ack = pack( 'C*', 0xaa, 0x0e, 0x0d, $FrameNum, 0x00, 0x00);
instead of
my $Ack = pack( 'C*', 0xaa, 0x0e, 0x0d, 0x.$FrameNum, 0x00, 0x00);
UPDATE: Do you need to send more SYNC commands to the camera? The docs state that it requires 25 to 60 SYNC commands before it will issue an ACK.
In reply to Re: Serial camera - Issues connecting
by thundergnat
in thread Serial camera - Issues connecting
by SquareJ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |