BLE TI Sensor Tag

Discuss mobile apps for Texas Instruments products.
Ghrenig
Posts: 4
Joined: 14:18, 04 Jun 2014

BLE TI Sensor Tag

Postby Ghrenig » 10:56, 06 Jun 2014

Hi there
Evothings is excellent and makes it a lot easier developing cordova apps on ble devices.
I have been using the TI Sensor Tag and I can get the Accelerator or the Magnetometer to work but I am trying to get several of the sensors working at the same time.

Do you have any examples of reading multiple items.
regards
Roger

User avatar
micke
Posts: 256
Joined: 20:49, 18 Nov 2013

Re: BLE TI Sensor Tag

Postby micke » 18:01, 08 Jun 2014

Hi, you should be able to connect to multiple devices. Just call connect on them and supply a callback function to handle each device.

Made a high-level example here that is meant to work with multiple sensors, but only the accelerometer is implemented and tested. You could try to add other sensors. Here is the code:

https://github.com/divineprog/evo-demos ... MagicStone

Skeleton code of enabling more sensors (in index.html). NOTE: Scroll to see all code!

Code: Select all

   
sensortag.connect(
    ['f000aa10-0451-4000-b000-000000000000', // Accelerometer service UUID.
    add uuid for other sensor(s) here],
   function()
   {
        // We are connected.

        // Start accelerometer.
        sensortag.acceleromenterOn(
            100, // millisecond rate
            moveStone, // action function
            ....

        // Start other sensors, the "On" functions must be implemented in sensortag.js.
        sensortag.magnetometerOn(
            100, // millisecond rate
            doSomething, // action function
            ....


The method of manually typing raw UUIDs in the connect function is a bit crude, should be replaced by symbolic names. The API could be made even more high-level I think.

Here is a video of the thing, by the way:

https://www.youtube.com/watch?v=Cxd0OS1FNsc

Best regards, Micke

Ghrenig
Posts: 4
Joined: 14:18, 04 Jun 2014

Re: BLE TI Sensor Tag

Postby Ghrenig » 04:23, 17 Jun 2014

Thanks for that. Like the rock moving app nice demo.

Just received some gimbal.com ibeacon devices which you can get three free if your register on the http://www.gimbal.com site.
Only problem being on the Android the ibeacon causes the bluetooth to crash on the Android phone. The problem I understand is that the ibeacons pumps out ids which then fills up the Android device.

I am using Motorola Moto G which as far as I understand the 4.4.3 release should solve this problem.

Ghrenig

User avatar
micke
Posts: 256
Joined: 20:49, 18 Nov 2013

Re: BLE TI Sensor Tag

Postby micke » 14:57, 17 Jun 2014

Hi,

Thanks a lot for the pointer to gimbal.com, cool that you can get free iBeacons from them.

Do you have any crash log for Android? Which app did you use? I have tested BLE scanning with lots of devices and iBeacons that send out data with no crash. Used Nexus 5.

Regards, Micke

Ghrenig
Posts: 4
Joined: 14:18, 04 Jun 2014

Re: BLE TI Sensor Tag

Postby Ghrenig » 23:36, 17 Jun 2014

Using Motorola Moto G
Using the TI fob software no gimbal sensor set on and the app works fine. Native app using the TI java source code.
Turn on gimbal ibeacon. Everytime I then run the TI fob software I get bluetooth error. If I then remove the iBeacon battery and then rerun the TI software it then finds the fob and no error displayed. Maybe this is just an issue with the TI software.

If I run your ble detector I then get the list of items no problem. But the iBeacon is sending out a series of UUIDs

With your moving stoneapp it sometimes fails to work and I thought this was a similar problem with the Android phone.

Having looked on the internet I found various references to the android bluetooth crash.
https://code.google.com/p/android/issue ... l?id=67272 look at

#2 cs07...@gmail.com
The summary of this posting substantially mis-states the issue.

There is no compatibility problem whatsoever with "iBeacon BLE packets".

Rather the issue is with the above BTLE stack code's attempt to remember recently heard BTLE hardware addresses in general.

To trigger the bug, it is necessary to expose the device to a large number of unique hardware addresses, and thus overwhelm this subsystem beyond its current discarding mechanism (if indeed there is any).

Once a phone begins experiencing this bug, it will continue to function fine for any BTLE device with a hardware address which has already be heard, but will crash immediately when it receives an identical transmission coming from an identical BTLE device with a previously unheard hardware address.

Which is what I understood the problem to be and being addressed in 4.4.3

User avatar
micke
Posts: 256
Joined: 20:49, 18 Nov 2013

Re: BLE TI Sensor Tag

Postby micke » 11:51, 23 Jul 2014

Hi, thanks for the update. Let's hope Android 4.4.3 fixes the problem! BLE on Android seems to need to mature a bit to be fully stable.
Best regards, Mikael

rdoshi
Posts: 1
Joined: 18:41, 11 Mar 2015

Re: BLE TI Sensor Tag

Postby rdoshi » 18:49, 11 Mar 2015

Hello Micke,

I was wondering if you could maybe provide a few more hints on how to connect two TI SensorTags to the same instance of the application at the same time. I am able to use different sensors on one TI SensorTag unit, but I need to be able to connect two of them to the same application.

Thank you very much.

Kind Regards,

RD

micke wrote:Hi, you should be able to connect to multiple devices. Just call connect on them and supply a callback function to handle each device.

Made a high-level example here that is meant to work with multiple sensors, but only the accelerometer is implemented and tested. You could try to add other sensors. Here is the code:

https://github.com/divineprog/evo-demos ... MagicStone

Skeleton code of enabling more sensors (in index.html). NOTE: Scroll to see all code!

Code: Select all

   
sensortag.connect(
    ['f000aa10-0451-4000-b000-000000000000', // Accelerometer service UUID.
    add uuid for other sensor(s) here],
   function()
   {
        // We are connected.

        // Start accelerometer.
        sensortag.acceleromenterOn(
            100, // millisecond rate
            moveStone, // action function
            ....

        // Start other sensors, the "On" functions must be implemented in sensortag.js.
        sensortag.magnetometerOn(
            100, // millisecond rate
            doSomething, // action function
            ....


The method of manually typing raw UUIDs in the connect function is a bit crude, should be replaced by symbolic names. The API could be made even more high-level I think.

Here is a video of the thing, by the way:

https://www.youtube.com/watch?v=Cxd0OS1FNsc

Best regards, Micke

User avatar
micke
Posts: 256
Joined: 20:49, 18 Nov 2013

Re: BLE TI Sensor Tag

Postby micke » 10:45, 08 May 2015

Sorry for the super-slow response.

Actually I have not tested this myself, but here is a thing to try out:

sensortag1 = evothings.tisensortag.createInstance(
evothings.tisensortag.CC2650_BLUETOOTH_SMART)
// TODO: enable sensors
sensortag1.connectToNearestDevice()

sensortag2 = evothings.tisensortag.createInstance(
evothings.tisensortag.CC2650_BLUETOOTH_SMART)
// TODO: enable sensors
sensortag2.connectToNearestDevice()

Checkout the new TI SensorTag library and new example apps in Evothings Studio 1.2.

Download:

http://evothings.com/download/

Source code related to the above snippet:

https://github.com/evothings/evothings- ... index.html

Library documentation:

http://evothings.com/doc/studio/api-overview.html
http://evothings.com/doc/raw/lib-doc/index.html

Best, Mikael


Return to “Texas Instruments”

Who is online

Users browsing this forum: No registered users and 0 guests