webispy / DemoKit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Standard - JavaScript Style Guide

DemoKit

ARTIK Cloud and ARTIK Module Demo

Getting Started

Prerequisites

Hardware

  • ARTIK 710 with LCD module
  • ARTIK 710 with Camera module
  • Belkin WeMo Insight Switch
  • Hue Bridge + Hue Bulb
  • ipTime A3004NS-d (Wireless router supporting Android phone usb tethering)
  • Bluetooth Speaker
  • Samsung Smartcam SNH-P6410BN

Software - Initial setup

  • Install dependency packages to each ARTIK 710 boards
dnf update
dnf install git alsa-lib-devel npm gstreamer1-rtsp-server avahi-devel avahi-compat-libdns_sd-devel
  • Install RTSP server program
dnf install autoconf automake m4 libtool gtk-doc glib2-devel gstreamer1-devel gstreamer1-plugins-base-devel
git clone https://github.com/GStreamer/gst-rtsp-server.git
cd gst-rtsp-server
git checkout 1.8
./autogen.sh
./configure --enable-examples
make
cd examples
libtool --mode=install install test-launch /usr/local/bin/
  • Install TTS program (SVOX pico2wave)
[ubuntu-host]# apt-get source libttspico-utils
[ubuntu-host]# scp -r svox-1.0+git20130326/pico {your-710-board}
chmod +x autogen.sh
dnf install autoconf automake libtool popt-devel
./autogen.sh
./configure
make
make install

Environment configuration

710 board(master) IP settings
  • Static MAC address setup (u-boot) Serial console
...
Hit any key to stop autoboot:  3   <-- Enter key 
artik710# run factory_load
artik710# factory_info list
artik710# factory_info write ethaddr <your mac address>  e.g.) 00:11:58:23:12:54
artik710# run factory_save
artik710# reset
  • Static IP setup: 192.168.0.10 (OAuth2 callback url)
    1. Open the ipTime admin webpage (http://192.168.0.1)
    2. Setup static IP address using 710 board MAC address
BT pairing with 710 board(master)
bluetoothctl
[bluetooth]# scan on
[NEW] Device XX:XX:XX:XX:XX:XX Logitech X100
[bluetooth]# pair XX:XX:XX:XX:XX:XX
[bluetooth]# connect XX:XX:XX:XX:XX:XX
[bluetooth]# exit

pactl list cards
pactl set-card-profile 1 a2dp_sink
ipTime setup
  1. Open the ipTime admin webpage (http://192.168.0.1)
  2. Login (default id/password = 'admin' / 'admin')
  3. Enable the USB tethering option
WeMo switch setup
  1. Install WeMo app on your smartphone
  2. Wi-Fi connect to WeMo (WeMo AP)
  3. Run WeMo application
  4. Setup WeMo to use ipTime AP
Hue bridge setup
  1. Install Hue app on your smartphone
  2. Add Hue Bridge on Hue app
  3. Add Hue Bulb to Hue Bridge
Samsung Smartcam setup
  1. https://www.samsungsmartcam.com/
  2. Register your account
  3. Register the SNH-P6410BN camera to your account
  4. Setup camera id/password to 'admin' / '1234'

Installing

git clone http://github.com/...
cd demokit
npm install

npm install -g forever forever-service

# Master board (indoor simulation)
forever-service install master --script bin/www
service master start

# Slave board (front door simulation)
forever-service install slave --script slave.js
service slave start

reboot

Patch

demokit/node_modules/mdns/lib/resolver_sequence_tasks.js

        try {
-          //var error = dns_sd.buildException(errorCode);
+          var error = null;
          if ( ! error && service.interfaceIndex === iface) {

Create your own Alexa Voice Service

  1. https://developer.amazon.com/edw/home.html#/avs/list
  2. Register a Product Type --> Device
  3. Fill the form
    • Device Type Info
      • Company Name: ...
      • Device Type ID: demokit
      • Display Name: ...
    • Security profile

Create your own ARTIK Cloud application

  1. https://developer.artik.cloud/dashboard/applications
  2. Click NEW APPLICATION
  3. Fill the form
  4. Save
  5. Permissions
    • PERMISSIONS
      • Profile: Check to Read
    • DEVICE PERMISSIONS
      • + SET PERMISSIONS FOR A SPECIFIC DEVICE
      • Belkin WeMo Insight Switch Proxy: Read + Write
      • Shell proxy: Read + Write
  6. Click 'DemoKit' from left panel
  7. Click 'SHOW CLIENT ID & SECRET' from right side
    • Client ID & Secret --> Copy to clipboard

Link the Alexa, ARTIK Cloud and Devices to DemoKit

Setup Alexa Voice Service & ARTIK Cloud device token

  • Open https://192.168.0.10:9745/setup
  • Fill your AVS information to the client-id, client-secret field and 'Save'
  • Fill your ARTIK Cloud application information to the client-client-secret field and 'Save'
  • Click 'Get user tokens'
  • Click 'Get device tokens' and 'Save'

Register DemoKit to Hue bridge

Using the DemoKit

Scenario #1

  • Dingdong --> Press MIC btn --> say 'ask artik to open the door' --> Release MIC btn

Scenario #2

  • ...

Open-source libraries/project used

Web

  • Bootstrap - Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile first projects on the web.
  • Bootstrap Switch
  • jQuery - jQuery is a fast, small, and feature-rich JavaScript library.
  • Notify.js - Notify.js is a jQuery plugin to provide simple yet fully customisable notifications.
  • socket.io - Socket.IO enables real-time bidirectional event-based communication.
  • Font Awesome - The iconic font and CSS toolkit.

Node.js

Utils

Etc

License and Copyright

This project is licensed under the Apache-2.0 License - see the LICENSE file for details

Copyright (c) 2016 Samsung Electronics Co., Ltd.

About

License:Apache License 2.0


Languages

Language:JavaScript 81.9%Language:HTML 17.6%Language:CSS 0.5%