<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ecuetips.com</title>
	<atom:link href="http://ecuetips.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ecuetips.com</link>
	<description>e:cue Tips and Tricks</description>
	<lastBuildDate>Fri, 30 Dec 2011 18:31:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Mutual Exclude Groups</title>
		<link>http://ecuetips.com/mutual-exclude-groups/</link>
		<comments>http://ecuetips.com/mutual-exclude-groups/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 18:31:55 +0000</pubDate>
		<dc:creator>Ruby Rubenstahl</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Group]]></category>
		<category><![CDATA[Mutual]]></category>
		<category><![CDATA[Mutual Exclude Group]]></category>

		<guid isPermaLink="false">http://ecuetips.com/?p=221</guid>
		<description><![CDATA[Mutual exclude groups are a feature that can come in very handy but don&#8217;t seem to be a well known feature. A mutual exclude group allows you to create a group of cuelists in which only one of those lists can be active at any given time. This comes in handy in scenarios where you [...]]]></description>
			<content:encoded><![CDATA[<p>Mutual exclude groups are a feature that can come in very handy but don&#8217;t seem to be a well known feature. A mutual exclude group allows you to create a group of cuelists in which only one of those lists can be active at any given time. This comes in handy in scenarios where you want to have multiple cuelists that control a single zone but don&#8217;t want them to run over top of each other. </p>
<p>In order to create a mutual include group just go to the properties dialog for each cuelist that you would like in the group (right click on the cuelist at the bottom of the screen and then click properties). On the bottom right you will see a section called &#8220;Group Memberships&#8221; with a &#8220;Mutual&#8221; option. Choose a number and select that same number for all of the cuelists you&#8217;d like in the group. When one cuelist in the group is playing and another one from the same group starts, the first cuelist will stop automatically using the release time defined in that list&#8217;s properties.</p>
<p>You can have as many mutual exclude groups as you&#8217;d like, but please note that one list cannot belong to more than one mutual exclude group. Also, by default the group is 0, which means that is not in any group and will act normally.</p>
]]></content:encoded>
			<wfw:commentRss>http://ecuetips.com/mutual-exclude-groups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conditional Triggers</title>
		<link>http://ecuetips.com/conditional-triggers/</link>
		<comments>http://ecuetips.com/conditional-triggers/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 19:51:30 +0000</pubDate>
		<dc:creator>Ruby Rubenstahl</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://ecuetips.com/?p=214</guid>
		<description><![CDATA[This post was created in response to a question on the e:cue e:script forum. The trigger engine in the programmer is a great thing, but one of the shortcomings is that other than setting a date range, there is no way to dynamically enable or disable a trigger in response to changing conditions. I&#8217;m going [...]]]></description>
			<content:encoded><![CDATA[<p>This post was created in response to a question on the e:cue e:script forum.</p>
<p>The trigger engine in the programmer is a great thing, but one of the shortcomings is that other than setting a date range, there is no way to dynamically enable or disable a trigger in response to changing conditions. I&#8217;m going to show you a way to use a little e:script magic to do just that.</p>
<p>Rather than having a trigger perform an action directly, we&#8217;ll have the trigger call an e:script macro, passing a trigger ID number as a parameter. The script will check whether the trigger is enabled currently, and run the action if it is enabled or ignore it if not. In order to keep track of multiple triggers, we&#8217;ll use a global array that allows us to track an arbitrary number of and also include a script that you can call to enable the triggers, and one to disable them.</p>
<p>So, on with the code:</p>
<pre>// init.cpp
// Set up the variables

// Only create the globals if they aren't defined
// already
if (undefined(_init)){
	int _init;
	int _triggercount =5;
	int _enabled[_triggercount];

	// Default all triggers to enabled state
	for (int i=0; i&lt;_triggercount; i++)
	{
		_enabled[i]=1;
	}
}</pre>
<p>This is the first script you&#8217;ll need (name it init), which will create the global variables that holds the status of each trigger as well as one more to that determines how many triggers you want to use. You&#8217;ll want to change the value of _triggercount to the number of triggers you plan on tracking. This script should be run using the &#8220;On Initialization&#8221; trigger so that the variables are declared as soon as the programmer is ready to go. When doing your initial programming, you&#8217;ll want to run this once or the rest of the scripts won&#8217;t work properly.</p>
<pre>// enabletrigger.cpp
// getarg(0) is the trigger to enable
// if -1 is passed to getarg(0), enable all triggers

int nTrigger = getarg(0);

if (nTrigger==-1)
{
	for (int i=0; i&lt;_triggercount; i++){
		_enabled(i)==1;
	}
	printf("All triggers enabled\n");

}
else{
	_enabled[nTrigger]=1;
	printf("Trigger %d enabled\n", nTrigger);
}</pre>
<p>The second script (name it enabletrigger) will allow you to enable any trigger number by passing it as the getarg(0) parameter. By passing a -1, enable all triggers that you are using. If you are using a call macro action you&#8217;ll want to use the following format for your macro name: &#8220;enabletrigger, x&#8221; where x is the value of the trigger you want to use. If you&#8217;re enabling it from e:script, you&#8217;ll use the following command:</p>
<pre>Call("enabletrigger", x, 0, 0);</pre>
<p>again, with x being the number of the trigger you want to enable.</p>
<pre>// disabletrigger.cpp
// getarg(0) is the trigger to enable
// if -1 is passed to getarg(0), disable all triggers

int nTrigger = getarg(0);

if (nTrigger==-1)
{
	for (int i=0; i&lt;_triggercount; i++){
		_enabled(i)==0;
	}
	printf("All triggers disabled\n");

}
else{
	_enabled[nTrigger]=0;
	printf("Trigger %d disabled\n", nTrigger);
}</pre>
<p>The disabletrigger macro is essentially the same as the enabletrigger macro, but it disables one or all of the triggers by passing -1 or the trigger numbers to the getarg(0) parameter.</p>
<pre>// runtrigger.cpp
// Run any trigger requested if enabled
// getarg(0) is the trigger to run

int nTrigger = getarg(0);

// only run the requested command if the trigger
// is enabled
if (_enabled[nTrigger]==1){
	printf("Running trigger %d\n", nTrigger);

	switch (nTrigger)
	{
	case 0:
		GotoCue(QL(1),Q(2),0);
		break;
	case 1:
		GotoCue(QL(2),Q(1),0);
		break;
	case 2:
		ReleaseAll();
		break;
               // Add more cases for each trigger action you want to perform
	}
}

else{
	printf("Trigger %d is not enabled\n", nTrigger);
}</pre>
<p>Finally, we have the runtrigger script, which actually receives the triggers and runs the action code if they are enabled. It gets called the same way as the previous two scripts using &#8220;runtrigger, x&#8221; from an Trigger action or the equivalent &#8221;call&#8221; command in e:script. It will test first if the trigger number is enabled. If it is, we go into a &#8220;switch&#8221; statement, which is essentially the same as if you did the following:</p>
<pre>if (nTrigger == 1){
    ....
}
if (nTrigger == 2){
    ....
}
if (nTrigger == 3)
    ....
}
....</pre>
<p>You&#8217;ll want to add a new case/break clause for each action you want to track and add the code that you want to run when that trigger is available in between case and break. Make sure to update the trigger count variable in the init script to match the number of triggers you are going to use. Also, note that the count is 0 based, so if you have 5 triggers, you will have triggers #0-4. You don&#8217;t have to use 0 if it is confusing to you, but you then need to add 1 to the number of triggers you&#8217;re using in the init script.</p>
<p>If you update the number of triggers in the init script after you&#8217;ve run that script the first time, you&#8217;ll need to hit the programmer reset button to reset all of the variables, as they cannot be redefined a second time once that script has already been run.</p>
<p>If it&#8217;s not already clear, once you have everything set up here, the number in the &#8220;case&#8221; statement is what defines your trigger number, so to disable the action code for case 3 in the runtrigger script, you&#8217;d use a Call Macro action with a name of &#8220;disabletrigger, 3&#8243; (or it&#8217;s equivalent call statement in e:script) in the action that you&#8217;d want to disable the trigger. To run trigger 3, you&#8217;d add the trigger to programmer&#8217;s trigger list and for the action use &#8220;runtrigger, 3&#8243;.</p>
<p>Please post in the comments if something in here doesn&#8217;t make sense. Good luck!</p>
<pre></pre>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://ecuetips.com/conditional-triggers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Manuals and Spec Sheets</title>
		<link>http://ecuetips.com/manuals-and-spec-sheets/</link>
		<comments>http://ecuetips.com/manuals-and-spec-sheets/#comments</comments>
		<pubDate>Mon, 27 Jun 2011 20:03:25 +0000</pubDate>
		<dc:creator>Ruby Rubenstahl</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://ecuetips.com/?p=207</guid>
		<description><![CDATA[If you&#8217;ve ever wanted to download all of the e:cue manuals and spec sheets in a single package, I&#8217;ve put them all together in a zip file organized by product. Download]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever wanted to download all of the e:cue manuals and spec sheets in a single package, I&#8217;ve put them all together in a zip file organized by product.</p>
<p><a class='wpdm-popup' rel='colorbox' title='e:cue Spec Sheet and Manual Pack' href='/feed/?download=1' style="background:url('http://ecuetips.com/wp-content/plugins/download-manager/icon/download.png') no-repeat;padding:3px 12px 12px 28px;font:bold 10pt verdana;">Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ecuetips.com/manuals-and-spec-sheets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring a Wireless Router for e:cue</title>
		<link>http://ecuetips.com/configuring-a-wireless-router-for-ecue/</link>
		<comments>http://ecuetips.com/configuring-a-wireless-router-for-ecue/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 20:47:50 +0000</pubDate>
		<dc:creator>Ruby Rubenstahl</dc:creator>
				<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://ecuetips.com/?p=185</guid>
		<description><![CDATA[Having wireless access to your lighting system can add a tremendous amount of flexibility both in the realms of installation/programming and end user control. Having wireless access allows you to program your system while freely walking around the installation and it also allows for end users to use smart phones and tablets to control their systems with [...]]]></description>
			<content:encoded><![CDATA[<p>Having wireless access to your lighting system can add a tremendous amount of flexibility both in the realms of installation/programming and end user control. Having wireless access allows you to program your system while freely walking around the installation and it also allows for end users to use smart phones and tablets to control their systems with a great degree of freedom.</p>
<p>While the names and locations of the settings discussed will be different from one router to the next, virtually all wireless routers will have the same basic options to configure your network. I&#8217;ll be using screenshots from the administrative interface for the Linksys WRT54G router, as it is one of the most popular and well known wireless routers on the market. I will be breaking this article down into 3 segments to keep things as simple as possible:</p>
<ol>
<li>Basic Setup</li>
<li>Configuring Network Options</li>
<li>Security</li>
</ol>
<p>Please note that this article assumes a prior basic understanding of setting up a network for an e:cue system.</p>
<h2>1) Basic Setup</h2>
<p>If you are using your wireless router in a very small system setup, you likely won&#8217;t need anything other than your e:cue devices, your server, and some patch cables. You&#8217;ll just need to plug each of the devices  into one of the numbered ports on the router. If you are using a larger setup that requires a switch, use a patch cable to connect one of the numbered ports on the router to a port on the switch.</p>
<p>One of the most common mistakes when setting up a wireless network is to plug the Uplink Port (some companies label it as &#8220;Internet&#8221;) to either connect to a server or the switch. This port should only be used to patch to a router or modem that will be providing internet access. Everything else should be connected to a numbered port on the router.</p>
<p>Once you have your router connected, you&#8217;ll need to follow its instructions to get to the administrative interface of that particular model. In most cases it will be a web based interface that you will get to by going to an <span class="domtooltips" title="A unique network address that consists of four numbers separated by periods such as 192.168.123.1 (which happens to be the default address for all e:cue equipment).">IP address</span> such as http://192.168.1.1 or http://192.168.0.1 both of these are popular default IP addresses.</p>
<p>Once you have access to the administration interface, you&#8217;re set to move on to configuring the network options.</p>
<h2>2) Network Configuration</h2>
<p>The goal for configuring the router is to get the router and your computer all on the same network segment and to set up the DHCP to do the same. DHCP is the protocol that allows computers to obtain an <span class="domtooltips" title="A unique network address that consists of four numbers separated by periods such as 192.168.123.1 (which happens to be the default address for all e:cue equipment).">IP address</span> and other setting automatically upon connecting to a network. It is what is used by default for most consumer network interfaces. You can learn more about DHCP <a href="http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol">here</a>.</p>
<p>As the butlers (and other e:cue hardware) need static IP addresses in order to ensure that the server is sending the correct data to the correct devices, they do not support DHCP. With some planning, however,  they can coexist peacefully on the same network as devices that do. I generally set my butlers as the low end of the network segment (192.168.123.1+), setting my servers at 192.168.123.101+ and then using the 192.168.123.200+ for my router as well as other devices (laptops, smart phones, tablets, etc) to connect with DHCP.</p>
<p>Log on to your router&#8217;s admin page, and you should see something similar to this:</p>
<p><a href="http://ecuetips.com/wp-content/uploads/2011/06/wrt54G-RouterBasicConfig.png"><img class="aligncenter size-full wp-image-186" title="Basic Router Configuration Menu" src="http://ecuetips.com/wp-content/uploads/2011/06/wrt54G-RouterBasicConfig-e1308860236671.png" alt="" width="500" height="494" /></a></p>
<ul>
<li>Change the Name of the router to whatever you wish (&#8220;SSID&#8221; for some manufacturers). This is the name that will be displayed by your operating system when listing available networks.</li>
<li>Set the Local <span class="domtooltips" title="A unique network address that consists of four numbers separated by periods such as 192.168.123.1 (which happens to be the default address for all e:cue equipment).">IP address</span> (Called &#8220;Router IP&#8221; by some manufacturers) to 192.168.123.200</li>
<li>Set the last digit of the &#8220;Starting <span class="domtooltips" title="A unique network address that consists of four numbers separated by periods such as 192.168.123.1 (which happens to be the default address for all e:cue equipment).">IP Address</span>&#8221; for the DHCP server to 192.168.123.201</li>
<li>Save the changes (the router may need to be restarted at this time).</li>
<li>You may also need to disconnect and then reconnect to the router so that it receives the new DHCP settings.</li>
</ul>
<p>Once these changes are applied, you should be able to access your e:cue equipment without having to manually change your <span class="domtooltips" title="A unique network address that consists of four numbers separated by periods such as 192.168.123.1 (which happens to be the default address for all e:cue equipment).">IP address</span> in your windows settings. You should keep your production server as a static <span class="domtooltips" title="A unique network address that consists of four numbers separated by periods such as 192.168.123.1 (which happens to be the default address for all e:cue equipment).">IP address</span> though so that it&#8217;s address never changes, which can cause problems.</p>
<h3>3) Security</h3>
<p>There are two levels of security that you need to provide, or at least be aware of: First, you need to control who can connect to the router, and secondly you need to control who has access to the administrative interface for the router.</p>
<h3>Controlling router access</h3>
<p>If, for whatever reason, you wish to allow public access to this router, you do not need to enable the wireless security on the router. The merits and drawbacks of the different encryption schemes are not really within the scope of this article but you can read all about them <a href="http://en.wikipedia.org/wiki/Wireless_security">here</a>. I&#8217;ll recommend that you go with WPA encryption. You&#8217;ll need to go the the security settings for your router, set the security mode you wish to use and the access key (the password that you&#8217;ll need to enter in order to connect to the router).</p>
<p><a href="http://ecuetips.com/wp-content/uploads/2011/06/Linksys-Security-Config.jpg"><img class="aligncenter size-full wp-image-188" title="Linksys Security Config" src="http://ecuetips.com/wp-content/uploads/2011/06/Linksys-Security-Config-e1308861492624.jpg" alt="" width="500" height="297" /></a></p>
<p>Each router is different in terms of where the security settings are and what security modes they support. Check your model&#8217;s documentation to determine how to set up encryption.</p>
<h3>Administrative Access</h3>
<p>The final step is to set a new password to access the administrative interface. This is an often skipped, but crucial security step. Default router passwords are a well known and easy to exploit vulnerability. Again, consult your model&#8217;s manual to figure out exactly how to change the password for your router.</p>
<p>Once you&#8217;ve got your wireless network setup, make sure to check out the articles on <a title="Remote Desktop Software" href="http://ecuetips.com/remote-desktop-software/">Setting up a Remote Desktop Solution</a>, <a title="Setting up the HTTP Server" href="http://ecuetips.com/setting-up-the-http-server/">Setting up the HTTP Server</a>. Also, if you are using an android device. make sure to consider my <a href="https://market.android.com/details?id=com.rubylighting.ecueTerminal&amp;feature=search_result">e:cue Remote Terminal</a> app.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://ecuetips.com/configuring-a-wireless-router-for-ecue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Custom UDP Protocol</title>
		<link>http://ecuetips.com/creating-a-custom-udp-protocol/</link>
		<comments>http://ecuetips.com/creating-a-custom-udp-protocol/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 23:37:22 +0000</pubDate>
		<dc:creator>Ruby Rubenstahl</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://ecuetips.com/?p=175</guid>
		<description><![CDATA[For those who need to do custom interfacing with the Programmer software, the built in UDP server- is a good choice in some cases. While the UDP server lies at a lower level than the HTTP server, it does have the advantage of being quite a bit faster. I&#8217;ve found it useful particularly when I [...]]]></description>
			<content:encoded><![CDATA[<p>For those who need to do custom interfacing with the Programmer software, the built in UDP server- is a good choice in some cases. While the UDP server lies at a lower level than the HTTP server, it does have the advantage of being quite a bit faster. I&#8217;ve found it useful particularly when I needed to create a custom drag and drop interface for a client who wanted building staff, untrained in any sort of computerized lighting system, to be able to program custom shows on a regular basis.</p>
<p>The downside, as you already know if you are familiar with UDP, is that unlike TCP (which HTTP uses) is connectionless and there is no guarantee that the data is being received. While TCP connections return an error if the data is not properly received, according to the UDP protocol, the data is sent out and there is no built-in checks that anyone is even listening for it.</p>
<p>A good metaphor for a TCP connection is a phone call&#8230; you dial a number and you either have the conversation you expected to have or you gett an error (&#8220;This number has been disconnected&#8221;, &#8220;Sorry, wrong number&#8221;, etc) where as a UDP connection is more like a radio station. You broadcast your message, but even if no one is tuned into your station, there is no way to know inherently whether your message is received (although you could, say, ask for someone who is listening to call in and let you know they hear you.</p>
<p>Without further adeiu, here are instructions for the method I implemented&#8230; you can obviously adapt it to suite your situation, but this should be able to give you a foundation:</p>
<p>First, we need to set up a generic UDP server device in your show file, so</p>
<ul>
<li>Open the device manager by clicking <a href="http://ecuetips.com/wp-content/uploads/2011/06/DeviceManager_Icon.png"><img class="alignnone size-full wp-image-42" title="DeviceManager_Icon" src="http://ecuetips.com/wp-content/uploads/2011/06/DeviceManager_Icon.png" alt="" width="47" height="46" /></a>.</li>
<li>Add a new device by clicking <a href="http://ecuetips.com/wp-content/uploads/2011/06/add-device.png"><img class="alignnone size-full wp-image-176" title="add device" src="http://ecuetips.com/wp-content/uploads/2011/06/add-device.png" alt="" width="40" height="32" /></a>.</li>
<li>Select &#8220;Terminals and Miscellaneous &gt; UDP Generic&#8221; and click ADD.</li>
<li>In the configuration window, select the network adapter you&#8217;d like to bind to and an available port.</li>
<li>Once you&#8217;ve chosen all the desired settings, click OK</li>
</ul>
<p>You should now have a UDP device ready to go. Now we have to create an e:script macro, which we will name UDP. I&#8217;ll give you the code to copy and paste first, and explain afterward. If you need an intro/refresher on e:script, you can read <a title="Scripting Basics" href="http://ecuetips.com/scripting-basics/">this tutorial</a>:</p>
<pre>// udp script comment
RegisterEvent(UdpReceive, OnUdp)
int sendport = 9001;
int nLen;
int nPort;
string sIpAddress;
string command;
string param;
string msg;
int nHandle;
int inBob;
int outBob;
inBob = BobAllocate(1500);
outBob = BobAllocate(1500);
Suspend();

// Handles an incoming UDP packet
function OnUdp(int nDriverHandle)
{
	// Clear the UDP input block
	BobSetRange(inBob,0,1500,0);

		// Copy UDP backet into a Binary Object Block
		nLen = ReceiveFrom(nDriverHandle, inBob, sIpAddress, nPort);

		// Exit if the packet is empty
		if (nLen &lt;= 0)
		{
			return;
		}

		// Parse out the 2 byte command and the parameter
		command = BobGetString(inBob, 0, 3);
		param = BobGetString(inBob, 2, 255-3);

		// Send an acknowladgement for a CHECK RESPONSE message
		if (strcmp("CS",command)==0)
		{
			msg = "ACK";
			sendMessage(nDriverHandle);
		}

		// Turn blind mode on or off
		if (strcmp("BL",command)==0)
		{
			SetSwitchState("blind", val(param));
		}

		// Play specified cuelist
		if (strcmp("PL",command)==0)
		{
			StartCuelist(QL(val(param)));
		}
}

// Send a UDP message to sIpAddress on sendport, message is msg
function sendMessage(int nHandle)
{
	BobSetRange(outBob,0,1500,0);
	BobSetString(outBob, 0,255, msg);
	SendTo(nHandle, outBob, strlen(msg), sIpAddress, sendport);

}</pre>
<p>This script takes advantage of e:scripts ability to run the script in the background. The first thing you&#8217;ll notices is the &#8220;RegisterEvent&#8221; command, which tells the programmer to call a function called &#8220;OnUDP&#8221; every time a UDP packet is received. After that there is a list of variables that are created for later use. You&#8217;ll need to change the &#8220;sendport&#8221; variable to match the port number that your client is listening on.</p>
<p>After the variables are created, thee is a &#8220;Suspend&#8221; Command which works in conjunction with the &#8220;RegisterEvent&#8221; command. The &#8220;RegisterEvent&#8221; tells the software where to send information when a particular event happens, while the &#8220;Suspend&#8221; command tells the software that you have finished setting up all the variables and such that you need and that control can return back to normal until the registered event can take place.</p>
<p>Most programs use a size of 1500 bytes for the payload of a UDP packet, and this is what I used in my case. A BOB (binary object block) was created to hold the data from the packet after it is received. A BOB is simply a chunk of memory that is set aside for use in your script.  Each time a UDP packet is received, the BOB named inBob is cleared using the &#8220;BobSetRange&#8221; command to ensure that no data from the previous packet remains to taint this packet. After the BOB is cleared, the &#8220;ReceiveFrom&#8221; command is called, which reads the most recent UDP packet and places the data into &#8220;inBob&#8221;. It also sets the &#8220;sIpAddress&#8221; and &#8220;nPort&#8221; variables, corresponding to the <span class="domtooltips" title="A unique network address that consists of four numbers separated by periods such as 192.168.123.1 (which happens to be the default address for all e:cue equipment).">IP address</span> and Port of the sender. It also returns the length of the packet, which is useful information to know.</p>
<p>After checking to ensure that the packet is not empty, the packet gets broken into components: the &#8220;command&#8221;, which is a consists of a 2 byte ASCII code and the &#8220;parameter&#8221; (param). The command specifies the action being requested, and the parameter contains any information needed to execute that action (such as a cue number or cuelist number).  This is done using the &#8220;BobGetString&#8221; command.</p>
<p>After the packet is split up into the command and parameter, you simply use an &#8220;if&#8221; statement for each command you&#8217;re defining to see if that command has been sent, and then perform the specified action within the &#8220;if&#8221; statement&#8217;s code block. I left a few examples in the code. Parameters are always passed as ASCII, but the value of a number passed can be retrieved using the &#8220;val&#8221; statement, an example of which can be seen in the &#8220;BL&#8221; command which turns blind mode on or off. The client will send either &#8220;BL1&#8243; or &#8220;BL0&#8243;, it reads BL as the command and then either 0 or 1 as the parameter. The parameter is converted to an integer and then used in the &#8220;SetSwitchState&#8221; e:script command, which sets the state of blind mode. The PL command uses the same logic,  but is used to play the cuelist specified in the parameter.</p>
<p>The last peice of the puzzle deals with the weakness that I talked about earlier. Since UDP doesn&#8217;t guarantee that there is anyone out there listening, I created a &#8220;heartbeat&#8221; system, in which the client can periodically send out a request for a response. In this case, the request comes in the form of a &#8220;CS&#8221; (check server&#8221;) command. When it is received it sends back a UDP packet containing the string &#8220;ACK&#8221; (acknowledge). This allows the client to ensure that the server is there to process its requests. This is a simple solution that still doesn&#8217;t guarantee any given packet was being received, but it provided enough security on the installation I designed this system for, which was running on a contained network with very little traffic. For higher reliability you could certainly design an algorithm that, for example, responds to every command with a check-sum that verifies that exactly the right command was received.</p>
<p>In order to start listening to for UDP packets the script must be started. You can do this manually while you are testing, but should be automated with an &#8220;On Initialization&#8221; trigger so that it starts as soon as the show file is loaded.</p>
<p>The script I&#8217;ve put on here is a pared down version of what was created for a specific situation. You may certainly use it as a base for your needs, but you should most certainly adapt it to suit the particular requirement you are using it for. Over a small local network this works great, but I would definitely recommend adding more error checking for larger networks or use over the internet.</p>
]]></content:encoded>
			<wfw:commentRss>http://ecuetips.com/creating-a-custom-udp-protocol/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Chasing to the Beat of Live Music</title>
		<link>http://ecuetips.com/chasing-to-the-beat-of-live-music/</link>
		<comments>http://ecuetips.com/chasing-to-the-beat-of-live-music/#comments</comments>
		<pubDate>Sun, 19 Jun 2011 18:18:55 +0000</pubDate>
		<dc:creator>Ruby Rubenstahl</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://ecuetips.com/?p=164</guid>
		<description><![CDATA[Ever been using e:cue for a live show and wanted to have a chase that runs with the beat of the music? This is easy to acheive with the programmer. Just follow these steps: Create a cue list with the chase steps you&#8217;d like to use. Go into the cuelist properties by either right clicking [...]]]></description>
			<content:encoded><![CDATA[<p>Ever been using e:cue for a live show and wanted to have a chase that runs with the beat of the music? This is easy to acheive with the programmer. Just follow these steps:</p>
<ol>
<li>Create a cue list with the chase steps you&#8217;d like to use.</li>
<li>Go into the cuelist properties by either right clicking on the cuestack and clicking &#8220;properties&#8221; in the main window or from within the cuelist window, click button that covers the width of the window under the list of cues.</li>
<li>Go to the &#8220;Extras&#8221; tab.</li>
<li>Change the type to any chase you like.</li>
<li>Set the default chase speed (optional).</li>
<li>Set the &#8220;chase crossfade&#8221; option (0% bumps from cue to cue, 100% is a smooth crossfade between cues with no wait time between).</li>
<li>Click &#8220;OK&#8221;</li>
<li>Repeatedly press the play button along with the music. After a few presses, the BPM speed will automatically update to match your speed.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://ecuetips.com/chasing-to-the-beat-of-live-music/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>butler xt Power Requirements</title>
		<link>http://ecuetips.com/butler-xt-power-requirements/</link>
		<comments>http://ecuetips.com/butler-xt-power-requirements/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 18:39:28 +0000</pubDate>
		<dc:creator>Ruby Rubenstahl</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[butler XT]]></category>
		<category><![CDATA[Glass Touch]]></category>
		<category><![CDATA[power]]></category>

		<guid isPermaLink="false">http://ecuetips.com/?p=159</guid>
		<description><![CDATA[The butler xt has a variety of options regarding power, but it can be a bit confusing to get set up properly, especially when using it with a glass touch or other e:bus device. There are a few rules to follow that will allow you to easily figure out what your power needs are: If [...]]]></description>
			<content:encoded><![CDATA[<p>The butler xt has a variety of options regarding power, but it can be a bit confusing to get set up properly, especially when using it with a glass touch or other e:bus device. There are a few rules to follow that will allow you to easily figure out what your power needs are:</p>
<ul>
<li>If you are using the butler XT with an e:bus device, you must have an external 24V power supply attached.</li>
<li>If you are using non-Traxon fixtures you must have a power supply providing 12V-24V.</li>
<li>If you are using Traxon fixtures, but you have a DMX booster, DMX splitter, or a any similar device between the butler xt and the first fixture, you must have an external power supply providing 12V-24V.</li>
<li>If you are directly connecting Traxon fixtures but no e:bus device, you do not need an external power source. The fixtures will supply an appropriate amount of voltage back.</li>
<li>If you are using Traxon fixtures <strong>and</strong> an e:bus device, you need to disable power input over the DMX line by flipping the switch located behind the RJ-45 DMX connector. Failing to do so will cause a conflict, causing  an e:bus power error and you won&#8217;t be able to use any e:bus devices connected to the butler xt.</li>
</ul>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://ecuetips.com/wp-content/uploads/2011/06/butler-xt-power-switch.png"><img class="size-full wp-image-160 aligncenter" title="butler xt power switch location" src="http://ecuetips.com/wp-content/uploads/2011/06/butler-xt-power-switch.png" alt="butler xt power switch location" width="400" height="282" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://ecuetips.com/butler-xt-power-requirements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovering From a Lost Password</title>
		<link>http://ecuetips.com/recovering-from-a-lost-password/</link>
		<comments>http://ecuetips.com/recovering-from-a-lost-password/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 20:50:57 +0000</pubDate>
		<dc:creator>Ruby Rubenstahl</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://ecuetips.com/?p=153</guid>
		<description><![CDATA[The e:cue software includes the ability to set a supervisor password and then go into &#8220;User mode&#8221; which allows the show to be played back but does not allow you to change settings or do any programming. On more than one occasion I&#8217;ve come across a system where the password is unknown for one reason or another [...]]]></description>
			<content:encoded><![CDATA[<p>The e:cue software includes the ability to set a supervisor password and then go into &#8220;User mode&#8221; which allows the show to be played back but does not allow you to change settings or do any programming. On more than one occasion I&#8217;ve come across a system where the password is unknown for one reason or another but some legitimate work needs to be done on the show. After a bit of work, I found that it is possible to disable the password in order work.</p>
<p><span style="color: #993300;">Warning! &#8211; The following describes editing of the windows registry. If you follow the instructions on this page you will be fine, but please note that making changes in the registry can be a dangerous and has the ability to render your system inoperable in some cases.</span></p>
<h2>Instructions</h2>
<ul>
<li>Close Programmer</li>
<li>Go to Start/Run or Press [Windows Key] + R</li>
<li>Type in &#8220;regedit&#8221; and click OK.</li>
<li>Navigate to &#8220;HKEY_CURRENT_USER\Software\ecue\e:cue Programmer V5.3\Options&#8221;</li>
<li>Find the setting named &#8220;m_go.password_active&#8221; double click on it</li>
<li>Change the value to 0 and click OK.</li>
<li>Start the programmer back up.</li>
</ul>
<p>Once you do this, programmer should automatically start in supervisor mode instead of user mode. The password is still there, it is just not being requested. Once you are done doing your editing, you can re-enable the default to supervisor mode.</p>
<p>This trick has saved me a few times, but please use it responsibly. If you are an end-user, the software was probably protected for a reason and you may cause problems without realizing it if you are not familiar with the show&#8217;s programming.</p>
]]></content:encoded>
			<wfw:commentRss>http://ecuetips.com/recovering-from-a-lost-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Action Pad Shortcut</title>
		<link>http://ecuetips.com/flash-action-pad-shortcut/</link>
		<comments>http://ecuetips.com/flash-action-pad-shortcut/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 20:26:52 +0000</pubDate>
		<dc:creator>Ruby Rubenstahl</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://ecuetips.com/?p=148</guid>
		<description><![CDATA[In an earlier article I explained how to get the HTTP server up and running. Once it is working, you should be able to go to http://yourserverIP/ActionPad/ActionPad.html but who is going to remember that whole ugly path name? I&#8217;m going to show you how to create a simple redirect so that you can just go [...]]]></description>
			<content:encoded><![CDATA[<p>In an <a title="Setting up the HTTP Server" href="http://ecuetips.com/setting-up-the-http-server/">earlier article</a> I explained how to get the HTTP server up and running. Once it is working, you should be able to go to http://yourserverIP/ActionPad/ActionPad.html but who is going to remember that whole ugly path name? I&#8217;m going to show you how to create a simple redirect so that you can just go to http://yourserverIP and automatically be sent to your action pad.</p>
<p>In your root directory, create a new text file (or open the existing file) that you have set as the default file in the HTTP server settings. In that file, paste the following:</p>
<pre>&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;e:cue Action Pad Redirect&lt;/title&gt;
	&lt;/head&gt;
	&lt;body&gt;
		You are being redirected to the action pad. If you are
		not automatically directed, please click
		&lt;a href="/ActionPad/ActionPad.html"&gt;here&lt;/a&gt;

		&lt;script type="text/javascript"&gt;
			&lt;!--
			window.location = "/ActionPad/ActionPad.html";
			//--&gt;
		&lt;/script&gt;
	&lt;/body&gt;
&lt;/html&gt;</pre>
<p>Save the file and then go to a web browser and simply type in the <span class="domtooltips" title="A unique network address that consists of four numbers separated by periods such as 192.168.123.1 (which happens to be the default address for all e:cue equipment).">IP address</span> of the HTTP server. you should automatically jump to the action pad page as soon as you type it in.</p>
]]></content:encoded>
			<wfw:commentRss>http://ecuetips.com/flash-action-pad-shortcut/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting up the HTTP Server</title>
		<link>http://ecuetips.com/setting-up-the-http-server/</link>
		<comments>http://ecuetips.com/setting-up-the-http-server/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 19:45:38 +0000</pubDate>
		<dc:creator>Ruby Rubenstahl</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://ecuetips.com/?p=138</guid>
		<description><![CDATA[The e:cue Programmer&#8217;s HTTP server is an extremely powerful tool for creating completely customized end user interfaces. Depending on your needs there are a couple of different ways that you can go about interfacing with the server. This tutorial is only going to cover getting the server enabled (including troubleshooting common problems). I&#8217;ll follow up [...]]]></description>
			<content:encoded><![CDATA[<p>The e:cue Programmer&#8217;s HTTP server is an extremely powerful tool for creating completely customized end user interfaces. Depending on your needs there are a couple of different ways that you can go about interfacing with the server. This tutorial is only going to cover getting the server enabled (including troubleshooting common problems). I&#8217;ll follow up later with tutorials to help get you going with the flash action pad and creating your own html interface.</p>
<p>For those of you who aren&#8217;t familiar with what an HTTP server is, it is the type of server used for web pages. I&#8217;m not going to go in depth about what HTTP is or how it works. If you want an easy-to-read yet thorough explanation of the HTTP protocol, you can find one <a href="http://www.jmarshall.com/easy/http/#whatis">here</a>.</p>
<p>OK, let&#8217;s get started. For this tutorial I will be using programmer V5.3. This is important because both the settings and the method for choosing those settings has changed dramatically from older versions of the programmer. Also, you will need to be running the programmer in Enterprise mode (with an Enterprise dongle) to be able to start the server.</p>
<p>First thing you need to do is go to your application options by clicking the <a href="http://ecuetips.com/wp-content/uploads/2011/06/ApplicationOptions-Icon.png"><img class="alignnone size-full wp-image-139" title="ApplicationOptions Icon" src="http://ecuetips.com/wp-content/uploads/2011/06/ApplicationOptions-Icon.png" alt="Application Options Icon" width="46" height="51" /></a> icon and then click on the &#8220;HTTP Server&#8221; tab. You should now be able to see this.</p>
<p><a href="http://ecuetips.com/wp-content/uploads/2011/06/http-settings1.png"><img class="aligncenter size-full wp-image-142" title="http settings" src="http://ecuetips.com/wp-content/uploads/2011/06/http-settings1-e1307989366133.png" alt="" width="500" height="538" /></a></p>
<h2>Enabling the Server</h2>
<p>The first thing you&#8217;ll want to do is set your network interface. If you click on the <span class="domtooltips" title="A unique network address that consists of four numbers separated by periods such as 192.168.123.1 (which happens to be the default address for all e:cue equipment).">IP address</span> next to the &#8220;Network Address&#8221; setting, you will see a button labeled &#8220;&#8230;&#8221;  Click this button and you&#8217;ll get a list of IP addresses available on your computer. Select the interface that you would like to use.</p>
<p style="padding-left: 30px;"><em>Why do I need to do this? </em>Say you have a server running a bunch of butlers on their own network. You can hook up a secondary network interface on the server that connects to the internet, corporate network, wireless router, etc. which will allow you to communicate with the e:cue software via a secondary network.</p>
<p>The default port for an HTTP server is 80. When you go to a website such as http://ecue.com your web browser automatically knows that it should contact that server on port 80. In most cases you should leave this as is. If, for some reason, you wish to change from the default port (you are already running another web server, or you want to use an obscure port to make sure no one accidentally stumbles onto the web page, etc) you can change it to any other <a href="http://en.wikipedia.org/wiki/Port_number">valid TCP port number</a>. If you change the port number, then you need to specifically ask for that port within your browser. For example, let&#8217;s say that we changed it to 99 and your <span class="domtooltips" title="A unique network address that consists of four numbers separated by periods such as 192.168.123.1 (which happens to be the default address for all e:cue equipment).">IP address</span> is 192.168.1.5 You would need to use the address http://192.168.1.5:99/somepath in order to talk to the server.</p>
<p>Now that you have your <span class="domtooltips" title="A unique network address that consists of four numbers separated by periods such as 192.168.123.1 (which happens to be the default address for all e:cue equipment).">IP address</span> and port set, click on OK and go to the HTTP Server log tab on the main interface. If everything went well, you should see a message that says something like &#8220;Listening on 192.168.123.5:80&#8243;. If you see that, you can go ahead and move on to the next section.</p>
<p>If you see a error message that says something like &#8220;Error setting up listener thread! Port 80 may be unavailable!&#8221; then your socket 80 is already being used by another program. Most likely if there is already another HTTP server set up on your computer you&#8217;d know about it and you can either disable it, change it&#8217;s listening port, or change Programmer&#8217;s listening port. The major culprit for unintended open HTTP ports is Skype. By default Skype uses port 80 to listen for incoming connections. You can either completely shut down Skype or go to &#8220;Tools &gt; Options &gt; Advanced &gt; Connection&#8221; and uncheck the &#8220;Use ports 80 and 443 as alternatives for incoming connections&#8221;. Once you&#8217;ve done this, go back to programmer and try again to see if it works.</p>
<p>If you don&#8217;t have Skype installed and you&#8217;re still having this error message, then you&#8217;ll have to hunt down what program is keeping the port open, which is a bit beyond the scope of this article, but I can pont you to <a href="http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx">this tool</a> which will make hunting it down a lot easier.</p>
<h2>Preparing for use</h2>
<p>At this point, if you are planning to use the flash action pad, you should be set, you should be able to point any browser on the same network segement as the server to http://192.168.123.99/ActionPad/ActionPad.html (replace the <span class="domtooltips" title="A unique network address that consists of four numbers separated by periods such as 192.168.123.1 (which happens to be the default address for all e:cue equipment).">IP address</span> with the one you are using) and you should see the flash action pad load up. You&#8217;ll want to pay attention to the next part of the article though because you&#8217;ll be able to use it to create a shortcut later.</p>
<p>If you are going to be creating custom HTML files, you&#8217;ll need to set the home path for them. You&#8217;ll want to create a folder on your computer for these files to be stored. The default is C:\ServerRoot but you can set it to anything you like.</p>
<p>Next you&#8217;ll want to set the default document. The default document is the document that is sent from the server when you don&#8217;t ask for a specific file name. For example, when you go to http://ecue.com the server is going to see that you didn&#8217;t ask for a file name, so it will give you http://ecue.com/index.php. Most servers use index.htm, index.html, or default.htm as their default documents. You can change it to whatever you wish, but I would suggest leaving it as index.html to remain consistent with the defacto standard.</p>
<p>Once you have the home folder and default set as you wish, click on OK then create a text file in that folder with the name of your default file (such as c:\ServerRoot\index.html). In that test file simply type &#8220;test&#8221; and save it. Now, go to your browser and go to your <span class="domtooltips" title="A unique network address that consists of four numbers separated by periods such as 192.168.123.1 (which happens to be the default address for all e:cue equipment).">ip address</span> (ie http://192.168.123.55) don&#8217;t forget to add the port if you selected something other than 80.</p>
<p>If you see anything other than &#8220;test&#8221;, go through and make sure that your file and folder names match the settings you created. If you used notepad, make sure that the file actually got saved as a .html file instead of a .txt file, as in some circumstances it will add it automatically so that you end with a file named index.html.txt. You may have to <a href="http://mintywhite.com/windows-7/7customization/showhide-file-extensions-windows-xp-vista-7-quick-tip/">enable viewing of hidden file extensions</a>.</p>
<p>Once you get to this point, you are able to use the HTTP server as described in the System Basic Manal help file included with the software. I will also be doing another tutorial in the future that goes in depth on how to create web based interfaces that use the server.</p>
<h2>Security</h2>
<p>The largest advances in the newly revamped HTTP server are in security. You can now assign a username and password both to the html part of the server and to the flash action pad. To enable the use of this security feature, all you need to do is set the username and password that you want and it will automatically be enforced next time you try to use the server. Unfortunately you can only have one set of credentials with no way to serve different content based on who is logging in.</p>
<p>Finally we have the &#8220;Security Policies&#8221; options, which mainly have to do with scripting.</p>
<ul>
<li>e:script Execution &#8211; allows execution of e:script commands over the http server</li>
<li>System Commands &#8211; allows external programs to be called, which can be dangerous especially if left open on the internet</li>
<li>Show Modification &#8211; allows cues to be recorded, etc</li>
<li>File Modification &#8211; allows commands that save to, create, or delete external files</li>
</ul>
<p>You should only enable the options that you absolutely need, and be especially careful if the machine is accessible over the internet or any other network subject to unknown users.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://ecuetips.com/setting-up-the-http-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

