rainy is a tiny tool for IoT data collection and monitoring, and supports the following devices and protocols:
- TI SensorTag CC2650 - java driver by bluez-dbus
- IR Temperature (Object / Ambience)
- Relative humidity
- Barometric pressure
- Optical
- Movement (Gyroscope / Accelerometer / Magnetometer)
- BME280 - java driver by Pi4J
- Temperature
- Relative humidity
- Barometric pressure
If you do not have CC2650, you can substitute these sensors with BME280.
- BH1750FVI - java driver by Pi4J
Optical
If you do not have CC2650, you can substitute this sensor with BH1750FVI. - MH-Z19B - java driver by jSerialComm
CO2 gas concentration - PPD42NS - java driver by Pi4J
PM2.5 dust concentration - RCWL-0516 - java driver by Pi4J
Motion detector (Microwave) - HC-SR501 - java driver by Pi4J
Motion detector (PIR) - OPC-UA - java driver by Eclipse Milo
Protocol of industrial automation
These data can be sent to InfluxDB (Time Series Database) for visualization, or sent to MQTT Broker to be used as a data source for any other purposes.
rainy runs on Apache Felix (OSGi). I think that rainy can be embedded in the environment without OSGi.
I releases this in the form of the Eclipse plug-in project and this tool - rainy-felix.zip. The list of my source codes and third party bundles is Bundle list. You need Java 8. I have confirmed that it works in Raspberry Pi 3B (Raspbian Buster Lite OS (2019-07-10)).
The following figure is overview of rainy.
The following figure is overview which the monitoring is running together with rainy on same Raspberry Pi 3B. I checked easily that it also works with Raspberry Pi 4B.
The following image shows the hardware configuration.
- Purpose
- Setup OS
- Setup sending data
- Setup visualization tools
- Configuration - rainy/conf
- Run rainy
- Create dashboards with visualization tools
- Check the data sent to MQTT broker
- Limitations
- Bundle list
- P.S.
The purpose of this tool is briefly as follows.
- For private / office / factory room, easily collect general environmental information and industrial / factory equipment running information via OPC-UA.
- Real-time monitoring and convert these information to MQTT as a data source for any other purposes.
- Runs as Java / OSGi application on Raspberry Pi 3B (arm) and Ubuntu machine (amd64).
The concept is as follows.
Although I think the functionality and performance of this tool are not sufficient for formal operation, it may be an easy-to-try tool.
Please refer to here for setting RaspberryPi 3B as an environment for running rainy. Both Bluetooth, serial communication, GPIO and I2C can be enabled.
rainy supports InfluxDB and MQTT broker as sending data.
I am using InfluxDB on Ubuntu 18.04. The installation is as follows from here.
# wget https://dl.influxdata.com/influxdb/releases/influxdb_1.7.8_amd64.deb
# dpkg -i influxdb_1.7.8_amd64.deb
# systemctl enable influxdb.service
# systemctl start influxdb.service
In addition, the step to install InfluxDB on Raspberry Pi 3B is as follows.
# wget https://dl.influxdata.com/influxdb/releases/influxdb_1.7.8_armhf.deb
# dpkg -i influxdb_1.7.8_armhf.deb
# systemctl enable influxdb.service
# systemctl start influxdb.service
I am using Mosquitto as MQTT broker on Ubuntu 18.04. The installation is as follows.
# apt-get update
# apt-get install mosquitto
# apt-get install mosquitto-clients
# systemctl enable mosquitto.service
# systemctl start mosquitto.service
In addition, the step to install Mosquitto on Raspberry Pi 3B is the same as above.
I am using Grafana on Ubuntu 18.04. The installation is as follows from here.
# wget https://dl.grafana.com/oss/release/grafana_6.4.3_amd64.deb
# dpkg -i grafana_6.4.3_amd64.deb
# systemctl enable grafana-server.service
# systemctl start grafana-server.service
In addition, the step to install Grafana on Raspberry Pi 3B is as follows.
# wget https://dl.grafana.com/oss/release/grafana_6.4.3_armhf.deb
# dpkg -i grafana_6.4.3_armhf.deb
# systemctl enable grafana-server.service
# systemctl start grafana-server.service
I am using Chronograf on Ubuntu 18.04. The installation is as follows from here.
# wget https://dl.influxdata.com/chronograf/releases/chronograf_1.7.14_amd64.deb
# dpkg -i chronograf_1.7.14_amd64.deb
# systemctl enable chronograf.service
# systemctl start chronograf.service
In addition, the step to install Chronograf on Raspberry Pi 3B is as follows.
# wget https://dl.influxdata.com/chronograf/releases/chronograf_1.7.14_armhf.deb
# dpkg -i chronograf_1.7.14_armhf.deb
# systemctl enable chronograf.service
# systemctl start chronograf.service
In general, it is not recommended to use a self-signed certificate for formal operation, but it is sufficient for testing purposes.
# openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout cert.key -out cert.pem -subj "/CN=localhost" -days 365
# mkdir /etc/rainy
# cp cert.pem cert.key /etc/rainy/
# cd /etc/rainy
# chmod 0644 cert.pem cert.key
See here for details.
- Edit
/etc/grafana/grafana.ini
@@ -29,7 +29,7 @@
#################################### Server ####################################
[server]
# Protocol (http, https, socket)
-;protocol = http
+protocol = https
# The ip address to bind to, empty will bind to all interfaces
;http_addr =
@@ -58,8 +58,8 @@
;enable_gzip = false
# https certs & key file
-;cert_file =
-;cert_key =
+cert_file = /etc/rainy/cert.pem
+cert_key = /etc/rainy/cert.key
# Unix socket path
;socket =
- Restart Grafana and connect to
https://hostAddress:3000/
with a browser
# systemctl restart grafana-server.service
See here for details.
- Edit
/etc/default/chronograf
TLS_CERTIFICATE=/etc/rainy/cert.pem
TLS_PRIVATE_KEY=/etc/rainy/cert.key
- Restart Chronograf and connect to
https://hostAddress:8888/
with a browser
# systemctl restart chronograf.service
clientID
Set a unique client identifier for running rainy.cc2650
Set totrue
when using CC2650. default isfalse
.bme280
Set totrue
when using BME280. default isfalse
.bh1750fvi
Set totrue
when using BH1750FVI. default isfalse
.mhz19b
Set totrue
when using MH-Z19B. default isfalse
.ppd42ns
Set totrue
when using PPD42NS. default isfalse
.rcwl0516
Set totrue
when using RCWL-0516. default isfalse
.hcsr501
Set totrue
when using HC-SR501. default isfalse
.opcua
Set totrue
when using OPC-UA. default isfalse
.
Note. This tool uses Pi4J for BME280/BH1750FVI/PPD42NS/RCWL-0516/HC-SR501, so these devices can only be used with Raspberry Pi series (arm). Therefore, their feature of this tool does not work on amd64 Linux machines, so set them to false
on amd64 Linux machines.
influxDBUrl
default ishttp://localhost:8086
.userName
password
actions
Set the number of actions to collect. default is1000
.flushDuration
Set the time to wait at most (msec). default is1000
.dataOnly
Set totrue
when collecting only data. default istrue
.
brokerUri
default istcp://localhost:1883
.userName
password
clientID
First half string of unique client identifier when connecting to MQTT broker. After this string, this system adds a random string to complete the clientID string.qos
default is0
.topic
Topic when publishing data to MQTT broker. default israiny
.
Here is also helpful.
bluetoothAdapter
Bluetooth adapter name. default ishci0
. Check the list of adapter names with thehciconfig
command.
# hciconfig -a
hci0: Type: Primary Bus: UART
BD Address: B8:27:EB:7D:0F:7D ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING
RX bytes:28342 acl:441 sco:0 events:2265 errors:0
TX bytes:34605 acl:441 sco:0 commands:1955 errors:0
Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH SNIFF
Link mode: SLAVE ACCEPT
Name: 'raspberrypi'
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Version: 4.1 (0x7) Revision: 0x168
LMP Version: 4.1 (0x7) Subversion: 0x2209
Manufacturer: Broadcom Corporation (15)
influxDB
Set totrue
when sending data to InfluxDB. default isfalse
.mqtt
Set totrue
when sending data to MQTT broker. default isfalse
.prettyPrinting
Set totrue
when indenting the log output of JSON format data. default isfalse
. It is also necessary to change the following log level ofconf/logging.properties
.#io.github.s5uishida.level=INFO --> io.github.s5uishida.level=FINE
readCrontab
Set the schedule for sensing data in crontab format. default is every minute.batteryLevel
Set totrue
when getting battery level. default isfalse
.- Example of setting Temperature sensor
temperature
Set totrue
when using a Temperature sensor. default isfalse
.temperatureNotify
Set totrue
when using the notification function. default isfalse
. When the notification function is enabled, the readCrontab schedule for Temperature sensor is disabled.temperatureNotificationPeriod
Set the notification time interval in milliseconds. default is1000
.
- Movement
gyroscope
Set totrue
when using a Gyroscope sensor. default isfalse
.accelerometer
Set totrue
when using a Accelerometer sensor. default isfalse
.magnetometer
Set totrue
when using a Magnetometer sensor. default isfalse
.movementNotify
Set totrue
when using the notification function. default isfalse
. When the notification function is enabled, the readCrontab schedule for Movement sensor is disabled.movementNotificationPeriod
Set the notification time interval in milliseconds. default is1000
.wakeOnMotion
Set totrue
when sending movement data when a shake is detected. It sendsMovement
data at a time interval specified by notification for 10 seconds. default isfalse
.accelerometerRange
Set Accelerometer range. default is2
.
devices
List the addresses of the target CC2650 devices. To check the address of CC2650, usehcitool
command as follows.
# hcitool lescan
LE Scan ...
B0:B4:48:B9:92:86 (unknown)
B0:B4:48:B9:92:86 CC2650 SensorTag
After launching hcitool
command, press the power button of CC2650 and the scan results will be displayed as above.
Here is also helpful.
i2cBusAddress
Set the I2C bus number and address. default is1:76
.influxDB
Set totrue
when sending data to InfluxDB. default isfalse
.mqtt
Set totrue
when sending data to MQTT broker. default isfalse
.prettyPrinting
Set totrue
when indenting the log output of JSON format data. default isfalse
. It is also necessary to change the following log level ofconf/logging.properties
.#io.github.s5uishida.level=INFO --> io.github.s5uishida.level=FINE
readCrontab
Set the schedule for sensing data in crontab format. default is every minute.
Here is also helpful.
i2cBusAddress
Set the I2C bus number and address. default is1:23
.influxDB
Set totrue
when sending data to InfluxDB. default isfalse
.mqtt
Set totrue
when sending data to MQTT broker. default isfalse
.prettyPrinting
Set totrue
when indenting the log output of JSON format data. default isfalse
. It is also necessary to change the following log level ofconf/logging.properties
.#io.github.s5uishida.level=INFO --> io.github.s5uishida.level=FINE
readCrontab
Set the schedule for sensing data in crontab format. default is every minute.
Here is also helpful.
Note. When using with PPD42NS, please connect pin#4 (Yellow) of PPD42NS to pin#19 (GPIO10) or pin#38 (GPIO20) of Raspberry Pi 3B.
Or when connecting pin#4 (Yellow) of PPD42NS to pin#8 (GPIO14) of Raspberry Pi 3B, connect MH-Z19B to Raspberry Pi 3B via USB serial adapter
(etc. DSD TECH SH-U09C USB to TTL Serial Adapter with FTDI FT232RL Chip).
When connecting MH-Z19B to a USB serial adapter, you should specify /dev/ttyUSB0
for the port name.
portName
Set the serial port name. default is/dev/ttyAMA0
.influxDB
Set totrue
when sending data to InfluxDB. default isfalse
.mqtt
Set totrue
when sending data to MQTT broker. default isfalse
.prettyPrinting
Set totrue
when indenting the log output of JSON format data. default isfalse
. It is also necessary to change the following log level ofconf/logging.properties
.#io.github.s5uishida.level=INFO --> io.github.s5uishida.level=FINE
readCrontab
Set the schedule for sensing data in crontab format. default is every minute.autoCalibration
Set whether to calibrate automatically every 24 hours after powered on. default isfalse
.zeroCalibration
Set whether to calibrate to400
ppm. default isfalse
.detectionRange
Set the detection range to2000
or5000
ppm. default is5000
ppm.
Here is also helpful.
gpioPin
Set toGPIO_10
,GPIO_20
orGPIO_14
. default isGPIO_10
.influxDB
Set totrue
when sending data to InfluxDB. default isfalse
.mqtt
Set totrue
when sending data to MQTT broker. default isfalse
.prettyPrinting
Set totrue
when indenting the log output of JSON format data. default isfalse
. It is also necessary to change the following log level ofconf/logging.properties
.#io.github.s5uishida.level=INFO --> io.github.s5uishida.level=FINE
readCrontab
Set the schedule for sensing data in crontab format. default is every minute.
Here is also helpful.
gpioPin
Set toGPIO_18
,GPIO_19
,GPIO_12
orGPIO_13
. default isGPIO_18
.influxDB
Set totrue
when sending data to InfluxDB. default isfalse
.mqtt
Set totrue
when sending data to MQTT broker. default isfalse
.prettyPrinting
Set totrue
when indenting the log output of JSON format data. default isfalse
. It is also necessary to change the following log level ofconf/logging.properties
.#io.github.s5uishida.level=INFO --> io.github.s5uishida.level=FINE
When a motion is detected, an event occurs immediately. If mqtt
is set to true
, this event can be received from the MQTT broker.
Here is also helpful.
gpioPin
Set toGPIO_18
,GPIO_19
,GPIO_12
orGPIO_13
. default isGPIO_19
.influxDB
Set totrue
when sending data to InfluxDB. default isfalse
.mqtt
Set totrue
when sending data to MQTT broker. default isfalse
.prettyPrinting
Set totrue
when indenting the log output of JSON format data. default isfalse
. It is also necessary to change the following log level ofconf/logging.properties
.#io.github.s5uishida.level=INFO --> io.github.s5uishida.level=FINE
When a motion is detected, an event occurs immediately. If mqtt
is set to true
, this event can be received from the MQTT broker.
influxDB
Set totrue
when sending data to InfluxDB. default isfalse
.mqtt
Set totrue
when sending data to MQTT broker. default isfalse
.prettyPrinting
Set totrue
when indenting the log output of JSON format data. default isfalse
. It is also necessary to change the following log level ofconf/logging.properties
.#io.github.s5uishida.level=INFO --> io.github.s5uishida.level=FINE
keyStoreType
keyStoreAlias
keyStorePassword
certificate
The following is an example of Public Demo Server of Eclipse Milo.
use
Set totrue
to use this server. default isfalse
.serverName
Set the OPC-UA server name.endpointIP
Set the OPC-UA server address.endpointPort
Set the OPC-UA server port number.securityPolicy
Set one ofBasic128Rsa15
,Basic256
,Basic256Sha256
orNone
in securityPolicy. default isNone
.securityMode
Set one ofSign
,SignAndEncrypt
orNone
to securityMode. default isNone
.userName
password
requestTimeout
default is10000
(msec).sessionTimeout
default is10000
(msec).publishingInterval
Set publishingInterval (msec). default is1000
(msec).samplingInterval
Set samplingInterval (msec). default is500
(msec).queueSize
Set queueSize. default is10
.dataChangeTrigger
Set one of the following to dataChangeTrigger:0
for DataChangeTrigger.Status1
for DataChangeTrigger.StatusValue2
for DataChangeTrigger.StatusValueTimestamp
default is1
.
nodeIDs
List the target node ID. The format is as follows.<namespaceIndex>,<identifier>,<depth>
In the above example, specifynodeIDs=2,Dynamic/RandomInt32,0 \ 2,Dynamic/RandomInt64,0 \ 2,Dynamic,-1 \ 0,2295,-1
2,Dynamic/RandomInt32
and2,Dynamic/RandomInt64
uniquely, and search for the NodeID to be monitored from2,Dynamic
and0,2295
(VendorServerInfo) at an infinite depth. In this case, only2,Dynamic,-1
and0,2295,-1
should be specified, but I wrote it for explanation of the format.
conf/opcua
also contains a milo-example.properties
file.
This is an example server-properties file of connecting to the server (milo-example-server) where the Milo sample server code is built almost as it is.
For reference, there is toem impulse OPC/UA Extension (Eclipse pulug-in) as a tool for easily checking the address space of OPC-UA server.
- start
Start rainy as follows.
# cd /path/to/rainy-felix/bin
# sh rainy-start.sh
-> ps
START LEVEL 1
ID State Level Name
[ 0] [Active ] [ 0] System Bundle (6.0.3)
[ 1] [Active ] [ 1] bcpkix (1.62)
[ 2] [Active ] [ 1] bcprov (1.62)
[ 3] [Active ] [ 1] java driver for bh1750fvi - ambient light sensor (0.1.2)
[ 4] [Active ] [ 1] bluetooth scanner (0.1.4)
[ 5] [Active ] [ 1] bluez-dbus-osgi (0.1.2.201911022022)
[ 6] [Active ] [ 1] java driver for bme280 - combined humidity, pressure and temperature sensor (0.1.3)
[ 7] [Active ] [ 1] bsd-parser-core (0.3.4)
[ 8] [Active ] [ 1] bsd-parser-gson (0.3.4)
[ 9] [Active ] [ 1] java driver for ti sensortag cc2650 (0.1.2)
[ 10] [Active ] [ 1] Apache Commons Lang (3.9.0)
[ 11] [Active ] [ 1] cron4j-osgi (2.2.5)
[ 12] [Active ] [ 1] dbus-java-osgi (3.2.1.SNAPSHOT)
[ 13] [Active ] [ 1] Gson (2.8.5)
[ 14] [Active ] [ 1] Guava: Google Core Libraries for Java (26.0.0.jre)
[ 15] [Active ] [ 1] java driver for hc-sr501 - pir motion detector sensor module (0.1.1)
[ 16] [Active ] [ 1] Java client for InfluxDB (2.15)
[ 17] [Active ] [ 1] jSerialComm (2.5.1)
[ 18] [Active ] [ 1] Jackson-annotations (2.9.9)
[ 19] [Active ] [ 1] Jackson-core (2.9.9)
[ 20] [Active ] [ 1] jackson-databind (2.9.9.1)
[ 21] [Active ] [ 1] JavaBeans Activation Framework (1.2.0)
[ 22] [Active ] [ 1] jaxb-api (2.3.1)
[ 23] [Active ] [ 1] file:/home/pi/rainy-felix/bundle/jaxb-runtime-2.3.2.jar
[ 24] [Active ] [ 1] java driver for mh-z19b - intelligent infrared co2 module (0.1.3)
[ 25] [Active ] [ 1] A modern JSON library for Kotlin and Java (1.7.0)
[ 26] [Active ] [ 1] MessagePack serializer implementation for Java (0.8.17)
[ 27] [Active ] [ 1] Netty/Buffer (4.1.38.Final)
[ 28] [Active ] [ 1] netty-channel-fsm-osgi (0.3.0)
[ 29] [Active ] [ 1] Netty/Codec (4.1.38.Final)
[ 30] [Active ] [ 1] Netty/Codec/HTTP (4.1.38.Final)
[ 31] [Active ] [ 1] Netty/Common (4.1.38.Final)
[ 32] [Active ] [ 1] Netty/Handler (4.1.38.Final)
[ 33] [Active ] [ 1] Netty/Resolver (4.1.38.Final)
[ 34] [Active ] [ 1] Netty/Transport (4.1.38.Final)
[ 35] [Active ] [ 1] Apache Felix Shell Service (1.4.3)
[ 36] [Active ] [ 1] Apache Felix Shell TUI (1.4.1)
[ 37] [Active ] [ 1] Apache ServiceMix :: Bundles :: jsr305 (3.0.2.1)
[ 38] [Active ] [ 1] Apache ServiceMix :: Bundles :: okhttp (3.14.1.1)
[ 39] [Active ] [ 1] Apache ServiceMix :: Bundles :: okio (1.15.0.1)
[ 40] [Active ] [ 1] Apache ServiceMix :: Bundles :: retrofit (2.5.0.2)
[ 41] [Active ] [ 1] Paho MQTT Client (1.2.1)
[ 42] [Active ] [ 1] OSGi LogService implemented over SLF4J (1.7.26)
[ 43] [Active ] [ 1] Pi4J :: Java Library (Core) (1.2)
[ 44] [Active ] [ 1] java driver for ppd42ns - dust sensor module (0.1.7)
[ 45] [Active ] [ 1] osgi activator of rainy - a tiny tool for iot data collection and monitoring (0.1.8)
[ 46] [Active ] [ 1] OPC-UA bundle of rainy - a tiny tool for iot data collection and monitoring (0.1.5)
[ 47] [Active ] [ 1] rainy - a tiny tool for iot data collection and monitoring (0.1.24)
[ 48] [Active ] [ 1] java driver for rcwl-0516 - microwave presence sensor module (0.1.1)
[ 49] [Active ] [ 1] sdk-client (0.3.4)
[ 50] [Active ] [ 1] sdk-core (0.3.4)
[ 51] [Active ] [ 1] slf4j-api (1.7.26)
[ 52] [Resolved ] [ 1] slf4j-jdk14 (1.7.26)
[ 53] [Active ] [ 1] stack-client (0.3.4)
[ 54] [Active ] [ 1] stack-core (0.3.4)
[ 55] [Active ] [ 1] strict-machine-osgi (0.1.0)
->
- stop
Stop rainy as follows.
-> stop 0
If you change the following logging level of conf/logging.properties
to INFO --> FINE
and restart rainy, the sensor values will be output to the log file logs/rainy.log.0
.
#io.github.s5uishida.level=INFO
-->
io.github.s5uishida.level=FINE
The sample of the output log is as follows.
[/dev/ttyAMA0] co2:1110
[I2C_1_76] temperature:20.84
[I2C_1_76] humidity:52.66211
[I2C_1_76] pressure:1012.5222
[I2C_1_23] optical:82.5
[hci0] B0:B4:48:ED:B6:04 obj:15.8125 amb:21.75
[hci0] B0:B4:48:ED:B6:04 humidity:56.78711
[hci0] B0:B4:48:ED:B6:04 pressure:1012.96
[hci0] B0:B4:48:ED:B6:04 optical:84.84
[hci0] B0:B4:48:ED:B6:04 gyr[x]:-8.888245
[hci0] B0:B4:48:ED:B6:04 gyr[y]:-7.5759883
[hci0] B0:B4:48:ED:B6:04 gyr[z]:-0.06866455
[hci0] B0:B4:48:ED:B6:04 acc[x]:0.010375977
[hci0] B0:B4:48:ED:B6:04 acc[y]:-0.0040283203
[hci0] B0:B4:48:ED:B6:04 acc[z]:0.24835205
[hci0] B0:B4:48:ED:B6:04 mag[x]:183.0
[hci0] B0:B4:48:ED:B6:04 mag[y]:403.0
[hci0] B0:B4:48:ED:B6:04 mag[z]:-192.0
[GPIO_10] pcs:4248.701 ugm3:6.6253257
[GPIO_18] detect:true
[GPIO_19] detect:true
In order to reduce writing to the SD card, it is usually recommended to set it to INFO
.
Check from the log file logs/rainy.log.0
. The following is an example. Note that InfluxDB will not do anything if the database already exists.
execute - CREATE DATABASE RP3B_01__dev_ttyAMA0 <-- MH-Z19B
...
execute - CREATE DATABASE RP3B_01_I2C_1_76 <-- BME280
...
execute - CREATE DATABASE RP3B_01_I2C_1_23 <-- BH1750FVI
...
execute - CREATE DATABASE B0_B4_48_B9_92_86 <-- CC2650
...
execute - CREATE DATABASE B0_B4_48_ED_B6_04 <-- CC2650
...
execute - CREATE DATABASE milo_digitalpetri_com_62541_milo <-- Public Demo Server of Eclipse Milo
...
execute - CREATE DATABASE RP3B_01_GPIO_10 <-- PPD42NS
...
execute - CREATE DATABASE RP3B_01_GPIO_18 <-- RCWL-0516
...
execute - CREATE DATABASE RP3B_01_GPIO_19 <-- HC-SR501
These database names are required for the visualization tools Grafana and Chronograf to connect to InfluxDB.
Visualization tools can be connected to InfluxDB to monitor time-series sensor data.
Please refer to Getting started of Grafana site for how to use Grafana.
The following figure is a sample image of a dashboard.
The following figure is a sample graph of Magnetometer using Plotly panel.
The following figure is a sample monitoring image with environmental information on the floor map using ImageIt panel.
Please refer to Getting started of Chronograf site for how to use Chronograf.
The following figure is a sample image of a dashboard.
The following figure is a sample dashboard for the following NodeIDs on OPC-UA Public Demo Server of Eclipse Milo.
1,VendorServerInfo/ProcessCpuLoad
1,VendorServerInfo/SystemCpuLoad
1,VendorServerInfo/UsedMemory
2,Dynamic/RandomDouble
2,Dynamic/RandomFloat
2,Dynamic/RandomInt32
2,Dynamic/RandomInt64
The upper displays 1,VendorServerInfo/ProcessCpuLoad
, 1,VendorServerInfo/SystemCpuLoad
and 1, VendorServerInfo/UsedMemory
. The middle displays 2,Dynamic/RandomDouble
and 2,Dynamic/RandomFloat
superimposed and the lower displays 2,Dynamic/RandomInt32
and 2,Dynamic/RandomInt64
as time series graphs.
If you put data into InfluxDB which is a time series DB, you can easily create a dashboard using Grafana or Chronograf.
Check the data sent to the MQTT broker using the MQTT client command as follows:
# mosquitto_sub -d -t rainy/B0_B4_48_ED_B6_04
Client mosqsub|2095-u1804 sending CONNECT
Client mosqsub|2095-u1804 received CONNACK
Client mosqsub|2095-u1804 sending SUBSCRIBE (Mid: 1, Topic: rainy/B0_B4_48_ED_B6_04, QoS: 0)
Client mosqsub|2095-u1804 received SUBACK
Subscribed (mid: 1): 0
Client mosqsub|2095-u1804 received PUBLISH (d0, q0, r0, m0, 'rainy/B0_B4_48_ED_B6_04', ... (670 bytes))
{"deviceID":"B0:B4:48:ED:B6:04","clientID":"RP3B-01","samplingDate":"2019-08-09 12:56:00.009","samplingTimeMillis":1565351760009,"samplingTimeNanos":0,"firmwareVersion":"1.30 (May 23 2016)","batteryLevel":{"value":72,"unit":"%"},"objectTemperature":{"value":27.46875,"unit":"deg C"},"ambientTemperature":{"value":32.03125,"unit":"deg C"},"humidity":{"value":34.61914,"unit":"%"},"pressure":{"value":1009.16,"unit":"hPa"},"optical":{"value":203.84,"unit":"lux"},"gyroscope":{"x":-10.589599,"y":-7.8887935,"z":-2.281189,"unit":"deg/s"},"accelerometer":{"x":-0.029785156,"y":-0.06347656,"z":1.1887207,"unit":"G"},"magnetometer":{"x":138.0,"y":125.0,"z":-199.0,"unit":"uT"}}
- Only one Bluetooth adapter can be used.
- Only a few CC2650 (Bluetooth devices) can be used at the same time. (Restriction of Bluetooth chip)
- When the connection with CC2650 is lost, it may not recover automatically.
- This tool uses Pi4J for BME280/BH1750FVI/PPD42NS/RCWL-0516/HC-SR501, so these devices can only be used with Raspberry Pi series (arm). Therefore, the the features of these devices of this tool does not work on amd64 Linux machines.
- To use Pi4J 1.2's I2C functionality, sun.misc.SharedSecrets.class is required, but this class can only be used up to Java 8 and cannot be used since Java 9. Therefore, Java 8 is required to use BME280 and BH1750FVI.
- Depending on the combination of the number of monitored items of OPC-UA servers and the publishing interval, the load on InfluxDB may become too large.
The following bundles I created follow the MIT license.
- bluetooth-scanner 0.1.4
- cc2650-driver 0.1.2
- bme280-driver 0.1.3
- bh1750fvi-driver 0.1.2
- mh-z19b-driver 0.1.3
- ppd42ns-driver 0.1.7
- rcwl-0516-driver 0.1.1
- hc-sr501-driver 0.1.1
- rainy-opcua 0.1.5
- rainy-activator 0.1.8
- rainy 0.1.24
Please check each license for the following bundles used in addition to these.
- SLF4J 1.7.26
- Apache Commons Lang 3.9
- dbus-java-osgi 3.2.1-SNAPSHOT
- bluez-dbus-osgi 0.1.2-SNAPSHOT
- cron4j-osgi 2.2.5
- influxdb-java-osgi 2.15.0
- msgpack-core-osgi 0.8.17
- moshi-osgi 1.7.0
- Jackson 2.9.9 annotations, core, databind
- Apache Felix 6.0.3
- Apache Felix Shell 1.4.3
- Apache Felix Shell TUI 1.4.1
- JSR 305 3.0.2
- Okio 1.15.0
- OkHttp 3.14.1
- Retrofit 2.5.0
- Eclipse Paho Client Mqttv3 1.2.1
- jSerialComm 2.5.1
- Netty 4.1.38 netty-buffer-4.1.38.Final.jar, netty-codec-4.1.38.Final.jar, netty-codec-http-4.1.38.Final.jar, netty-common-4.1.38.Final.jar, netty-handler-4.1.38.Final.jar, netty-resolver-4.1.38.Final.jar, netty-transport-4.1.38.Final.jar
- JAXB API 2.3.1
- JAXB Runtime 2.3.2
- JavaBeans Activation Framework (JAF) 1.2.0
- strict-machine-osgi 0.1
- netty-channel-fsm-osgi 0.3
- bsd-parser-core 0.3.4
- bsd-parser-gson 0.3.4
- stack-core 0.3.4
- stack-client 0.3.4
- sdk-core 0.3.4
- sdk-client 0.3.4
- Gson 2.8.5
- Bouncy Castle PKIX, CMS, EAC, TSP, PKCS, OCSP, CMP, and CRMF APIs 1.62
- Bouncy Castle Provider 1.62
- Guava: Google Core Libraries for Java 26.0
- Pi4J 1.2 (pi4j-core.jar)
I would like to thank the authors of these very useful codes, and all the contributors.
If Raspberry Pi 4B (4GB memory model), InfluxDB and Grafana may be able to run together with rainy in enough resources. In this case, from sensor data collection to monitoring, it may be possible to run with one RP4.