We want to demonstrate a connected greenhouse that reports its temperature on a regular basis, and that includes a remotely controlled light. The key points that we want to demonstrate are as follows:
- Interoperability – The open frameworks and protocols at Eclipse IoT allow the creation of interoperable IoT solutions (e.g. control the greenhouse lights from a web application as easily as from a physical remote)
- Reusability - Thanks to the Java and OSGi platforms, it is easier to produce modular and reusable software components that can be shared at several levels of the end-to-end IoT chain
- Connectivity - Protocols like MQTT and CoAP allow easy connections of devices to the cloud or to each other
WARNING: the hardware platform is still subject to change as of Jul. 10. However, the fact that the H/W platform has not been finalized has no impact on the MQTT and CoAP interfaces and it is possible to simulate the greenhouse behavior anyways.
- Raspberry Pi model B+
- I2C Temperature and Humidity Sensor (link)
- I2C Luminosity sensor (optional) (link)
- LED (link)
- A GrovePi (link)
- Acrylic greenhouse
- A QR-code on the greenhouse takes the visitor to a web page that allows to control the greenhouse
The Raspberry Pi will be running Eclipse Kura plus an application that periodically sends temperature value using MQTT. The polling interval is configurable via a setting, therefore allowing to showcase the Kura Web UI. The application is also subscribed to a specific topic on which a command to toggle the LED ON/OFF can be sent.
In order to enable CoAP demonstrations, the temperature and light command will also be exposed over CoAP (ideally, both WiFi and 802.15.4), thanks to a Kura bundle using Californium. [TBD what kind of "client" application do we want to visualize the temperature read using CoAP?]
The Kura application is available at https://github.com/kartben/kura-greenhouse-demo
A web UI uses MQTT over Websockets to display live temperature updates (both instant value and history chart using Rickshaw JS charting library). The web UI must be responsive to look nice on a smartphone (live demo should include a scenario where two people on the booth can both interact with the greenhouse simulteanously)
In order to allow early integration by people interested in extending the demo, and also for the sake of demonstrating multiples greenhouses at the same time, a self-contained web simulator will allow users to create their own fake greenhouse.
- The Kura greenhouse app talks to iot.eclipse.org MQTT broker (tcp://iot.eclipse.org:1883)
- Temperature is posted on the topic "javaone2014/eclipse-greenhouse/sensors/temperature" ; payload is a string representation of the temperature, in degrees Celsius (example: "24.2")
- Command to toggle the LED can be sent on "javaone2014/eclipse-greenhouse/actuators/light" ; payload should be "on" or "off"
- You can simulate a greenhouse by using the simulator available here
- The Kura greenhouse exposes a set of CoAP resources to control the LED (read/GET and set/PUT) and retrieve the temperature (read/GET)
- The resources are laid out as follows:
- The LED state can be changed by issuing a PUT request on gh/act/light, with "on" or "off" as a payload
- The state of the LED can be retrieved by issuing a GET on gh/sens/light. The response's payload will be "on" or "off"
- The current temperature can be retrieved by issuing a GET on gh/sens/temperature. The response's payload will be a string representation of the temperature in degrees Celsius (eg: "23.53")
- TBD: as of today, we don't know which interface the CoAP resource will be exposed on, although ideally it would be on an IPv6 one.
Suggested extensions to the demo core scenario
- Consume live or consolidated sensor data using MQTT and "forward it" to another cloud service
- Consume live or consolidated sensor data using MQTT and provide a custom visualization for it
- Greenhouse connected to a commercial MQTT broker instead of iot.eclipse.org's
- More complex greenhouse with many sensors (Philips Hue, ...) connected to Eclipse Smarthome
- Embedded app developed using Reactive Blocks
- Provide all the files to run the demo on the "IoT Java launch" page
- Kura .deb package
- Greenhouse demo dpp package
- Enhance web simulator to also be able to act as a "control remote" for an existing greenhouse, therefore allowing temperature visualisation and control of the LED
- Enhance web simulator to allow URL query parameter to decide which greenhouse to control, to allow flashing a QR code on the greenhouse and take control
- Expose CoAP resource over 6LoWPAN using a Contiki mote