Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Latest commit

 

History

History
34 lines (24 loc) · 1.71 KB

File metadata and controls

34 lines (24 loc) · 1.71 KB

OSGi enRoute LED Controller Example

Example application to switch on/off or blink LED connected to Raspberry Pi GPIO Pins using MQTT Communication

Hardware Requirements:
  1. LED Light
  2. Resistor
  3. Raspberry Pi (Any Model)
Bundles Used:
  1. osgi.enroute.examples.led.controller.application - Example Application Project
  2. osgi.enroute.examples.led.controller.core.api - LED Controller API
  3. osgi.enroute.examples.led.controller.core.provider - LED Controller Service Implementation
  4. osgi.enroute.examples.led.controller.mqtt.api - MQTT Communication API (Simplified Version)
  5. osgi.enroute.examples.led.controller.mqtt.provider - MQTT Communication Service Implementation
HOW TO RUN

Before you start executing the following steps, it is advisable to configure the LED with GPIO Pin as mentioned the following image (although the image is an example). As soon as you connect the LED to the GPIO, you can start executing the following steps.

  1. Run either osgi.enroute.examples.led.controller.bndrun or debug.run
  2. You can now access the application at http://<IP Address of the Raspberry Pi>:8080
  3. Update the settings before you play with this tool
  4. Now you can publish MQTT message (with on or off or blink X payload where X is any integer number) to the specified topic

on - to switch the LED ON

off - to switch the LED OFF

blink X - to blink the LED for X number of seconds (Don't forget to change X to any number)

LED Configuration:

The following image is an example of connecting LED to GPIO PIN 1. You can connect to whichever PIN you like.

alt text