Show last authors
1 = Tutorials =
2
3 === How to write an OGEMA application ===
4
5 Make sure you have [[downloaded the SDK>>doc:Main.Download.WebHome]] before starting the tutorial. Then follow these steps to get acquainted with OGEMA, and learn how to program applications. It guides you through the creation of your first OGEMA applications, and introduces you to a couple of useful system apps and best practices along the way.
6
7 * [[Setup your development environment incl. Introduction to Resource Tree and SDK Search Functionality>>doc:Main.Getting started with the OGEMA SDK.WebHome]]
8 * [[Sample App 1: Hello OGEMA. >>doc:Tutorial Collection.Example projects.Hello OGEMA.WebHome]]Introduces the basic app structure and a timer.
9 * [[Sample App 2: Sensor App.>>doc:Tutorial Collection.Example projects.Sensor App.WebHome]] Introduces listeners (event-based database interaction) and Resource patterns (template-based database interactions).
10 * [[Sample App 3: Window heat control.>>doc:Tutorial Collection.Example projects.Event-based Database Interaction.WebHome]] An almost realistic app that listens to different device types (window sensors, thermostats, batteries), groups them according to the room they are located in, and implements some energy saving management functionality.
11 ** [[Extended Event-based Database Interaction>>doc:Tutorial Collection.Example projects.Event-based Database Interaction.WebHome]]
12 ** [[Using OGEMA Simulation>>doc:Tutorial Collection.Using OGEMA Simulation.WebHome]]
13 ** [[Adding a GUI to the Window-Heat-Battery application>>doc:Tutorial Collection.Example projects.Event-based Database Interaction.Adding a GUI to the Window-Heat-Battery application.WebHome]]
14 ** [[Adding a configuration resource to the Window-Heat-Battery application>>doc:Tutorial Collection.Example projects.Event-based Database Interaction.Adding a configuration resource.WebHome]]
15 ** [[Window Heat Control: How to go on>>doc:Tutorial Collection.Example projects.Event-based Database Interaction.Window Heat Control\: How to go on.WebHome]]
16
17 === How to write a hardware driver for OGEMA ===
18
19 OGEMA drivers connect the OGEMA database with outside data sources and sinks. A typical driver e.g. reads a value from a sensor and writes it into an OGEMA resource or reads from an OGEMA resource and sends a setpoint to an actor/device. But also external data from cloud servers, from the file system or from other local computers (PC, mobile device, ...) can be integrated into OGEMA via a driver.
20
21 Although the structure of a typical driver differs a bit from an app drivers are also OGEMA apps from a technical point of view. So we recommend to go through the initial tutorial first before starting into the drivers examples.
22
23 More details on the drivers available and the development of new drivers is provided on [[How to write a hardware driver for OGEMA>>doc:Tutorial Collection.How to write a hardware driver for OGEMA.WebHome]]
24
25 = HowTo pages =
26
27 * [[Create a new project: >>url:https://community.ogema-source.net/xwiki/bin/view/Tutorial%20Collection/Create%20a%20new%20project/]]explains how to use the OGEMA plugin to create a new app, how to build and run it, and how to access its user interface
28 * [[Data logging and analysis>>url:https://community.ogema-source.net/xwiki/bin/view/Tutorial%20Collection/Data%20logging%20and%20analysis/]]
29 * [[Set permissions and test your application with security enabled>>url:https://community.ogema-source.net/xwiki/bin/view/Tutorial%20Collection/Setting%20Permissions%20and%20Configure%20OGEMA%20for%20Secure%20Operation/]]
30 * [[Load the app onto your OGEMA gateway>>url:https://community.ogema-source.net/xwiki/bin/view/Tutorial%20Collection/Developing%20for%20the%20Smartrplace%20Box/]]: Steps to install and run an application developed in a productive OGEMA system
31 * [[Optimize your Eclipse and OGEMA Development Experience>>doc:Tutorial Collection.Optimize your Eclipse and OGEMA Development Experience.WebHome]]: Tipps and Tricks for using Eclipse with OGEMA
32 * [[OGEMA Alliance Extensions>>doc:Tutorial Collection.OGEMA Alliance Extensions.WebHome]]: Learn how to use contributions from other that are not in the standard OGEMA API (yet) and how to contribute yourself
33
34 = Reference pages =
35
36 * The full API reference can be found here: [[https:~~/~~/www.ogema-source.net/apidocsextended/>>url:https://www.ogema-source.net/apidocsextended/]]
37 * You can also browse the OGEMA Data models in the [[source code on Github>>url:https://github.com/ogema/ogema/tree/public/src/core/models/src/main/java/org/ogema/model]]
38 * [[OGEMA Utilily Classes and Concepts Reference>>doc:Tutorial Collection.Optimize your OGEMA Development Experience.WebHome]]: Utility Classes, Messaging
39 * [[System and Support Apps: >>doc:Tutorial Collection.System and Support Apps.WebHome]]A set of tools for the developer which are shipped with the SDK.
40 * [[Full Widget Framework Documentation>>url:https://community.ogema-source.net/xwiki/bin/view/Main/The%20OGEMA%20Widgets%20framework/]] and [[Widget reference>>doc:Main.The OGEMA Widgets framework.Widgets reference.WebHome]]: the complete reference to the graphical elements available in the OGEMA widgets framework. They allow you to generate user pages easily, which can be displayed in the browser, but are written purely in Java.
41 * [[OGEMA Model Reference Cases>>doc:Main.OGEMA Model Reference Cases.WebHome]]
42
43 The OGEMA Wiki ([[https:~~/~~/ogema-source.net/wiki/display/OGEMA/OGEMA+Home>>url:https://ogema-source.net/wiki/display/OGEMA/OGEMA+Home]]) contains many more pages dedicated to specific concepts, such as:
44
45 * [[Introduction to the Resource database>>url:https://ogema-source.net/wiki/display/OGEMA/Working+with+OGEMA+Resources]]
46 * [[Introduction to Resource Patterns>>url:https://ogema-source.net/wiki/pages/viewpage.action?pageId=7242167]]
47 * [[Introduction to Time Series>>url:https://www.ogema-source.net/wiki/display/OGEMA/Time+series]]
48 * [[Using the REST interface>>url:https://ogema-source.net/wiki/display/OGEMA/Using+the+OGEMA+REST+Interface]]
49 * [[Security technical notes>>url:https://ogema-source.net/wiki/display/OGEMA/Security+Technical+Notes]]: more information on permissions and OGEMA security
50 * [[A list of available drivers and apps >>url:https://ogema-source.net/wiki/display/OGEMA/Public+Applications+and+Drivers]](note: the SDK contains a few additional apps which are not yet part of the public OGEMA release; they are explained in the tutorials above)
51 * [[HardwareManager:>>url:https://ogema-source.net/wiki/display/OGEMA/HardwareManager]] a useful tool for hardware drivers, to identify connected communication devices
52
53 = Example Apps and Drivers =
54
55 A set of example apps is available via Github: [[https:~~/~~/github.com/ogema/tutorial. >>url:https://github.com/ogema/tutorial]]In decending order of complexity:
56
57 * [[hello-ogema>>doc:Tutorial Collection.Example projects.Hello OGEMA.WebHome]]: illustrates the basic setup of an OGEMA application, using a timer.
58 * [[sensor-app>>doc:Tutorial Collection.Example projects.Sensor App.WebHome]]: illustrates the use of listeners, and access to the OGEMA database by means of pattern declarations.
59 * [[window-heat-control>>doc:Tutorial Collection.Example projects.Event-based Database Interaction.WebHome]]: a sample app that interacts with different types of devices, including window sensors, thermostats and a battery. Whenever a window is opened in a room, it reduces the thermostat temperature setpoints for this room. Furthermore, it provides a simple user interface for configuring the target temperature, individually for the managed rooms. This example comes closer to a production-ready app, already.
60
61 Besides the apps, there are two examples of drivers available in the tutorial repository:
62
63 * [[schedule-csv-driver>>url:https://github.com/ogema/tutorial/tree/master/src/schedule-csv-driver]]: reads timeseries from csv files and stores them in a schedule, the OGEMA format for persistent timeseries
64 * [[sample-androiddriver>>doc:Tutorial Collection.Exame.WebHome]]: illustrates the interaction between an Android app and the OGEMA gateway, via the OGEMA REST interface.
65
66 === Get tutorial apps from Github ===
67
68 In Eclipse go to Window->Show Perspective->Other->Git. Then click on the second icon above the left column names "Git" ("Clone a Git Repository..."). Then enter the following access data:
69
70 [[image:Github_cloneDialog.png||height="450"]]
71
72 [[image:http://88.198.127.166:8080/xwiki/wiki/public/download/Main/Getting+started+with+the+OGEMA+SDK/WebHome/Github_cloneDialog.png||alt="Github_cloneDialog.png"]]
73
74 Now you can checkout tutorial projects:
75
76 In Eclipse go to "Window" -> Perspective -> Open Perspective -> Other, then choose "Git"
77
78 [[image:https://community.ogema-source.net/xwiki/bin/download/OGEMA%20Alliance%20Pages/OGEMA%20Alliance%20Cooperative%20Development/WebHome/OpenPerspective.png||alt="OpenPerspective.png"]]
79
80 Afterwards you can always get back directly to this perspective using the button at the top right. Open ogema-Github repository, open "Working Tree"->src. You can now import OGEMA Apps as Maven projects: Select the projects to import, right-click and select "Import Maven Projects...", then click Finish. You should then see the project in your Eclipse Package Explorer of the Java perspective.