TC2.2 - Scenario with IOT Applications with users sharing position, GDPR, real time data, Acting to IOT Application from City Dashboards and vice versa

Test Case Title

TC2.2 - Scenario with IOT Applications with users sharing position, GDPR, real time data, Acting to IOT Application from City Dashboards and vice versa

Goal

A group of users are registered in the snap4city portal and have created a shared application that allow them to:

  • Explore a map of the city (1) showing the position of some services of interest, like parking (with real time status), position of restaurant and …(POI, historical data, referral data, real time data)
  • Show the time trend (Below the map a trend graph is available (2)) that can belong to a selected point of interest in the map. In this manner the user can also see, for example, the prediction of the parking availability.
  • Below the trend graph, three buttons are available showing in the map the position of the selected services: Parking (3), Restaurant (4) and Pollution sensors (5).
  • The “Update GPS Position” (6) button save the user position in its temporary data.
  •  “Show My Position” (7) show in the map the last saved position retrieved by temporary data.
  • With the "Shared My Position" (9) and "Save My Position" (10) buttons, the user  saves its data into its GDPR compliant private data on its profile, and shared data are accessible to other users according to a delegation rules. The sharemode is not intended for all users who use other applications, but only for those who have been authorized by the user to collect data on the personal profile accessible via www.snap4city.org .
  • See the position of the other friends by clicking the “Where Are My Friends” (8) button. As mentioned in the previous point, we will only be able to recover the position of those friends who have allowed our access to their data
  • Within the application it is also possible to have personal sensors (in this case taken from SIGFOX) whose data are shown in real time on the graph (12) or data from public sensors and shown on the graph (13)
  • The panel (11) is used to display messages that vary according to the buttons that are pressed

Prerequisites

A snap4city user registered, capability of creating a IOT APP via NodeRED

The following functionalities are available only for a specific Snap4City account with specific privileges.

Expected successful result

 

Steps

 

 

  •  In this test case, 5 users have created their own application to share their location with others who are allowed to see it.
  • Once the application is created, you cannot view the locations of other users if they have not authorized the current user to see their data. As you can see on the map you can already update and see your location and decide whether to save it as a shared location or as a private location.

 

  • Let's connect with another user's application and save a location that is shared with other users. To do this we first have to press the "Update My Position" button in order to recover the new position (if you want to be sure that it is the correct position we can click later on "Show My Position") and then press the "Share My Position" button that will save the newly updated position on the data of the current user ready to be shared.

 

  • For your testing:

 

user

email

Password

https://iot-app.snap4city.org/nodered/nr25

******

************

******

https://iot-app.snap4city.org/nodered/nr26

******

******

******

https://iot-app.snap4city.org/nodered/nr27

******

******

******

https://iot-app.snap4city.org/nodered/nr28

******

******

******

https://iot-app.snap4city.org/nodered/nr29

******

******

******

https://iot-app.snap4city.org/nodered/nr30

     

 

By accessing the Snap4City portal it is possible to see the location that the user has just saved as a shared within his application according to the user profile on the portal


  • Please note the nr30 is the name assigned by user at the App.

  • Although the position is shared, it is not possible to see it from other applications because no one has yet been delegated to access the shared data.
  • To allow access to another user you must enable data recovery by indicating the name of the variable you want to share and the e-mail address of the user who must be able to access the data
  • If the user exists, a successful message is displayed with the shared variable under this message. You can remove this delegation at any time by pressing the - button on the left of the image

     
  • Now that the user claudio.badii@unifi.it has been authorized to see the coordinates of the user PaoloNesi we can press the button "Where Are My Friends" to see what has changed.

      
  • If the user who shared the position now deletes the delegation from his portal


  • A user can at any time delegate multiple users to access his shared data.

 

  • And each user can receive multiple authorizations. In this case, since the shared data of the coordinates are shown on the map in the correct position. 

  • In the image we can see the complete flow that realizes the application "ClaudioApplication".

  • In the initial part of the flow on the top left we can distinguish the nodes that make the buttons inside the application. As you can see the first button once pressed inside the application receives the user's GPS coordinates and saves them temporarily in a file on NodeRed. The other 3 buttons below take this information from the file and use it in their operations that we will describe later. The last button does not take the data saved by the user but retrieves the data for which it is delegated through the "get-other-data" block.

  • Following the flow to the right, the top part corresponds to the pressure of the "Show My Position" button and once you have recovered the user's coordinates, uses a block related to the Advanced Smart City API to enrich them with data related to the address, city and province.

 

  • In the streams below the co-oridated data are formatted in the format valid for being saved within the personal data through the block "Save My Data". There are two streams because we distinguish cases in which the saved coordinates are private or to be shared later with another user.
  • Once saved, the data is retrieved again through the "Get-my-data" block to be shown to the user on the map that is at the top of the application. The map view is done using the "WS Sender Test" block which allows you to send the recovered data directly to the map.

  • The data recovered from MyData (both private and shareable) are gathered together and enriched in this case with the block of the "Advanced Smart City API". This data transformed into GeoJSON is sent on the map and transformed into a string is sent to the text box at the bottom right of the application and shows the various dynamic messages that change according to the pressed buttons.

  • Data retrieved (through the "get-other-data" block) by other users who have delegated the current user to retrieve it is enriched by the Advanced Smart City API block and shown on the map and in the text box.