connectivity

Transcription

connectivity
Intelligent Device Platform XT
Technical Brief
Jeffrey Fortin
Director, Product Management
March 2014
•1
| © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Agenda
•
•
•
•
•
IoT Gateway Overview
Hardware Overview
Software Overview
IoT Gateway Security
Application Environments (Programing Support)
2 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Typical IoT Gateway Implementation
3 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Wind River Intelligent Device Platform
Connectivity
Manageability
Security
 Platform customization
significantly reduces timeto-product while increasing
productive life of M2M
devices.
 Security features designed for
M2M development protect
critical data throughout the
device life cycle.
 Situatio)
• Pre-integrated smart and
connected capabilities
enable rich network
options to save
development time and
costs.
• Validated and flexible
firmware provide an
extensive network of
connectivity choices,
including broad modem
support and PAN, LAN, and
WAN network access.
4
| © 2014 Wind River. All Rights Reserved.
 Intuitive web-based tool
reduces configuration and
support costs and allows for
anytime provisioning and
management of devices.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
 Customizable SRM ensures the
integrity of the end devices via
secure boot, provides
encrypted communication
between device and
management console in the
cloud, and offers device
resource management to limit
system exposure of untrusted
applications.
IoT Gateway Targets
• Regulated Markets
– Industrial Control
– Energy
– Transportation
• Targeted Applications
–
–
–
–
“Low Touch” and High Volume
Single Local Connectivity
Single or Dual Wide Area Connectivity
Low compute local data aggregation requirements
5 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Value Metrics of IoT
Cost Reduction
New Revenue Capture
Faster Innovation
Power of 1%
Time to Revenue
Expand market share
Device monetization
Solve bigger problem
Improve ASP
Consolidation
Disrupt supply chain
Function virtualization
BOM versus OPEX
From device to service
Move value-add bar up
New go-to-market
New business model
6 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Granular Billing for Usage-Based Leasing
Use Case
Provide up-to-the minute
visibility into engine-hour
usage to avoid surprises for
end users and greater
visibility into revenue for
equipment manufacturers.
Business Case
Switch from a device centric
CAPEX / frontloaded model,
to an OPEX / service oriented
model. Motivation : Constant
recurring revenue closer to
the customer value provided
√
√
!
Forklift is well-within
Engine-hour usage
Lease parameters.
7 | © 2014 Wind River. All Rights Reserved.
Forklift risks exceeding
engine-hour cap. Use
Further use should be
limited or authorized.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Forklift is well-within
Engine-hour usage
Lease parameters.
Daikin Applied
Daikin Applied is part of Daikin Industrial, LTD.,a Fortune 1000 company with
2013 revenues in excess of $18 billion and more than 51,000 employees
worldwide, it is the largest HVAC manufacturer in the world.
•
•
•
•
Rebel AC line is already
considered to be
‘Smart’.
The MicroTech III
processor already
collects over 600
different data points
none of this information
leaves the unit.
The plan is to turn the
‘Smart’ unit into an
‘Intelligent’ system, with
the ability to
communicate system
state and health to the
cloud.
8 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Daikin Applied Use Case
DMQ Rebel
Roof Top Unit
Building
Owner
Cloud
DMQ
Support &
Service
Mobile
iDigi Connector
BACnet
Maintenance
Console
DMQ App
Wi-Fi
DMQ MicroTek III
Controller
30cm
Ethernet
9 | © 2014 Wind River. All Rights Reserved.
IDP
IoT Intelligent Gateway
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
•IT/Business
Domain
HARDWARE
10 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
2014 Moon Island 2.0 IoT Gateway Family
Form Factor Reference Designs (FFRD)
Cross Hill
Clanton Hill
Valley
Island
UTX 3115
(Advantech)
Canova
Beach
(follow on
to CrH)
Ocean
Beach
(follow on to
VI)
Time
1H’14
1H’14
1H’14
2H’14
2H’14
CPU
Quark
x1000
Quark
x1000
Bay Trail
E3827
Dual Core, No
ECC
Quark
x1000
Bay Trail
E3827
Dual Core
Energy,
Industrial
Transportation
Energy,
Industrial,
Transportation
Energy,
Industrial
Energy,
Industrial,
Transportation
0°to 55°
-40°to 85°
-20°to 60°
-40°to 85°
-40°to 85°
Vertical
Temp
11
| © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
CPU Requirements
Categories
CPU
Quark Processor Options
 X1020. ECC, Secure Boot,
