Skip to content

viatra/viatra-cep-mqtt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VIATRA-CEP: MQTT integration demo

A demo for EclipseCon Europe 2015, more details at the ECE website

Getting started

The instructions below were tested on Ubuntu 14.04 LTS.

Arduino setup

Install driver: sudo apt-get install arduino arduino-core If something doesn't work, sudo copy librxtxSerial.so (from Sensors/com.incquerylabs.iot.javatransmitter/exported) to /usr/lib/

Arduino circuit

The demo circuit is built from three push buttons and a 10k Ohm potentiometer.

Arduino firmware

Flash the demo sensor firmware (from Sensors/iot-demo-sensors/iot-demo-sensors.ino) to Arduino.

Mosquito broker and client

  1. Install docker: sudo apt-get -y install docker.io
  2. Pull and start appropriate mosquitto image docker run -tip 1883:1883 -p 9001:9001 toke/mosquitto
  3. Install mosquito client: sudo apt-get install mosquito-clients
  4. Start mosquito_sub (in a separate terminal) to see output from demo device: mosquitto_sub -p 1883 -t "{sensor_name}"

Eclipse

Developer workspace

  1. Start with an Eclipse Modeling setup, for Eclipse Mars.1
  2. Install m2e (Maven for Eclipse) from the Mars update site
  3. Install the latest Xtext 2.9, tested version: 201510290501
  4. Install EMF-IncQuery 1.1.0, tested version: 201510281452
  5. Install Viatra CEP 0.8.0 from CI update site, tested version: 201510251802
  6. Import the MIDL projects (org.eclipse.viatra.cep.mqtt.midl and TODO generator) from this git repository into your workspace, and run the org.eclipse.viatra.cep.mqtt.midl/src/org/eclipse/viatra/cep/mqtt/midl/GenerateMIDL.mwe2 script to generate the MIDL Xtext projects.

Note: after Xtext 2.9.0, EMF-IncQuery 1.1.0 and VIATRA 0.8.0 are released, you can replace the above CI versions with these release versions, installable from their standard update sites as well as Marketplace entries.

Runtime workspace

  1. Clone Paho Java library and import the org.eclipse.paho.client.mqttv3 project to the workspace, ignore the compile error in the pom.xml file
  2. Import the following projects into your workspace from this git repository:
  • Demo/com.eclipsesource.json
  • Demo/com.incquerylabs.iot.demo.dashboard
  • Demo/com.incquerylabs.midl.demo ( copy project into workspace )
  • Sensors/com.incquerylabs.iot.javatransmitter
  1. Make sure everything builds cleanly.

Trying the demo

  1. Start Mosquitto broker as described above
  2. Open demo_setup.midl file in eclipse and save it
  3. Make sure org.eclipse.viatra.cep.mqtt.cep and org.eclipse.viatra.cep.mqtt.commons projects are generatered and import them into the workspace ( the latter step is temporarily necessary )
  4. Edit generated vepl and eiq files to create customized events.
  5. Call dashboard publisher methods from cep rules to visualize events on dashboard (at least once)
    • DashboardUtil.publishSimpleEvent()
    • DashboardUtil.publishHighlightedEvent()
  6. Run TestApplication as Junit plugin test in generated CEP project.
  7. Start dashboard with running com.incquerylabs.iot.demo.dashboard.Main from eclipse.
  8. Point your browser at localhost:8080
  9. Open a terminal and navigate into Sensors/com.incquerylabs.iot.javatransmitter/exported/ directory. Select one of the followings to start sending sensor data:
    • With device: Run runWithDefaultParameters.sh script.
    • Without device: Run runEmulator.sh script.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •