Hi,
i've managed to scan, connect and read data from sensor's services in Angular, but would it be possible somehow to connect and read from multi sensortag parallel eg.
sensortag
.temperatureCallback(temperatureHandler, 1000)
.accelerometerCallback(accelerometerHandler, 1000)
.connectToDevice($scope.devices[i].deviceInfo);
Those callback returns values in circle with specified time.
How can i read data from next device in the same time ? Is it possible to accomplish this with javascript api at all ?
I'm aware that JS processes remains in one thread. I'm trying to simulate parallel tasks using the setTimeout() or setInterval(), but with no luck.
Maybe you can help me somehow ?
One more thing, i've noticed that there's a problem with accelerometer and gyroscope service, it returns values more or less 10 times and stops broadcasting.
Same story is on my app and your official Evothings apps (eg. TISensorTag Sensors), that i've downloaded from Google Play.
I'm using CC2650 Sensors
ps.
Love the job you guys doing
Cheers
Michal
Parallel read data from multi tisensortag
Re: Parallel read data from multi tisensortag
I haven't tried it, so I don't know if it can work, but what you would want to do is add another sensortag instance (evothings.tisensortag.createInstance), but do scanning on only one of them, wait for two different devices, then connect each instance to a device.
We're aware of the problem with the accelerometer service. It's a bug in the TI firmware. We can't fix it. You might try upgrading the firmware on your tag using the TI's own sensortag app.
We're aware of the problem with the accelerometer service. It's a bug in the TI firmware. We can't fix it. You might try upgrading the firmware on your tag using the TI's own sensortag app.
Re: Parallel read data from multi tisensortag
As I remember, downloading TI's own app for the cc2650 tag brings about a OTA firmware upgrade option once you connect it to the tag, that's probably the easiest way to go about it. It works for iOS, we've done that a couple of times in the past.
Here is a good starter link for altering other properties, like having the tag advertise indefinitely rather than the 2 minutes after a button press, altering the signal strength (in a trade-off for battery life): http://stackoverflow.com/questions/2209 ... definitely
Here is a good starter link for altering other properties, like having the tag advertise indefinitely rather than the 2 minutes after a button press, altering the signal strength (in a trade-off for battery life): http://stackoverflow.com/questions/2209 ... definitely
Re: Parallel read data from multi tisensortag
Ok, sensors firmware updated, accelerometer seems working fine now. Thanks.
Still strugling with reading from multi sensors. I'll try manage it with your suggest. If someone had done it please let me know.
Still strugling with reading from multi sensors. I'll try manage it with your suggest. If someone had done it please let me know.
Re: Parallel read data from multi tisensortag
Guys would it be possible to add to data returned from callbacks (eg. from temperature, accelelometer) information about device let's say address ?
So in case of temperature it might have look :
before change:
data = [96, 11, 4, 14]
after change:
data = [96, 11, 4, 14], "68:C9:0B:17:BF:03"
That would solve problem with parallel reads from couple sensors.
So in case of temperature it might have look :
before change:
data = [96, 11, 4, 14]
after change:
data = [96, 11, 4, 14], "68:C9:0B:17:BF:03"
That would solve problem with parallel reads from couple sensors.
Re: Parallel read data from multi tisensortag
You should be able to add enough state to your callback to know which device it was called on.
For example, if your one-sensor init is like this:
Then your multi-sensor init could be like this:
Note the addition of the "tagId".
For example, if your one-sensor init is like this:
Code: Select all
function initialiseSensorTag() {
sensortag = evothings.tisensortag.createInstance(
evothings.tisensortag.CC2650_BLUETOOTH_SMART)
sensortag
.statusCallback(statusHandler)
.errorCallback(errorHandler)
.temperatureCallback(temperatureHandler, 1000)
}
Then your multi-sensor init could be like this:
Code: Select all
function initialiseSensorTag(tagId) {
sensortag = evothings.tisensortag.createInstance(
evothings.tisensortag.CC2650_BLUETOOTH_SMART)
sensortag
.statusCallback(statusHandler)
.errorCallback(errorHandler)
.temperatureCallback(function(data) { temperatureHandler2(data, tagId); }, 1000)
}
Note the addition of the "tagId".
Re: Parallel read data from multi tisensortag
Great, i did something similar, works as well.
Thank you !
Thank you !
Who is online
Users browsing this forum: No registered users and 8 guests