SPLat Logo

SPLat Call Home: The sandbox

NOTICE: Our web site is being updated, but is currently experiencing extreme slowness due to host issues. Please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map

SPLat Call Home: The sandbox

Point your browser to http://www.splatco.com/sch/sandbox.php (copy and paste the URL (address) into your browser). This is the "sandbox" page we have created as a tool to assist in developing SPLat programs for SPLat Call Home (SCH). It is hosted on the same server as our website, at a 3rd party web hosting company in the USA.

The sandbox consists of a php script, linked to a web page. If you connect to it from a web browser, it will return and display a web page which shows what you sent it. If you send to it from a SX10509 SCH board, it will return some data to the SCH, and simultaneously update the web page to show you what the SCH sent and what the sandbox script sent back to the SCH. You can also influence what is to be sent to the SCH, on the web page. Hence, the sandbox is a useful tool for monitoring what comes out of SCH and for sending back some known data.

The sandbox is a useful tool for confirming that the SPLat SCH programming is working correctly against a known, good, php script in the server. This means you won't have to try and debug both ends at once. This can be particularly valuable if someone else is doing the server programming. The overall strategy then is to get your code in the SPLat working against the sandbox, and then switch over to your own php on your own server. At that point it would be a good idea to implement bits of the sandbox on your server, so you can test it against a known good SPLat program.

Once you have displayed the sandbox page using the URL http://www.splatco.com/sch/sandbox.php, you can try adding a "query string" to the URL. Query data is something following a question mark after the filename sandbox.php.

For example, you could try this:

http://www.splatco.com/sch/sandbox.php?a=5&b=-9

The query string here is a=5&b=-9. This consists of two "name-value pairs", separated by an ampersand - &. The first name-value pair is a=5, the second is b=-9. There is no law that says you must send data in this format (except for the question mark), but it is the convention, and php is very good at extracting data in that format.

You may recognize this format from Google queries like http://www.google.com/search?q=splat+call+home&ie=UTF-8 that will appear in your browser's address bar. You will notice this contains plus-signs between the words, in place of spaces. It is illegal to send spaces (and several other characters) in a query string. For Google queries plus signs can substitute for spaces. More commonly "percent escaped" characters are used, for example %20. 20 is the hexadecimal code for an ASCII space character. A number of characters must be percent escaped, including space, carriage return, ampersand and the percent sign. More information..

Don't use your browser to explore what will work in a query string. Browsers are very good at "fixing" up incorrect syntax, so any conclusions you might draw about what works and what doesn't work could be incorrect.

The sandbox distinguishes between 3 types of query string:

Query string (after ?)

Sand box response back to SCH Meaning / notes
(Nothing)

05:24:01 GMT

The current GMT time

a=5&b=-9

-4

the sum a + b

config

therm=67.78
cktime=99
pump=1
valve=0

4 name-value pairs separated by carriage return ('0D) characters

Have a play with the sandbox from your browser. It will always show you what it received, and if you send it name-value pairs it will show you the individual variable.

When you use the sandbox from a browser. it cannot show you what would have been sent back to a SCH board. Once you interact with it with a real SCH board, it will show you what it sent back to the board.