1 / 26

An Auto-Join Network of Things

An Auto-Join Network of Things. Wong, H. and Wesson, B. bit.ly /TUT6256. Program Agenda. Introduction to the Internet of Things Install Java Embedded and the Oracle IoT Gateway Configure the “ lookup service ” Add liquid level and thermometer sensors

Download Presentation

An Auto-Join Network of Things

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. An Auto-Join Network of Things Wong, H. and Wesson, B. bit.ly/TUT6256 Oracle Confidential – Internal/Restricted/Highly Restricted

  2. Oracle Confidential – Internal/Restricted/Highly Restricted

  3. Program Agenda Introduction to the Internet of Things Install Java Embedded and the Oracle IoT Gateway Configure the “lookup service” Add liquid level and thermometer sensors View data analytics on the device and in the cloud 1 2 3 4 5

  4. Managing Complexity Data, Insights, Actions at the Right Time

  5. Acquireand Manage Integrate and Secure Internet of Things Analyzeand Act Oracle Confidential – Internal/Restricted/Highly Restricted 5

  6. Acquire and Manage A Standards-based, Scalable and Secure Device Platform Oracle Confidential – Internal/Restricted/Highly Restricted 6

  7. Integrate and Secure Reduce Cost and Complexityand Protect Your Investment Oracle Confidential – Internal/Restricted/Highly Restricted 7

  8. Analyze and Act Extract Business Value and Take Action Oracle Confidential – Internal/Restricted/Highly Restricted 8

  9. Motivation Towards Real-Time Everything* While Ensuring Accuracy, Efficiency, and Scale Acquire & Manage Acquire & Manage Integrate & Secure Integrate & Secure Reduced Time Business Value Analyze & Act Analyze & Act Increased Value Action Time *Richard Hackethorn’s Component’s of Action Time 9

  10. Program Agenda Introduction to the Internet of Things Install the Java Embedded Runtime Configure the “lookup service” Add liquid level and thermometer sensors View data analytics on the device and in the cloud 1 2 3 4 5

  11. Exercise 2 Install the Java Embedded Runtime Install RaspbianDebian Wheezy (September 2014 Version) including JDK 8* or install Java Embedded (oracle-java8-jdk) sudoapt-get update sudoapt-get install oracle-java8-jdk sudochmod +s /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/bin/java • java –version • java version "1.8.0" • Java(TM) SE Runtime Environment (build 1.8.0-b132) • Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode) * Not part of tutorial. Navigate to http://www.raspberrypi.org/downloads and choose RaspbianDebian Wheezy Version September 2014

  12. Exercise 2 Configure Java Embedded Runtime • Oracle Java SE 8 • Java Programming Language • Lambda Expressions • Method references • Default methods • Repeating Annotations, Type Annotations • Compact Profiles - predefined subsets of the Java SE platform

  13. Program Agenda Introduction to the Internet of Things Install the Oracle IoT Gateway Configure the “lookup service” Add liquid level and thermometer sensors View data analytics on the device and in the cloud 1 2 3 4 5

  14. Exercise 3 Configure the “lookup service” Running a Simple Jini Lookup Service with Java Embedded • Provides the infrastructure for the Service-object-oriented architecture (SOOA). • Locating services is done through a lookup service • Services try to contact a lookup service (LUS), either by unicast interaction, when it knows the actual location of the lookup service • Clients use the lookup service to retrieve a proxy object to the service • Endpoint Registry

  15. Exercise 3 Calling the Lookup Server // … // liquidLevelProbe has been discovered // … if (!liquidLevelProbeDiscoveredFlag) { System.out.println("liquidLevelProbe discovered"); joinLookUpService(LIQUID_LEVEL_PROBE); liquidLevelProbeDiscoveredFlag = true; }

  16. Program Agenda Introduction to the Internet of Things Install the Oracle IoT Gateway Configure the “lookup service” Add liquid level and thermometer sensors View data analytics on the device and in the cloud 1 2 3 4 5

  17. Exercise 4 Add liquid level sensor using IoT Auto-Join Add an eTape liquid level and thermometer sensors to Raspberry Pi • Writing a IoT Endpoint proxy object • Registering the IoT Endpoint proxy object with the IoT Gateway LUS • User plugs in the liquid level sensor to the Raspberry Pi and it is auto-discovered • Running the liquid level sensor java –jar iot-liquid-level-sensor.jar

  18. Exercise 4 Add liquid level sensor using IoT Auto-Join // Open RandomAccessFile handle to each GPIO port raf= new RandomAccessFile("/sys/class/gpio/gpio" + gpioInputChannel + "/value", "r"); raf.seek(0); raf.read(inBytes); inLine = new String(inBytes); // Endpoint: liquidLevelProbe if (inLine.startsWith("1")) { commandChannels[1].write(GPIO_ON); commandChannels[1].flush(); if (!liquidLevelProbeDiscoveredFlag) { System.out.println("liquidLevelProbe discovered"); joinLookUpService(LIQUID_LEVEL_PROBE); liquidLevelProbeDiscoveredFlag = true; }

  19. Exercise 4 Add thermometer using IoT Auto-Join Add a Go!Temp Temperature Probe to Your Raspberry Pi • Writing a IoT Endpoint proxy object • Registering the IoT Endpoint proxy object with the IoT Gateway LUS • User plugs in Go!Temp Temperature Probe to the Raspberry Pi and it is auto-discovered • Run the temperature probe • java –jar iot-temp-probe.jar

  20. Exercise 4 Add thermometer using IoT Auto-Join // Endpoint: tempProbe File tempProbeCheck = new File("/dev/ldusb0"); if (tempProbeCheck.exists()) { commandChannels[0].write(GPIO_ON); commandChannels[0].flush(); if (!tempProbeDiscoveredFlag) { System.out.println("tempProbe discovered"); joinLookUpService(TEMP_PROBE); tempProbeDiscoveredFlag = true; }

  21. Program Agenda Introduction to the Internet of Things Install the Oracle IoT Gateway Configure the “lookup service” Add liquid level and thermometer sensors View data analytics on the device and in the cloud 1 2 3 4 5

  22. Exercise 5 Set-up data analytics on the Gateway Running Simple Analytics on the Gateway • Data Analytics on the Gateway • Local Analytics can be used to monitor the local devices and sensors • Local Java algorithms to watch for triggers • User is notified for anomalous events • Examining Analytics Running on the Raspberry Pi • Browse the Gateway URL for demo

  23. Exercise 5 Set-up data analytics on the Gateway static void tempProbeAdapter() { System.out.println("liquidLevelProbe Adapter: storing data locally " + "and sending data to IoT Cloud"); // Store data locally // Upload data to the IoT Cloud CloudStorageConfigmyConfig = new CloudStorageConfig(); myConfig.setServiceName("myService-myIdentityDomain") .setUsername("myUsername") .setPassword("myPassword".toCharArray()) .setServiceUrl("https://storage.us2.oraclecloud.com"); CloudStoragemyConnection = CloudStorageFactory.getStorage(myConfig); FileInputStreamfis = new FileInputStream("iotcloud-liquid-level-data.txt"); myConnection.storeObject("MyContainer", "iotcloud-liquid-level-data.txt", "text/plain", fis); // Process data }

  24. Exercise 5 Set-up data analytics on the Cloud Running a Global Analytics on the Cloud • Data Analytics in the Cloud • Global Analytics can be used to monitor the worldwide sets of devices and sensors • Global ruleset to watch for triggers • Administrator is notified for anomalous events • Examining Analytics Running in the Cloud • Browse the Cloud URL • http://iotcloud.x10host.com/autojoin/

  25. Exercise 5 Set-up data analytics on the Cloud static void tempProbeAdapter() { System.out.println("liquidLevelProbe Adapter: storing data locally " + "and sending data to IoT Cloud"); // Store data locally // Upload data to the IoT Cloud CloudStorageConfigmyConfig = new CloudStorageConfig(); myConfig.setServiceName("myService-myIdentityDomain") .setUsername("myUsername") .setPassword("myPassword".toCharArray()) .setServiceUrl("https://storage.us2.oraclecloud.com"); CloudStoragemyConnection = CloudStorageFactory.getStorage(myConfig); FileInputStreamfis = new FileInputStream("iotcloud-liquid-level-data.txt"); myConnection.storeObject("MyContainer", "iotcloud-liquid-level-data.txt", "text/plain", fis); // Process data }

More Related