How to continually monitor a bluetooth Characteristic? - bluetooth

I have a React Native application. Im trying to get Glucose measurements from a peripheral.
theres a Data Transfer option on the peripheral where it'll transfer data from the peripheral device via bluetooth.
I can retrieve and decode the data off the peripheral but i cant continually monitor Glucose characteristic. i.e if i add a new data to peripheral and select Data Transfer option the second time around i dont get latest data.
any ideas on what i should be doing to achieve this?
im using react-native-ble-plx library
this.manager.monitorCharacteristicForDevice(
device.id,
'00001808-0000-1000-8000-00805f9b34fb',
'00002a18-0000-1000-8000-00805f9b34fb'
)

Related

Recording audio and sending data in real time through bluetooth on raspberry pi zero

I am trying to record audio on raspberry pi zero and want to transfer the audio data in real time through Bluetooth (Classic or BLE) to an android application . I have created a GATT server referring to Bluez example code but given the amount of data(32-bit audio data, 16000 Hz). The process through BLE is really slow and i am not able to record and send the data simultaneously but one by one.
So i want to shift to Bluetooth Classic. What would be the preferable protocol where i can record and send the data along as soon as i receive it ? Are there Pybluez API which can allow me to achieve this?

Has anyone used bleak to connect multiple BLE devices and receive notifications from all of them simultaneously?

I am able to use bleak and get data from all 5 BLE sensors. But the problem is that I am unable to identify which data is from which device. I mean i need a string representing the address of the device alongwith the data itself.
I was able to get data simultaneously from all the BLE modules using bleak in Windows, as well as on raspberry pi.
The only problem with Windows is that if you use Bluetooth 4.2 adapter & above. It will be much better for the high speed data rate, and proper devices connection handling. As with the 4.0 adapter, I have always gone through one or two exceptions each time i started the script, and the maximum number of connections I got was 3.
When i tried this script on Raspberry pi 3b+, it has on-board chip of Bluetooth 4.2. It was able to give high speed data rate, and my 5 sensors were connected to it simultaneously.
Also, The two_devices examples in bleak source code on Github, is very good example for starting with further coding.
And if you run the script and found the data on console, but you were unable to get that which data is from device. Then you need to use functools, (what it does is it will inject the client you're connected to at present, with the callback function, and it will make the work much easier).
Check this out on Github: https://github.com/hbldh/bleak/issues/601

How to receive continuous data from usb endpoint in Linux device driver

I'm writing a usb device driver for a data acquisition device in Ubuntu 16.04.
The data acquisition device is currently working in Windows and the manufacturer only provides the driver for Windows and I need it to be working in Linux.
So, to do the reverse engineering, I captured the data with Wireshark in Windows.
I figured out all the setup urbs and I can send data to the data acquisition device and works well but the problem is to receive the data.
It seems that there are continuous(periodic) data coming from endpoints 1 and 3(which are the bulk in endpoints). In Windows, there doesn't seem to be any request packet going to the usb device to receive the data from endpoints 1 and 3 but in Linux, the data is received only when I send some kind of request(for example, read file operation).
I've found that there is something called "Continuous Reader" in Windows, but I can't find any hint in Linux for reading continuous data from usb device.
https://learn.microsoft.com/en-us/windows-hardware/drivers/usbcon/how-to-use-the-continous-reader-for-getting-data-from-a-usb-endpoint--umdf-
I would really appreciate your help, Thank you!
Are you sure the device doesn't have an intr-IN endpoint to announce availability of data, which is then fetched using bulk IN transfers? How does it configure EP2, which I assume is interrupt? If you use something like libusb you may need to set up an interrupt poller based on the intr-EP description.

Sensor Tag CC2650 - reading movement sensor

Is there any way to read data continuously upon request without using notifications? Thank you for your help.
If you want an app capable of working with all the sensors from CC2541DK, CC2650STK, ThunderBoard React and Sense (e.g. accelerometer., magnetometer, gyroscope etc.), you can download it from: BLE SensorTags (blessTags) – the software is able of giving new uses (movement & magnetic security, accelerometer mouse, PC remote control and wireless presenters) to all these IoT SensorTags. For more info: Bluetooth low energy SensorTag.
Yes, it is possible. You have notifying and reading mechanism of data transfer - in CC2650 almost all characteristics support both mechanism of data transfer. But other characteristics can only be accessed based only one method of data reading. One such example is the reading of the buttons states on the CC2650STK and CC2541DK that can only be read by means of the notification mechanism. But, notifications is preferred if you need a higher data transfer rate between the SensorTag and your application.

Creating a picture frame with arduino and bluetooth module HC-05

I am planning to make a arduino picture frame which gets data from an android phone through bluetooth module HC-05.Most of the example in the internet gives information about serial communication over the bluetooth module. Is it possible to send an image file over HC-05 to arduino?
Please help me out on this!!!!
Of course... An image is just a bunch of bytes, so you will be able to transfer it.
Ok, you will have a lot of troubles on the arduino side because of the low memory on the device, but.. Yes, you can.
The best way is to load the image in the application, then send it pixel-by-pixel on the serial interface and, on the arduino side, pass it directly to the screen. This will avoid keeping it in memory...
Otherwise you will have to add external memory, better if with a fast interface.
And of course it will be slow (you won't be able to see an animation.. arduino is really slow) but... I think it can work.

Resources