Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 2
Howdy, I’m Blaine Carter
Oracle Developer Advocate for Open Source
Oracle Corporation
Email: blaine.carter@oracle.com
Twitter: @OraBlaineOS
Blog: learncodeshare.net
Team: community.oracle.com/docs/DOC-917690
2
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 3
Internet of Things
Lots and lots of things
3
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 4
Home Automation
4
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 5
Home Theater
5
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 6
Things that don’t need to be connected
6
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 7
OK, that’s pretty cool
7
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 8
Howdy, I’m Blaine Carter
8
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 9
Build it yourself
DIY "Samsung Family Hub" Refrigerator with Raspberry Pi + Camera!!!
https://www.youtube.com/watch?v=u3Jkv3xl8W4
+
9
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 10
What kind of things
Things I have
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 11
What kind of things
Things I have
● OpenGarage
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 12
What kind of things
Things I have
● OpenGarage
● Sonos
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 13
What kind of things
Things I have
● OpenGarage
● Sonos
● OpenSprinkler
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 14
What kind of things
Things I have
● OpenGarage
● Sonos
● OpenSprinkler
● Raspberry Pi
 KODI
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 15
What kind of things
Things I have
● OpenGarage
● Sonos
● OpenSprinkler
● Raspberry Pi
 KODI
 Weather sensors
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 16
What kind of things
Things I want
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 17
What kind of things
Things I want
● Lighting
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 18
What kind of things
Things I want
● Lighting
● Thermostats
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 19
What kind of things
Things I want
● Lighting
● Thermostats
● Window blinds
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 20
What kind of things
Things I want
● Lighting
● Thermostats
● Window blinds
● OpenSprinkler +
Weather Sensors
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 21
What kind of things
Things I want
● Lighting
● Thermostats
● Window blinds
● OpenSprinkler +
Weather Sensors
● Security systems
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 22
What kind of things
Things I want
● Lighting
● Thermostats
● Window blinds
● OpenSprinkler +
Weather Sensors
● Security systems
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 23
What kind of things
Things I want
● Lighting
● Thermostats
● Window blinds
● OpenSprinkler +
Weather Sensors
● Security systems
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 24
What’s Kept Me From
Automating Everything?
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 25
What’s Kept Me From
Automating Everything?
● Expensive
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 26
What’s Kept Me From
Automating Everything?
● Expensive
● Vendor lock in
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 27
What’s Kept Me From
Automating Everything?
● Expensive
● Vendor lock in
● So many accounts/passwords
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 28
What’s Kept Me From
Automating Everything?
● Expensive
● Vendor lock in
● So many accounts/passwords
● Not enough control over ‘my’ things
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 29
Control
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 30
Control
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 31
Control
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 32
Control
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 33
Control
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 34
How to manage all these things
Commercial Systems?
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 35
How to manage all these things
Commercial Systems?
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 36
How to manage all these things
Commercial Systems?
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 37
How to manage all these things
Commercial Systems?
What happens if it’s
discontinued?
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 38
How to manage all these things
Commercial Systems?
What happens if it’s
discontinued?
If you can’t modify it, you don’t own it.
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 39
Take back as much control as you can
It’s your castle!
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 40
openHAB
Vendor and technology agnostic open source automation software for your home.
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 41
openHAB
Vendor and technology agnostic open source automation software for your home.
Add some smarts to
your castle.
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 42
openHAB
Vendor and technology agnostic open source automation software for your home.
Add some smarts to
your castle.
● Vendor neutral
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 43
openHAB
Vendor and technology agnostic open source automation software for your home.
Add some smarts to
your castle.
● Vendor neutral
● Works with a bunch of technologies
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 44
openHAB
Vendor and technology agnostic open source automation software for your home.
Add some smarts to
your castle.
● Vendor neutral
● Works with a bunch of technologies
● Robust APIs
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 45
openHAB
Vendor and technology agnostic open source automation software for your home.
Add some smarts to
your castle.
● Vendor neutral
● Works with a bunch of technologies
● Robust APIs
● Powerful rules engine
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 46
openHAB
Vendor and technology agnostic open source automation software for your home.
Add some smarts to
your castle.
● Vendor neutral
● Works with a bunch of technologies
● Robust APIs
● Powerful rules engine
● Runs on JVM
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 47
openHAB
Vendor and technology agnostic open source automation software for your home.
Add some smarts to
your castle.
● Vendor neutral
● Works with a bunch of technologies
● Robust APIs
● Powerful rules engine
● Runs on JVM
● Open source!
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 48
openHAB
Vendor and technology agnostic open source automation software for your home.
Add some smarts to
your castle.
● Vendor neutral
● Works with a bunch of technologies
● Robust APIs
● Powerful rules engine
● Runs on JVM
● Open source!
● Easy to extend
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 49
Install openHAB
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 50
Install openHAB
Add the repository key to your package manager
wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?
username=openhab' | sudo apt-key add -
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 51
Install openHAB
Add the repository key to your package manager
wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?
username=openhab' | sudo apt-key add -
Add repository to your system sources list
echo 'deb http://dl.bintray.com/openhab/apt-repo2 stable main' | sudo tee
/etc/apt/sources.list.d/openhab2.list
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 52
Install openHAB
Add the repository key to your package manager
wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?
username=openhab' | sudo apt-key add -
Add repository to your system sources list
echo 'deb http://dl.bintray.com/openhab/apt-repo2 stable main' | sudo tee
/etc/apt/sources.list.d/openhab2.list
Do an update
sudo apt-get update
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 53
Install openHAB
Add the repository key to your package manager
wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?
username=openhab' | sudo apt-key add -
Add repository to your system sources list
echo 'deb http://dl.bintray.com/openhab/apt-repo2 stable main' | sudo tee
/etc/apt/sources.list.d/openhab2.list
Do an update
sudo apt-get update
Install openHAB and the addons
sudo apt-get install openhab2
sudo apt-get install openhab2-addons
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 54
Start it up
These commands are for Linux init systems based on systemd
(e.g. Debian 8, Ubuntu 15.x, Raspbian Jessie and newer)
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 55
Start it up
These commands are for Linux init systems based on systemd
(e.g. Debian 8, Ubuntu 15.x, Raspbian Jessie and newer)
Start service and check the status
sudo systemctl start openhab2.service
sudo systemctl status openhab2.service
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 56
Start it up
These commands are for Linux init systems based on systemd
(e.g. Debian 8, Ubuntu 15.x, Raspbian Jessie and newer)
Start service and check the status
sudo systemctl start openhab2.service
sudo systemctl status openhab2.service
Set the service to auto start
sudo systemctl daemon-reload
sudo systemctl enable openhab2.service
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 57
UI Options
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 58
Persistence - I’m using the JPA configuration.
Install JPA Add-on
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 59
Persistence - I’m using the JPA configuration.
Install JPA Add-on
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 60
Persistence - I’m using the JPA configuration.
Install JPA Add-on
● Add-ons
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 61
Persistence - I’m using the JPA configuration.
Install JPA Add-on
● Add-ons
● Persistence
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 62
Persistence - I’m using the JPA configuration.
Install JPA Add-on
● Add-ons
● Persistence
● Click install
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 63
Persistence - I’m using the JPA configuration.
Install JPA Add-on
● Add-ons
● Persistence
● Click install
Set Default Persistence
● Configuration
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 64
Persistence - I’m using the JPA configuration.
Install JPA Add-on
● Add-ons
● Persistence
● Click install
Set Default Persistence
● Configuration
● System
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 65
Persistence - I’m using the JPA configuration.
Install JPA Add-on
● Add-ons
● Persistence
● Click install
Set Default Persistence
● Configuration
● System
● Select jpa
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 66
Persistence - I’m using the JPA configuration.
Install JPA Add-on
● Add-ons
● Persistence
● Click install
Set Default Persistence
● Configuration
● System
● Select jpa
● Click save
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 67
Persistence - Configure JDBC
67
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 68
Persistence - Configure JDBC
68
● Download the jdbc driver and put it in
/usr/share/openhab2/runtime/lib
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 69
Persistence - Configure JDBC
69
● Download the jdbc driver and put it in
/usr/share/openhab2/runtime/lib
● Edit /etc/openhab2/services/jpa.cfg
# connection string url
url=jdbc:oracle:thin:@//192.168.0.188:1521/orcl
# driver class name
driver=oracle.jdbc.OracleDriver
# username
user=oh_demo
# password
password=dd
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 70
Persistence - Configure JDBC
70
● Download the jdbc driver and put it in
/usr/share/openhab2/runtime/lib
● Edit /etc/openhab2/services/jpa.cfg
# connection string url
url=jdbc:oracle:thin:@//192.168.0.188:1521/orcl
# driver class name
driver=oracle.jdbc.OracleDriver
# username
user=oh_demo
# password
password=dd
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 71
Persistence - Configure JDBC
71
● Download the jdbc driver and put it in
/usr/share/openhab2/runtime/lib
● Edit /etc/openhab2/services/jpa.cfg
● Default persistence rules in
/etc/openhab2/persistence/jpa.persist
// persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {
// for rrd charts, we need a cron strategy
everyMinute : "0 * * * * ?"
}
Items {
DemoSwitch,NoOfLights,Window_GF_Toilet,Heating* : strategy = everyChange, everyMinute, restoreOnStartup
// let's only store temperature values in rrd
Temperature*,Weather_Chart* : strategy = everyMinute, restoreOnStartup
}
// vim: syntax=Xtend
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 72
Persistence - Configure JDBC
72
● Download the jdbc driver and put it in
/usr/share/openhab2/runtime/lib
● Edit /etc/openhab2/services/jpa.cfg
● Default persistence rules in
/etc/openhab2/persistence/jpa.persist
● Create the table
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 73
Persistence - Configure JDBC
73
● Download the jdbc driver and put it in
/usr/share/openhab2/runtime/lib
● Edit /etc/openhab2/services/jpa.cfg
● Default persistence rules in
/etc/openhab2/persistence/jpa.persist
● Create the table
Logs in /var/log/openhab2/openhab.log
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 74
Persistence - Configure JDBC
74
● Download the jdbc driver and put it in
/usr/share/openhab2/runtime/lib
● Edit /etc/openhab2/services/jpa.cfg
● Default persistence rules in
/etc/openhab2/persistence/jpa.persist
● Create the table
Logs in /var/log/openhab2/openhab.log
I’d rather not use a database on a virtual machine
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 75
Persist To The Cloud – Oracle Exadata Express Cloud Database
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 76
Persist To The Cloud – Oracle Exadata Express Cloud Database
Excellent security
– Needs a little extra configuration
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 77
Persist To The Cloud – Oracle Exadata Express Cloud Database
Excellent security
– Needs a little extra configuration
JDK 8 - JDK8u71 or higher
JDK 7 - JDK7u80 or higher
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 78
Persist To The Cloud – Oracle Exadata Express Cloud Database
Excellent security
– Needs a little extra configuration
JDK 8 - JDK8u71 or higher
JDK 7 - JDK7u80 or higher
JCE Unlimited Strength Jurisdiction Policy Files
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 79
Persist To The Cloud – Oracle Exadata Express Cloud Database
In your cloud admin panel you need to:
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 80
Persist To The Cloud – Oracle Exadata Express Cloud Database
In your cloud admin panel you need to:
● Click on Manage
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 81
Persist To The Cloud – Oracle Exadata Express Cloud Database
In your cloud admin panel you need to:
● Click on Manage
● Enable Client Access
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 82
Persist To The Cloud – Oracle Exadata Express Cloud Database
In your cloud admin panel you need to:
● Click on Manage
● Enable Client Access
● Download the client credentials
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 83
Persist To The Cloud – Oracle Exadata Express Cloud Database
In your cloud admin panel you need to:
● Click on Manage
● Enable Client Access
● Download the client credentials
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 84
Persist To The Cloud – Oracle Exadata Express Cloud Database
In your cloud admin panel you need to:
● Click on Manage
● Enable Client Access
● Download the client credentials
● Extract it
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 85
Persist To The Cloud – Oracle Exadata Express Cloud Database
EXTRA_JAVA_OPTS="-Doracle.net.tns_admin=/home/pi/EE_Credentials
-Doracle.net.ssl_server_dn_match=true
-Doracle.net.ssl_version=1.2
-Djavax.net.ssl.trustStore=/home/pi/EE_Credentials/truststore.jks
-Djavax.net.ssl.trustStorePassword=MyPassword
-Djavax.net.ssl.keyStore=/home/pi/EE_Credentials/keystore.jks
-Djavax.net.ssl.keyStorePassword=MyPassword"
In your cloud admin panel you need to:
● Click on Manage
● Enable Client Access
● Download the client credentials
● Extract it
● Edit – /etc/default/openhab2
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 86
Persist To The Cloud – Oracle Exadata Express Cloud Database
In your cloud admin panel you need to:
● Click on Manage
● Enable Client Access
● Download the client credentials
● Extract it
● Edit – /etc/default/openhab2
● Edit /etc/openhab2/services/jpa.cfg
# connection string url
url=jdbc:oracle:thin:/@dbaccess
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 87
Persist To The Cloud – Oracle Exadata Express Cloud Database
http://docs.oracle.com/en/cloud/paas/exadata-express-cloud/csdbp/
In your cloud admin panel you need to:
● Click on Manage
● Enable Client Access
● Download the client credentials
● Extract it
● Edit – /etc/default/openhab2
● Edit /etc/openhab2/services/jpa.cfg
# connection string url
url=jdbc:oracle:thin:/@dbaccess
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 88
Integrations Using REST
Camera linked to Automatic License Plate Reader (ALPR) software
1. Picture taken & sent to OpenALPR
2. Data comes back
3. POST data to my database
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 89
Welcome to Oracle REST Data Services
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 90
Set Up Oracle REST Data Services (ORDS)
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 91
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 92
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 93
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 94
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 95
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 96
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 97
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 98
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 99
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 100
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table CREATE TABLE plates (
ID NUMBER GENERATED ALWAYS AS IDENTITY NOT NULL,
Plate VARCHAR2(255),
TIMESTAMP TIMESTAMP,
CONSTRAINT plates_PK PRIMARY KEY (ID) ENABLE
);
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 101
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 102
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 103
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 104
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 105
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 106
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 107
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 108
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
● Create module
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 109
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
● Create module
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 110
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
● Create module
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 111
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
● Create module
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 112
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
● Create module
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 113
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
● Create module
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 114
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
● Create module
● Create URI
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 115
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
● Create module
● Create URI
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 116
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
● Create module
● Create URI
● Specify Handler
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 117
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
● Create module
● Create URI
● Specify Handler
● Finish
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 118
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
● Create module
● Create URI
● Specify Handler
● Finish
● Add PL/SQL code
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 119
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
● Create module
● Create URI
● Specify Handler
● Finish
● Add PL/SQL code
● Upload
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 120
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
● Create module
● Create URI
● Specify Handler
● Finish
● Add PL/SQL code
● Upload
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 121
Set Up Oracle REST Data Services (ORDS)
● Connect to the Database
● Enable REST Services
● Create table
● Open REST Data Services
- Development panel
● Connect to ORDS server
● Create module
● Create URI
● Specify Handler
● Finish
● Add PL/SQL code
● Upload
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 122
Configure Item
We’ll fake it with a light switch
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 123
Configure Item
We’ll fake it with a light switch
1. Install HTTP binding
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 124
Configure Item
We’ll fake it with a light switch
1. Install HTTP binding
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 125
Configure Item
We’ll fake it with a light switch
1. Install HTTP binding
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 126
Configure Item
We’ll fake it with a light switch
1. Install HTTP binding
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 127
Configure Item
We’ll fake it with a light switch
1. Install HTTP binding
2. Edit items file
/etc/openhab2/items/demo.items
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 128
Configure Item
Switch Light_FF_Child_Ceiling "Ceiling" (FF_Child, Lights)
We’ll fake it with a light switch
1. Install HTTP binding
2. Edit items file
/etc/openhab2/items/demo.items
3. Locate the item
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 129
Configure Item
Switch Light_FF_Child_Ceiling "Ceiling" (FF_Child, Lights) {http=">[CHANGED:POST:
https://myserver.oraclecloudapps.com:443/apex/oh_demo/camera/alpr?plate=abc123&timestamp=1234]"}
We’ll fake it with a light switch
1. Install HTTP binding
2. Edit items file
/etc/openhab2/items/demo.items
3. Locate the item
4. Add a POST call
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 130
Our Castle In The Cloud
Historic data persisted to
Exadata Express Cloud Database
Special case interfacing with an
ORDS based Restful service.
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 131
IoT Risks
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 132
IoT Risks
Just because you’re paranoid,
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 133
IoT Risks
Just because you’re paranoid,
it doesn’t mean they’re not out to get
you.
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 134
IoT Risks
Just because you’re paranoid,
it doesn’t mean they’re not out to get
you.
● Devices in a botnet
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 135
IoT Risks
Just because you’re paranoid,
it doesn’t mean they’re not out to get
you.
● Devices in a botnet
● Ransomware
It’s not just for computers anymore
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 136
IoT Risks
Just because you’re paranoid,
it doesn’t mean they’re not out to get
you.
● Devices in a botnet
● Ransomware
It’s not just for computers anymore
● Devices with always on mic
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 137
IoT Risks
Just because you’re paranoid,
it doesn’t mean they’re not out to get
you.
● Devices in a botnet
● Ransomware
It’s not just for computers anymore
● Devices with always on mic
Can’t get into my network!
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 138
IoT Risks
Just because you’re paranoid,
it doesn’t mean they’re not out to get
you.
● Devices in a botnet
● Ransomware
It’s not just for computers anymore
● Devices with always on mic
Can’t get into my network!
● Teapot
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 139
IoT Risks
Just because you’re paranoid,
it doesn’t mean they’re not out to get
you.
● Devices in a botnet
● Ransomware
It’s not just for computers anymore
● Devices with always on mic
Can’t get into my network!
● Teapot
● “Smart” Doorbell
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 140
Be Aware.
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 141
Question the Security of the Things.
Be Aware.
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 142
Question the Security of the Things.
Take Control.
Be Aware.
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 143
We can make it better
www.openhab.org
Github Repo - github.com/openhab
● Fork
● Change
● Pull Request
There are many ways to contribute.
● Enhance code
● Add tests
● Improve documentation
● Submit / review issues
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 144
Howdy, I’m Blaine Carter
Oracle Developer Advocate for Open Source
Oracle Corporation
Email: blaine.carter@oracle.com
Twitter: @OraBlaineOS
Blog: learncodeshare.net
Team: community.oracle.com/docs/DOC-917690

More Related Content

Move your Castle to the Cloud

  • 1. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |
  • 2. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 2 Howdy, I’m Blaine Carter Oracle Developer Advocate for Open Source Oracle Corporation Email: blaine.carter@oracle.com Twitter: @OraBlaineOS Blog: learncodeshare.net Team: community.oracle.com/docs/DOC-917690 2
  • 3. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 3 Internet of Things Lots and lots of things 3
  • 4. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 4 Home Automation 4
  • 5. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 5 Home Theater 5
  • 6. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 6 Things that don’t need to be connected 6
  • 7. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 7 OK, that’s pretty cool 7
  • 8. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 8 Howdy, I’m Blaine Carter 8
  • 9. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 9 Build it yourself DIY "Samsung Family Hub" Refrigerator with Raspberry Pi + Camera!!! https://www.youtube.com/watch?v=u3Jkv3xl8W4 + 9
  • 10. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 10 What kind of things Things I have
  • 11. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 11 What kind of things Things I have ● OpenGarage
  • 12. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 12 What kind of things Things I have ● OpenGarage ● Sonos
  • 13. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 13 What kind of things Things I have ● OpenGarage ● Sonos ● OpenSprinkler
  • 14. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 14 What kind of things Things I have ● OpenGarage ● Sonos ● OpenSprinkler ● Raspberry Pi  KODI
  • 15. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 15 What kind of things Things I have ● OpenGarage ● Sonos ● OpenSprinkler ● Raspberry Pi  KODI  Weather sensors
  • 16. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 16 What kind of things Things I want
  • 17. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 17 What kind of things Things I want ● Lighting
  • 18. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 18 What kind of things Things I want ● Lighting ● Thermostats
  • 19. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 19 What kind of things Things I want ● Lighting ● Thermostats ● Window blinds
  • 20. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 20 What kind of things Things I want ● Lighting ● Thermostats ● Window blinds ● OpenSprinkler + Weather Sensors
  • 21. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 21 What kind of things Things I want ● Lighting ● Thermostats ● Window blinds ● OpenSprinkler + Weather Sensors ● Security systems
  • 22. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 22 What kind of things Things I want ● Lighting ● Thermostats ● Window blinds ● OpenSprinkler + Weather Sensors ● Security systems
  • 23. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 23 What kind of things Things I want ● Lighting ● Thermostats ● Window blinds ● OpenSprinkler + Weather Sensors ● Security systems
  • 24. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 24 What’s Kept Me From Automating Everything?
  • 25. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 25 What’s Kept Me From Automating Everything? ● Expensive
  • 26. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 26 What’s Kept Me From Automating Everything? ● Expensive ● Vendor lock in
  • 27. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 27 What’s Kept Me From Automating Everything? ● Expensive ● Vendor lock in ● So many accounts/passwords
  • 28. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 28 What’s Kept Me From Automating Everything? ● Expensive ● Vendor lock in ● So many accounts/passwords ● Not enough control over ‘my’ things
  • 29. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 29 Control
  • 30. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 30 Control
  • 31. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 31 Control
  • 32. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 32 Control
  • 33. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 33 Control
  • 34. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 34 How to manage all these things Commercial Systems?
  • 35. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 35 How to manage all these things Commercial Systems?
  • 36. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 36 How to manage all these things Commercial Systems?
  • 37. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 37 How to manage all these things Commercial Systems? What happens if it’s discontinued?
  • 38. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 38 How to manage all these things Commercial Systems? What happens if it’s discontinued? If you can’t modify it, you don’t own it.
  • 39. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 39 Take back as much control as you can It’s your castle!
  • 40. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 40 openHAB Vendor and technology agnostic open source automation software for your home.
  • 41. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 41 openHAB Vendor and technology agnostic open source automation software for your home. Add some smarts to your castle.
  • 42. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 42 openHAB Vendor and technology agnostic open source automation software for your home. Add some smarts to your castle. ● Vendor neutral
  • 43. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 43 openHAB Vendor and technology agnostic open source automation software for your home. Add some smarts to your castle. ● Vendor neutral ● Works with a bunch of technologies
  • 44. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 44 openHAB Vendor and technology agnostic open source automation software for your home. Add some smarts to your castle. ● Vendor neutral ● Works with a bunch of technologies ● Robust APIs
  • 45. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 45 openHAB Vendor and technology agnostic open source automation software for your home. Add some smarts to your castle. ● Vendor neutral ● Works with a bunch of technologies ● Robust APIs ● Powerful rules engine
  • 46. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 46 openHAB Vendor and technology agnostic open source automation software for your home. Add some smarts to your castle. ● Vendor neutral ● Works with a bunch of technologies ● Robust APIs ● Powerful rules engine ● Runs on JVM
  • 47. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 47 openHAB Vendor and technology agnostic open source automation software for your home. Add some smarts to your castle. ● Vendor neutral ● Works with a bunch of technologies ● Robust APIs ● Powerful rules engine ● Runs on JVM ● Open source!
  • 48. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 48 openHAB Vendor and technology agnostic open source automation software for your home. Add some smarts to your castle. ● Vendor neutral ● Works with a bunch of technologies ● Robust APIs ● Powerful rules engine ● Runs on JVM ● Open source! ● Easy to extend
  • 49. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 49 Install openHAB
  • 50. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 50 Install openHAB Add the repository key to your package manager wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey? username=openhab' | sudo apt-key add -
  • 51. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 51 Install openHAB Add the repository key to your package manager wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey? username=openhab' | sudo apt-key add - Add repository to your system sources list echo 'deb http://dl.bintray.com/openhab/apt-repo2 stable main' | sudo tee /etc/apt/sources.list.d/openhab2.list
  • 52. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 52 Install openHAB Add the repository key to your package manager wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey? username=openhab' | sudo apt-key add - Add repository to your system sources list echo 'deb http://dl.bintray.com/openhab/apt-repo2 stable main' | sudo tee /etc/apt/sources.list.d/openhab2.list Do an update sudo apt-get update
  • 53. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 53 Install openHAB Add the repository key to your package manager wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey? username=openhab' | sudo apt-key add - Add repository to your system sources list echo 'deb http://dl.bintray.com/openhab/apt-repo2 stable main' | sudo tee /etc/apt/sources.list.d/openhab2.list Do an update sudo apt-get update Install openHAB and the addons sudo apt-get install openhab2 sudo apt-get install openhab2-addons
  • 54. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 54 Start it up These commands are for Linux init systems based on systemd (e.g. Debian 8, Ubuntu 15.x, Raspbian Jessie and newer)
  • 55. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 55 Start it up These commands are for Linux init systems based on systemd (e.g. Debian 8, Ubuntu 15.x, Raspbian Jessie and newer) Start service and check the status sudo systemctl start openhab2.service sudo systemctl status openhab2.service
  • 56. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 56 Start it up These commands are for Linux init systems based on systemd (e.g. Debian 8, Ubuntu 15.x, Raspbian Jessie and newer) Start service and check the status sudo systemctl start openhab2.service sudo systemctl status openhab2.service Set the service to auto start sudo systemctl daemon-reload sudo systemctl enable openhab2.service
  • 57. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 57 UI Options
  • 58. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 58 Persistence - I’m using the JPA configuration. Install JPA Add-on
  • 59. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 59 Persistence - I’m using the JPA configuration. Install JPA Add-on
  • 60. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 60 Persistence - I’m using the JPA configuration. Install JPA Add-on ● Add-ons
  • 61. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 61 Persistence - I’m using the JPA configuration. Install JPA Add-on ● Add-ons ● Persistence
  • 62. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 62 Persistence - I’m using the JPA configuration. Install JPA Add-on ● Add-ons ● Persistence ● Click install
  • 63. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 63 Persistence - I’m using the JPA configuration. Install JPA Add-on ● Add-ons ● Persistence ● Click install Set Default Persistence ● Configuration
  • 64. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 64 Persistence - I’m using the JPA configuration. Install JPA Add-on ● Add-ons ● Persistence ● Click install Set Default Persistence ● Configuration ● System
  • 65. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 65 Persistence - I’m using the JPA configuration. Install JPA Add-on ● Add-ons ● Persistence ● Click install Set Default Persistence ● Configuration ● System ● Select jpa
  • 66. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 66 Persistence - I’m using the JPA configuration. Install JPA Add-on ● Add-ons ● Persistence ● Click install Set Default Persistence ● Configuration ● System ● Select jpa ● Click save
  • 67. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 67 Persistence - Configure JDBC 67
  • 68. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 68 Persistence - Configure JDBC 68 ● Download the jdbc driver and put it in /usr/share/openhab2/runtime/lib
  • 69. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 69 Persistence - Configure JDBC 69 ● Download the jdbc driver and put it in /usr/share/openhab2/runtime/lib ● Edit /etc/openhab2/services/jpa.cfg # connection string url url=jdbc:oracle:thin:@//192.168.0.188:1521/orcl # driver class name driver=oracle.jdbc.OracleDriver # username user=oh_demo # password password=dd
  • 70. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 70 Persistence - Configure JDBC 70 ● Download the jdbc driver and put it in /usr/share/openhab2/runtime/lib ● Edit /etc/openhab2/services/jpa.cfg # connection string url url=jdbc:oracle:thin:@//192.168.0.188:1521/orcl # driver class name driver=oracle.jdbc.OracleDriver # username user=oh_demo # password password=dd
  • 71. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 71 Persistence - Configure JDBC 71 ● Download the jdbc driver and put it in /usr/share/openhab2/runtime/lib ● Edit /etc/openhab2/services/jpa.cfg ● Default persistence rules in /etc/openhab2/persistence/jpa.persist // persistence strategies have a name and a definition and are referred to in the "Items" section Strategies { // for rrd charts, we need a cron strategy everyMinute : "0 * * * * ?" } Items { DemoSwitch,NoOfLights,Window_GF_Toilet,Heating* : strategy = everyChange, everyMinute, restoreOnStartup // let's only store temperature values in rrd Temperature*,Weather_Chart* : strategy = everyMinute, restoreOnStartup } // vim: syntax=Xtend
  • 72. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 72 Persistence - Configure JDBC 72 ● Download the jdbc driver and put it in /usr/share/openhab2/runtime/lib ● Edit /etc/openhab2/services/jpa.cfg ● Default persistence rules in /etc/openhab2/persistence/jpa.persist ● Create the table
  • 73. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 73 Persistence - Configure JDBC 73 ● Download the jdbc driver and put it in /usr/share/openhab2/runtime/lib ● Edit /etc/openhab2/services/jpa.cfg ● Default persistence rules in /etc/openhab2/persistence/jpa.persist ● Create the table Logs in /var/log/openhab2/openhab.log
  • 74. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 74 Persistence - Configure JDBC 74 ● Download the jdbc driver and put it in /usr/share/openhab2/runtime/lib ● Edit /etc/openhab2/services/jpa.cfg ● Default persistence rules in /etc/openhab2/persistence/jpa.persist ● Create the table Logs in /var/log/openhab2/openhab.log I’d rather not use a database on a virtual machine
  • 75. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 75 Persist To The Cloud – Oracle Exadata Express Cloud Database
  • 76. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 76 Persist To The Cloud – Oracle Exadata Express Cloud Database Excellent security – Needs a little extra configuration
  • 77. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 77 Persist To The Cloud – Oracle Exadata Express Cloud Database Excellent security – Needs a little extra configuration JDK 8 - JDK8u71 or higher JDK 7 - JDK7u80 or higher
  • 78. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 78 Persist To The Cloud – Oracle Exadata Express Cloud Database Excellent security – Needs a little extra configuration JDK 8 - JDK8u71 or higher JDK 7 - JDK7u80 or higher JCE Unlimited Strength Jurisdiction Policy Files
  • 79. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 79 Persist To The Cloud – Oracle Exadata Express Cloud Database In your cloud admin panel you need to:
  • 80. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 80 Persist To The Cloud – Oracle Exadata Express Cloud Database In your cloud admin panel you need to: ● Click on Manage
  • 81. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 81 Persist To The Cloud – Oracle Exadata Express Cloud Database In your cloud admin panel you need to: ● Click on Manage ● Enable Client Access
  • 82. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 82 Persist To The Cloud – Oracle Exadata Express Cloud Database In your cloud admin panel you need to: ● Click on Manage ● Enable Client Access ● Download the client credentials
  • 83. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 83 Persist To The Cloud – Oracle Exadata Express Cloud Database In your cloud admin panel you need to: ● Click on Manage ● Enable Client Access ● Download the client credentials
  • 84. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 84 Persist To The Cloud – Oracle Exadata Express Cloud Database In your cloud admin panel you need to: ● Click on Manage ● Enable Client Access ● Download the client credentials ● Extract it
  • 85. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 85 Persist To The Cloud – Oracle Exadata Express Cloud Database EXTRA_JAVA_OPTS="-Doracle.net.tns_admin=/home/pi/EE_Credentials -Doracle.net.ssl_server_dn_match=true -Doracle.net.ssl_version=1.2 -Djavax.net.ssl.trustStore=/home/pi/EE_Credentials/truststore.jks -Djavax.net.ssl.trustStorePassword=MyPassword -Djavax.net.ssl.keyStore=/home/pi/EE_Credentials/keystore.jks -Djavax.net.ssl.keyStorePassword=MyPassword" In your cloud admin panel you need to: ● Click on Manage ● Enable Client Access ● Download the client credentials ● Extract it ● Edit – /etc/default/openhab2
  • 86. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 86 Persist To The Cloud – Oracle Exadata Express Cloud Database In your cloud admin panel you need to: ● Click on Manage ● Enable Client Access ● Download the client credentials ● Extract it ● Edit – /etc/default/openhab2 ● Edit /etc/openhab2/services/jpa.cfg # connection string url url=jdbc:oracle:thin:/@dbaccess
  • 87. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 87 Persist To The Cloud – Oracle Exadata Express Cloud Database http://docs.oracle.com/en/cloud/paas/exadata-express-cloud/csdbp/ In your cloud admin panel you need to: ● Click on Manage ● Enable Client Access ● Download the client credentials ● Extract it ● Edit – /etc/default/openhab2 ● Edit /etc/openhab2/services/jpa.cfg # connection string url url=jdbc:oracle:thin:/@dbaccess
  • 88. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 88 Integrations Using REST Camera linked to Automatic License Plate Reader (ALPR) software 1. Picture taken & sent to OpenALPR 2. Data comes back 3. POST data to my database
  • 89. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 89 Welcome to Oracle REST Data Services
  • 90. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 90 Set Up Oracle REST Data Services (ORDS)
  • 91. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 91 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database
  • 92. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 92 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database
  • 93. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 93 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services
  • 94. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 94 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services
  • 95. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 95 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services
  • 96. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 96 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services
  • 97. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 97 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services
  • 98. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 98 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services
  • 99. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 99 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services
  • 100. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 100 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table CREATE TABLE plates ( ID NUMBER GENERATED ALWAYS AS IDENTITY NOT NULL, Plate VARCHAR2(255), TIMESTAMP TIMESTAMP, CONSTRAINT plates_PK PRIMARY KEY (ID) ENABLE );
  • 101. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 101 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel
  • 102. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 102 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel
  • 103. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 103 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel
  • 104. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 104 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server
  • 105. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 105 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server
  • 106. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 106 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server
  • 107. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 107 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server
  • 108. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 108 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server ● Create module
  • 109. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 109 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server ● Create module
  • 110. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 110 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server ● Create module
  • 111. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 111 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server ● Create module
  • 112. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 112 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server ● Create module
  • 113. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 113 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server ● Create module
  • 114. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 114 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server ● Create module ● Create URI
  • 115. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 115 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server ● Create module ● Create URI
  • 116. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 116 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server ● Create module ● Create URI ● Specify Handler
  • 117. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 117 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server ● Create module ● Create URI ● Specify Handler ● Finish
  • 118. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 118 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server ● Create module ● Create URI ● Specify Handler ● Finish ● Add PL/SQL code
  • 119. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 119 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server ● Create module ● Create URI ● Specify Handler ● Finish ● Add PL/SQL code ● Upload
  • 120. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 120 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server ● Create module ● Create URI ● Specify Handler ● Finish ● Add PL/SQL code ● Upload
  • 121. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 121 Set Up Oracle REST Data Services (ORDS) ● Connect to the Database ● Enable REST Services ● Create table ● Open REST Data Services - Development panel ● Connect to ORDS server ● Create module ● Create URI ● Specify Handler ● Finish ● Add PL/SQL code ● Upload
  • 122. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 122 Configure Item We’ll fake it with a light switch
  • 123. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 123 Configure Item We’ll fake it with a light switch 1. Install HTTP binding
  • 124. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 124 Configure Item We’ll fake it with a light switch 1. Install HTTP binding
  • 125. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 125 Configure Item We’ll fake it with a light switch 1. Install HTTP binding
  • 126. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 126 Configure Item We’ll fake it with a light switch 1. Install HTTP binding
  • 127. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 127 Configure Item We’ll fake it with a light switch 1. Install HTTP binding 2. Edit items file /etc/openhab2/items/demo.items
  • 128. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 128 Configure Item Switch Light_FF_Child_Ceiling "Ceiling" (FF_Child, Lights) We’ll fake it with a light switch 1. Install HTTP binding 2. Edit items file /etc/openhab2/items/demo.items 3. Locate the item
  • 129. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 129 Configure Item Switch Light_FF_Child_Ceiling "Ceiling" (FF_Child, Lights) {http=">[CHANGED:POST: https://myserver.oraclecloudapps.com:443/apex/oh_demo/camera/alpr?plate=abc123&timestamp=1234]"} We’ll fake it with a light switch 1. Install HTTP binding 2. Edit items file /etc/openhab2/items/demo.items 3. Locate the item 4. Add a POST call
  • 130. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 130 Our Castle In The Cloud Historic data persisted to Exadata Express Cloud Database Special case interfacing with an ORDS based Restful service.
  • 131. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 131 IoT Risks
  • 132. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 132 IoT Risks Just because you’re paranoid,
  • 133. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 133 IoT Risks Just because you’re paranoid, it doesn’t mean they’re not out to get you.
  • 134. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 134 IoT Risks Just because you’re paranoid, it doesn’t mean they’re not out to get you. ● Devices in a botnet
  • 135. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 135 IoT Risks Just because you’re paranoid, it doesn’t mean they’re not out to get you. ● Devices in a botnet ● Ransomware It’s not just for computers anymore
  • 136. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 136 IoT Risks Just because you’re paranoid, it doesn’t mean they’re not out to get you. ● Devices in a botnet ● Ransomware It’s not just for computers anymore ● Devices with always on mic
  • 137. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 137 IoT Risks Just because you’re paranoid, it doesn’t mean they’re not out to get you. ● Devices in a botnet ● Ransomware It’s not just for computers anymore ● Devices with always on mic Can’t get into my network!
  • 138. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 138 IoT Risks Just because you’re paranoid, it doesn’t mean they’re not out to get you. ● Devices in a botnet ● Ransomware It’s not just for computers anymore ● Devices with always on mic Can’t get into my network! ● Teapot
  • 139. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 139 IoT Risks Just because you’re paranoid, it doesn’t mean they’re not out to get you. ● Devices in a botnet ● Ransomware It’s not just for computers anymore ● Devices with always on mic Can’t get into my network! ● Teapot ● “Smart” Doorbell
  • 140. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 140 Be Aware.
  • 141. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 141 Question the Security of the Things. Be Aware.
  • 142. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 142 Question the Security of the Things. Take Control. Be Aware.
  • 143. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 143 We can make it better www.openhab.org Github Repo - github.com/openhab ● Fork ● Change ● Pull Request There are many ways to contribute. ● Enhance code ● Add tests ● Improve documentation ● Submit / review issues
  • 144. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | 144 Howdy, I’m Blaine Carter Oracle Developer Advocate for Open Source Oracle Corporation Email: blaine.carter@oracle.com Twitter: @OraBlaineOS Blog: learncodeshare.net Team: community.oracle.com/docs/DOC-917690