ATEM Arduino Library
The ATEM Arduino Library is a reverse engineering of the ATEM protocol, or more specifically useful parts of it. This library is essential to all products communicating with an ATEM Switcher via an Arduino. For the latest about the protocol head over to the protocol page.
Make sure you have read read the disclaimer on the bottom of this page!
- Follow these Steps to install an Arduino Library from GitHub. The library files from GitHub are found here.
Install and Test
- Open the example "ATEM Monitor"
- Configure IP addresses and Mac Address (instructions are in the file)
- Upload it to your Arduino board (assuming it's connected to the ATEM Switcher with ethernet)
- Open the serial monitor on 9600 baud; You should see the connection is established and some output more or less like the listing below:
Serial started. Sending connect packet to ATEM switcher. Program Bus: 5 Preview Bus: 8 Keyers on Next Transition: 1 Transition Style: 0 Transition Preview: 0 Upstream Keyer 1: 0 _hasInitialized=TRUE ACK, rpID: 15 Program Bus: 5 Preview Bus: 8 Keyers on Next Transition: 1 Transition Style: 0 Transition Preview: 0 Upstream Keyer 1: 0 ACK, rpID: 1 ACK, rpID: 16 ACK, rpID: 17 ACK, rpID: 18 ACK, rpID: 19 ACK, rpID: 20 ACK, rpID: 21 ACK, rpID: 22 ACK, rpID: 23 ACK, rpID: 24 End of normal loop() - still kicking? ACK, rpID: 25 ACK, rpID: 26 ACK, rpID: 27 ACK, rpID: 28 ACK, rpID: 29 ... (continues like that every second or so)
Tutorials and Examples
- Arduino Library for ATEM Switchers - YouTube
- ATEM 1M/E Switcher connected to an Arduino - YouTube
- My First Arduino Atem Controller - YouTube
- Known to work with ATEM firmwares up to v.1.5 (distributed with ATEM Switcher Software 3.1, 24th May 2012)
- The library works with ATEM 1M/E and ATEM TeleVision studio, should work with 2M/E as well, but not tested much
- The library (version 1.0.1) should be used only with Arduino 1.0.1 SDK released in May 2012 - it has a fixed UDP implementation!
The examples in this library depend on other Arduino Libraries. For the examples that comes with the Library you must read the comments in the top. They will tell you about the purpose of the example and what dependencies they have. Notice that many of these examples are made for specific hardware such as the SKAARHOJ C50 Control Module etc.
Concerns and Challenges
- The Arduino platform seems to be too slow to catch all the initial information the ATEM Switchers send. There are something like 10 full UDP packets coming and only the first one is fully read. Probably because the buffer is not emptied fast enough for the next packets to fit in. This may be completely impossible to overcome since the W5100 chip has only 8k of memory divided out on 4 sockets. Maybe that buffer can be used fully buy only 1 socket - but we would still have the problem that only 4 packets fit in then. For now this problem is no deal breaker for communicating with the ATEM Switchers but one consequence for instance is that the Tally information is initially not detected because it is sent in the very last packet from the switcher. Does anyone know how a client can query the ATEM Switcher for information it needs?
- Development from GitHub
- Clean-up work: Less memory usage, better C++ practices
- API level support for the various switcher models (TVS, 1M/E, 2M/E): For instance, input numbering etc.
There is no guarantee that this library will work with future firmware upgrades of the ATEM Switchers. Blackmagic Design (producers of the ATEM Switchers) has never published their protocol in full and the development SDK they have released uses a dynamically linked library which they will update themselves as they further develop the ATEM Switcher protocol. The worst case scenario is that Blackmagic decides to change or obfuscate the protocol in ways beyond easy reverse engineering. In that case the ATEM Library will only work on ATEM Switchers with old firmwares.
When all this is said, it seems reasonable to assume that Blackmagic Design will play nice and tolerate this project and maybe even (un)officially support it. After all, it should be a very obvious advantage for them that the ATEM Library for Arduino exists since it eventually leads to more arguments to buy their products.