{"id":148,"date":"2015-10-13T11:31:00","date_gmt":"2015-10-13T15:31:00","guid":{"rendered":"http:\/\/provideotech.org\/?p=148"},"modified":"2016-08-18T14:27:08","modified_gmt":"2016-08-18T18:27:08","slug":"simple-script-to-automate-aja-kumo-routers","status":"publish","type":"post","link":"https:\/\/provideotech.org\/?p=148","title":{"rendered":"Simple script to automate AJA KUMO Routers"},"content":{"rendered":"<p>I was working on a project this week that is using a multitude of AJA Kumo routers. While the routers themselves are brilliant, the API documentation is less than desirable. After digging through the API example code, I uncovered a great little text dump call that gives me all of the IDs.<\/p>\n<p>I&#8217;ve put the source code to the python script on GitHub.<\/p>\n<p><a href=\"https:\/\/github.com\/szumlins\/Scripts\/blob\/master\/kumo.py\" target=\"_blank\">https:\/\/github.com\/szumlins\/Scripts\/blob\/master\/kumo.py<\/a><\/p>\n<p>The script requires the <a href=\"http:\/\/docs.python-requests.org\/en\/latest\/\" target=\"_blank\">requests<\/a> library for python. Easiest way to get requests is to use <a href=\"http:\/\/pip.readthedocs.org\/en\/stable\/installing\/\" target=\"_blank\">pip<\/a> to install.<\/p>\n<p>You can get the help output by running the -h flag:<\/p>\n<pre lang=\"bash\">bash-3.2# .\/kumo.py -h\r\nusage: kumo.py [-h] [-d CROSSPOINT] [-s CROSSPOINT] [-a ADDRESS] [-e]\r\n\r\nSet and Get AJA KUMO cross points. On get success, the script returns the\r\nsource. On set success, the script returns the source and destination\r\nseparated by a comma. On failure, the script returns -1\r\n\r\noptional arguments:\r\n  -h, --help            show this help message and exit\r\n  -d CROSSPOINT, --get_xpt CROSSPOINT\r\n                        Get crosspoint source for destination\r\n  -s CROSSPOINT, --set_xpt CROSSPOINT\r\n                        Set crosspoint source for destination (defined by -d)\r\n  -a ADDRESS, --address ADDRESS\r\n                        IP address or DNS name of KUMO\r\n  -e, --print_error     Print out all error codes and exit\r\n<\/pre>\n<p>You can also get output of all the error codes by running the -e flag<\/p>\n<pre lang=\"bash\">\r\nbash-3.2# .\/kumo.py -e\r\nError Codes:\r\n\r\n-1: can't connect to KUMO (check your URL or network)\r\n-2: destination out of range (not enough destinations in router)\r\n-3: source is out of range (not enough sources in router)\r\n<\/pre>\n<p>So for example, to get what the source of destination 1 is, we can run a relatively simple command.<\/p>\n<pre lang=\"bash\">\r\nbash-3.2# .\/kumo.py -a 192.168.10.59 -d 1\r\n3\r\n<\/pre>\n<p>This responds by telling us that the source for this destination is input 3.  If we want to change the source for that destination, we run another simple command to set the source.<\/p>\n<pre lang=\"bash\">\r\nbash-3.2# .\/kumo.py -a 192.168.10.59 -d 1 -s 1\r\n1,1\r\n<\/pre>\n<p>This tells us that destination 1 is now set to source 1.<\/p>\n<p>I found that using this we can use simple tools like Arduino\/Raspberry Pi systems to control KUMO routers without heavy scripting.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was working on a project this week that is using a multitude of AJA Kumo routers. While the routers themselves are brilliant, the API documentation is less than desirable. After digging through the API example code, I uncovered a great little text dump call that gives me all of the IDs. I&#8217;ve put the &hellip; <a href=\"https:\/\/provideotech.org\/?p=148\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Simple script to automate AJA KUMO Routers&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7,3],"tags":[],"class_list":["post-148","post","type-post","status-publish","format-standard","hentry","category-aja","category-general-info"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2bwLw-2o","_links":{"self":[{"href":"https:\/\/provideotech.org\/index.php?rest_route=\/wp\/v2\/posts\/148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/provideotech.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/provideotech.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/provideotech.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/provideotech.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=148"}],"version-history":[{"count":0,"href":"https:\/\/provideotech.org\/index.php?rest_route=\/wp\/v2\/posts\/148\/revisions"}],"wp:attachment":[{"href":"https:\/\/provideotech.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/provideotech.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/provideotech.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}