Commercial Temp
 X1021. ECC, Secure Boot,
Industrial Temp
12 | © 2014 Wind River. All Rights Reserved.
Atom Processor Options
 E3815. 1C, 512KB Cache,
1 x DDR3L-1067 ch,
400MHz Gfx
 E3825. 2C, 1MB Cache,
1 x DDR3L-1067 ch,
533MHz Gfx
 E3826. 2C, 1MB Cache,
2 x DDR3L-1067 ch,
533MHz Gfx
 E3827. 2C, 1MB Cache,
2 x DDR3L-1333 ch,
542MHz Gfx
 E3845. 4C, 2MB Cache,
2 x DDR3L-1333 ch,
542MHz Gfx
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Cross Hill Industrial/Energy FFRD
• Physical System:
• 4 Layer Board
• 10cm x 15cm I
• With Enclosure
• Intel® Quark X1000 Core
• 400 MHz
• ECC Enabled
• Secure Boot
• Wireless Connectivity
• Intel® Centrino 6205 Wi-Fi
• Telit HE910 3G with GPS
• Zigbee (X-bee & Exegin)
• Wired Connectivity
• 4GB MicroSD
• 2 10/100 Ethernet Ports
• 1 USB2.0 Device Port
• 1 USB2.0 Host Port
• 1 RS-232 UART Port
13
| © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Cross Hill Industrial/Energy FFRD
Industrial / Energy Specific Features
•1 GB DDR3-800
•8 ch ADC for sensing raw inputs
•1 RS-485 port
•Certifications (CE, FCC, PTCRB ..)
Telit
Modem
Development Kit Content:
•Chassis with CRB installed
•Linux image pre-installed
•Power supply, Accessories
•Documentation
•Quark X1000 Software Stack to be
downloaded via web site
•Safety & Carrier Certified
•SW Licenses
WiFi
14
| © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Energy Module (moving
to USB based I/F for production)
Clanton Hill Transport FFRD
Physical System Characteristics
 Board in Enclosure
Intel® Quark X1000 Core
 400 MHz Quark Core
 ECC Enabled, Secure Boot
 512 MB DDR3-800
Vehicle I/F and Network Connectivity
 High Speed CAN (max 1Mbps)
 Fault Tolerant CAN max 125 kbps
 6 Ch 12-bit ADC
Wireless Connectivity
 PCIe based Wi-Fi
 Bluetooth 4.0
 Telit HE910 3G Modem with GPS
Wired Connectivity
 2 10/100 Ethernet Ports
 USB2.0 Device Port
 3 USB2.0 Host Port
 RS-232 UART Port
 4GB MicroSD
15
| © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Clanton Hill Transport FFRD
Transportation Specific Features
 Collision and Rollover Detection
via on board Accelerometer
 Emergency Call Support with
Microphone In and Line Out
 Driver Call Button
 Driver Alarm Button
 4.5V to 28V with Battery Backup
 Battery Monitor(s)
 Certifications for Transportation
use, including CE, FCC, PTCRB)
Development Kit Content:
 Chassis with CRB installed
 Linux image pre-installed
 Power supply, Accessories
 Documentation
 Safety & Carrier Certified
 Quark X1000 Software Stack
16
| © 2014 Wind River. All Rights Reserved.
battery
mPCIe
mPCIe
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
•IT/Business
Domain
SOFTWARE
17 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Software Requirements
Categories
Operating System
Software Stack
IDP 2.1 XT Features
Feature











Windriver Linux v5.0.1
Intelligent Device Platform 2.1 XT
Security
Manageability
OpenSSL with
FIPS140-2
Module, TPM
Based
McAfee
Embedded
Control
Grsecurity
OpenPTS
Grub.efi (signed)
Signed Kernel
Secure Boot
Enabled
Encrypted
Storage
VPN
18 | © 2014 Wind River. All Rights Reserved.



Web
Interface
(WebIF)
OMA-DM
Agent
TR-069 Agent




Application
Development
OpenJDK
LUA Scripting
SQLite3
OSGi
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.



