wiki:BabyMonitorForTV

Baby Monitor for TV

Project Details

Purpose of this project

Attempting to make new parents' lives easier, this project's intention is to develop an App for SmartTV's that would allow parents to watch TV and simultaneously stay vigilant of their baby using an IP Camera, more commonly known as netcam.

Project Description

After putting their babies to sleep, parents often want to relax and watch TV. While something like Netflix might sound distracting, parents are sure to either check on their baby periodically or use some sort of remote surveillance system like baby monitors to trust that their child sleeps soundly. This project tries to make parents' lives easier by making sure they don't need to get up from the couch to check on their baby.
The final result should be a Web App that runs on a SmartTV that would display a stream of video coming from a netcam onto a small section of the TV's screen (PiP - Picture in Picture). The App should be controllable from the TV's remote control and should be able to display the stream in fullscreen and temporarily disable the display of the stream (for those intense TV moments). Additionally, a motion detection algorithm could be applied to the oncoming stream and display a warning message would the baby move too much or start crying.

Created a GMAIL account for the MyDLINK service:
username: caixamagica.babymonitor@…
password: cmswev2015 (Caixa Mágica Software, Estágio Verão 2015)

Created a MyDLINK service account using the email address for this project
username: caixamagica.babymonitor@…
password: cm2015
This account can be used to remotely access the camera (if it's plugged in to an Internet connection), wherever it is. Use with caution!

Project Source Code

Source Code

Road-map

[Phase 1] State of the art and Architecture - July 15th to July 26th

  • Tutor meeting and goals definition
  • Project planning
  • Platform selection for implementation phase
  • Initial Presentation

[Phase 2] Further research - July 26th to August 5th

  • Sharpen Android skills and learn to:
    1. Work with notifications
    2. Activate PiP mode in an AndroidTV App
    3. Receive a video stream on a webview and displaying it with an appropriate size (depending on application settings)
  • Learn the workings of one particular netcam (DLink DCS-932L):
    1. Get the camera to stream the video to the TV
    2. Anticipate codec issues on the Android TV Webview
    3. Check if it can toggle between streaming audio, video (just image) or both
  • Look into several types of detection algorithms, specifically:
    1. Motion detection algorithm applied to a video stream
    2. Voice detection algorithms

[Phase 3] Implementation and Design - August 5th to September 1st

  • Camera API Documentation
    1. Create and host page for the API
    2. Reverse engineer API methods using the NetCam Web interface and WireShark
    3. Document parameters, add method description and needed headers
    4. Add authentication details and set generic page layout
    5. Make it pretty with good ol' Bootstrap 3
  • Application Development
    1. Video stream
      1. Play the video stream from the NetCam on a WebView
      2. Make its size scale with the size of the WebView (for fullscreen and minimize features)
      3. Apply any necessary logic (e.g. motion detection) to the stream
    2. Picture in Picture (PiP)
      1. Make the PiP spot of the screen modifiable (better UX)
      2. Display the WebView with the video stream onto the PiP section
    3. Notifications
      1. Display a brief notification telling parents to check on their child upon a received event (motion or sound detection)
    4. Motion Detection
      1. Use the built-in motion detection function to generate notifications
    5. Parameterization
      1. Taking extensibility into account, make all possible settings parameterizable
      2. Default setting should be a minimized stream with notifications turned on
    6. Design
      1. Create main user interface for the application

[Phase 4] Tests and Documentation - September 1st to September 12th

  • Functionality Tests
  • Improvement of design and accessibility
  • Final Presentation

Weekly Reports

Week 1 - July 15 to July 17

  • Documenting this Wiki page
  • Considering the desired functionalities and their associated advantages/disadvantages
  • Brief pondering of other possible and relevant scenarios
  • Analysing different SmartTV options, considering ease of use and quality/richness of the associated SDK
  • Selection of Set Top Boxes (STBs) for possible implementation as an alternative to a native SmartTV application
  • Deciding in favor of either a native App for a particular brand of SmartTV or a native app for a STB
  • Preparing July 22nd's initial presentation of the project
  • Planning project road-map

Week 2 - July 20 to July 24

  • Creating the project presentation
  • Road-map revision
  • Arranging workspace for the Netcam and for building AndroidTV Apps
  • Initial investigation on the Netcam's inner components

Week 3 - July 27 to July 31

  • Thorough investigation of the Netcam's capabilities and APIs
  • Partial Netcam API documentation
  • Creation of a bare-bones example of the PiP screen in HTML5

Week 4 - August 3 to August 7

  • Documentation of the camera API
  • Quick investigation about how to detect devices in computer networks
  • Introduction to Android development
    1. Layouts: LinearLayout, RelativeLayout
    2. Views: TextView, ImageView
    3. Wiring functionality to Layouts and Views.

Week 5 - August 10 to August 14

  • Continue Android learning:
    1. Nesting Layouts in application: use cases and usefulness.
    2. Using ListView with nested Layouts.
    3. WebViews: displaying pages containing HTML, CSS and JavaScript.
    4. Creating Fragments with reusable Layouts
    5. Using Fragments to display ListView data
  • Building the HTML5 code to display the video feed from the camera

Week 6 - August 17 to August 21

  • Solving WebView incompatibility problems.
  • Begin implementation of the device detection algorithm.
  • Creating webpage to display user interface on Android (it's a webapp)

Week 7 - August 24 to August 28

  • AndroidTV live tests
  • Continue building of webpages for the App's UI
  • End implementation of the device detection algorithm
  • Separation of JavaScript behavior in two: application module + camera module
  • First functional tests

Week 8 - August 31 to September 4

  • Cross-referencing ARP table results with DNS service detection for autoloading camera module
  • Listing algorithm results for users to choose
  • Adding button for refreshing in case of algorithm failure or disconnected camera

Week 9 - September 7 to September 11

  • Fixed bug that would cause JavaScript not to be executed (It's a side effect from the use of ProGuard)
  • Fixed bug that would cause random freezes in the Android TV STB (bug in AsyncTask, switched to Java's INetAddress.isReachable())
  • Improving code documentation
  • Code refactoring to improve maintainability of this project

Week 10 - September 14 to September 18

  • Functionality tests and improving user experience
  • Adding a Settings and Home screen page to the WebApp
  • Final Wiki documentation
  • Writing last report and preparing final presentation for friday, sept 18th
  • Code submits in Subversion repository

Trainee details

Trainee Name

Gonçalo Tomás

Past Experience

  • College assignments and events

Current Situation

(summer 2015)

I'm a Computer Engineering Msc. student at Faculty of Sciences and Tecnology - New University of Lisbon.
My interests include system security, GUI's, game development, algorithms, concurrency and distribuited systems.

Motivation for the Project

  • Create a better user experience for baby monitoring systems
  • Possible alternative for surveillance systems
  • Possible version with multiple cameras for automatic intrusion detection

Mentor

Diogo Gonçalves

Last modified 3 years ago Last modified on Sep 18, 2015, 4:28:02 PM