IoT with OpenSensors – 28 April 2015
IoT deep dive with OpenSensors https://opensensors.io/
Node-RED – plumbing system for iot. nodered.org (opensource but developed at IBM Emerging Technology)
@BorisAdryan
node.js based webservice on various platfroms – Rpi, mac, cloud…
- flows shared as JSON strings
http://flows.nodered.org
Node.js is a prerequirement, then run
> sudo npm install -g node-red
> node-red
Access the interface at http://localhost:1880/
About 100 extra nodes on npmjs
IBM have a cloud version on Bluemix https://console.ng.bluemix.net
- If the serial port is picking up extra broadcasts from other Pi’s:
sudo nano /etc/inittab
comment out the line (using a hash) with ttyAMA0
sudo nano /boot/cmdline
delete the reference to ttyAMA0
====
REFS & TERMS:
Data communication protocol – MQTT.org
MQTT is designed for M2M, connects via TCP, very lightweight for sending small packets of data. HTTP has big headers.
OpenSensors is a MQTT broker. Each part of the system is autonomous – the sensor sending doesn’t care where the data is going, the broker doesn’t care where data is from, the user … etc.
Notes to create basic node-red io’s: http://www.slideshare.net/BorisAdryan/node-red-coursecamjamjuly2014
Payload – is the thing/data you are sending (can be JSON, PDF, whatever)
COAP – HTTP lite, avoid headers but use GET and POST HTTP-like requests. http://coap.technology/
opensensors.io
user: misslake pp: usual33 e: misslake@lubric.com
- client ID: 1321. pp: 8SbXhPdT
SSE’s (which OpenSensors uses) get through firewalls more easily than websockets. RESEARCH this.
===
Machine Learning
supervised learning – classification and regression
dimensionality reduction
deep learning
unsupervised learning – xxx and xxx
hierarchical clustering (split into pairs and see what we end up with)
- build distance matrix on basis of correlation coefficient (cc)
k-means clustering
- finds the optimum clustering for you, starting from a set of n starting conditions.
- K is optimum number of clusters in the set
Support vector machine – train the data, get suggestion for grouping, present new data
Random forests – find the shortest tree that gets me to my data (classifications)
Outlier prediction through regression
cassandra – open sensors stores data.
For longevity, in 10 years say…
- will the data from inferior hardware still be comparable to the latest precision hardware?
- give all your data as much metadata as possible for longevity (hardware versions, softwares, etc)
The concrete embedded sound sculpture… layers under layers under layers. Bio, concrete, plastic, PLA, metal, alloys, … The time is now. write up with Gavin. Climate change. Disposible culture. Noise pollution. Wifi. Electronic material world. Nature as technology. (+ collaborator from materials lab? Zoe XX?)
Yodit is sending notes on Python data analysis (uses iPython)
$ killall -# screen (where # is the number of screens open)
NMRTracker Flow
[{“id”:”2b3c023e.d4c3fe”,”type”:”serial-port”,”serialport”:”/dev/cu.usbserial”,”serialbaud”:”9600″,”databits”:”8″,”parity”:”none”,”stopbits”:”1″,”newline”:”A”,”bin”:”false”,”out”:”char”,”addchar”:true},{“id”:”be7e25f7.4181d8″,”type”:”debug”,”name”:””,”active”:true,”console”:”false”,”complete”:”payload”,”x”:624,”y”:142,”z”:”afb085ff.504f78″,”wires”:[]},{“id”:”68e6ebb4.971914″,”type”:”serial in”,”name”:”minitracker”,”serial”:”2b3c023e.d4c3fe”,”x”:127,”y”:165,”z”:”afb085ff.504f78″,”wires”:[[“6c493c2d.93b6c4”]]},{“id”:”6c493c2d.93b6c4″,”type”:”function”,”name”:”str.search”,”func”:”var str = msg.payload;\nvar n = str.search(\”806\”);\nif (n == -1){\n msg.payload = \”nmr01\”;\n} else {\n msg.payload = \”nmr02\”; \n}\nreturn msg;”,”outputs”:1,”valid”:true,”x”:320,”y”:188,”z”:”afb085ff.504f78″,”wires”:[[“d960f09e.269f1”]]},{“id”:”d960f09e.269f1″,”type”:”delay”,”name”:””,”pauseType”:”delay”,”timeout”:”1″,”timeoutUnits”:”seconds”,”rate”:”1″,”rateUnits”:”second”,”randomFirst”:”1″,”randomLast”:”5″,”randomUnits”:”seconds”,”drop”:false,”x”:477,”y”:234,”z”:”afb085ff.504f78″,”wires”:[[“be7e25f7.4181d8”]]}]
NMRTracker Flow 20150508