Using an Ethernet Shield to Send RS232 Commands to Camera

I am trying to get an Arduino to be able to control the position of a security camera. I have a Vaddio ClearVIEW HD-19 camera (manual), Arduino Uno, and ethernet shield. The camera accepts VISCA commands through an RJ45 RS232 connector to change the camera position. I am trying to have the Arduino send these commands with the help of the ethernet shield. Currently I have the following code but the camera is not responding at all. The Tx LED on the ethernet shield blinks and I can receive data in the terminal window. I have not worked with the ethernet shield before and am not sure if I am setting it up correctly. The connection between the shield and the camera is an ethernet cable.

    #include <SPI.h>
    #include <Ethernet.h>
    
    // MAC address for Arduino
    byte mac[] = {0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02};
    
    // telnet defaults to port 23
    EthernetClient client;
    
    // Camera Commands
    // Default message 8x 01 04 3F 02 0p FF where x is camera number and p is preset number
    byte preset1[7] = {0x81, 0x01, 0x04, 0x3F, 0x02, 0x01, 0xFF}; // camera position 1 command
    byte preset2[7] = {0x81, 0x01, 0x04, 0x3F, 0x02, 0x02, 0xFF}; // camera position 2 command
    
    byte address_command[4] = {0x88, 0x30, 0x01, 0xFF}; // send camera address command
    byte if_clear[5] = {0x88, 0x01, 0x00, 0x01, 0xFF}; // check if the serial is clear command

    void setup()
    {
      Ethernet.begin(mac);
      Serial.begin(9600); //  Open the serial port at 9600 bps
      while (!Serial) 
      {
        ; // wait for serial port to connect.
      }
    
      //Send Address command
      for (int i = 0; i < 4; i++)
      {
        Serial.write(address_command[i]);
      }
    
      delay(500);  //delay to allow camera time for next command
    
      //Send IF_clear command
      for (int i = 0; i < 5; i++)
      {
        Serial.write(if_clear[i]); 
      }
    }
    
    void loop()
    {
      for (int i = 0; i < (sizeof(preset1)); i++) // sizeof returns a count of bytes
      {
        Serial.write(preset1[i]); // moves to camera to position 1
      }
      delay(5000); // waits 5 seconds to send next command
    
      for (int i = 0; i < (sizeof(preset2)); i++) 
      {
        Serial.write(preset2[i]); // moves camera to position 2
      }
      delay(5000);
    }

The camera’s data settings are as follows:

Communication Speed: 9600 bps (default)
Start bit: 1
Stop bit: 1
Data bits: 8
Parity: None
No Flow control

Any help or suggestions would be very much appreciated. Thank you.

You could use the arduino as a web server and control the cam via a web page. You would need to convert the arduino TTL output to RS232.

Would the web server be an easier set up than a direct connection to the camera itself? I also have a Link Sprite RS232 Shield but it uses a DB9 connector when the camera accepts an RJ45 connector. That's why I was hoping to be able to do a serial communication with the Ethernet shield.

MaxSensei:
That's why I was hoping to be able to do a serial communication with the Ethernet shield.

The Ethernet signals are nothing like RS232 signals, you can not generate an RS232 signal from an Ethernet shield.

Grumpy_Mike:
The Ethernet signals are nothing like RS232 signals, you can not generate an RS232 signal from an Ethernet shield.

Agreed.

If they're still connected, disconnect them.

Here's an inexpensive RS232 board.

You could use it with the RJ-45 to DB-9 adapter the manual states comes with the camera. If you don't have this adapter, it wouldn't be too hard to make an adapter with one end of an ethernet cable.

RJ-45 connectors aren't usually used with RS232. I doubt you're the only one thinking there could be a way of using an ethernet port to communicate with the camera.

I don't think the ethernet shield will do you any good when communicating with the camera.

You can put a rj45 connector on a piece of cat3 phone wire and use that for the serial connection. You have to know the cam jack pinouts for the connector.

This is the syndrome of "because it has the same shaped connector it must be the same signal". To a large extent this has been eliminated in recent years by having unique connectors for each product. But I remember years ago someone plugging an IEEE interface into printer port because it had the same shaped socket.

Thanks for everyone's great advice. I was definitely making the wrong assumption that "copper is copper" and the wire should be able to work. I also have a Link Sprite RS232 Shield and will be attempting my project with this instead.

Would the web server be an easier set up than a direct connection to the camera itself? I also have a Link Sprite RS232 Shield but it uses a DB9 connector when the camera accepts an RJ45 connector. That's why I was hoping to be able to do a serial communication with the Ethernet shield.

You will need to make an RJ45 connector to connect to the cam serial input from the RS232 board output. Sa to the web page control GUI, the browser sends a GET request with the control command to the arduino with ethernet shield. The arduino parses out the command and sends it out the TTL pins to the RS232 conversion chip an on to the cam.