Getting Started with the AllJoyn Lighting Service Framework 14.12



Similar documents
Getting Started Android + Linux. February 27 th, 2014

Cid Santos Luis Matos. Introduction to AllJoyn

User's Guide. [Home Network] app. Model No.

Manual Instruction for. AU06-DL13W/RGB/30K MiLight Wifi LED Controller

Present and Act Upon. Register. Consume. Stream Analytics. Event Hubs. Field Gateway. Applications Cloud Gateway. Legacy IoT (custom protocols)

Network/Floating License Installation Instructions

Programming the Internet of Things

Homeguard Wireless Home Camera Quick Start Guide

Secure Cloud and Remote Service Connections for AllJoyn Applications

Secure Cloud and Remote Service Connections for AllJoyn Applications

Secure Cloud and Remote Service Connections for AllJoyn Applications

Wyse Device Manager TM

Honeywell Internet Connection Module

USER GUIDE. Ethernet Configuration Guide (Lantronix) P/N: Rev 6

User s manual for Android Application

What is Bitdefender BOX?

Dell SupportAssist Version 2.0 for Dell OpenManage Essentials Quick Start Guide

Basic Android Setup Windows Version

AllJoyn Android Environment Setup Guide

IoT Cloud, All Seen Alliance. Masanari Arai 荒 井 真 成 CEO, Kii Corpora0on

AllJoyn Analytics Service Framework 1.0 Interface Definition

Advanced Diploma In Hardware, Networking & Server Configuration

HL2170W Windows Network Connection Repair Instructions

AllJoyn Device System Bridge

Nighthawk AC1900 WiF Range Extender

Error! Bookmark not defined. Error! Bookmark not defined. Error! Bookmark not defined.

Quick Start. Nighthawk X8 AC5300 Tri-Band WiFi Router Model R8500. Package Contents. NETGEAR, Inc. 350 East Plumeria Drive San Jose, CA USA

3.5 EXTERNAL NETWORK HDD. User s Manual

HRG App for Android Devices. User Guide

Novell ZENworks Asset Management

Home Monitoring and Control service provided by Verizon Online LLC

Back-up Server DOC-OEMSPP-S/2014-BUS-EN-10/12/13

Skynax. Mobility Management System. System Manual

User Guide Vodafone Pocket WiFi Pro. Designed by Vodafone

The LimitlessLED Wifi Bridge 4.0 is compatible with RGBW(new), RGB(old), and Dual White(current) LimitlessLED lightbulbs.

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

Introducing BEEKS Proximity Solutions. Developer Kit Gets You Started

BlackVue Cloud App Overview...3. Getting Started...6. Basic Menu Screens BlackVue Cloud BlackVue Wi-Fi Internal Memory...

Push2TV Wireless Display Adapter

CITRIX 1Y0-A17 EXAM QUESTIONS & ANSWERS

EM6230 e-camview HD outdoor IP camera

Workshop on Android and Applications Development

Partek Flow Installation Guide

Troubleshooting BlackBerry Enterprise Service 10 version Instructor Manual

Using GIGABYTE Notebook for the First Time

PLA4231. User s Guide. Quick Start Guide. 500 Mbps Powerline Wireless N Extender. Default Login Details. Version 1.00 Edition 1, 12/2012

Backup Server DOC-OEMSPP-S/6-BUS-EN

OpenScape Business V1R3

User's Guide - Beta 1 Draft

ALTIRIS Deployment Solution 6.8 PXE Overview

Arduino Wifi shield And reciever. 5V adapter. Connecting wifi module on shield: Make sure the wifi unit is connected the following way on the shield:

ANDROID GUEST GUIDE. Remote Support & Management PC Tablet - Smartphone. 1. An Introduction. Host module on your PC or device

User Guide Vodafone Pocket WiFi 4G. Designed by Vodafone

E-Blocks Easy Internet Bundle

Using RAID Admin and Disk Utility

Smart Control Center. User Guide. 350 East Plumeria Drive San Jose, CA USA. November v1.0

