The most important processor here is the ListenTCP processor, which will listen on port 20000 and will receive the JSON payload. The flow also contains a Site 2 Site NIFI connection to a remote processgroup with the URL
http://wbekkerhdf0.field.hortonworks.com:9090/nifi. You can change it to your own remote NIFI cluster.
Get Ruby 'forward' script
The Mindwave Thinkgear driver will create a socket where we can consume the sensor data as Json messages. To ingest it with the current vanilla version of NIFI, we need to 'forward' the messages from the thinkgear port to the NIFI ListenTCP processor port number. Upcoming versions of NIFI will have a
GetTCP processor, making this Ruby script obsolete.
Save this Ruby script as a file under
thinkgear.rb. Run it with ruby thinkgear.rb AFTER you have connected your headset AND started ListenTCP processor on the NIFI flow. Otherwise you will run into connection errors.