Connectivity
Protocols
WiFi Access
Point
MQTT Client &
Broker
Zigbee Stack
IoT Gateway Software Architecture
Manageability
WebIF
Runtime Environment
Security
OSGi
OMA-DM
Lua
Online
Update
OpenJDK
TR-069
OpenSSL TPM Engine
Secure Package
Management
Intel Security Embedded
Control
Connectivity
Remote Attestation
Wireless
Wired
Protocols
Encrypted Storage
Resource Control
Wind River Linux 5.0.1
Application
Integrity Monitor
Board Support Packages for Intel Quark, Bay Trail
Secure Boot
A Board Support Package (BSP) based on Wind River Linux v5.0.1 with the IDP XT 2.x software solution will be
needed to run the Gateway Stack on a new board. Wind River can perform this work through a services
engagement.
19 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Included IDP XT Components
Add On
Partner
Description
Distribution
OSGi
mBS SmartHome SDK based on OSGi
Binary
OMA-DM
OneAgent OMA-DM
Binary
TR-069
OneAgent TR-069
Binary
802.15.4
802.154 MAC Layer + Interface Library
Binary
ZigBee
Native ZigBee stack
Binary
• All 3rd party components come fully licensed, if the customer purchases the Developer Kit, then there are no
additional per seat developer costs. Runtime licensing is included as part of the customers Production License
purchase, there are no additional deployment costs.
• Source code licensing for Add-ons may be available from the various partners.
20
| © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
IDP XT Development Environment
Software Development Environment
Wind River Workbench 3.3.4
• Eclipse framework 3.5
• Eclipse CDT project 6.0
• Wind River GNU compiler
• User space and kernel debuggers
• Linux user & kernel space configuration tools
• Run-time analysis tools:
• System viewer
• Memory analyzer
• Performance profiler
• Code coverage analyzer
Additional Tools Add-ons
• OSGi Eclipse Plug-ins
Common development environment across all supported
hardware
21
| © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
SECURITY
22 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
•23
•| © 2009 Wind River. All Rights Reserved.
•24
•| © 2011 Wind River. All Rights Reserved.
Secure Package Management
5. Target is
notified to update
2. Assemble into
a RPM package
Repository
6. Target
downloads
package
Package
Files
Package
8. Written
to disk
4. Added to
repository
7. Package
integrity checked
3. Sign with
private key of
certificate
Files
Certificate
1. Trust relationship
established
Authorized
Certificates
Trusted software vendor
Deployed target
Repository is typically accessed via https, but other protocols may be used.
26 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Storage
27 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
MEC Application Control Modes
Operates in the following modes:
• Enabled Mode - Allows only the whitelisting applications to
execute. Protects whitelisted files from unauthorized
modifications and deletion attempts.
• Update Mode - Allows the administrator to perform authorized
updates on the system. The whitelist is dynamically updated in
update mode.
• Disable Mode - All application control features are disabled.
The whitelist is not dynamically updated.
28 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Overriding the Whitelist
Non-whitelisted software execution can be authorized
or blocked with the following methods:
1. Name
2. By adding to whitelist
This list is in order of precedence.
A program which is allowed to execute based on whitelist and is
banned by name will not be allowed to execute.
29 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Additional update methods
Complete list of the different system updating methods
available for MEC Linux:
• Authorized Updaters – description on following slides
• Update Mode - Allows the administrator to perform authorized
updates on the system. The whitelist is dynamically updated in
update mode.
30 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
More on Authorized Updaters
• An updater is trusted component authorized to
update a protected system. The updater must be
present on the system’s whitelist.
• Useful for frequent required updates (as opposed to
placing system in update mode)
• Programs, Scripts & Binaries can be configured as
an Authorized Updater.
31 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
•IT/Business
Domain
APPLICATION ENVIRONMENTS
32 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
IDP XT 2.0 Application Environments
•
•
•
•
•
•
Professional C/C++ Embedded Development Support
Java Applications (via OpenJDK)
OSGi (via mBS SDK)
Lua
Python
Other environments can be added to standard package
33 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
OpenJDK
Java Applications
Host
JDK (Java
Development Kit)
JDK (Java Development Kit)
JRE (Java Runtime Environment)
Compiler
Java class Library
Javadoc
Jarsigner
JVM
Zero VM
Cacao VM
…
Bitbake Build System
IDP Native Environment
A full, free, open source edition of Java Standard Edition (SE), Java Virtual Machine (JVM)
implementation:
 Supports Java SE versions 6 and 7, leverages system provided libraries (zlib, libpng, ...)
 Choice of JVM – OpenJDK, Zero VM, Cacao VM
 For a full list of features supported by openjdk, please refer to: http://openjdk.java.net/
34 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
OSGi 101
• A set of Java specifications
that define a dynamic
component system and app
post-deployment (app store).
• Service provider’s own app
store enabled
• Vertical market adopted
solution





