Distributed Sensor Logging : As Easy as a Mesh of Yoyos *

The Mass Gathering Data Acquisition and Analysis (MaGDAA) project involved the development of hardware and software solutions to facilitate the rapid and effective collection of autonomous and survey based data during mass gathering events. The aim of the project was the development and trial of a purpose-built Open Hardware based environment monitoring sensor prototypes using IOIO (pronounced “yoyo”) boards. Data from these sensors, and other devices, was collected using Open Source software running on Android powered mobile phones, tablets and other open hardware based platforms. Data was shared using a Wi-Fi mesh network based on an Open Source project called The Serval Project. Additional data in the form of survey based questionnaires were collected using ODK Collect, one of the applications in the Open Data Kit suite. The MaGDAA project demonstrated that it is possible for researchers (through the use of Open Source software and Open Hardware) to own, visualise, and share data without the difficulties of setting up and maintaining servers. MaGDAA proved to be an effective infrastructure independent sensor logging network that enables a broad range of data collection (demographic, predispositions, motivations, psychosocial and environmental influencers and modifiers of audience behaviour, cultural value) in the field of mass gathering research.

The Mass Gathering Data Acquisition and Analysis (MaGDAA) project has been focused on the development of Open Source Software and Open Hardware to support research in the area of mass gatherings.By using open technologies and standards the project has been able to develop prototype hardware and software in a relatively short time period.
The use of the MaGDAA sensors and survey management tools on Android powered devices were developed to improve the speed, automation and overall effectiveness of the collection of data, particularly in a way that could be incorporated into the overall dataset for a wide range of events.
Additionally, through the use of mesh networking, the sensor network can be used without the need for additional infrastructure and can also support distributed data management.

