Control client through hardware buttons

I am trying to make a physical button interface for the original client.
The documentation is scarce.

I have found an example for an arduino control here:

I am reasonably proficient in js and c# but have no experience in c++ or arduinos in general.
The example is a bit unclear for me, so I am hoping somebody can help me.

The general idea is to make physical buttons for
play / stop / next / update / invoke(somefunction)

And hopefully some dynamic ones with uid 1 to 9.

The device should be an desktop enclosure with some custom buttons.
connection to the pc is preferably of usb type.

Alternatively I can use the OSC to control it, (there is much better documentation) but it connects via ethernet and is more setup sensitive.
I want something to connect, set uid’s in the caspar client, tape some labels on the device and hit buttons.

How hard can this be, well apparently I need some help!

What about using Companion? You can very easy control Caspar via OSC with it and as a side effect you could also control other stuff as well, if the need arises.

I’ve looked at that, but it is a process you can’t setup and move. I do not always have the ability to install software on the machine that runs the caspar client.

I think for me the issue is that the example does not make use of anything I would use so it’s hard for me to adapt as a newbie.

I hope somebody can give me an example of a howto with a single button.

That’s a good point. Then I would use a cheep laptop for Companion or try to build something with an Arduino. The Arduino’s programming language is not too much based on c++. With an understanding of JavaScript you should find yourself comfortable very quickly.

Another idea would be to use a X-Keys keyboard. There is a mode where you can store the key-sequences on the keyboard, so that you don’t need to install software on the machine. To mostly send F-keys to Caspar client, that would work.

By the way: The invoke commands can be sent by writing the invoke procedure name inside the corresponding field in the client and trigger it by sending F7. Movement in the list is possible by sending up/down and home/end keys etc.

This was the initial plan. To use an arduino leonardo based on the ATmega32u4 to emulate a keyboard. For simple control its the most straightforward method.

Then you start reading about the gpi button and the fact that it IS possible,
But its so lacking in doc’s that I hope somebody here already figured it out and wants to share with me.

I made a little program long time ago that mimics a blackmagic router and converts keypresses to OSC commands to start item’s in the rundown. This way you can make a 40 button hardware panel with a blackmagic router panel.

just a idea

That is a cool way of doing it. But requires a lot of (expensive) hardware and a networked connection. I hope to avoid this. I know I can fix something with a Pi and OSC, but the point should be connect and go.
Setting network configurations every time I move it is not ideal.
I like your creativity though !!

What about that?

Honestly it’s a viable solution for the basic stuff. But I can get there now with an arduino posing as a hid. As you pointed out there can be a limited amount of control in the rundown by macro-ing commands together.
For an of-the-shelf product its really nice, but it does have its limitations.

The idea is to set the UID in caspar and fire that particular title when pressed.
A roll of writable tape, a pen, a usb connection and setting some UID’s in the client should be sufficient than.

If you just need play/stop/next/update -> X-Keys via USB or Arduino USB-Serial with the Caspar builtin GPI.

If you need UIDs: Google: “Arduino USB OSC” - As you need to have the messages sent to CasparClient via OSC.

In my eyes your best option is Companion on an Raspberry Pi 4, so it´s portable and config is stored on the Raspberry. Streamdeck can be labeld inside companion, so no need for pen and tape… Also you don´t have to care about UIDs, just select the title you want in Companion and go for it… nothing to “think about” in stressfull situations…

After some research I found out that your right about the need for OSC when you want to use the UID’s. I have another question.

Does the casparcg client listen when you sent OSC as serial over usb?
I assume it’s only listening on UDP on the mentioned port in the settings.

AFAIK “Serial over USB” is something that not really exist. It is a way to simulate a serial (COM) port via USB, so that a program written for serial communication can be fooled. CasparCG Client never was made to listen to serial commands.

Too bad. Maybe be a good feature to get an advanced single cable controller option.

Serial over usb sounds so much better than “serial endpoints of usb wrapped in the slip protocol.” :wink:

1 Like

That´s the point where any type of middleware comes into play… So you can do USB to OSC.
So something via network seems to be your way…

Just my 0.02$ since I’ve being trying to use X-Keys, and also used Companion and programmed Arduino:

  • X-Keys setup is very cumbersome, everything looks terribly outdated and functionality is nowhere near Companion’s. When you go from X-Keys to Companion you feel like leaving steam engine for a space ship :wink:

  • Companion is highly recommended, awesome number of plugins and also great support from the community. Works great.

  • There were some very successful Arduino / CasparCG integrations, for instance:
    https://nrkbeta.no/2014/08/13/nrk-breaks-new-ground-to-show-chess-on-television/
    While you can do everything you want when custom-building solution like this, it’s very hard to replicate rich feedback you get from Companion. It can hardly be worth unless you need to integrate very specific hardware Companion can not access. If you only need physical buttons I would go with Companion…

Regards.

I agree. I also use both. The good thing about X-Keys is, that it can be loaded on the device and you just connect it to a USB and it works, without the need to install software and that was what he wanted. I would also go with a Companion and either with a small laptop or a Raspberry Pi, whatever is around.

After all your comments (thank you) I figured out I can use companion for pi.

There is a plugin for pi gpio for physical buttons:

When all the equipment comes in I will put an update of the progress.

1 Like

3 Likes

The inside layout;
pi with companion for streamdeck.
arduino leonardo for big buttons.

C14 (euro) to shuko > powersupply pi > pi
usb A in > to usb hub [input to pc]
usb hub > to usb B nr 1&2 [outside loop for keyboard/mouse]
usb hub > usb network > utp > pi
usb hub > arduino
usb hub power in < pi
pi > to usb B nr 3&4
pi microhdmi > hdmi

Nice setup. I think you use the big buttons to send keyboard events to the official client, right?