Enterprise Application Servers (Oracle)
Mobile Industry (Sprint, Nokia, IBM, …)
Automotive Industry (BMW, Siemens, Delphi…)
Telematics (Daimler AG, Bombardier, DB, …)
Smart Home (Deutsche Telekom, Siemens)
35 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
•IT/Business
Domain
MANAGEABILITY
36 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Manageability Options
• Leverage Established Management Protocols
– ODA-DM
– TR-069
• Use Web UI for small deployments
• Future updates will include more options for IoT
37 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Web based Configuration
WebIF is Wind River’s Web Based Configuration Interface.
-- add capabilities.
38 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
WEB-IF Demo
39 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
•IT/Business
Domain
CONNECTIVITY
40 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Connectivity Types
• Local Connectivity
– Examples
• Ethernet, 802.15.4, Bluetooth
• WAN Connectivity
– Wired, Cellular
• Interface Protocols
– Examples
• MQTT, TCP/IP
– Sample applications are provided
– Additional protocols like BacNet can be added to standard
offering
41 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Local Connectivity
42 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
WAN Connectivity
43 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
MQTT
 Message Queue Telemetry Transport
 A lightweight (low power, low network bandwidth) publish-and-subscribe messaging protocol
 An important protocol of the M2M/Internet of Things (IoT) revolution
 MQTT offered by IDP:
 paho.mqtt.lua: a client-side implementation based on Lua for version 3.1 of the MQTT protocol, plus
command-line utilities for publishing and subscribing to MQTT topics.
 mosquitto: server version 3.1 of the MQTT protocol