Mass Gathering Research
In 2004 Arbon proposed a conceptual model that was founded on the idea that mass-gathering health can be understood as an inter-relationship between three domains: 1) the biomedical; 2) the environmental; and 3) the psychosocial [1].Mass gatherings are defined in terms of the number of people who attend an event where people gather and where there is potential for a delay response to emergencies or medical care [2].To date the science of mass gatherings has focused on the environmental and biomedical domains with limited knowledge to support understanding of the psychosocial domain.The psychosocial domain captures the psychological and social influences within mass gatherings mass gatherings and includes both individual and audience behaviour and motivation [1].
In the past there has been recognition that the nature of the audience will impact directly on its health and safety, however the majority of published research focuses on audience behaviour in a negative context such as violence or conflict [3,4].Additionally there is no agreement on what audience behaviour, mood and type actually mean.At the same time these elements have a number of applications, including event design and management, emergency planning and mass gathering medicine.These questions are, therefore, worthy of exploration.
An important component of this early model is the potential impact that the psychosocial domain may have on the incidence of injury and illness due to features traditionally described as crowd mood and type.This potential arises from the interaction of key features of the event and understanding the audience's demographic, predispositions and behaviour can lead to the development of interventions that are likely to reduce risk and enhance the safety of the event.Yet this potential has been little explored until now and there is a dearth of literature describing how the audience's behaviour, mood, type and motivation impacts on their health and safety at mass gatherings.In addition there is limited evidence of models with practical applications to monitor and measure crowd at mass gatherings [5].This assertion is supported by Emergency Management Australia (2005) who state that "practical applications to monitor and measure crowd type and mood have received limited attention" (Emergency Management Australia (p. 14) in the past.
Crowd (or audience) behaviour has been defined by [5] as the demonstrable factor that requires assessment and monitoring to underpin management actions at mass gathering events.Zeitz et al. [5] proclaim the term refers to the gathering of a large number of people; not dependent on the reason for the gathering.Whereas "type" is a social descriptor of the sub-culture (society) and "mood" is a psychological descriptor of an audience.Type and mood impact on behaviour.Impacting factors on behaviour also include the nature of the activity, motivation of the crowd, security, weather and the density of the audience (e.g.people per square metre) [2,6].
As audience behaviour is the most visible feature of the psychosocial domain of mass gatherings it is surprising that is has not been measured in a rigorous fashion.In the mid-nineties two models where developed to assess crowd mood and crowd type; Berlonghi (USA) [7] and Pines and Maslach (UK).In Australia Berlonghi's classification of crowd types is now promoted by the EMA (1999) and the work of Pines and Maslach [8] was adapted by Zeitz et al. [5] to analyse the effect crowd mood may have on emergency services workload at mass gatherings.
In the past few years Brown and Hutton [9,10] have been examining practical strategies to develop accurate models to understand crowd behaviour at mass gatherings.The outcomes of this research will enable more accurate predictions on the health care needs of people attending these large public events and support the development of theory.Part of this strategy is to measure audience behaviour through a wide range of variables (including density, humidity and temperature) and relate these back to the observed health status of individuals.To achieve this a data collection system is being designed to capture and compare real-time data on the wide range of variables of audience behaviour at mass gatherings that can influence the health of individuals and are measured as patient presentation (PPR) and transport to hospital rates (TTHR).
The maintenance of public order at mass gatherings is often referred to as audience management [11].The size of the audience and the type of event can impact on the workload of emergency services [12].Therefore gaining an understanding of audience behaviour is important in supporting timely and appropriate management principles in the planning and provision of emergency services at mass gathering.There is a large theory to practice gap in relation to crowd/audience psychology within the mass gathering setting [3].
The purpose of the research is to develop an evidence base to support theoretical and conceptual models to provide a better understanding of the interaction between key characteristics of individual behaviour and the health effects of mass gatherings.This data will contribute to more accurate predictive models for patient presentation rate (PPR) and transport to hospital rate (TTHR) for mass-gatherings.
The purpose of the MaGDAA project is to automate the collection of as much of the environment data as possible, while at the same time supporting the collection of empirical data using surveys that are accessed using tablet based computers.Additionally a Wi-Fi mesh network is used to support the distribution of data to each device in the network to reduce the risk of data loss and support easier data management activities.

MaGDAA System Architecture
The core of the MaGDAA system architecture is a Wi-Fi mesh network.A mesh network within the context of the MaGDAA project is a Wi-Fi network that supports peerto-peer communication and where the network can be created, used and maintained independently of the presence of any traditional wireless network infrastructure.The formation and management of the Wi-Fi mesh network is undertaken by the open source Serval Mesh software developed by the Serval Project.

The Serval Project
The Serval Project has developed software, which uses the Wi-Fi capabilities of mobile devices powered by the Android operating system to form a wireless mesh network.A mesh network is formed when each device is identify and launch survey forms.connected to all other devices in its proximity.By traversing the links between devices, communication can occur between devices that normally would be outside of each other's range.Android was chosen as the initial development target as it is an open source platform and as such more readily supports the development of software such as the Serval Mesh software.Other more closed platforms, such as iOS and Windows Phone, have restrictions prohibit the development of software that needs to integrate with the underlying phone hardware such as the Serval Mesh software.
The collection of data via the survey form is conducted using the ODK Collect application, one of a suite of tools that if it relied on the effective distance of a Wi-Fi network alone.Future development plans for the Serval Project include the possibility of integrating with custom hardware to support the use of sub 1GHz, which while lower in bandwidth supports longer distances.Additionally there are plans to support integration with other network topologies such as satellite to broaden the range of a mesh network even further.The primary functionality provided by the Serval Mesh software is voice calls using mobile phones.There is also the additional functionality of messaging and file sharing using the Serval Rhizome data transfer service.The Rhizome data transfer service is an extension of the technology created to support Serval MeshMS services [13], and is a form of store and forward networking.Data that is stored on one device in the mesh network is automatically shared with other devices on the network.This ensures a high probability that information from one device is copied to all other devices in the mesh network over time.
The use of the Serval Mesh software provides two main advantages.The first advantage is the ability to form a network for sharing data between devices on the network without the need for any additional infrastructure.The second advantage is that the data collected by the sensors, and other devices such as tablets used in undertaking surveys, is distributed onto all of the devices on the network.The data sharing capabilities of the Rhizome data service mitigates the risk of data loss through the loss of any one device.Any single device on the network has copies of the data that it has collected as well as data from other devices.Currently there are four different types of devices envisaged for the MaGDAA system.They are outlined in the following sections, additionally an overview of the system architecture is provided in Figure 1.
Importantly this type of approach also supports transient network devices, such as devices that come into, and then out of, network range of other devices.Data can be propagated from one section of the network to another simply by the act of a researcher moving through the site of the mass gathering event with a mobile device running the Serval Mesh software in their pocket.The network can then cover a greater area than audience such as audience behaviour.MaGDAA SAM is designed to provide an easy to use interface that allows researchers to quickly

Survey & Crowd Metric Collection Nodes
During the course of a mass gathering event a researcher is engaged in the acquisition of audience metrics and other information through the use of surveys.The researcher uses the MaGDAA Survey Acquisition Man- agement (SAM) software to launch the appropriate survey.For example a survey that collects demographic information from participants at the event, or various metrics related to the audience such as audience behaviour.MaGDAA SAM is designed to provide an easy to use interface that allows researchers to quickly identify and launch survey forms.
The collection of data via the survey form is conducted using the ODK Collect application, one of a suite of tools that are part of the Open Data Kit (ODK).The ODK suite of tools has been shown to be effective in collecting data in the field using mobile devices [14], especially in the collection of medical and health information [15].
Using the ODK Collect application it is possible to construct survey forms that collect textual information, including free text fields and single and multiple option selection lists, as well as rich media such as images, video and sound.Additionally geographic location information can also be collected as part of completing a survey using the GPS capabilities of the device.The use of the ODK Collect application provides researchers with a wide variety of options for data collection.
There are three key factors, which have made the ODK suite of applications an attractive choice for the MaGDAA project.First, is that the ODK suite of tools is released as open source software and that in particular the ODK Collect application is designed for devices using the Android operating system.Second, is that there are other applications in the ODK suite which can be used for data aggregation as well as survey construction.Lastly, is that the ODK suite of applications uses of the open standard XForms [16].XForms is an XML based standard for the definition of survey forms and their results in a platform independent manner.Once a survey is finalised by the ODK Collect application the MaGDAA SAM application bundles up the survey data, and any associated rich media, into a single compressed archive and shares this with the other devices on the network using the Rhizome data transfer service.
By using open source software, open hardware and open standards it has been easier to quickly develop the prototype hardware and software that has been required to achieve the initial goals of the MaGDAA project and is one of the key success factors for the project.

Weather Information Collection Node
A prototype weather information collection node is an Android powered mobile phone connected to a custom hardware module based on the open hardware IOIO development board.The hardware module acts as a bridge between the mobile phone and the console of a Vantage Vue weather station from Davis Instruments.Communication between the hardware module and the console is achieved using the serial communications protocol.The hardware module communicates with open source software developed by the MaGDAA project known as Weather Information Straight to Network (WInSTON).
It is envisaged that the WInSTON software will poll for new weather information periodically and distribute the collected information using the Rhizome data transfer service.The weather information collected by the Win-STON software can used by the researchers to gain an indication of the overall weather conditions at the site of a mass gathering event.

Static Environment Sensor Nodes
Environmental data is collected at a single location over the course of the mass gathering event using a prototype static environment sensor device.Connected to a mobile phone running the Android operating system is a sensor module constructed using an IOIO development board.The two sensors currently connected to the module are a TMP36 temperature sensor and a HIH-5031 humidity sensor.The open source MaGDAA Mobile Environment Monitoring (MEM) software interfaces with the sensor module and periodically polls for new sensor readings.This data is then shared with the other devices on the network using the Rhizome data transfer service.
Importantly the IOIO development board has support for the connection of additional sensor components.One such sensor is a light sensor, which provides readings in lux and would provide an indication of the amount of light in an area.Another additional sensor is a carbon dioxide sensor, which when combined with the readings from the temperature and humidity sensor could provide an indication indoor air quality.
The environmental information collected by the MEM software provides researchers with information about the environmental conditions in a specific area, for example inside a marque.

Mobile Environment Sensor Nodes
A mobile environment sensor device is a variation of the static environment sensor device outlined in the previous section.It is envisaged that the mobile environment sensor module will be constructed using an IOIO Mint development kit from Adafruit Industries, and a custom built case.The case could potentially be 3D printed.The IOIO Mint development kit comprises a custom IOIO development board, rechargeable battery, Bluetooth network adapter, and supporting electronics in the form factor of a small mint tin.Connected to the IOIO development board are the same sensors as those used with the static environment sensor module.In contrast to the static sensor module the MaGDAA MEM software running on an Android powered device uses Bluetooth to connect to the mobile sensor module thereby making it a portable environment monitoring solution.
The environment information collected by the MEM software when used with the mobile sensor modules provides researchers with environmental information wherever they go on the site of a mass gathering event.

Distributed Data Management
As mentioned previously the use of the Rhizome data transfer service ensures that the data collected on one device on the network is automatically shared with other devices on the network.In this way there is no single point of failure that will result in data loss.For example if a sensor node fails, or is stolen, the data that it has collected up to that point is likely to have been copied to at least one other device on the mesh network.
Additionally at the end of the mass gathering event each device on the network when brought back to the researchers base of operations will automatically share any remaining data with the other devices on the network.In this way the researchers primary computing device, such as a laptop, will have all of the data copied to it and available for copying onto the researchers' computers in their office to start the analysis process.

Open Source Software
Open Source Software is software created under licensing that requires the additional distribution of the source code.While a creator (or group of creators) may wish to charge for their software version, they must provide the source code.Others are allowed to utilise the source code to provide additional or altered functionality.This right to the code is at the inner most core of the definition of Open Source software.However, the Open Source Initiative says that there is more to Open Source than just "access to the source code" [17].Under terms of distribution, to be defined as Open Source, software must meet additional criteria including the following.
The licensed software must be distributed freely and the source code must be included with the software, or provision for the easy access to the source code be made.The licensing must allow for derived worked and modifications, with the proviso that they must be distributed under the same terms as the originally licensed software.However, to maintain integrity with the originating author, this original license may in fact restrict modified forms being available unless they indicate incremented version numbering, or different naming to indicate the changes.
No additional licensing should be required to use or work with the software in any form, and the license must not be restrictive in the specificity of the product-the software must not, for example, be tied to a particular device, or particular version or distribution of software, and the licensing must not inhibit or restrict the function-ality of other software.Discrimination of any person or group of people is unacceptable under Open Source software provisions, as is discrimination based on a particular endeavour, with examples often used including a type of business or research.
It is the belief in these principles, which has encouraged the release of the software developed by the Ma-GDAA project as open source via a freely available and accessible source code repository (https://github.com/magdaaproject).Additionally the open source like nature of the Android operating system has contributed to the ability of the Serval Project to access the low level hardware necessary to construct a mesh network and has also contributed to the overall success of the Android operating system [18].

Open Hardware
Open Hardware, also known as Open Source Hardware, is similar in nature to Open Source Software.The Open Source Hardware Initiative in fact utilises [19] the definitions and restrictions from the Open Source Software Initiative to maintain a "co-existence" [20], which should enable the clear intention and definition to proliferate.
Whereas Open Source Software is obviously where the code is the product upon which all rules are targeted, Open Hardware is hardware where the design is the product, that again has the option to be freely duplicated or modified, albeit with similar restrictions to the ones listed previously.In addition to the design or idea being the product, it is envisaged that: "Ideally, open source hardware uses readily-available components and materials, standard processes, open infrastructure, unrestricted content, and open-source design tools to maximize the ability of individuals to make and use hardware" [19].
The IOIO development board, which is the core of all of the sensor boards, is an example of open hardware.All of the schematics and software required to use, and optionally construct your own IOIO board is available via the projects main website (http://github.com/ytai/ioio).
It is the belief in these principles, as applied to open hardware as well as open software, which has resulted in the MaGDAA project making all of the documentation, including schematics for the prototype sensor nodes, available on the MaGDAA project wiki (http://wiki.magdaaproject.org/).Using open source hardware has made it possible for the MaGDAA project to rapidly develop the environment sensors starting with a bare development board and moving through to the finalised prototype sensors.

Method
The MaGDAA project was first trialled at two major events staged in Adelaide, South Australia in March, 2013.The first, the 2013 Adelaide Festival, is an arts and cultural festival that is held annually and is staged over two weeks and three weekends in a range of indoor and outdoor venues.The second, an outdoor (predominantly world music) festival, Womadelaide, is a 4-day festival, staged in Botanic Park on the edge of the central business district.
The Adelaide Festival trial involved the use of the tablets and the Wi-Fi mesh network, the use of Android powered tablets with the ODK suite of application.Demographic and cultural value related data was successfully collected and safely stored over the network with automatic data entry.The Womadelaide trial also involved the use of: environmental data (including temperature, humidity, audience density and sound pressure levels); observational data (audience mood and behaviour); and the demographic and cultural value data first trialled at the Adelaide Festival.Again the data was successfully captured and entered and securely stored over the network.
For each trial a post-doctoral fellow (under the supervision of two academic staff both on campus and onsite in the field) managed the project, briefing up to 12 surveyors on the use of the Android tablets and software.The tablets were trialled by the surveyors on campus prior to deployment in the field at the events and ethics approval was sought and gained from the university.
Surveyors were re-briefed onsite at the events about the particular circumstances of the venue and the audience in attendance along with any restrictions imposed by the event organisers.A "refresher" briefing about the use of the tablets and software was given before surveying commenced.Supervision staff observed the surveyors to ensure random data collection form audience members and that surveyors remained within parameters set for observational data collection.
Data was collected on each of the tablets and then transferred via Wi-Fi to a "master" computer on site.
Backup batteries were used and on charge so tablets were always deployed with full power at all times.

Results
The MaGDAA project is in its infancy; the proposed system presented here in this paper is the result of a three-month development sprint.The use of open source software and open hardware has been critical to achieving the goals of the project.The ability to develop software that can run on both Android powered smartphone and tablet devices; with a minimum of hardware specific customisation continues to be attractive.
The use of Open Source Software has been critical to the success of the project.By using open platforms, systems and specifications it has been possible to achieve the goals of the project in a shorter time frame.Additionally by using open data specifications such as XForms it is anticipated that using platforms other than Android will be significantly easier.As the survey form specifications can be written once for all platforms.
Similarly the use of Open Hardware has had a significant impact on the project.The open platforms such as the IOIO and IOIO Mint have made prototyping sensors easier and the IOIO development community has provided significant assistance.
The use of a mesh Wi-Fi network has been found to be effective in constructing a sensor network without the need for external infrastructure.Additionally be using the Rhizome data sharing service the data collected during a mass gathering event can be distributed to as many network device as possible which improves data resiliency and security.As the Serval Mesh software matures it is possible to extend the capabilities of the MaGDAA sensor network using other network topologies such as satellite, or sub 1GHz network links.Additionally the use of SMS as a command and control channel can also be explored to support functionality such as retrieving the current sensor values by a researcher who is outside the range of the mesh network.

Limitations
The increased fragmentation of the Android ecosystem [21] is making development on the platform for a small team increasingly difficult.Additionally Google's low level of support for Ad-Hoc Wi-Fi, as evidenced by the long-standing bug number 82 in the Android issue system (http://code.google.com/p/android/issues/detail?id=82), slows the continued development of mesh networking on the Android platform.

Discussion
The aim of the MaGDAA project is the development of a sensor network that can support research that is seeking a better understanding of the interaction between key characteristics of audience behaviour and consequent health effects in the mass gatherings setting.MaGDAA achieves this by: 1) automating the collection of a range of data; 2) increasing the effectiveness of the collection survey and audience metrics through the use of ODK Collection; 3) implementing an infrastructure independent mesh network for transferring sensor data and support distributed data management.
The speed of data entry and automated data entry together with immediate robust and secure storage were key factors for the development of MaGDAA project and the two trials undertaken in the field in real time at quite complex events demonstrated the effectiveness of the system compared to more traditional data collection methods.
The combination of a Wi-Fi mesh network, the use of Android powered mobile phones and tablets and the prototype environment sensors with the ODK suite of application, therefore makes the MaGDAA project a unique sensor network for the collection of an extensive range of data in real time at mass gathering events.