[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rxtx
Subject:    Re: [Rxtx] sending a command to a camera. need jump start help
From:       Joachim Buechse <joachim () buechse ! ch>
Date:       2007-04-16 8:36:07
Message-ID: 49B5F08C-DDED-4E5A-935F-31186B6D5712 () buechse ! ch
[Download RAW message or body]

The cabling is sound, you always need a 0/ground reference in RS232  
serial communications.

As long as the power supply of your camera is not complete crap it is  
based on a transformer which decouples the output ground level from  
the input ground level as a side effect. Additionally most computers  
have input protection better models use opto-couplers. If you want to  
be on the safe side, you could also use a good USB2serial adapter -  
they are usually based on opto-couplers, which will give your  
computer a nearly 100% protection.

Your greater risk is a lightning stroke into the camera... as it will  
be outdoor, you definetly want to connect its casing to some serious  
ground cable (min 4mm copper)! If you can't connect it to ground, get  
yourself a SerialViaWLAN adapter (approx $150) or a SerialViaEthernet  
+ EthernetOverPowerline to be sure that you have no cable running  
from the camera to the PC.

Regards,
Joachim

On 15.04.2007, at 18:43, Guy Katz wrote:

> Jim with you permission I have a final way off topic question.
> I have noticed that in the back of the camera (per
> http://img338.imageshack.us/img338/948/2321je9.jpg &
> http://img338.imageshack.us/img338/9826/2322au1.jpg ) it seems that I
> need to connect both pin 5  of the rs232 cable & the electricity (DC)
> ground to the camera GND (ground) input.
>
>> From what you guys have experienced in the past, Is this a common  
>> case
> when dealing with such devices?
>
>
>
> -----Original Message-----
> From: rxtx-bounces@qbang.org [mailto:rxtx-bounces@qbang.org] On Behalf
> Of Jim Redman
> Sent: Sunday, April 15, 2007 6:34 PM
> To: RXTX Developers and Users
> Subject: Re: [Rxtx] sending a command to a camera. need jump start  
> help
>
> Guy,
>
> If this is not a for-fun project and someone is serious about  
> relying on
>
> the results from the camera, then I would advise some serious help.
> There's more to getting the system working than just commands, you  
> need
> to handle errors, timeouts, etc. etc.  Serial interfacing isn't all  
> that
>
> complex, but it does help to have a little experience before  
> working on
> a "critical" system - that is, one where there is any significance to
> downtime.
>
> If you just want to play with the camera, then follow the "send"  
> example
>
> from the CommAPI.  Set the baud rate, probably to 9600 (according  
> to the
>
> page you sent the baud rate should be displayed on the camera screen)
> set the flow control to none, and the parity to none and stop bits  
> to 1.
>
> Then send something like the following (totally untested):
>
> int checksum = 1 + 0 + 1 + 0x20 + 0 + 0 + 0;  //bytes 2-8
> checksum = 0xFFFF-checksum;
> byte[] toSend = new byte[] {0xA0,1,0,1,0x20,0,0,0,(checksum&0xFF)};
>
> send "toSend" through the output stream, and then read the input  
> stream.
>
> IF you've never done anything with serial ports before, I would  
> suggest
> that before you talk to the camera, you take the wires that are  
> attached
>
> to 2 & 3 of the camera and twist them together.  If you do this,
> everything you send will be echoed back to you.  This way, you can  
> test
> your code and that you hit the right pins and make sure that you are
> writing and reading the serial port correctly before worrying about
> things like baud rate, parity, correct TX/RX, etc. etc.
>
> After you connect to the camera, if nothing happens, first, double  
> check
>
> the parameters from the serial port.  Then check the cable, if it  
> looks
> OK, switch the connections to pins 2 & 3 and try again.
>
> If still nothing works, buy a serial port monitor that has LEDs on it,
> and plug it between the computer and the camera and watch for blinking
> lights.  If nothing else, that act of buying it will give you time for
> some of your frustrations to calm.  (Actually, owning one of these
> should probably be a pre-requisite for downloading code, you don't  
> need
> it, but it surely saves time on just about every project).
>
> If you still don't have anything working after all of this, try asking
> again.
>
> Jim
>
>
> Guy Katz wrote:
>> Hi all;
>> I am a web developer finding my self in an odd situation trying to
>> control a security camera and having to deal with bits,bytes and
>> hardware stuff.
>>
>> So, with great humbleness, I ask that maybe someone can take a look
> and
>> the link (http://img413.imageshack.us/img413/4232/rs232ib6.jpg) which
>> describes the interface to the security camera (the bytes that should
> be
>> sent) and maybe someone can show me how to code a simple "zoom in"
>> command to the camera.
>>
>> Also, is there suppose to be a return value from such command?
>>
>> Thanks in advance.
>>
>> _______________________________________________
>> Rxtx mailing list
>> Rxtx@qbang.org
>> http://mailman.qbang.org/mailman/listinfo/rxtx
>
> -- 
> Jim Redman
> (505) 662 5156 x85
> http://www.ergotech.com
> _______________________________________________
> Rxtx mailing list
> Rxtx@qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx
>
> _______________________________________________
> Rxtx mailing list
> Rxtx@qbang.org
> http://mailman.qbang.org/mailman/listinfo/rxtx

_______________________________________________
Rxtx mailing list
Rxtx@qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic