Ingesting Data from the Matrix Creator with MiniFi
The Matrix Creator is an interesting multiple sensor hat that fits on a Raspberry Pi 3.
First step is to connect it, which is a simple snap, no soldering required.
The specs are pretty impressive:
- Xilinx Spartan 6 XC6SLX4 FPGA
- Amtel Cortex-M3 ATSAM3S2 Microcontroller
- 8 MEMS MP34DB02 audio sensor digital microphones
- ST LSM9DS1 3D accelerometer, 3D gyroscope, 3d magnetometer IMU
- ST HTS221 capacitive digital sensor for relative humidity and temperature
- NXP MPL3115A2 precision pressure sensor with altimetry
- Silicon Labs EM358X - 2.4 GHz IEEE 802.15.4 Zigbee
- Sigma Designs ZM5202 - 868/908/921 MHz ZWave
- Vishay TSOP573 - carrier 38.0 kHz IR Receiver
- Vishay VEML6070 UV light sensor
- NXP PN512 NFC reader
- Everloop 35 RGBW LEDS
It runs on Raspian lite and installs via:
curl https://matrix-io.github.io/matrix-documentation/install.sh | sh



Our Apache NiFi Flow For Processing the Three Types of Data

Our Versioned Apache NiFi and MiniFi Flows

We tail the three files produced by the three example Python sensors readers

Both our MiniFi and Apache NiFi flows are very simple and documented above. Tail data from files as Python writes it, send from MiniFi to Apache NiFi which separate the files into different flows for future processing. We could create schemas, convert to JSON, merge the feeds with JSON, store them in three different data stores or more depending on what you want to do. This can be one on the edge or in Apache NiFi on a cluster. You could have MiniFi or NiFi trigger off specific values or ranges as they need arises. Or like me, you can just store it for later use in your endless HDFS Data Lake.
Using Three Existing Examples
Getting Temperature, UV and IMU Values.
python /home/pi/matrix-creator-malos/src/python_test/test_humidity.py
nohup ./humidity.sh &
fh = open("/opt/demo/logs/humidity.log", "a")
fh.writelines('{0}'.format(humidity_info))
fh.close
python /home/pi/matrix-creator-malos/src/python_test/test_uv.py
/opt/demo/logs/uv.log
python /home/pi/matrix-creator-malos/src/python_test/test_imu.py
/opt/demo/logs/imu.log
/Volumes/seagate/Apps/minifi-toolkit-0.3.0/bin/config.sh transform $1 config.yml
scp config.yml pi@192.168.1.197:/opt/demo/minifi-0.3.0/conf
Example Data
imu.2603753-2604002.log
yaw: 141.655654907
roll: 1.66126561165
accel_x: -0.0261840820312
accel_y: 0.0283813476562
accel_z: 0.978576660156
gyro_x: -0.0672912597656
gyro_y: 2.06359863281
gyro_z: 1.33087158203
mag_x: 0.23982000351
mag_y: 0.189700007439
mag_z: -0.480480015278
uv.172512-172528.log
oms_risk: "Low"
humidity.29015-29074.log
temperature: 21.9526348114
temperature_is_calibrated: true
References:
- https://medium.com/kkbankol-events/raspberry-pi-15662c3ca881
- https://creator.matrix.one/#!/examples
- https://github.com/matrix-io/matrix-creator-malos/blob/master/docs/pressure.md
- http://community.matrix.one/t/how-to-record-with-pyaudio/357
- https://matrix-io.github.io/matrix-documentation/matrix-core/examples/pytests/
- https://github.com/matrix-io/matrix-creator-alexa-voice-services
- https://matrix-io.github.io/matrix-documentation/matrix-hal/getting-started/installation/
- https://matrix-io.github.io/matrix-documentation/matrix-core/examples/pytests/
- https://matrix-io.github.io/matrix-documentation/setup/
- https://www.matrix.one/products/creator

