Access Keys:
Skip to content (Access Key - 0)
All CIMA spaces

CIMA

This space

Real time data capture

compared with
Current by Richard Meredith-Hardy
on 14 Jul, 2014 17:16.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (16)

View page history
*Suggestions for improvement welcome\!*

Refer to the [ABG 2012 system|cimaWiki:The ABG system] for a working demo detailed description of something which inspired the idea.

h3. The problem

* In any competition it is desirable to be able to produce results as quickly as possible.
* It is also desirable to be able to produce in-competition data, eg an elapsing time, count of targets hit thus far.
* Fundamental to this objective is *data collection*; none of the above can be achieved in anything like real time without some sort of electronic data collection system. (Compare this to the paper forms traditionally used to collect performance data, none of the content can get into the scoring system until all the form has the forms have physically been delivered to the scoring centre.)
* A solution to our requirement is not as simple as purchasing or renting some equipment used in some other sport, eg a ski-timing system, because that would only collect one element of the data we need to produce a score.
* However it is done, the hardware needs to be cheap or it won't be used.

h3. The proposed solution

* An app which works on common hand-held devices.
* Configurable to the data collection task in hand.
* Core to the system is an app which works on common hand-held devices, primarily tablets, but should also be functional on smaller devices like phones. (the data *terminal*)
* It is proposed the initial work on terminals should be directed at [Android devices|http://www.android.com/] since this is an open-source OS and the hardware is just as prevalent and generally much cheaper than the equivalent offerings from Apple, but there is no reason why the same thing can't be ported to iOS or Windows at a later time.
* Hence it would One solution might be sensible to look at cross-platform systems such as [phonegap|http://www.phonegap.com/], [Appcelerator Titanium|http://docs.appcelerator.com] or [Adobe AIR|http://www.adobe.com/uk/products/air.html]. Tribal have published an interesting [analysis of modern cross platform systems|http://www.mole-project.net/images/documents/deliverables/WP4_crossplatform_mobile_development_March2011.pdf] (paid for by the US navy)
* The app should be a touch-screen centric application capable of:
** Displaying means of collecting all the data as may be required to score all pilots in a task. (except, for the time being, logger derived data).
The app must be simple to use by inexperienced operators in a relatively stressful environment. The solution is therefore not as simple as having an app which the operator can unilaterally choose from many options the kind of data they are supposed to be collecting. Instead, the app must be externally configurable so each operator is only shown what they must be collecting for that task, and the workflow must be organized so this is as 'idiot-proof' as possible. This implies that the collection of a data item may trigger another, for example a strike on a stick which adds one to a counter may also start a timer.

Several tasks may be happening simultaneously, or data for a task may be being collected from several different sources simultaneously, but there is no requirement for the _same_ data item to ever be collected from more than one source. A single data item can therefore said to be defined as *Task \> > Competititor \> > Element* where the element is one part of the competitors' performance in task which must be recorded so the whole performance in task can eventually be compared to all the other performances in task.

The ABG system was disadvantaged by being hard-coded, which made it only usable in a very specific set of tasks without re-writing and re-installing the terminal software.
Some sub-components must be capable of collecting external data such as a start list. (Names, comp no., task start order). This implies there must be a *standard data-structure* (xml or JSON) with a detailed specification for each sub-component of this type, which in turn means there must be at least one simple method of generating it. It is proposed that the simplest way of initially achieving this is to produce an *Excel add-in* similar to the one already demoed with the [WLC results|cimaContinentalCup:WLC Results 2012], but other systems can be made available at a later time as necessary.

New discovery: A very good excel REST library at [mcpher.com|http://ramblings.mcpher.com/Home/excelquirks]
Worth a look: An interesting excel REST library at [mcpher.com|http://ramblings.mcpher.com/Home/excelquirks]

h5. Timing
The app is useless unless the data it produces can be read by something. As with data-in, it is proposed an *Excel add-in* is initially produced which is capable of reading the supplied data and inserting it into the appropriate place in the scoring spreadsheet. Other systems can be made available at a later time as necessary.

Two variants of data-out.?
* Full version: A full record of everything so it also contains logging info such as the current configuration, sequence of keypresses Etc. Continuously saved locally but sent to server only rarely.
* A 'reduced' version containing only key data for normal transmission to server.

Two types of data out
* Provisional:  Sends data whilst the performance being measured is actually happening, mainly useful for scoreboard, commentator and TV caption displays.
* Confirmed: As soon as possible after the performance is completed, physical action by the operator (eg '*send* button') transmits all collected data including 'extras' eg penalties which must be applied.  Can be repeated (ie an update).

Since the provisional type of data definitely needs special softwares on the receiving end this need not be present in early versions of the app. but the concept should be borne in mind for introduction into more developed versions.

h5. Communications

1) Simple: A file system on the local subnet (wi-fi capability of the device)
2) Via http to a server on the local subnet (wifi)
3) Via https, wifi and a router on the local network to a remote internet based server.
4) Via mobile data network to a remote server. Could be file-based (eg dropbox) or https.

[MQTT|http://mqtt.org/] might be a better option than http.
[MQTT|http://mqtt.org/] might be a better option than http? Much lighter weight protocol highly suited for this type of requirement, [various Android apps|http://mqtt.org/wiki/doku.php/mqtt_on_the_android_platform] , but does need a [broker|http://mqtt.org/wiki/doku.php/brokers] and translation services to other protocols (eg [Mule ESB|http://www.mulesoft.org/]).

The choice of which system is used is dependent on the sophistication of the user. Variant 1 should require nothing more than a single computer connected to a wireless router in access-point mode which is within range of the terminals in use.
It is fundamental to the system that current communication state is known to the app and the operator, if communication is not currently possible to the configured data source then the app must cache data until comms are re-established. Equally, the operator must be made aware of current comms state so he can do something about it if comms are lost (eg move back into range of the wi-fi signal).

Note that option 1) above might be more difficult to achieve than having some sort of web server on the receiving end.  If it is, then the web server must be available in its most basic form as a really simple thing to install on a host computer.

*Problem?* Phones and tablets usually hop amongst wifi providers depending on the best signal. The system in use may be a single AP, may be a mesh system, may have several different APs, hopping amongst them is desirable, but probably there will be other APs in the vicinity too (eg for public internet access). Is some special arrangement necessary to ensure it will only lock onto the designated network?

h5. Synchronization

Systems using http connection which is intrinsically asynchronous will need some level of software at the receiving end not just to do something with the data (eg write it to a file or db) but which can also manage the same sync protocol in an orderly manner.

h5. Security

* On an internal subnet this is probably quite easy to arrange, simply set up the wifi so it is dedicated only to data collection and have it protected by normal WEP security. The terminal devices are set up with the appropriate password to the access point, nobody else on site has access. Note however that this simple setup relies on the data collection and the scoring being totally isolated from any other network. If you are intending to use the system to publish scores to the local 'public' network you will probably need to look into having a switch or router which can route selected traffic between local subnets through a firewall.
* Connections to remote internet based servers must be https. Regular basic authentication is then probably good enough and its not necessary to mess with complicated systems like oAuth.

h3. summary of requirements for a complete initial system


Adaptavist Theme Builder Powered by Atlassian Confluence