de leukste bug
DESCRIPTION
The Bug is a device with which you can build your own mobile system by combining certain modules. Each module delivers a specific piece of functionality, such as camera, video output, GPS location, etc. The fun part of this device is that both the hardware and the software are completely modular and dynamic. That means that you can easily, with Eclipse and an SDK, write your own software for it. This session will introduce the Bug and the OSGi based software stack and will build and deploy a whole application.TRANSCRIPT
![Page 1: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/1.jpg)
luminis
De leukste BugMarcel Offermans
![Page 2: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/2.jpg)
luminis
Introduction
• Marcel Offermans
• .
• IT solutions from idea toimplementation
• experts in Java, OSGi, .NET,Agile/Scrum
Enschede
image © 2008 Google Earth
ApeldoornArnhem
![Page 3: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/3.jpg)
luminis
Agenda
• The BUG hardware
• The software stack, from kernel to application
• OSGi overview
• Concierge, R3 and the SDK
• Live demos
• Hello world on the BUG
• Developing and deploying a camera application
• Wrapping up
![Page 4: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/4.jpg)
luminis
Agenda
• The BUG hardware
• The software stack, from kernel to application
• OSGi overview
• Concierge, R3 and the SDK
• Live demos
• Hello world on the BUG
• Developing and deploying a camera application
• Wrapping up
![Page 5: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/5.jpg)
luminis
BUG
• Electronic building blocks to build personalized devices
• Open platform for custom hardware and software development
• Based on proven technologies:
• Linux
• Java
• OSGi
• 100% open source ((L)GPL, BSD and EPL)
![Page 6: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/6.jpg)
luminis
BUG elements
• BUGbase
• mobile linux computer
• BUGmodules
• video, audio, GPS, sensors, general I/O, ...
• SDK
• based on Eclipse
• BUGnet
• community application repository
![Page 7: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/7.jpg)
luminis
BUGbase
• Mobile Linux computer
• Freescale ARM SoC at 532 MHz
• 128 MB RAM, 32 MB flash, 2 GB SD storage, USB 2.0
• LCD menu system with navigation buttons and LEDs
• battery powered
• BUG Module Interface with 4 slots
• I2C, I2S, UART, ...
• hot pluggable
• kernel subsystem
![Page 8: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/8.jpg)
luminis
BUG camera
• 2 megapixel camera
• flash LED
• 3 buttons
![Page 9: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/9.jpg)
luminis
BUG LCD
• QVGA (320x240) resolution
• touchscreen
• (simple) accelerometer
![Page 10: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/10.jpg)
luminis
BUG GPS
• GPS device
• internal or external antenna
![Page 11: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/11.jpg)
luminis
BUG motion and accelerometer
• IR motion detector
• 3 axis accelerometer
![Page 12: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/12.jpg)
luminis
BUG von Hippel
• named after MIT professor Eric von Hippel
• exposes most hardware interfaces
• suited for rapid prototyping of modules, and as general I/O device
Democratizing Innovation
In this book I explain in detail how the emerging process of user-centric, democratized innovation works. I also explain how innovation by users provides a very necessary complement to and feedstock for manufacturer innovation.
![Page 13: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/13.jpg)
luminis
BUG audio
• audio in and out
• mic, headphone, line-in, line-out
• 2 hardware buttons
![Page 14: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/14.jpg)
luminis
Third party and planned
• Zigbee
• Wifi
• 3G
![Page 15: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/15.jpg)
luminis
Agenda
• The BUG hardware
• The software stack, from kernel to application
• OSGi overview
• Concierge, R3 and the SDK
• Live demos
• Hello world on the BUG
• Developing and deploying a camera application
• Wrapping up
![Page 16: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/16.jpg)
luminis
BUG software stack
• Linux 2.6 kernel
• CDC JVM (phoneME advanced)
• OSGi R3 framework (Concierge)
• BUG applications are collections of OSGi bundles Linux Kernel
Java VM
OSGi
AppAppApp
![Page 17: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/17.jpg)
luminis
OSGi history
• Started as an embedded platform for the “home gateway”
• Originally under the JCP as JSR-8 (1999)
• OSGi alliance, large consortium, with a mission:
• maintaining and publicizing the OSGi specification
• certifying implementations
• organising events
• OSGi R3: march 2003
• Current version: OSGi Release 4.1 (JSR-291)
![Page 18: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/18.jpg)
luminis
OSGi today
OSGi technology is the dynamic module system for Java™
OSGi technology is Universal Middleware.
OSGi technology provides a service-oriented, component-based environment for developers and offers standardized ways to manage the software lifecycle. These capabilities greatly increase the value of a wide range of computers and devices that use the Java™ platform.
![Page 19: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/19.jpg)
luminis
OSGi Alliance
• Expert Groups:
• core platform (CPEG)
• mobile (MEG)
• vehicle (VEG)
• enterprise (EEG)
• residential (REG)
• Working Groups:
• marketing
• requirements
![Page 20: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/20.jpg)
luminis
OSGi specification
OSGi Service PlatformService CompendiumThe OSGi Alliance
Release 4, Version 4.1April 2007
OSGi Alliance
Digitally signed by OSGi Alliance DN: cn=OSGi Alliance, c=US Date: 2007.02.22 14:44:10 + 01'00'
Signatu re Not Verified
OSGi Service PlatformCore SpecificationThe OSGi Alliance
Release 4, Version 4.1April 2007
OSGi Alliance
Digitally signed by OSGi Alliance DN: cn=OSGi Alliance, c=US Date: 2007.02.22 14:45:47 + 01'00'
Signatur e Not Verified
![Page 21: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/21.jpg)
luminis
OSGi Framework Layering
L3 - Provides a publish/find/bind service model to decouple bundles
L2 - Manages the life cycle of a bundle in a framework without requiring the vm to be restarted
L1 - Creates the concept of a module (aka. bundles) that use classes from each other in a controlled way according to system and bundle constraints
L0 - well defined profiles that define the environment in which bundles can work, ie:* CDC/Foundation* JavaSE-6
SERVICE MODEL
MODULE
LIFE-CYCLE
ExecutionEnvironment
![Page 22: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/22.jpg)
luminis
Module Layer
• Unit of deploymentis the bundle i.e., a JAR
• Separate class loaderper bundle
• Class sharing at the Java package level
• Supports multiple versions of packages
Module
ModuleBundle Bundle Bundle
org.apache.utils 1.0
org.apache.utils 1.1org.apache.log 2.3
org.apache.db 1.4
Bundle
exports
imports
exports
imports
exports
exports
![Page 23: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/23.jpg)
luminis
Manifest
Bundle-Name: Example BundleBundle-SymbolicName: net.luminis.example.bundleBundle-Version: 1.0.0DynamicImport-Package: net.luminis.jdbc.*Import-Package: org.osgi.framework;version=“1.3“, org.osgi.service.event;version=“[1.0,2.0)“, net.luminis.foo;resolution:=“optional“Export-Package: org.osgi.service.event;version=“1.1“Bundle-ManifestVersion: 2
![Page 24: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/24.jpg)
luminis
Life-cycle Layer
• Managed life cycle
• States for each bundle;
• Allows updates of existing bundles
• Dynamically install, start, update, and uninstall
Life-cycle
Life-cycle
start
end
installedinstall
startingstart
stopping stop
activeresolved
uninstalled
uninstall
Module
![Page 25: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/25.jpg)
luminis
Life-cycle Example
Bundle
OSGi Framework
![Page 26: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/26.jpg)
luminis
Life-cycle Example
Bundle
OSGi Framework
Provided Package
![Page 27: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/27.jpg)
luminis
Life-cycle Example
Bundle
OSGi Framework
Bundle
Install
Bundle
![Page 28: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/28.jpg)
luminis
Life-cycle Example
Bundle
OSGi Framework
Bundle
Resolve
Bundle
![Page 29: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/29.jpg)
luminis
Service Layer
• OSGi framework promotes service oriented interaction pattern among bundles
Service
Service
Log Database
Bundle Bundle Bundle
publish useuse
publish
Bundle
Prefs
publish
use
Service Provider
Service Requester
Service Registry
interact
publish find
Life-cycle
Module
![Page 30: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/30.jpg)
luminis
Service Example
Bundle
OSGi Framework
![Page 31: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/31.jpg)
luminis
Service Example
Bundle
OSGi Framework
Provided Package
Provided Service
![Page 32: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/32.jpg)
luminis
Service Example
Bundle
OSGi Framework
Bundle
Install
Bundle
![Page 33: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/33.jpg)
luminis
Service Example
Bundle
OSGi Framework
Bundle
Resolve
Bundle
![Page 34: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/34.jpg)
luminis
Service Example
Bundle
OSGi Framework
Bundle
Resolve
Service
![Page 35: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/35.jpg)
luminis
Security Concepts Overview
• Codebased security of the Java Security Model
• Makes use of Protection Domain
• The stack walk based Permission Check
• Signed bundles
• User based security is supported by the UserAdmin service but not integrated in the standard permission check as with JAAS
• PermissionAdmin and ConditionalPermissionAdmin servicesprovide management infrastructure
Security
Module
Life-cycle
Service
![Page 36: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/36.jpg)
luminis
Leveraging standard services
• Specification:
• OSGi compendium – catalog of standard service descriptions
• Implementations:
• OBR repository at bundles.osgi.org – over 1400 bundles, implement compendium and other services
• Maven repository and third party OBR’s
• Springsource has a repository
• More and more projects are made OSGi compatible, for example: Apache Commons OSGi, Jetty, ...
![Page 37: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/37.jpg)
luminis
OSGi compendium
Log
HTTP
Device Access
Configuration AdminPreferences
Metatype
Wire AdminUser Admin
IO Connector
Initial Provisioning
UPnP™ Device
Declarative Services
Event Admin Service Tracker
XML Parser
Position
Measurement and State
Execution Environment Spec
OSGi Service PlatformService CompendiumThe OSGi Alliance
Release 4, Version 4.1April 2007
OSGi Alliance
Digitally signed by OSGi Alliance DN: cn=OSGi Alliance, c=US Date: 2007.02.22 14:44:10 + 01'00'
Signatu re Not Verified
![Page 38: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/38.jpg)
luminis
Concierge
• implements OSGi R3 specification
• small footprint: 80 kB
• optimized for embedded environments
• low resource consumption
• tuned for VM’s that interpret bytecode
• tested on many platforms
• iPAQ, Zaurus, Nokia 9300, LinkSys NSLU, iMote2, ...
• Homepage: http://concierge.sourceforge.net/
![Page 39: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/39.jpg)
luminis
OSGi R3
• no bundle symbolic names
• no require-bundle
• only one version of a package
• a somewhat smaller compendium
OSGi Service Platform
Release 3March 2003
![Page 40: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/40.jpg)
luminis
Dragonfly BUG SDK
• software development kit to build applications
• Eclipse plug-ins, open source
• includes a virtual BUG, an emulator to test applications without hardware
![Page 41: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/41.jpg)
luminis
SDK interfaces with hardware
![Page 42: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/42.jpg)
luminis
Agenda
• The BUG hardware
• The software stack, from kernel to application
• OSGi overview
• Concierge, R3 and the SDK
• Live demos
• Hello world on the BUG
• Developing and deploying a camera application
• Wrapping up
![Page 43: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/43.jpg)
luminis
Hello World on the BUG
• Register ourselves as a listener for button events
• When an event comes in, blink all LEDs for half a second
• Deploy the code to the BUG
![Page 44: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/44.jpg)
luminis
Adding modules
• at the OSGi level, adding a module means new services appearing
• applications can track these services and become active once all required services are present
• BUG SDK has a convenient project wizard to help you with that
• internally, Service Trackers are used to track OSGi services
![Page 45: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/45.jpg)
luminis
Developing and deploying a camera application
• Use the camera, LCD and accelerometer to:
• wait until you hold the device still for a little while
• take a picture
• display the picture on the LCD
• Use the project wizard to depend on the right services
• Deploy to the BUG
• Test the application
![Page 46: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/46.jpg)
luminis
Agenda
• The BUG hardware
• The software stack, from kernel to application
• OSGi overview
• Concierge, R3 and the SDK
• Live demos
• Hello world on the BUG
• Developing and deploying a camera application
• Wrapping up
![Page 47: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/47.jpg)
luminis
Wrapping up
• We’ve looked at the open software and hardware stack of the BUG
• After a brief look at OSGi, we developed and deployed a couple of applications to the BUG
• Before you ask, a new version of the BUG, which supports WiFi is scheduled for June and will ship to europe (you need a US address now)
• The BUG community is very supportive, check it out on their site and go to #buglabs on Freenode IRC
![Page 48: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/48.jpg)
luminis
Links
• Slides, docs and code:http://opensource.luminis.net/
• Buglabs:http://buglabs.net/
• OSGi:http://www.osgi.org/
• Marcel Offermans: [email protected]
![Page 49: De leukste Bug](https://reader036.vdocument.in/reader036/viewer/2022062419/558740b9d8b42a5f388b4740/html5/thumbnails/49.jpg)
luminis
Questions?!
? & !