• Aucun résultat trouvé

3.8 Enabling Mobile Crowdsensing

3.8.2 Syndesi 2.0 App

The latest update on the general architecture ofSyndesiis a new component which enables the whole framework to become Mobile Crowdsensing enabled as shown also in Figure 3.17. In that end, people by downloading the new updated version of the smartphone application,Syndesi 2.0,3can actively participate in contributing sensory data from their smartphones to the system. Hence, they can augmented the sensory infrastructure of the facility by letting the embedded sensors of their smartphones to opportunistically sense their surrounding environment and send the raw data to the backend server.

Server side

In order to support the participatory sensing and contribution from the users of the Syndesi 2.0smartphone application, we implemented a new set of "crowdsensing"

RESTful APIs on the server’s side. This new set of APIs can be divided into two categories: one focusing on gathering the sensed information from the smartphones

3The always latest version ofSyndesi 2.0application can be downloaded here : https://github.com/

tcslab/Syndesi-2.0-Smartphone-App

and the other one on forwarding the list with the registered actuator-nodes of the server to the smartphones. In the first one, the smartphones are sending periodically information from their sensors (as it is explained later) and the Syndesi server is registering this information. By using the "../crowddata" service via a Web browser a user can see all the sensed measurements either those are reported by a mobile smartphone user or by fixed sensors and actuators. In addition, a timestamp is embedded in the data, and in the case of the mobile data, the uniqueaccountIdof the smartphone user is also reported. Figure 3.18 shows the result of the "crowddata"

RESTful service.

Similarly, to the "crowddata" RESTful API, the "crowdusers" RESTful API is implemented in order to provide information related to the users of theSyndesi 2.0 application. Every user receives a unique ID, and the available sensors from her smartphone are also propagated to the server. In addition, profile information of the user: "Name", "Surname", "Device Model", "Office Number", "Preferred Light Value",

"Preferred Temperature Value", "IP address of the phone", and "Crowd Points" is listed as well. The result from the request on thecrowddatais also represented in JSON format. Figure 3.19 shows the "crowdusers" service.

Smart Phone Application

The smart phone applicationSyndesi 2.0has been developed with the Android Studio SDK and it supports devices running the API 15 and up. The application is an easy to use interface to manage sensors, preferences and actuators. By using this application users are except of opportunistically sending data to the backend server, they are able to have a direct access to the actuators that are registered on the system. The first time a user boots up the application, an "Account Setup" screen is shown where the user is requested to insert the following basic personal information: "Name", "Surname",

"Office Number", "Preferred Light Value" and "Preferred Temperature Value" as shown in Figure 3.20. After the user enters her information, the main menu of the application

3.8. Enabling Mobile Crowdsensing

Figure 3.18:CrowddataAPI for reporting Mobile Crowdsensed information as well as measurements

from fixed wireless nodes

Figure 3.19:CrowdusersAPI for reporting Mobile Crowdsensing

Users registered inSyndesi

appears. This menu is shown in Figure 3.21, in which the application at this time is not reporting anything because the user needs to access first the "settings" menu.

In the "settings menu" as shown in Figure 3.22, the user can "Modify her account", choose the "Sensing rate" between the values: Very slow (5 min.), Slow (2 min.), Medium (1 min.), Fast (30 sec.) and Very fast (10 sec.), insert the "Server IP address"

and finally "enable the sensors", for start sensing and sending data. Every time a user modifies her personal data, an update package is send to the server in order to update also in the server’s side the account information.

Once the adjustments have been made in the settings menu, in the main menu of the application there is shown information from the sensors, as in Figure 3.23. In the tested phone there are available sensors on proximity, temperature, pressure, light and humidity. The application is designed in a dynamic way in terms of incorporating the available sensors of the phone. Once the application starts, it scans the phone

Figure 3.20:Syndesi 2.0App. - Account Setup

3.8. Enabling Mobile Crowdsensing

Figure 3.21:Syndesi 2.0App. -Main menu with Sensor Reporting

disabled

Figure 3.22:Syndesi 2.0App. - Settings menu

Figure 3.23:Syndesi 2.0App. -Main menu with Sensor Reporting

enabled

Figure 3.24:Syndesi 2.0App. -Nodes manager and actuator

for available sensors and when the users enables them, then they appear in the main screen. In Figure 3.24 is shown the "Nodes Manager" menu which is used to trigger commands to the actuators currently available by theSyndesiserver. When a new actuator joins theBackend WSN, then it appears its ID, description and its current status (i.e. whether it is "ON", "OFF", "Up", "Down", etc.). The user by performing a simple click on the icon of the actuator can change its status. With this way, the user has the possibility to override the automatic control of the system.

Figure 3.25 shows the complete UML diagram of theSyndesi 2.0Android application.

One of the aims while designing the architecture of the application was to keep each component as separated as possible from the others, following the SoC design principles. This separation gives to the application the necessary modularity and it is therefore straightforward to maintain and expand it. A developer, with minimal effort could port the application to smart watches, tablets, phablets or other smart electronic devices. The UML diagram is separated in 4 main components: a) the

"User Interface" which is responsible for the for setting the activities on the screen, updating the relevant part of the main UI thread and adapting the data models to be displayed; b) the "Node" component, which is used to discover and actuate the devices connected to the server; c) the "Sensor" component, which handles the sensors of the phone, sets up the services and hosts the listener which reports and displays the data sampled from the sensors; and d) the "User" component, which contains all the classes related to the user, her preferences and the application settings she sets.

Incentivizing the Users

One of the key enhancements in the basic Syndesi framework from the Mobile Crowdsensing, is the implementation of an Incentivizing Mechanism which aims to attract the crowd to provide data and measurements from their smart phones. The users in order to participate in augmenting the "wisdom of the crowd" and consequently in improving the statistical smoothness of the data, need typically to receive a benefit, either this is monetary profit, satisfaction or achievement points.

3.8. Enabling Mobile Crowdsensing

Figure 3.25:Syndesi 2.0App. - Account Setup

The Incentive Mechanism that we implement in the context of our work, awards users that participate in the provisioning of data with achievement points. The more sensors the user has and the faster she reports the data, the more points she gets.

Different approaches could be established in how many points a user can earn per minute or per sensor, however for avoiding to over-complex the system we use a naive simple approach. In chapter 7 we present several Incentive Mechanisms with which a system can motive users to take part in.