third level pimp your pi - rcp vision€¦ · is in an osgi bundle (plug-in) – implements a...
TRANSCRIPT
![Page 1: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/1.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 1
Pimp your Pi with Eclipse RCP for your Home TV
![Page 2: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/2.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 2 © Copyright 2014, Genuitec, LLC. 2
Who’s Talking?
Nicholas Baumer
European Account Manager
Technology Enthusiast
![Page 3: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/3.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 3 © Copyright 2014, Genuitec, LLC. 3
Obligatory Disclaimer
• We’re here because we love Eclipse.
• Yes, we could plug Genuitec, and our awesome products like
MyEclipse and Secure Delivery Center…
• But this talk is all about the fun you can have with Pi and open
source!
• MyEclipse is your fully loaded IDE, ready to go. Built on Eclipse and
optimized for a broad array of development tasks including rich Java EE.
• Secure Delivery Center lets you eliminate engineering overhead by simply
packaging up Eclipse with add-ons and configuration, and delivering it to a
team, or your end-users.
![Page 4: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/4.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 4 © Copyright 2014, Genuitec, LLC. 4
Agenda
• Introducing PiPlug
• Building your first PiPlug application
• Understanding performance on the Raspberry Pi
• PiPlug architecture and rapid deployment cycles
• Where to start on your own apps
• What’s next
![Page 5: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/5.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 5 © Copyright 2014, Genuitec, LLC. 5
• Platform for tinkering
• Exemplifies opportunities of the
“Internet of Things” (IoT)
• Based on ARM architecture
• Lower-powered but flexible
• Rich foundation of components for
devices to servers
• Flexible deployment models
• Simple extensibility
• Vibrant community
Pi Meets Eclipse
Raspberry Pi ® +
= An ideal pairing of technologies
![Page 6: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/6.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 6 © Copyright 2014, Genuitec, LLC. 6
Pi Setup Example
How do we solve this problem?
![Page 7: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/7.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 7 © Copyright 2014, Genuitec, LLC. 7
Introducing PiPlug
• PiPlug brings the ease and extensibility
of Eclipse to the Raspberry Pi
• Runs using a simple RCP front-end with app plug-ins
• Optimized for low overhead and responsive UI
• Remote deployment of apps from Eclipse to Pi
running PiPlug
PiPlug
Daemon*
w/PiPlug Deploy
Raspberry Pi ®
* Daemon can be automatically self-hosted inside Eclipse
![Page 8: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/8.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 8 © Copyright 2014, Genuitec, LLC. 8
What’s Possible?
• What works well with PiPlug
– Apps using standard SWT and JFace
– Apps using Java bindings to Pi services and add-on modules
– Apps using custom canvases for dynamic rendering
– Apps using remote network resources (off UI thread!)
• What’s not intended for the PiPlug
– Non-UI services (though not strictly prohibited)
– Very heavy weight apps that won’t perform well on the Pi
(example, full Eclipse IDE takes ~10 minutes to start up!)
![Page 9: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/9.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 9 © Copyright 2014, Genuitec, LLC. 9
Architecture of PiPlug
Daemon
UI
UI
UI App A
App B
App C
Deploy View
![Page 10: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/10.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 10 © Copyright 2014, Genuitec, LLC. 10
Demonstration
Running your first application
Seeing PiPlug in Action
![Page 11: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/11.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 11 © Copyright 2014, Genuitec, LLC. 11
App Plug-ins in PiPlug
• Each application…
– is in an OSGi bundle (plug-in)
– implements a PiPlug API extension point
– defines a lifecycle class
– contributes UI controls for the application display
• Additional service bundles can be deployed
– Provides services outside of core framework
• Already available to PiPlug apps:
– JFace, SWT, Jobs, Registry, and other base Eclipse bundles
![Page 12: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/12.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 12 © Copyright 2014, Genuitec, LLC. 12
Implement App Lifecycle
public class YourFirstApp implements IPiPlugApplication {
public void installed(IPiPlugServices services) {
// called upon installation of the plug-in
}
public Composite prepare(IPiPlugServices services, Composite parent) {
// called to initialize the UI on first access or upgrade
}
public void resume(IPiPlugServices services) {
// called as app will be placed in the foreground
}
public void suspend(IPiPlugServices services) {
// called when app is no longer in the foreground
}
public void shutdown(IPiPlugServices services) {
// called to allow cleanup for upgrade or shutdown
}
}
![Page 13: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/13.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 13 © Copyright 2014, Genuitec, LLC. 13
installed(…)
public void installed(IPiPlugServices services) { … }
• Prepares services needed for the bundle off UI thread
• Called once per invocation of VM or when upgraded to a new
app version
• Should wait until prepare/resume is called for anything heavy
![Page 14: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/14.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 14 © Copyright 2014, Genuitec, LLC. 14
prepare(…)
public Composite prepare(
IPiPlugServices services, Composite parent) { … }
• Initializes the user interface controls for the application
• Called once per invocation of VM or when upgraded to a new
app version
![Page 15: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/15.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 15 © Copyright 2014, Genuitec, LLC. 15
resume(…)
public void resume(IPiPlugServices services) { … }
• Populates the UI with current information
• Starts background workers or services
• Called each time application will be in the foreground
• Resumes previous operations that were otherwise suspended
![Page 16: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/16.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 16 © Copyright 2014, Genuitec, LLC. 16
suspend(…)
public void suspend(IPiPlugServices services) { … }
• Saves off any application state
• Suspends background jobs or threads
• Called once the application is in the background
• Should stop any CPU utilization from the application
![Page 17: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/17.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 17 © Copyright 2014, Genuitec, LLC. 17
shutdown(…)
public void shutdown(IPiPlugServices services) { … }
• Frees handles to classes in the runtime
– Make sure to null out references, and clean up services
• Called just before PiPlug front-end shuts down or bundle is
uninstalled before upgrade
![Page 18: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/18.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 18 © Copyright 2014, Genuitec, LLC. 18
Guidelines for Apps
• Optimize for responsive UI
– Minimize UI created in prepare(…)
– Depend on SWT, or at most JFace
– Minimize # of dependent bundles
• Build for OSGi bundle reloading
– Cleanly dispose and cleanup services in shutdown(…)
– Cleanly track Images and other heavy resources
– If using background threads, respond to shutdown & suspend
![Page 19: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/19.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 19 © Copyright 2014, Genuitec, LLC. 19
Demonstration
Working with your applications
Seeing PiPlug in Action
![Page 20: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/20.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 20 © Copyright 2014, Genuitec, LLC. 20
Performance on the Pi
• Starting Java is slow
– Java 8 ARM is better!
– Stay in the same VM
• Your app runs in a shared JVM/OSGi runtime
– Startup is ~10 seconds
– You don’t pay for your own JVM/OSGi/SWT Display
– Follow good UI responsiveness rules (instant feedback)
• Overclocking makes a difference (are you a hardware guy?)
– A good power supply matters, as do heat sinks!
![Page 21: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/21.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 21 © Copyright 2014, Genuitec, LLC. 21
Idiosyncrasies of RCP on Pi
• No SWT fragment
– ARM LE is not officially supported
– This makes building products difficult
– PDE export works if you put in your arch as arm
• Xlib: RANDR missing on display :1.0
– Can be ignored
![Page 22: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/22.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 22 © Copyright 2014, Genuitec, LLC. 22
Demonstration
Rapid development with PiPlug
Seeing PiPlug in Action
![Page 23: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/23.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 23 © Copyright 2014, Genuitec, LLC. 23
Time to Start Plugging!
• It’s all on Github!
– http://genuitec.github.io/piplug
• In your Eclipse
– Install the PiPlug Deployment View
– Create your app or copy an example
• On your Pi
– Install the PiPlug Frontend (& dependencies)
– Run it!
![Page 24: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/24.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 24 © Copyright 2014, Genuitec, LLC. 24
Back to the IoT
• Lifecycle of software rollout
• How to get IoT devices out in volume with applications
• How to manage many IoT devices
• How to handle versions of applications
• What security constraints apply to the IoT
• We’ve done this for Eclipse & Eclipse Plugins with Secure
Delivery Center but what’s right for the IoT?
![Page 25: Third level Pimp your Pi - RCP Vision€¦ · is in an OSGi bundle (plug-in) – implements a PiPlug API extension point – defines a lifecycle class – contributes UI controls](https://reader033.vdocuments.mx/reader033/viewer/2022052102/603c2acc3549953bc0516646/html5/thumbnails/25.jpg)
• Click to modify
– Second level
• Third level
– Fourth level » Fifth level
© Copyright 2014, Genuitec, LLC. All rights reserved. 25
Thank You! • Get started with PiPlug at http://genuitec.github.io/piplug/
• Learn about Genuitec products at http://www.genuitec.com