Assignment 3: IoT

In this individual assignment, you will need to develop a mobile app using the frameworks you have previously learnt in the course. The app does not need to be deployed on a real mobile phone.

IoT Application Scenario

The mobile app that you will develop will be used in a Smart Eldercare setting to keep tabs on the safety of seniors who are living alone in their own homes. To facilitate real-time monitoring, it is assumed that every room/location in a senior’s home is covered by an ordinary motion sensor which periodically reports whether or not motion has been detected in the last monitoring period. To receive a real-time feed of the motion sensor readings, your mobile app will need to subscribe to an MQTT broker with the following details:

  • MQTT Broker Address: barretts.ecs.vuw.ac.nz
  • MQTT Broker Port (Websockets): 8883
  • MQTT Topic: swen325/a3
Every message from the MQTT broker contains exactly one motion sensor reading which follows this simple CSV format:

timestamp,sensor_location,motion_status,battery_status

The meaning and format of the individual fields are as follows:
  • timestamp: The date and time the reading was taken by the sensor; format: YYYY-MM-DD hh:mm:ss
  • sensor_location: Location covered by the sensor; possible values are living, kitchen, dining, toilet, and bedroom
  • motion_status: Sensor reading; possible values are 0 (no motion detected) and 1 (motion detected)
  • battery_status: Amount of charge remaining in battery as percentage
Example feed:

2018-08-11 13:32:01,toilet,0,95

Things To Note About the MQTT Broker

  • The MQTT Broker above is only accessible from within the University. Thus, when you test your code outside the University, you may not be able to connect to this broker and receive feeds.
  • You are free to setup your own MQTT feed to test your app. I will discuss during the tutorial on Week 10 on how to setup one. You may use the Python script here to generate data (you will need to edit the script first to point to your MQTT account before running it).

Required Screens and Push Notification

You are required to develop 2 screens and 1 push notification.

Senior Status

This should be the main/home screen of the app. When the app is executed, this is the screen shown to the user. This screen must present the following details about the senior:

  • Last seen location (room/location where last motion was detected)
  • Time since last motion (in minutes)

The screen should also show a visualization of the total number of movements in different parts of the house. You can present it as heatmap, histogram, or any component that you think is suitable for presenting the data. If you are using a heatmap, you are free to draw the house layout, provided it has only 5 locations (living, kitchen, dining, toilet, and bedroom).

Battery Status

This screen should present the battery levels of all the sensors.

Prolonged Inactivity Push Notification

The app should trigger a push notification if no motion is detected by all the sensors in the house for the last 5 minutes. The notification must only be triggered once (i.e., notification must not be triggered after 6 minutes, 7 minutes, etc). When user clicks on a notification, the Senior Status screen must be shown in the app.

For this assignment, you can assume that the senior is at home and not sleeping, hence, movements are expected to be detected by the sensors.

Self-Designed Interaction/Screen

In addition to the required screens and notification described above, you will need to design and implement your own screen to enrich the application. This self-designed feature must be relevant to the IoT Application Scenario. You will need to discuss this feature in detail in the report.

Items to be Marked

It is extremely important to follow good Software Architecture; organise your code clearly and well without any unnecessary materials; documenting and making it easy for someone else to take over your app in the future (imagine you are doing it in a large company and then have to move on to a different project); provide relevant readme.txt files and self-documenting code and folder names. Good design will be assessed at both code, report, and demo level by the markers.

Source Code (5 out of 29 marks)

Submit the ECS GitLab link of your tagged source code for this assignment in 325-a3-readme-username.txt file. Do not submit your source code to the ECS Assessment System. Comment your code to highlight the four items in the marking guide enumerated below. You will need to show the different aspects of your code during the in-person Demo session.

Rough marking guide:

  • Code for MQTT messaging and handling feeds: 1 out of 5 Marks
  • Code for Senior Status screen: 1 out of 5 Marks
  • Code for Battery Status screen: 1 out of 5 Marks
  • Code for generating Prolonged Inactivity notification: 1 out of 5 Marks
  • [Completion] Code for a self-designed interaction/screen: 1 out of 5 Marks

Demo (5 out of 29 marks)

You will present a good demo to the tutor using a video that should be uploaded as per the instructions below. YOU NEED TO SIGN UP FOR MARKING SLOT OR NO MARKS.

Submit a video (at most 3 minutes long) of your demo called created/uploaded using Panopto linked from the Blackboard page of this course (where you see the lecture videos being posted). Try to call your recording: 325-a3-demo-username to make it easier for us even though only tutors and you can see the video you upload (not others in the class). You should be able to use Panopto to record the video of your desktop so hopefully no external tool will be required but this may not work properly in the labs (in which case use QuickTime available there to record and then upload the video).

NB! Then upload a done.txt file to the appropriate ECS submission system item and click complete the submission button to ensure we can mark your submission in the ECS submission system! The file can be blank or contain a link to the Panopto recording.

DURING THE DEMO (15 MINUTE SLOT). Start by showing your code to the tutor and explain how you organised your App and what Architecture you followed. Then demonstrate either using a laptop or phone or the demo video that you submitted and talk about the following aspects of your App:

  • Interactions with the Senior Status screen (and other relevant screens you have developed), showing changes as new feeds are received: 0.5 out of 5 Marks
  • Interactions with the Battery Status screen (and other relevant screens you have developed), showing changes as new feeds are received: 0.5 out of 5 Marks
  • Triggering of Prolonged Inactivity alert while app is running, explaining how/why it occurred: 1 out of 5 Marks
  • Triggering of Prolonged Inactivity alert while app is in background, explaining how/why it occurred, and showing of senior status screen when notification is tapped: 1 out of 5 Marks
  • [Completion] Self-designed interaction/screen: 1 out of 5 Marks
Then be prepared for the tutor's questions regarding what different parts of your code do and how and for what purpose. 1 out of 5 Marks

Report (19 out of 29 marks)

Submit a file called 325-a3-report-username.pdf that contains:

  • For the required screens: description with screenshots of at least 2 different UX decisions made in your app with justification and at least two alternatives presented with a reasoning why you went with the one you implemented. Between 2-3 Pages of A4, Worth 4 out of 19 Marks
  • [Completion] For the self-designed screen: rationale for providing this screen, description with screenshots of at least 2 different UX decisions made in your app with justification and at least two alternatives presented with a reasoning why you went with the one you implemented. At most 2 Pages of A4, Worth 4 out of 19 Marks
  • [Completion] Discussion of possible issues with the system that can affect the behaviour of your mobile app. Possible issues include loss of connection of one or more sensors to the broker, loss of connection of mobile app to the broker, dead or faulty sensors, presence of pets at home that can trigger motion, and senior sleep or leaving the house. You may think of other issues. Discuss and elaborate on at least three issues, i.e., how they would affect your app and how your app should respond to these issues. Support your arguments with existing work (books, research papers, magazine/news articles, case studies, white papers, etc.) Between 2-3 Pages of A4, Worth 4 out of 19 Marks
  • [Challenge] A detailed critique of the given IoT system architecture. Propose your own IoT system architecture to address the weaknesses of the given system architecture. Discuss the advantages and disadvantages of your proposed architecture. Cite several existing work (books, research papers, magazine/news articles, case studies, white papers, etc) to support your critique and arguments. To get the full marks for this part, you will need to present cogent, clear, well-reasoned arguments, backed up by existing work as evidence. Between 2-3 Pages of A4, Worth 7 out of 19 Marks