Using a Stream deck and a raspberry pi to create a remote control panel to adjust marshall cameras over ip with rs-485 control

At my church, we have 4 of these cameras: Marshall CV503

Marshall CV503 Miniature Camera

We use them during services to capture shots of the instruments (drums, keys, etc.) and whatever is happening on stage. They are great little action-style cameras, and they have SDI out on them so they are super easy to integrate into our video system.

They have a lot of adjustment options to them via a local joystick-style controller at the camera, but obviously, that’s challenging to use during a service if we needed to adjust the camera’s exposure. The menu is OSD and shows up on the live output. Plus they’re all over the stage and we can’t walk there during the service!

While I wish they were IP-controllable directly, this particular model does not have that option. They do, however, come with RS-485 serial connectors.

So we decided to create a remote shading system using a stream deck running Bitfocus Companion. The Marshall cameras support the VISCA protocol over RS-485. In fact, if you’re a Windows user, Marshall provides free software to control the cameras over RS-485.

Marshall provides this program to control, if you have Windows and want to connect your cameras directly to that computer.

We don’t use a lot of Windows computers around here, and that program requires that the computer running their software be the one physically connected to the cameras via serial. Not ideal for us because the cameras are on a stage and our computers typically are not. Marshall also actually makes a nice hardware RCP – but we didn’t want to pay for that.

So we did what you probably already guessed – put in a Raspberry Pi with a USB to RS-485 adapter that we could control remotely.

We have several wallplates across the stage with network tie lines on them that feed back to the rack room in a patchbay. So we made cables that connect to the RS-485 ports at each camera that then go back to a wall plate into a RJ45 port. We utilized the blue/white-blue pair on CAT6 cable. We used that pair because these are data pins in a normal network connection, which means if someone ever accidentally connected it straight to a switch or something, there would not be any unintended voltage hitting the cameras.

Each camera is set to its own camera ID (1-4), and the matching baud rate of 9600 (the default). Then in the rack room, we made a custom loom to take the 4 connections and bring them into a jack, which then feeds into the USB to RS-485 adapter on the Pi.

The Pi is a 4 model with 4GB of ram. Honestly, for what this thing is doing, we probably could have just run it off of a Pi Zero, but I wanted it hardwired to my network, and the bigger Pi’s come with ethernet ports built in.

I bought this adapter off Amazon:

DSD TECH SH-U10 USB to RS485 Converter with CP2102 Chip

When connected, it represents itself as serial port /dev/ttyUSB0. We originally planned to use the socat program in Linux to listen for UDP traffic coming from Companion:

sudo socat -v UDP4-LISTEN:52381 open:/dev/ttyUSB0,raw,nonblock,waitlock=/tmp/s0.locak,echo=1,b9600,crnl

To actually send the UDP data, we’re using the Sony VISCA module already built into Companion. The Marshall cameras use the same protocol over RS-485.

Using the socat method, we quickly found that it would only listen to UDP traffic coming from one instance of the module. We need 4 instances of the Companion module because we have 4 cameras, each with a different camera ID.

However, nothing a small Node.JS program can’t solve. So I wrote a program that opens the specified UDP port, opens the specified serial port, and sends any data received at that UDP port straight to the serial port. You just configure a new instance in Companion for each camera with the same IP of the Pi running the udp-to-serial program, and the camera ID that you configured at the Marshall camera.

Here’s a video that shows it all in action:

If you want to try this out for yourself, I’ve made the udp-to-serial repository available here:

http://github.com/josephdadams/udp-to-serial

19 comments

  1. I’m trying to connect one camera (at the moment), and I’m not getting any response from the camera. What pins are you using on the serial adapter? In the video, it appears that there are 4 wires connected to the serial adapter, but the camera only uses 2.

    Like

      1. ok, still not seeing a response from the camera. I set the ID, are there any other settings I need to change to allow remote control? I’m starting with the same Gain controls, and I’d love to be able to do white balance as well.

        Like

    1. Iv got 1 Marshall CV503 and am using a Windows 10 PC instead. I connected a 2 core cable to the RS-485 connector on the camera and the other end to the USB adapter you recommended. Iv plugged this into the PC which finds the driver and automatically installs it.
      In the Companion software i use the Sony Visca module and input the IP address of the PC and the ID of the camera (ID1). Iv installed gain up and gain down buttons but it does not work, pressing either button has no affect. Iv tested the cable using the Marshall Camera Control software and that works fine.
      Any ideas?

      Like

      1. Phil, you didn’t mention it, but I’m assuming you’re running my udp to serial program?
        I thought i only needed this if i was going RS-485 into a network? Im going cable only RS-485 camera to USB adapter into PC?

        Like

      2. Thanks Joseph now I understand. Do you know how to set this up in windows 10. Do I have to download java, if so what version, where do i get your script to run etc. Thanks again

        Like

  2. Update: I discovered that I needed to set the AE setting to full manual for the controls to work, that would be something helpful to add to the directions. The only hiccup now is that the server doesn’t run automatically. Here’s what I get: pi@raspberrypi:~/udp-to-serial $ pm2 startup index.js –name udp-to-serial
    [PM2] Init System found: systemd
    ———————————————————–
    PM2 detected systemd but you precised index.js
    Please verify that your choice is indeed your init system
    If you arent sure, just run : pm2 startup
    ———————————————————–
    [PM2] To setup the Startup Script, copy/paste the following command:
    sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup index.js -u pi –hp /home/pi
    pi@raspberrypi:~/udp-to-serial $ pm2 startup
    [PM2] Init System found: systemd
    [PM2] To setup the Startup Script, copy/paste the following command:
    sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi –hp /home/pi
    pi@raspberrypi:~/udp-to-serial $

    Like

  3. Got this working on Windows 10.
    I have the button “WB Indoor” set to Indoor
    I have the button “WB Push” set to White Balace Mode ATW
    I have the button “Gain Up” set to Gain Up and “Gain Down” set to Gain Down
    BUT gain up and down does not work. Holding the butons down or quickly pressing them has no effect on the Gain?

    Like

  4. Thank you Joseph, will that AE setting also allow the shutter and iris to be controlled via the relevant companion buttons?

    Like

  5. One last question in your config.json you have “/dev/ttyUSB0” for the port_serial. Do you know what to put in here for a windows PC?

    Like

  6. This has given me an idea. I have 2 P2 Panasonic Cameras but they don’t have any remote control protocol’s but they do have a 2.5mm jack for Zoom,S/S and 3.5mm jack for Focus/Iris. I was wondering if I get a RS-232 serial adapter to 2.5mm/3.5mm cable to then an IP based controller like the Global Cache I then could remotely shade that camera. But then I would need to figure what module I would need to you use to control it. You think this could work Joesph?

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s