-

   rss_rss_hh_new

 - e-mail

 

 -

 LiveInternet.ru:
: 17.03.2011
:
:
: 51

:


[ ] TI SensorTag, Eclipse kura Apache Camel

, 04 2017 . 17:38 +

Photo

. TI SensorTag, Raspberry PI, Apache Camel . , , Apache Camel .



:


  1. Raspberry PI 3
  2. TI SensorTag 2650 ( TI SensorTag 2541, )

TI SensorTag


  • , .
  • BLE Stack SmartRF Flash Programmer CC2650SensorTag_BLE_All_v1_20.hex, %programfiles(x86)%\Texas Instruments\SmartRF Tools\BLE Device monitor\firmware\cc26xx\sensortag

Raspberry PI


Raspbian Raspberry PI .


Eclipse Kura


Eclipse Kura , IoT Raspberry PI. API. OSGi. mqtt . [1]


Eclipse Kura


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 , .


BlueZ BLE SensorTag


. :


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


Mosquitto MQTT. SensorTag Camel backend .


, Rasperry PI, , (IBM, Azure). web , , mosquitto mqtt over websockets ( , ).


Raspberry PI:



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

BLE TI SensorTag example


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. .


Kura web example

Kura, , .


Kura:


  • CloudService encode.gzip false
  • MqttDataTransport broker-url, topic.context.account-name

Camel Web


MongoDB + Mosquitto + Webview docker-compose up -d . 3 mqtt, websocket, http (8081) localhost. http://localhost:8081. mqtt broker localhost:1883, Kura MqttDataTransport IP.


:
Web ui example


Camel


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 , .



  1. http://eclipse.github.io/kura/doc/intro.html
  2. https://mosquitto.org/2013/01/mosquitto-debian-repository/
  3. http://blog.mrgibbs.io/bluez-5-39-ble-setup-on-the-raspberry-pi/
  4. http://wiki.beyondlogic.org/index.php?title=Cross_Compiling_BlueZ_Bluetooth_tools_for_ARM
  5. http://eclipse.github.io/kura/doc/deploying-bundles.html
Original source: habrahabr.ru (comments, light).

https://habrahabr.ru/post/332428/

:  

: [1] []
 

:
: 

: ( )

:

  URL