This is the repository for the Valo Hackathon and J On The Beach 2017.
The purpose of the hackathon is hacking the J On The Beach conference. In order to do so, we will use Valo as the core real-time analytics engine. We will feed Valo from IoT and mobile devices. Then we will create data visualizations that help us get insights about J On The Beach itself.
Below you will see a quick Getting started section. Find extended documents and tutorials in the Wiki.
-
Fork this repository.
-
Make a pull request targeted to this repo's master branch
Under valo/
we put all the code (examples, helpers) and documentation created by Valo for the participants to use.
For each team, this is how we will organise the Hackathon:
- Each team will clone the Hackathon repo and will create its own branch, which is where they will develop their use case.
The branch name should follow this format: team-<team_name>-project
.
No PR will be accepted from this branch to the master one, any project will leave in its own branch.
- Each team will also create a branch named
team-<team_name>-info
, in which it will create a folder under theteams/
directory with the team name (e.g. teams/team-a). Under that folder, the team will create a file that contains the following information at least:
Team name: ...
Team members: ...
Link to slides/presentation assets: ...
Use case description:
...
...
A PR is expected from this team-<team_name>-info
to the master branch, so that we can track all the projects and teams info.
You will need to have installed in your environment:
-
A Git client.
-
Java Run Environment. Valo needs version:
1.8.0_131
to run smoothly. Download it here -
NodeJS. The running environment for javascript outside a web browser.
-
Babel. A transpiler from Ecmascript2015 and beyond to Ecmascript5. Our examples and code use the latest elegant flavor of Javascript and need this! Although it is installed locally in our local hackathon repository, it is convenient to have it installed globally in our system.
$ npm i --global babel-cli babel-present-env
-
One of the following alternatives for sending HTTP requests:
-
Curl. The command line tool for sending and receiving HTTP.
-
Advanced Rest Client. A GUI alternative to Curl.
-
-
(Optional) Wireshark for capturing and analyzing HTTP traffic.
-
Clone this repository in your computer and install its dependencies:
$ git clone https://github.com/ITRS-Group/hackathon2017.git
$ npm install
- Valo. Download from here. Check the documentation to learn more.
There are different parts of the Hackathon's base scenario that must be launched, preferably in order.
-
Run Valo
-
Create contributors and streams in Valo.
-
Start data contributors. They inject data (events) into Valo:
- Simulator
- Twitter feed
- Mobile application
- MQTT feed
-
Run data visualizations. They query Valo and visualize data from the processed stream they receive as input:
- Web browser visualization
- Philps Hue visualization
-
Download Valo from the Valo site if you haven't already. Look for the Try Me button.
-
Download and unpack Valo (currently valo-1.5.1-GA). The zip file already comes with an evaluation license.
-
Give yourself the appropriate permissions to run the app, i.e.
chmod 755 valo-1.5.1-GA/bin/valo
-
Edit the
conf/application.conf
file and remove the comment in line 15:valo.node.host: localhost
, in order to access Valo on your localhost -
Start Valo:
./bin/valo
- Monitor Valo log file:
tail -f logs/valo.log
When running things for the 1st time, we need to create the streams and contributors in Valo. The following script assumes you are running a Unix shell. If not, inspect the target shell script and run the curl commands it contains.
- From the root of this repository:
$ npm run createAllStreamsAndContributors
- If you are curious or run into trouble, inspect the master
package.json
file at the root of the repository to see what script you are starting with the command above:
$ grep createAllStreamsAndContributors package.json
"createAllStreamsAndContributors": "cd valo/doc/interfaces && sh create_all_contributors_and_streams.sh; cd -"
The simulator injects fake events into Valo, from fake users using the mobile application. There are two types of events: user location and user rating of the event.
- From the root of this repository:
$ npm run launch:simulator
- If you are curious or run into trouble, inspect the master
package.json
file at the root of the repository to see what script you are starting with the command above:
$ grep "launch:simulator" package.json
"launch:simulator": "babel-node valo/src/simulator_js/bin/main.js",
This starts a script that listens to a Twitter stream and publishes the events into Valo.
-
You need a Twitter account.
-
Create a new Twitter app within your Twitter account at: https://apps.twitter.com/
-
From the Twitter app page, get consumer key, consumer secret, access token and access token secret. (You may have to generate them).
-
Export the 4 values items as environment variables. This depends on your operating system. In a Unix shell:
export TWITTER_CONSUMER_KEY='your_consumer_key'
export TWITTER_CONSUMER_SECRET='your_consumer_secret'
export TWITTER_ACCESS_TOKEN_KEY='your_access_token'
export TWITTER_ACCESS_TOKEN_SECRET='your_access_token_secret'
-
Make sure your current command line terminal has sourced the new environment variables.
-
Run the Twitter feed script. From the root of this repository:
$ npm run launch:twitter
- If you are curious or run into trouble, inspect the master
package.json
file at the root of the repository to see what script you are starting with the command above:
$ grep launch:twitter package.json
"launch:twitter": "babel-node valo/src/twitter_js/bin/main.js",
The mobile application allows a user to register as a mobile contributor in Valo, and then it periodically sends the user location and, upon user request, the user rating (happiness level).
-
Install IonicView in your mobile phone.
-
Sign up if you do not have a IonicView account yet.
-
Launch IonicView in your mobile.
-
View the application with code:
9ed6fcee
.
Some of the IoT board may publish events to a MQTT server like mqtt://iot.eclipse.org
. The MQTT to Valo bridge is a script that subscribes to certain channels of the MQTT server and relays the events to a Valo stream.
- Run the MQTT-to-Valo script:
$ npm run launch:transport
- If you are curious or run into trouble, inspect the master
package.json
file at the root of the repository to see what script you are starting with the command above:
$ grep launch:transport package.json
"launch:transport": "babel-node valo/src/transport_to_valo_bridge_js/bin/main.js",
The example web visualization displays data gathered from the mobile application (real or simulated), the surfboards (real or simulated) and the Twitter feed.
- Build the web visualization
$ npm run make:viz
- Start serving the visualization:
$ npm run launch:viz
-
Browse the visualization from your web browser at
http://127.0.0.1:8080/
-
As above, inspect
package.json
if you run into trouble or want to understand what is happening under the hood.
You should have set up the lightbulbs and the Philips Hue bridge. See the Wiki for specific information.
- Run the lightbulbs visualization
$ npm run launch:lights
Yara Senger, Vinicius Senger, Alvaro Santamaria
Danilo Rossi, Zuri Pabón, Andrés Ramírez, Andras Kecskes
Contributed to the preparation of the Hackathon (coding and documenting):
Documentation and design: Angela Dini, Paul Baxter, Katharine Murphy
IoT devices : David Torelli, Rémi Selva, Francisco Parada, David Sobieplan
Mobile application: Leo Andre Namuco
Visualizations: Danilo Rossi, Zuri Pabón, Andrés Ramírez, Javier Latorre