Python controlling AV- Barco E2 & S3 with JSONRPC

Barco’s EventMaster series includes the Barco S3 and E2 Presentation Switchers. These switchers offer multiple inputs and outputs, and fine control over content presentation and screen management.

They can also be controlled via three mechanisms:

  • JSONRPC, which are JSON requests over HTTP, on Port 9999
  • Telnet commands, generally compatible with previous Barco equipment, on port 9878
  • Direct XML commands on port 9876

We’re going to briefly touch on all three, including some sample code to get you started controlling these switchers from Python. In this first part, we’ll discuss JSONRPC control.

Requirements & Installation

You’ll need Python 3.x installed, which can be downloaded from Once Python is installed, you’ll also need the requests library, which makes our JSONRPC calls a little easier.

Open a command line or terminal, and type:

pip install requests

to install requests- then you’ll be ready to go.

An example JSONRPC Request

# We're using a couple of extra libraries to help with the heavy lifting- in this case, requests and json
import requests
import json
# Here is our method that takes in an IP address for the switcher, a method to call, and parameters for that method.
def emJSONRPCRequest(ip, method, params={}):

# First, we format the complete URL for the request,
# which is http://(ip address):9999/jsonrpc
url = "http://{0!s}:9999/jsonrpc".format(ip)
   # Next, we start crafting our request. The content-type,
# jsonrpc and id fields are standard for JSONRPC, and you
# don't need to worry about changing them.

# method is the name of any method Barco has defined,
# and params is a dictionary of parameters that go with
# that method call.
headers = {"content-type": "application/json"}
payload = {"method": method,
"params": params,
"jsonrpc": "2.0",
"id": 0}
   # Finally, we make the actual HTTP POST request, with some
# help from the requests library in python.
response =,
   # And we return a dictionary with anything the server
# returned back to us.
return response.json()
# ===== Examples ======
# This example freezes the input at ID 2
# If mode is 1, the input will freeze, if 0 it will unfreeze
ip = ""
method = "freezeDestSource"
params = {"type": 0,
"id": 2,
"mode": 1}
emJSONRPCRequest("", method, params)
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.