Using Neo4j as an IoT Data Store on Raspberry Pi
My new project, fold, is meant to explore an IoT counter-trend which I call "LAN-centric IoT" and uses Raspberry Pi as data stores and visualizers.
Join the DZone community and get the full member experience.Join For Free
last weekend a big wind and rain storm rolled through northwestern oregon where i live.
normally i don’t pay much attention to the barometer, but i was writing this blog post and noticed one of my internet things had captured the onset of the storm in the early morning hours of saturday the 29th of august, 2015.
here’s what it looked like:
below is another snapshot of data from the day after the storm. in the summer, when the air conditioner kicks on, i see sawtooth patterns like this as the ac drives the temperature down and then it drifts slowly upward.
the thing that captured this data is several rooms distant from the thermostat that controls the ac and i think this somehow explains the descending pattern of peaks and valleys in the late afternoon.
all of the data used to generate these charts was captured and stored in neo4j running on raspberry pi 2 and similar (arm7) hardware in my house.
my new iot project: fold
a little over a year ago, i met michael hunger at oscon 2014 and chatted about my iot experiments with neo4j. he encouraged me to write a guest post on the neo4j blog. now, after a complete rewrite of my iot hub software, i am finally writing this post.
my new project, fold , is meant to explore an iot counter-trend which i call “lan-centric iot.”
the primary trend (in my estimation) is cloud-centric iot, where devices are managed by cloud services. lan-centric iot assumes a handful of raspberry pis on a lan can act as a sort of home-scale cloud, keeping most of the networking and data local.
the charts above and the graph visualization below were generated on the raspberry pi class machines (by fold invoking gnuplot and graphviz sub-processes) instead of passing the data to something like google charts (a great service, but cloud-centric).
how fold uses time trees to organize iot data
i recently joined several neo4j slack groups and noticed a discussion about time trees . fold uses a variant of the time tree to organize iot sensor data as well as other events relevant to the thing running fold.
the diagram below shows how fold maps time from years down to minutes. nodes representing sensor data events link to the minute they happened in. the sensor data nodes store an event time in milliseconds, which allows for showing the order of events that occurred in the same minute.
fold is very alpha-quality at this point since it’s a hobby project that i work on as time permits and as things accumulate in my house.
i think other neo4j users might be interested in fold if you are exploring iot (got rpi2?) and especially if you know java and eclipse. it is easy to extend fold by creating a plugin with the fold channel extension-point .
i will watch the #share-your-project slack channel and try to answer questions anyone has about fold.
note: this post was written by guest contributor chris daly. as community content, this post reflects the views and opinions of the particular author and does not necessarily reflect the official stance of neo4j.
Opinions expressed by DZone contributors are their own.