Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » Problem in connecting to sensor tag
Problem in connecting to sensor tag [message #1732902] Sun, 22 May 2016 16:57 Go to next message
Tejram Kotakonda is currently offline Tejram KotakondaFriend
Messages: 7
Registered: May 2016
Junior Member
Hi all,

I'm developing a bundle which wants to integrate with a TI SensorTag via BLE, but I am having the following problem:

the log file:
2016-05-22 22:17:42,386 [BluetoothProcess Input Stream Gobbler] INFO o.e.k.l.b.l.BluetoothLeScanner - B0:B4:48:BD:95:06 CC2650 SensorTag
2016-05-22 22:17:42,388 [BluetoothProcess Input Stream Gobbler] INFO o.e.k.l.b.l.BluetoothLeScanner - m_scanResult.add B0:B4:48:BD:95:06 - CC2650 SensorTag
2016-05-22 22:17:42,389 [BluetoothProcess Input Stream Gobbler] INFO o.e.k.e.m.MyBluetoothSensorTag - Address B0:B4:48:BD:95:06 Name CC2650 SensorTag
2016-05-22 22:17:42,391 [BluetoothProcess Input Stream Gobbler] INFO o.e.k.e.m.MyBluetoothSensorTag - TI SensorTag B0:B4:48:BD:95:06 found.
2016-05-22 22:17:42,392 [BluetoothProcess Input Stream Gobbler] DEBUG o.e.k.e.m.MyBluetoothSensorTag - Found 1 SensorTags
2016-05-22 22:17:42,393 [BluetoothProcess Input Stream Gobbler] INFO o.e.k.e.m.MyBluetoothSensorTag - Connecting to TiSensorTag...
2016-05-22 22:17:42,396 [BluetoothProcessExecutor] DEBUG o.e.k.l.b.u.BluetoothProcess - Executing: [gatttool, -b, B0:B4:48:BD:95:06, -I]
2016-05-22 22:17:42,402 [BluetoothProcess Input Stream Gobbler] INFO o.e.k.l.b.l.BluetoothGattImpl - Sending connect message...
2016-05-22 22:17:42,403 [BluetoothProcess Input Stream Gobbler] DEBUG o.e.k.l.b.l.BluetoothGattImpl - send command = connect

2016-05-22 22:17:48,916 [BluetoothProcess Input Stream Gobbler] DEBUG o.e.k.l.b.l.BluetoothGattImpl - send command = exit

In log file after executing "connect" command it also executing "exit" command. I don't know why it is executing "exit".

When I am trying from the termnal it is connecting without anyerror
gatttool -b B0:B4:48:BD:95:06 -I
[ ][B0:B4:48:BD:95:06][LE]> connect
[CON][B0:B4:48:BD:95:06][LE]>

I am new to KURA.Please help me where I am doing wrong.I followed it here eclipse.github.io/kura/doc/bluetooth-le-example.html
Re: Problem in connecting to sensor tag [message #1732986 is a reply to message #1732902] Mon, 23 May 2016 14:50 Go to previous messageGo to next message
Pierantonio Merlino is currently offline Pierantonio MerlinoFriend
Messages: 39
Registered: March 2016
Member
Hi,

the example described in the documentation, indeed, creates a connection to the SensorTag, reads the sensor values and closes it.
Take a look on the updated example here [1]. In this case, the bundle keeps the connection open.

Best,
Pier

[1] https://github.com/eclipse/kura/blob/develop/kura/examples/org.eclipse.kura.example.ble.tisensortag/src/main/java/org/eclipse/kura/example/ble/tisensortag/BluetoothLe.java
Re: Problem in connecting to sensor tag [message #1733059 is a reply to message #1732986] Tue, 24 May 2016 07:13 Go to previous messageGo to next message
Tejram Kotakonda is currently offline Tejram KotakondaFriend
Messages: 7
Registered: May 2016
Junior Member
Hi Pier,
After connecting it is not showing any readings(like temperature, humidity etc.). In the github link it is not entering the if-loop at line no:434
At line 420==>m_connected = myTiSensorTag.connect(); It is returning false.
In TiSensorTag.java https://github.com/eclipse/kura/blob/develop/kura/examples/org.eclipse.kura.example.ble.tisensortag/src/main/java/org/eclipse/kura/example/ble/tisensortag/TiSensorTag.java file, in connect() function, at line 67==>connected = m_bluetoothGatt.connect(); it is trying to connect but it is also returning false.After that at line 78 it disconnecting with executing "exit" command.
I don't know why it's not connecting. With terminal it is connecting and I can read temperature values also.
Please help me.
Regards
Tejram.
Re: Problem in connecting to sensor tag [message #1733081 is a reply to message #1733059] Tue, 24 May 2016 09:22 Go to previous messageGo to next message
Pierantonio Merlino is currently offline Pierantonio MerlinoFriend
Messages: 39
Registered: March 2016
Member
Hi,

on which device are you running the example?
You could set the log level to debug on the org.eclipse.kura.linux.bluetooth package and see on kura.log the gatttool output.
Re: Problem in connecting to sensor tag [message #1733086 is a reply to message #1733081] Tue, 24 May 2016 02:52 Go to previous messageGo to next message
David Nguyen is currently offline David NguyenFriend
Messages: 13
Registered: March 2016
Junior Member
Hi Tejram,

May you show us your BluetoothLe.java file?
icon5.gif  Re: Problem in connecting to sensor tag [message #1737744 is a reply to message #1732902] Tue, 12 July 2016 12:46 Go to previous messageGo to next message
Serc Can is currently offline Serc CanFriend
Messages: 3
Registered: July 2016
Junior Member
Hey all,
same problem here.
I used the BLE Java File from:

https://github.com/eclipse/kura/blob/develop/kura/examples/org.eclipse.kura.example.ble.tisensortag/src/main/java/org/eclipse/kura/example/ble/tisensortag/BluetoothLe.java

2016-07-12 14:23:52,685 [Component Resolve Thread (Bundle 6)] INFO  o.e.k.e.b.t.BluetoothLe - Bluetooth adapter interface => hci0
2016-07-12 14:23:52,688 [Component Resolve Thread (Bundle 6)] INFO  o.e.k.e.b.t.BluetoothLe - Bluetooth adapter address => XX:XX:XX:XX:XX
2016-07-12 14:23:52,690 [Component Resolve Thread (Bundle 6)] INFO  o.e.k.e.b.t.BluetoothLe - Bluetooth adapter le enabled => true
2016-07-12 14:23:52,729 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - startLeScan
2016-07-12 14:23:52,766 [pool-14-thread-1] INFO  o.e.k.l.b.l.BluetoothLeScanner - Starting bluetooth le scan...
2016-07-12 14:23:53,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:23:54,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:23:55,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:23:56,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:23:57,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:23:58,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:23:59,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:24:00,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:24:01,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:24:02,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:24:03,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:24:04,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:24:05,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:24:06,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:24:07,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:24:08,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:24:09,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:24:10,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:24:11,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:24:12,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:24:13,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:24:13,725 [pool-14-thread-1] INFO  o.e.k.l.b.l.BluetoothLeScanner - Killing hcitool...
2016-07-12 14:24:13,992 [BluetoothProcess Input Stream Gobbler] INFO  o.e.k.l.b.l.BluetoothLeScanner - LE Scan ...
2016-07-12 14:24:13,997 [BluetoothProcess Input Stream Gobbler] INFO  o.e.k.l.b.l.BluetoothLeScanner - B0:B4:48:BD:XX:XX (unknown)
2016-07-12 14:24:14,012 [BluetoothProcess Input Stream Gobbler] INFO  o.e.k.l.b.l.BluetoothLeScanner - B0:B4:48:BD:XX:XX CC2650 SensorTag  

"XX Inserted by me"

2016-07-12 14:24:14,079 [BluetoothProcess Input Stream Gobbler] INFO  o.e.k.l.b.l.BluetoothLeScanner - m_scanResult.add B0:B4:48:BD:XX:XX - CC2650 SensorTag
2016-07-12 14:24:14,096 [BluetoothProcess Input Stream Gobbler] INFO  o.e.k.e.b.t.BluetoothLe - Address B0:B4:48:BD:XX:XX Name CC2650 SensorTag
2016-07-12 14:24:14,099 [BluetoothProcess Input Stream Gobbler] INFO  o.e.k.e.b.t.BluetoothLe - TI SensorTag B0:B4:48:BD:XX:XX found.
2016-07-12 14:25:33,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - startLeScan
2016-07-12 14:25:33,733 [pool-14-thread-1] INFO  o.e.k.l.b.l.BluetoothLeScanner - Starting bluetooth le scan...
2016-07-12 14:25:34,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 14:25:35,723 [pool-14-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning


Is the name of the SensorTag important? I changed it days ago with the iOS App into "CC2650"
Re: Problem in connecting to sensor tag [message #1737925 is a reply to message #1737744] Thu, 14 July 2016 08:34 Go to previous messageGo to next message
Pierantonio Merlino is currently offline Pierantonio MerlinoFriend
Messages: 39
Registered: March 2016
Member
Hi,

the name of the SensorTag is used only to select which type of device the bundle is trying to connect to. This is due to the fact that the old SensorTag has different sensors and register respect to the new one (CC2650).

Which SensorTag are you using? The new (CC2650) or the old one (CC2541)?

My suggestion is to set the log level to debug and take a look on kura.log.
To do this, edit the /opt/eclipse/kura/kura/log4j.properties file and add the following files:
log4j.logger.org.eclipse.kura.example.ble.tisensortag=DEBUG
log4j.logger.org.eclipse.kura.linux.bluetooth=DEBUG
Re: Problem in connecting to sensor tag [message #1738029 is a reply to message #1737925] Fri, 15 July 2016 08:17 Go to previous messageGo to next message
Serc Can is currently offline Serc CanFriend
Messages: 3
Registered: July 2016
Junior Member
Thanks for your reply. I logged also the debug, see below.

"Reads data from all the sensors onboard and writes the values in the log file" from https://eclipse.github.io/kura/doc/bluetooth-le-example.html#bundle_sensortag_1

But it doenst log Smile

2016-07-12 16:55:29,443 [BluetoothProcess Input Stream Gobbler] INFO  o.e.k.l.b.l.BluetoothLeScanner - LE Scan ...
2016-07-12 16:55:29,470 [BluetoothProcess Input Stream Gobbler] INFO  o.e.k.l.b.l.BluetoothLeScanner - B0:B4:48:BD:XX:XX (unknown)
2016-07-12 16:55:29,473 [BluetoothProcess Input Stream Gobbler] DEBUG o.e.k.l.b.l.BluetoothLeScanner - Device found: B0:B4:48:BD:XX:XX - (unknown)
2016-07-12 16:55:29,474 [BluetoothProcess Input Stream Gobbler] INFO  o.e.k.l.b.l.BluetoothLeScanner - B0:B4:48:BD:XX:XX CC2650 SensorTag
2016-07-12 16:55:29,477 [BluetoothProcess Input Stream Gobbler] DEBUG o.e.k.l.b.l.BluetoothLeScanner - Updating device: B0:B4:48:BD:XX:XX - CC2650 SensorTag
2016-07-12 16:55:29,478 [BluetoothProcess Input Stream Gobbler] INFO  o.e.k.l.b.l.BluetoothLeScanner - m_scanResult.add B0:B4:48:BD:XX:XX - CC2650 SensorTag
2016-07-12 16:55:29,481 [BluetoothProcess Input Stream Gobbler] INFO  o.e.k.e.b.t.BluetoothLe - Address B0:B4:48:BD:XX:XX Name CC2650 SensorTag
2016-07-12 16:55:29,482 [BluetoothProcess Input Stream Gobbler] INFO  o.e.k.e.b.t.BluetoothLe - TI SensorTag B0:B4:48:XX:XX:XXfound.
2016-07-12 16:55:29,512 [BluetoothProcess Input Stream Gobbler] DEBUG o.e.k.e.b.t.BluetoothLe - Found 1 SensorTags
2016-07-12 16:56:49,310 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - startLeScan
2016-07-12 16:56:49,314 [pool-19-thread-1] INFO  o.e.k.l.b.l.BluetoothLeScanner - Starting bluetooth le scan...
2016-07-12 16:56:49,316 [pool-19-thread-1] DEBUG o.e.k.l.b.u.BluetoothUtil - Command executed : [hcitool, -i, hci0, lescan]
2016-07-12 16:56:49,322 [BluetoothProcessExecutor] DEBUG o.e.k.l.b.u.BluetoothProcess - Executing: [hcitool, -i, hci0, lescan]
2016-07-12 16:56:50,310 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:56:51,310 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:56:52,310 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:56:53,311 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:56:54,311 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:56:55,310 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:56:56,310 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:56:57,310 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:56:58,310 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:56:59,311 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:57:00,311 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:57:01,311 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:57:02,311 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:57:03,311 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:57:04,310 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:57:05,310 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:57:06,310 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:57:07,311 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:57:08,311 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:57:09,310 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:57:10,310 [pool-19-thread-1] INFO  o.e.k.e.b.t.BluetoothLe - m_bluetoothAdapter.isScanning
2016-07-12 16:57:10,315 [pool-19-thread-1] INFO  o.e.k.l.b.l.BluetoothLeScanner - Killing hcitool...
2016-07-12 16:57:10,324 [SafeProcessExecutor] DEBUG o.e.k.l.b.u.BluetoothSafeProcess - Executing: [pidof, hcitool]
2016-07-12 16:57:10,440 [SafeProcessExecutor] DEBUG o.e.k.l.b.u.BluetoothSafeProcess - Executing: [kill, -2, 701]
2016-07-12 16:57:10,464 [BluetoothProcess ErrorStream Gobbler] DEBUG o.e.k.l.b.u.BluetoothProcess - End of stream!
2016-07-12 16:57:10,471 [BluetoothProcess Input Stream Gobbler] INFO  o.e.k.l.b.l.BluetoothLeScanner - LE Scan ...
2016-07-12 16:57:10,487 [BluetoothProcess Input Stream Gobbler] INFO  o.e.k.l.b.l.BluetoothLeScanner - B0:B4:48:BD:XX:XX(unknown)
2016-07-12 16:57:10,489 [BluetoothProcess Input Stream Gobbler] DEBUG o.e.k.l.b.l.BluetoothLeScanner - Device found: B0:B4:48:BD:XX:XX- (unknown)
2016-07-12 16:57:10,490 [BluetoothProcess Input Stream Gobbler] INFO  o.e.k.l.b.l.BluetoothLeScanner - B0:B4:48:BD:XX:XXCC2650 SensorTag
2016-07-12 16:57:10,493 [BluetoothProcess Input Stream Gobbler] DEBUG o.e.k.l.b.l.BluetoothLeScanner - Updating device: B0:B4:48:BD:XX:XX- CC2650 SensorTag


then it starts over and over again...

my settings on the Kura BLE Package: see png attached
I dont want to publish the data to a cloud right now, thats what I filled that "needed" part with anything...


Thanks!
  • Attachment: kura.png
    (Size: 35.10KB, Downloaded 136 times)
Re: Problem in connecting to sensor tag [message #1738215 is a reply to message #1738029] Mon, 18 July 2016 08:33 Go to previous messageGo to next message
Pierantonio Merlino is currently offline Pierantonio MerlinoFriend
Messages: 39
Registered: March 2016
Member
Hi,

what device and what version of Bluez are you using?
Did you try via command line?
Re: Problem in connecting to sensor tag [message #1738228 is a reply to message #1738215] Mon, 18 July 2016 09:30 Go to previous messageGo to next message
Serc Can is currently offline Serc CanFriend
Messages: 3
Registered: July 2016
Junior Member
Raspberry Pi Model B+, Bluez Version 5.23
Via cmd line and the Gatt table from the TI Website I can read out the single date from the sensor...
I dunno why it doenst work properly...

In my opinion the made sample by eclipse is probably a bit messy. But the single code lines like enable temp. sensor etc should be right... i checked some of them-

Does anybody got the system work? Raspi + SensorTag !? Would be nice to hear that i am not the only 1 with those problems Razz

Re: Problem in connecting to sensor tag [message #1738469 is a reply to message #1738228] Wed, 20 July 2016 07:12 Go to previous message
Pierantonio Merlino is currently offline Pierantonio MerlinoFriend
Messages: 39
Registered: March 2016
Member
Hi,
I tested the bundle with a RPi2, Bluez 5.23 and both SensorTags.
The bundle worked with my configuration, but I'll take a look on it trying to reproduce your situation.
Previous Topic:Eclipse Kura on BBB - Wifi Not connecting
Next Topic:BLE sample on Rasberry Pi3
Goto Forum:
  


Current Time: Fri Apr 26 11:29:09 GMT 2024

Powered by FUDForum. Page generated in 0.04124 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top