[ ] TI SensorTag, Eclipse kura Apache Camel |
. TI SensorTag, Raspberry PI, Apache Camel . , , Apache Camel .
Eclipse Kura , IoT Raspberry PI. API. OSGi. mqtt . [1]
sudo -i && apt-get update
. Java ( Oracle java, apt-get install oracle-java8-jdk
). Kura Raspbian (Model 2) Stable ( : wget http://mirror.onet.pl/pub/mirrors/eclipse//kura/releases/3.0.0/kura_3.0.0_raspberry-pi-2-3_installer.deb
) : dpkg -i kura_*_installer.deb && apt-get install -f
. Raspberry PI: shutdown -r now
.
Kura WEB UI http://\ c admin/admin. , wi-fi , .
. :
apt-get install -y libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev
apt-get install bluez
bluetooth : systemctl enable bluetooth && systemctl start bluetooth
. : hciconfig hci0 up
. , : hciconfig -a
. bluez, , [3][4].
Mosquitto MQTT. SensorTag Camel backend .
, Rasperry PI, , (IBM, Azure). web , , mosquitto mqtt over websockets ( , ).
apt-get install mosquitto
systemctl enable mosquitto
websocket mosquitto /etc/mosquitto/mosquitto.conf
# Websocket
listener 1883
listener 9001
protocol websockets
systemctl start mosquitto
. mosquttio websockets. [2]
wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
apt-key add mosquitto-repo.gpg.key
cd /etc/apt/sources.list.d/
wget http://repo.mosquitto.org/debian/mosquitto-jessie.list
apt-get update
apt-get install mosquitto
Kura TI SensorTag. n BLE , Generic Attribute Profile (GATT) . , .
kura. https://github.com/eclipse/kura https://github.com/leadex/kura, .
:
git clone https://github.com/leadex/kura
cd kura
linux. ./build-all.sh
. ble example:
cd kura/kura/examples/org.eclipse.kura.example.ble.tisensortag
mvn clean install -Dmaven.test.skip=true
jar Raspberry PI.
cd kura/examples/org.eclipse.kura.example.ble.tisensortag
scp target/org.eclipse.kura.example.ble.tisensortag-*-SNAPSHOT.jar pi@:/tmp
OSGi console Raspberry PI telnet localhost 5002
telnet 5002
. install file:///tmp/org.eclipse.kura.example.ble.tisensortag-1.0.3-SNAPSHOT.jar
ss
. , bundle : 75 INSTALLED org.eclipse.kura.example.ble.tisensortag
.
start 75
, 75 id . : 75 ACTIVE org.eclipse.kura.example.ble.tisensortag
Raspberry PI: tail -f /var/log/kura.log
[5].
Kura web UI BluetoohLe. .
MongoDB + Mosquitto + Webview docker-compose up -d
. 3 mqtt, websocket, http (8081) localhost. http://localhost:8081. mqtt broker localhost:1883, Kura MqttDataTransport IP.
:
iot-backend-camel Apache Camel , KuraPayload.
EclipseKura Google Protobuf. Google com.google.protobuf:protobuf-java
.
, json , MongoDB.
Camel : gradlew clean build
java -jar ./build/libs/iot-backend-camel-1.0.0-SNAPSHOT.jar
.
webview nginx html & js. mqtt over websocket Paho highcharts ( ).
. , mqtt webview. webview/dist/view.js
. :
// Create a client instance
client = new Paho.MQTT.Client("localhost", Number(9001), "webview_" + parseInt(Math.random() * 1000000, 10));
webview docker-compose up -d --build
. docker , .