Broker
Topic
Publish
......
Topic
Subscribe
Client
Client
44 | © 2014 Wind River. All Rights Reserved.
Client
Client
Client
Client
Client
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
……
MQTT – Demo Scenario
Problem Statement: Statistics need to be collected in order to track the number of
packets sent and received by a number of devices in a network. The number of
packets received needs to be sent to two different locations.
MQTT to the rescue.
We’ll set up two separate topics will be set up to capture the data from the devices:
1. Network/packets/sent
2. Network/packets/received
Three subscribers will be set up (two for Receive, one for Sent) to retrieve the data.
Subscribers
RX Collector1
RX Collector2
TX Collector
Broker
Network/packets/received
Publishers
45 | © 2014 Wind River. All Rights Reserved.
Device
Network/packets/sent
Device
Device
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
MQTT – Demo Setup
Ethernet Switch
Publisher
Publisher & MQTT Broker
172.16.1.5
aaeon5
172.16.1.2
Publisher
172.16.1.2
kontron2
Topics:
• network/packets/sent
• network/packets/received
172.16.1.1
Subscribers in 3 separate windows
2 for Packets Received
1 for Packets Sent
46 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
MQTT – Demo
Subscriber Side
$ mosquitto_sub -h aaeon -t network/packets/sent
Publisher Side:
$ mosquitto_pub -h aaeon -t network/packets/sent -m “$HOSTNAME: 5“
Note that mosquitto provides lots of options that are not shown that enable things like persistent messages,
47 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
REVIEW
48 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
IoT Gateway Software Architecture
Manageability
WebIF
Runtime Environment
Security
OSGi
OMA-DM
Lua
Online
Update
OpenJDK
TR-069
OpenSSL TPM Engine
Secure Package
Management
Intel Security Embedded
Control
Connectivity
Remote Attestation
Wireless
Wired
Protocols
Encrypted Storage
Resource Control
Wind River Linux 5.0.1
Application
Integrity Monitor
Board Support Packages for Intel Quark, Bay Trail
Secure Boot
A Board Support Package (BSP) based on Wind River Linux v5.0.1 with the IDP XT 2.x software solution will be
needed to run the Gateway Stack on a new board. Wind River can perform this work through a services
engagement.
49 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Call to Action
• Identify customers targets in the “Sweet Spot”
– Regulated Markets
• Industrial Control
• Energy
• Transportation
– Targeted Applications
•
•
•
•
“Low Touch” and High Volume
Single Local Connectivity
Single or Dual Wide Area Connectivity
Low compute local data aggregation requirements
• Work with Intel to establish a Go-To-Market Plan
–
–
–
–
Define Target Market or Application
Launch schedule
Hardware and Software Requirements
Enablement Partners (Wind River, McAfee, SIs)
50 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Wind River. All Rights Reserved.
51 || ©©2013
2014
Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
•IT/Business
Domain
BACKUP SLIDES
52 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Lua
-
•
•
•
A powerful, embeddable, dynamically typed language intended for use as
an extension or scripting language, created in Brazil in 1993
Complete language fits into 180kB, can go as low as 80k depending on
features required.
a “multi-paradigm” language, provides a small set of general features that
can be extended to fit different problem types,
- For example, does not contain explicit support for inheritance, but
allows it to be implemented relatively easily
compact enough to fit on a variety of host platforms – including modems!.
small set of advanced features such as first-class functions, garbage
collection, closures, proper tail calls, coercion (automatic conversion
between string and number values at run time), coroutines (cooperative
multitasking) and dynamic module loading.
attempts to strike a balance between power and size.
53 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
Lua – Examples
The classic hello world program can be written as follows:
print('Hello World!')
The factorial function:
function factorial(n)
if n == 0 then return 1 end
return n * factorial(n - 1)
end
Loops:
while condition do --statements end
repeat statements until condition
for i = first,last,delta do print(i) end
for key, value in pairs(_G) do print(key, value) end
54 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
SQLite
SQLite is an embedded relational database engine.
• self-contained, server-less, zero-configuration
• transactional SQL database engine.
• hundreds of millions copies in use today worldwide .
• used in the Solaris 10 and Mac OS operating systems
• Used by iPhone and Skype.
• The Qt4 library has built-in support for SQLite
•IT/Business
• Many popular applications use SQLite internally - Firefox, Google Chrome
Domain
or Amarok.
• Website: http://sqlite.org
• Tutorial: http://zetcode.com/db/sqlite/
55 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
SQLite
• implements most of the SQL-92 standard for SQL.
• the engine is not a standalone process, instead, it is statically or
dynamically linked into the application.
• It can require less than 300 KiB.
• An SQLite database is a single ordinary disk file that can be located
anywhere in the directory hierarchy. It is a cross platform file.
• It can be used on various operating systems, both 32 and 64 bit
architectures.
•IT/Business
Domain
• written in the C programming language.
• bindings are available for many languages, including C++, Java, C#,
Python, Perl, PHP, Ruby, Visual Basic, and Tcl.
• The source code of SQLite is in public domain.
56 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
SQLite – Create, Insert and Query
Create a new database ‘library’
$ sqlite3 library.db
Create a new table ‘Books’ table
sqlite> CREATE TABLE Books(Id INTEGER PRIMARY KEY, Title TEXT, Author TEXT,
...> ISBN TEXT DEFAULT 'not available');
Insert two book into the Books table
sqlite>
...>
sqlite>
...>
INSERT INTO Books(Id, Title, Author, ISBN)
VALUES(1, 'War and Peace', 'Leo Tolstoy', '978-0345472403');
•IT/Business
INSERT INTO Books(Title, Author, ISBN)
Domain
VALUES('The Brothers Karamazov', 'Fyodor Dostoyevsky', '978-0486437910');
Display the contents of the Books table
sqlite> SELECT * FROM Books;
Id|Title|Author|ISBN
1|War and Peace|Leo Tolstoy|978-0345472403
2|The Brothers Karamazov|Fyodor Dostoyevsky|978-0486437910
57 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
SQLite – Update & Delete
Update a record.
sqlite> UPDATE Books SET Author='Lev Nikolayevich Tolstoy' WHERE Id=1;
sqlite> SELECT * FROM Books WHERE Id=1;
Id|Title|Author|ISBN
1|War and Peace|Lev Nikolayevich Tolstoy|978-0345472403
Delete a record
sqlite> DELETE FROM Books2 WHERE Id=1;
sqlite> SELECT * FROM Books;
Id|Title|Author|ISBN
2|The Brothers Karamazov|Fyodor Dostoyevsky|978-0486437910
58 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
•IT/Business
Domain
SQLite - Example
Python SQLite Application Example
#!/usr/bin/python
import sqlite3 as lite
import sys
con = lite.connect('test.db')
with con:
cur = con.cursor()
cur.execute("CREATE TABLE Cars(Id INT, Name TEXT, Price INT)")
cur.execute("INSERT INTO Cars VALUES(1,'Audi',52642)")
cur.execute("INSERT INTO Cars VALUES(2,'Mercedes',57127)")
59 | © 2014 Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.
•IT/Business
Domain
Wind River. All Rights Reserved.
60 || ©©2013
2014
Wind River. All Rights Reserved.
For informational purposes only. No commitment or
warranty is implied. Subject to change without notice.