A demo for EclipseCon Europe 2015, more details at the ECE website
The instructions below were tested on Ubuntu 14.04 LTS.
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/
The demo circuit is built from three push buttons and a 10k Ohm potentiometer.
Flash the demo sensor firmware (from Sensors/iot-demo-sensors/iot-demo-sensors.ino) to Arduino.
- Install docker:
sudo apt-get -y install docker.io
- Pull and start appropriate mosquitto image
docker run -tip 1883:1883 -p 9001:9001 toke/mosquitto
- Install mosquito client:
sudo apt-get install mosquito-clients
- Start mosquito_sub (in a separate terminal) to see output from demo device:
mosquitto_sub -p 1883 -t "{sensor_name}"
- Start with an Eclipse Modeling setup, for Eclipse Mars.1
- Install m2e (Maven for Eclipse) from the Mars update site
- Install the latest Xtext 2.9, tested version: 201510290501
- Install EMF-IncQuery 1.1.0, tested version: 201510281452
- Install Viatra CEP 0.8.0 from CI update site, tested version: 201510251802
- 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.
- 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
- 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
- Make sure everything builds cleanly.
- Start Mosquitto broker as described above
- Open demo_setup.midl file in eclipse and save it
- 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 )
- Edit generated vepl and eiq files to create customized events.
- Call dashboard publisher methods from cep rules to visualize events on dashboard (at least once)
- DashboardUtil.publishSimpleEvent()
- DashboardUtil.publishHighlightedEvent()
- Run TestApplication as Junit plugin test in generated CEP project.
- Start dashboard with running com.incquerylabs.iot.demo.dashboard.Main from eclipse.
- Point your browser at localhost:8080
- 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.