ACU-1000 Manual Addendum Replacement of CPM-2 with CPM-4

Installing your UmtPlus Max Software on an Android Device

ZigBee Home Automation User Guide

How to setup EW-7438RPn with a Windows computer to extend an existing Wi-Fi network

Quick Start. PowerLINE WiFi 1000 Models PL1000 and PLW1000

Using GIGABYTE Notebook for the First Time

System i and System p. Customer service, support, and troubleshooting

Open Sourcing the Internet of Things

ALIBI Witness and ALIBI Witness HD Apps for Android - Quick Start Guide

OnCommand Performance Manager 1.1

Development of a new service using Wi-Fi Direct

Plena Voice Alarm System Firmware update

PN L, Revision B, October Epic 950 TM. Master Programmer User s Guide

How To Use 1Bay 1Bay From Awn.Net On A Pc Or Mac Or Ipad (For Pc Or Ipa) With A Network Box (For Mac) With An Ipad Or Ipod (For Ipad) With The

N300 WiFi Range Extender

Gauge Drawing Tool Slider Drawing Tool Toggle Button Drawing Tool One-Way List Drawing Tool... 8

DSA-1000 / PRT-1000 Device Server / Thermal Printer

FREQUENTLY ASKED QUESTIONS

Contents. Business Everywhere user guide. 1. Introduction. 2. How to Install/Uninstall Business Everywhere. 3. The Business Everywhere interface

IP Video 9100A User Guide

Chapter 5: Operating Systems Part 1

jfqbi= = eqji=qççäâáí= = = aéîéäçééêûë=dìáçé=== oéäé~ëé=oko=

Harmony Smart Control. User Guide

Using GIGABYTE Notebook for the First Time

SAS-IPCAM115 MANUAL IP CAMERA

OfficeSuite Mitel IP Phone User Reference Guide Release 4.1

ProSAFE 8-Port and 16-Port Gigabit Click Switch

Tutorial on Basic Android Setup

MediaTek LinkIt Smart 7688 FAQ

Using AORUS Notebook for the First Time

PLEASE READ THIS FIRST

ThinLinX TLXOS 64-bit Firmware Installation Guide for the Intel NUC Range. Materials Required

Rako Lighting Driver. For use with: Driver software written and provided by:

VMobile Talk User Guide

TestManager Administration Guide

How To Manage Hard Disk Partitioning In Windows (Windows 8) (Windows 7) (Powerbook) (For Windows 8) And Windows 8 (Pro) (Winstone) (Probation) (Perl

Quick Start Guide. WAP371 Wireless AC/N Dual Radio Access Point with Single Point Setup Quick Start Guide. Cisco Small Business

Network Licensing. White Paper 0-15Apr014ks(WP02_Network) Network Licensing with the CRYPTO-BOX. White Paper

Lenovo Miix 2 8. User Guide. Read the safety notices and important tips in the included manuals before using your computer.

USB VoIP Phone Adapter. User s Manual

Transcription:

Getting Started with the AllJoyn Lighting Service Framework 14.12 Lamp Service April 09, 2015 This work is licensed under a Creative Commons Attribution 4.0 International License. http://creativecommons.org/licenses/by/4.0/ Any and all source code included in this work is licensed under the ISC License per the AllSeen Alliance IP Policy. https://allseenalliance.org/allseen/ip-policy AllJoyn is a trademark of the AllSeen Alliance. Other products and brand names may be trademarks or registered trademarks of their respective owners.

Contents 1 Introduction... 3 1.1 Purpose... 4 1.2 Scope... 4 1.3 References... 4 1.4 Acronyms and terms... 4 2 Overview... 6 2.1 Lamp service... 6 2.2 Controller service... 6 3 Configuring the Development Environment... 7 3.1 Configure the Linux environment... 7 4 Obtaining the Lamp Service... 8 4.1 Obtain the source code... 8 5 Integrating the Lamp Service... 9 5.1 Modify the Lamp service details... 9 5.2 Modify the Lamp service's About details... 10 5.3 Configure OEM-specific functions... 11 6 Lamp Service Test Harness... 12 7 Common Errors... 13 7.1 About feature throwing exceptions... 13 7.2 Application cannot make AllJoyn method or property calls... 13 ii AllSeen Alliance

1 Introduction The AllJoyn Lighting service framework provides Lighting OEMs and application developers a means to build a complete lighting solution supported by the AllJoyn framework. The Lighting service framework comprises two service components: Lamp service: Enables an embedded lighting device (such as a connected light bulb) to be controlled by the Controller service. Controller service: Enables AllJoyn applications (e.g., an application running on a smartphone) to control the Lamp service. Lighting OEMs can embed the Lamp service in the firmware of their lighting products to enable Smart Lighting features. The Controller service is designed to find all devices running the Lamp service on the AllJoyn network and provide additional functionality to control the lighting devices in a variety of ways (e.g., create and control a group of lights simultaneously and applying custom lighting effects). The Controller service can reside in lighting device, a hub, router, gateway, mobile device (smartphone or tablet), desktop, or home automation controller. Developers can build AllJoyn applications that will communicate with the Controller service. Figure 1 illustrates the Lighting service framework components and their interaction with an OEM device. Figure 1: Lighting service framework components 3 AllSeen Alliance

Getting Started with the AllJoyn Lighting Service Framework 14.12 Introduction 1.1 Purpose This document provides an overview of the Lighting service framework and detailed instructions on how to start using the Lamp service. The following topics are covered: Overview of the Lighting service framework Configuring the development environment for the Lamp service Modifying the details about the device running the Lamp service Implementing device-specific methods of the Lamp service Building and running the Lamp service on Linux How to build an application to communicate with the Lamp service Common errors 1.2 Scope This document is written for OEMs and developers and assumes competent knowledge of AllJoyn development. It will focus on the main components of the Lighting service framework. 1.3 References The following documents are references found on the AllSeen Alliance web site's Docs/Downloads section. AllJoyn Framework Tutorial Introduction to the AllJoyn Framework Introduction to AllJoyn Thin Library AllJoyn Troubleshooting Guide Configuring the Build Environment (Linux Platform) 1.4 Acronyms and terms Term AllJoyn Standard Core Library Announcement Configuration service framework Controller service Definition An application or AllJoyn daemon process that contains the full implementation of the AllJoyn message bus. A sessionless signal whose payload includes published services' interfaces and metadata that are used for discovery. Software layer that enables devices to provide remote configuration of AllJoyn service frameworks' metadata (ConfigData) in a session. Maintains the Lamp Group, Scene, and Presets on behalf of the Lamps. The Controller service is a logical entity that can reside in a hub, router, gateway, smartphone/tablet, desktop, or home automation controller. 4 AllSeen Alliance

Getting Started with the AllJoyn Lighting Service Framework 14.12 Introduction Term Lamp group Lamp service Lighting service framework Notification service framework Onboarding service framework Preset Scene Definition Client service implemented in a Lamp, enabling it to be controlled by the Controller service. A Lamp service can reside in a lamp, luminaire, light switch, plug, outlet, or socket adapter and can leverage the AllJoyn Standard Core or Thin Client Library. AllJoyn framework that provides a means to build a complete lighting solution. It consists of the Controller service and Lamp service. Software layer that enables devices to send or receive human-consumable notifications. Software layer that enables devices to provide remote configuration (OnboardingData) and control (driver mode) over a device's onboarding process to a Wi-Fi AP over an AllJoyn session. Lighting setup for a particular event, for example, dimming the lights when a movie is on. The user can create a scene that they can apply to a set of lights. 5 AllSeen Alliance

2 Overview The Lighting service framework is part of a comprehensive lighting system that allows OEMs and developers to build lighting hardware that performs the following functions: Runs the Lamp service Create applications that interface with the Controller service to control lighting hardware. 2.1 Lamp service The Lamp service uses the AllJoyn Thin Core Library and is meant to be run on embedded hardware like a light bulb. The Lamp service uses several AllJoyn service frameworks to allow the embedded hardware to communicate with other devices on the AllJoyn network. 1. The Onboarding service framework connects the hardware to the Wi-Fi network. 2. Once onboarded, the About feature allows the Lamp service to broadcast its presence on the network. 3. Any device that receives the About announcement can connect directly to the Lamp service and use the Configuration service framework to modify settings as well as perform other operations like factory reset. 4. The Lamp service uses the Notification service framework to notify the user of any problems with the light. 2.2 Controller service The Controller service uses the AllJoyn Standard Library and is configured to listen for any lighting devices running the Lamp service that may be present on the network. The Controller service will discover any lighting device connected to the network by receiving the About announcement and then connecting directly to the device using an AllJoyn session. The Controller service can then perform operations on the Lamp service such as: Toggle the light on and off Retrieve power consumption and light details Set the brightness or hue of the light The Controller service can control every lighting device connected to your network. Developers can then build AllJoyn applications that communicate directly with the Controller service and control their lighting devices. The Controller service also provides developers the ability to grouped lights together and control them simultaneously, and create a custom lighting experience using scenes. Developers have the freedom to create a variety of applications to control their lights. 6 AllSeen Alliance

3 Configuring the Development Environment This chapter provides instructions to configure your Linux environment to build the Lamp service as well as the AllJoyn core. Verify your allseenalliance.org account has been created and you have received email confirmation before completing the procedures in this chapter. 3.1 Configure the Linux environment 1. Access the Configuring the Build Environment (Linux Platform) document on the AllSeen Alliance website. 2. Follow the instructions in Section 2 only up to the section titled Obtain the AllJoyn source. 7 AllSeen Alliance

4 Obtaining the Lamp Service This chapter provides instructions to download the Lamp service and AllJoyn core modules from the AllSeen Alliance web site. 4.1 Obtain the source code 1. Open a terminal window. 2. Change to your working directory. cd <path_to_working_directory> 3. In your working directory, create a folder called allseen. mkdir allseen/ 4. Use the following commands to clone the base/ and base_tcl/ source code repositories. git clone https://git.allseenalliance.org/gerrit/services/base git clone https://git.allseenalliance.org/gerrit/services/base_tcl 5. Create a folder called core/ inside the allseen directory and change into the core folder. mkdir core/ cd core/ 6. Use the following commands to clone the ajtcl/, alljoyn/, and service_framework/ repositories. git clone https://git.allseenalliance.org/gerrit/core/ajtcl git clone https://git.allseenalliance.org/gerrit/core/alljoyn git clone https://git.allseenalliance.org/gerrit/lighting/service_framework 8 AllSeen Alliance

5 Integrating the Lamp Service This chapter provides instructions on how to integrate the Lamp service into a Lighting OEM hardware platform. Note This chapter does not target any specific hardware platform. The Lamp service partitions two set of files: framework and OEM. Framework files are intended to be OEM- and hardware-independent. It is strongly recommended not to change framework files in order to maintain compatibility across all AllJoyn devices. OEM files are designed to consist of hardware dependent implementation such as drivers. Figure 2 illustrates the Lamp service components. Figure 2: Lamp service components 5.1 Modify the Lamp service details The Lamp service contains a hard-coded list of read-only OEM properties. These include properties such as dimmable and color that expose the supported behavior of the device running the Lamp service. Complete the following procedure to fill in the Lamp Details for the relevant lighting device. 9 AllSeen Alliance

Getting Started with the AllJoyn Lighting Service Framework 14.12 Integrating the Lamp Service 1. In a terminal, change into the following directory: cd <path_to_working_directory>/allseen/core/service_framework/ thin_core_library/lamp_service/src/ 2. In your favorite text editor, open OEM_LS_Code.c. 3. Scroll to the bottom to view a definition of the LampDetailsStruct data structure. Note Note You can see the definition of the LampDetails data structure in OEM_LS_Code.h in the./thin_core_library/lamp_service/inc/ directory. LampDetails fields lampmake, lampmodel, devicetype, lamptype, and BaseType are all defined as enumerated types defined in /service_framework/ common/inc/lampvalues.h. 4. Changes the values in the data structure to match your hardware specification. For example, does your lighting device support color or is it dimmable? Note To add the make, model, type, lamp type, or base type, add the relevant values to the enumeration definitions located in /service_framework/ common/inc/lampvalues.h. 5. Save and close all modified files. 5.2 Modify the Lamp service's About details The Lamp service uses the AllJoyn About feature to broadcast its existence, along with its About properties such as model number, over the AllJoyn network. Any device on the network that is configured to listen for the Lamp service About announcements can receive the announcement, discover what the device is, and see which AllJoyn interfaces are supported by the device. Complete the following procedure to modify the About details. 1. In a terminal, change into the following directory. cd <path_to_working_directory>/allseen/core/service_framework/ thin_core_library/lamp_service/src. 2. In your favorite text editor, open OEM_LS_Provisioning.c. 3. Modify default values as needed. Throughout the file, you can see the default values of the PropertyStore object that is used by the AllJoyn About feature. For example, you can see the default language is defined as "en" for English. This is where you can add support for other languages, change the manufacturer of the device, and modify fields like mode, software version, hardware version, etc. These are the details that are broadcast by the AllJoyn About announcement. 10 AllSeen Alliance

Getting Started with the AllJoyn Lighting Service Framework 14.12 Integrating the Lamp Service Note If you have never used the About feature, refer to the AllJoyn documentation listed in References for an explanation of the fields that are present in the AllJoyn About announcement. 4. Save and close the modified files. 5.3 Configure OEM-specific functions The Lamp service defines a specific set of OEM functions that can be implemented to interface directly with the lighting device hardware and provide the basic functionality for controlling the light. Complete the following procedure to implement the functions that start with a "OEM_" prefix. 1. In a terminal, change into the following directory: cd <path_to_working_directory>/allseen/core/service_framework/ thin_core_library/lamp_service/src/. 2. In your favorite text editor, open OEM_LS_Code.c. You should see a set of functions whose names start with "OEM_". 3. Implement the following OEM functions based on your hardware implementation. Details on each OEM function are documented in the code. Some examples about these OEM functions follow: OEM_LS_Initialize() performs OEM-specific startup functions such as NVRAM initialization (if needed) OEM_LS_Restart() - performs a restart on the light hardware. OEM_LS_DoFactoryReset() - performs a factory reset on the light hardware. OEM_LS_ApplyPulseEffect() - performs a lighting pulse effect of the light bulb 4. Save and close the modified files. 11 AllSeen Alliance

6 Lamp Service Test Harness A test harness is bundled with the Lamp service source code in AllSeen Alliance git repository, and is based on Linux Ubuntu platform. The test harness is located at: /thin_core_library/lamp_service/samples/ The build and execution instructions are in the README.txt in the /test folder specified above. 12 AllSeen Alliance

7 Common Errors There are many things that can go wrong when trying to write your own AllJoyn applications. The following important resources listed below can help: For issues surrounding the AllJoyn framework, refer to the AllJoyn Troubleshooting Guide. For issues surrounding the AllJoyn About feature, refer to the AllJoyn About Feature 1.0 Usage Guide (Android). 7.1 About feature throwing exceptions If the About feature is throwing exceptions, the appropriate permissions may not have been added to your Android Manifest file. Refer to section 6.7 of the Guide to AllJoyn Development Using the Java SDK. 7.2 Application cannot make AllJoyn method or property calls If your application cannot make AllJoyn method or property calls, the appropriate permissions may not have been added to your Android Manifest file. Refer to section 6.7 of the Guide to AllJoyn Development Using the Java SDK. 13 AllSeen Alliance