BTLE | Bluetooth Low Energy packet sniffer | Networking library
kandi X-RAY | BTLE Summary
kandi X-RAY | BTLE Summary
Bluetooth Low Energy (BLE) packet sniffer and transmitter for both standard and non standard (raw bit) based on Software Defined Radio (SDR).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of BTLE
BTLE Key Features
BTLE Examples and Code Snippets
Community Discussions
Trending Discussions on BTLE
QUESTION
I have Android devices mounted on vehicles in a manufacturing facility, and I'd like to deter people from removing them from one vehicle and moving it to another vehicle, but also still allow it (long story, but instead of physically locking the device to the vehicle with a cable or other device I'm looking to make it more inconvenient than impossible...). I was thinking if I mounted a Bluetooth low energy BTLE device or beacon of some sort to the vehicle in some inaccessible location, then pair my Android device to that beacon, my device would be allowed to work as long as it 'saw' that beacon. If someone were to move the device to another vehicle, it wouldn't see the beacon and would have to be 'paired' to the new vehicle, supplying a reason why it had to be moved, etc. Is BTLE/beacon the right technology for this or is there something better?
...ANSWER
Answered 2021-Dec-06 at 21:27Such a solution is possible with BLE beacons but has some implementation challenges. I have seen beacons used successfully in similar use cases like automatic workstation locking, contact tracing, virtual tethering of demo phones, and convention audience counting.
BLE has a range of about 30-40 meters, longer with clear line of sight. If the Android devices is moved from one vehicle to another that are within 40 meters of each other, the original beacon will probably still be visible.
You may be able to address the above issue with a "closest beacon" strategy, meaning that you consider whatever is seen as closest beacon above a certain signal threshold to be the vehicle the device is on or in.
If you use a battery-powered beacon, you can mount it anywhere, but battery life will typically be limited to a year or less.
A plugged-in beacon will never run out of power, but requires a USB supply, and AC outlet, or a DC supply like a car cigarette lighter port. This limits where you can hide it.
As you mention, there are other solutions aside from BLE like physical tether. But it is not inappropriate to consider BLE as it is widely used for similar proximity measurement applications.
QUESTION
I am trying to get filtered RSSI values of each BLE beacon using Kalman filtering. I cannot use a single instance of kalman filtering on all BLE devices, how to map or assign a instance of kalman filter for each BLE device. I know it has something to do with maps but cannot figure out how to implement it. Any help would be much appreciated.
...ANSWER
Answered 2021-Dec-06 at 06:30I don't think map
is the correct solution for this problem. An instance of the filter stored in a dictionary and keyed by the device address would seem a better solution. For example:
QUESTION
I use the bluepy
module to connect to an Arduino board with BLE running a battery monitor.
My Python script is working perfectly fine. I get the values I expect. But I do not like the solution because the binary value read from the characteristic is interpreted as an ASCII character before getting the decimal representation of that ASCII character.
I tried to use the binascii module
...ANSWER
Answered 2021-Aug-26 at 14:22The characteristic read is returning bytes e.g b'/'
. If you want to convert that into an integer then the int.from_bytes()
functionality is useful. e.g:
QUESTION
Is it possible to connect to a bluetooth device that supports Bluetooth 4.0 LE but has a password.
I can connect to the device from an iphone and print (which only supports BTLE) but when I try and connect from chrome (OSX) / web-bluetooth it does not prompt me for a password. I can return a device using:
...ANSWER
Answered 2021-Jul-27 at 18:17Can you get device.gatt.connect()
to resolve on Android?
Your best bet to solve your issue would be to file a Chromium bug by following instructions at https://www.chromium.org/developers/how-tos/file-web-bluetooth-bugs
QUESTION
I have a Bluetooth LE scan running which filters for specific Devices. This works fine and I see that the devices get actually added to my list.
But it doesn't trigger anything on my MainActivity
.
Here is a snipped from the relevant code (it does work similar to a normal scanCallback from BTLE):
ANSWER
Answered 2021-Apr-15 at 09:18you need use param MutableState>
, not MutableList
- xxx.value
.
QUESTION
I'm trying to read data from the BTLE fitness machine service, specifically the Indoor Bike Data characteristic.
A typical reading I'm getting has the bytes 44-02-9c-09-5c-00-4f-00-50
. The first two are flags which indicate that the rest of the bytes represent, in order:
- Instantaneous cadence (
uint16
) - Instantaneous power (
sint16
) - Heart rate (
uint8
)
The trouble is, that only accounts for 5 more bytes, but there are 7 more bytes in the value. It looks like 5c-00
is cadence, 00-4f
is power, and 50
is heart rate, but
- I don't know what the
9c-09
represents, but more importantly, - I don't know how to reliably read this characteristic if it's going to send me data that the flags field says is not present.
What do I need to do to parse these bytes correctly? In this specific case I could maybe skip those two bytes, but that won't be reliable over different device manufacturers.
Update: FWIW I don't think it was correct to mark this as a duplicate. I was able to parse the bytes, the problem was that the result appeared to contradict the fitness machine spec. The accepted answer clarified that.
...ANSWER
Answered 2021-Feb-18 at 02:56The 9c-09
value is instantaneous speed, which is present (counterintuitively) if the first flag bit is 0. See Fitness Machine Service spec, section 4.9.1.1.
QUESTION
I am collecting pressure sensor data from 4 Arduino Nano 33 ble to a raspberry pi 4. I am able to receive the data from all the sensors. Now, I want to send this received data to another Raspberry Pi 4 using BLE communication in real-time such that the first Raspberry Pi acts as a repeater. I searched but could not find a suitable approach or solution to implement this. The first Raspberry Pi could act as a peripheral/client sending all the received sensor data and the second raspberry pi could act as a central/server to receive all the sensor data which can be further displayed on web interfaces or stored in a database.
I tried connecting initially with one Arduino and sending its data over raspberry Pi. I have written the code for Raspberry Pi Client and Server using Bluedot library in Python.
Raspberry Pi 4 Client code
...ANSWER
Answered 2021-Feb-01 at 15:59Found the solution.
Create the client once outside the while loop and then the data transfer happens.
updated loop function.
QUESTION
I (like others) have multiple disconnects between a RPi4 central(client) and ESP32 BLE peripheral(server). Using the "nRF Connect" app on a android phone, the connection to the ESP32 is robust. However, RPi4 - ESP32 BLE communication is VERY unstable. This finding implies the fault is with the RPi and/or code. The initial BLE connection occurs faithfully but the connection inevitably drops after a random number of successful reads (usually 1-50 reads). I am using BluePy 1.3.0 with a new Raspbian image on a RPI4. I attached skeleton code and the error message produced after a random number of successful Reads.
...ANSWER
Answered 2020-Dec-19 at 15:34There are a large number of things it could be but there a couple areas that I would investigate.
Firstly there is a bit churn going on with Bluetooth firmware on the RPi at the moment as you can see from this thread: https://github.com/RPi-Distro/firmware-nonfree/issues/8
So I would check that you are up to date with with those.
BluePy I believe has a bluepy-helper
module which is based on Bluez version 5.47 which is behind what the RPi is using now. Might be worth trying a different library to see if the issue persists.
Here is an example of reading your characteristic with the BlueZ D-Bus API directly using pydbus for the python D-Bus bindings:
QUESTION
I am trying to send realtime data from a sensor through flask to the front-end through jquery. Right now my script uses setInterval(..., 1000);
to update the data through a ajax request.
However, I would like to update the jquery request when new sensordata is received from flask, as the framerate from the sensor differ and its hard to set a specific interval to make it realtime.
Is it possible to use some kind of signal in the jquery code when new data is sent through @app.route('/data')
?
Python script:
...ANSWER
Answered 2020-Dec-15 at 11:27For realtime data, use 'text/event-stream' MIME type
return Response(generate_random_data(), mimetype='text/event-stream')
or yield a server-side event (i used this type with the below snippet)
Here is part of a front-end snippet i used:
QUESTION
When doing Bluetooth communications one is often placed in a situation where one does a call which gets a response in a delegate, for example the characteristic discovery shown below:
...ANSWER
Answered 2020-Sep-07 at 22:23First of all, if you already have an implementation with CountDownLatch for Android, you may just do the same implementation for iOS. Yes, Swift doesn't have a built-in CountDownLatch
, but nice folks from Uber created a good implementation.
Another option is to rely on a variable, like you do, but make it atomic. There are various implementations available online, including one in the same Uber library. Another example is in RxSwift library. There are many other variations. Atomic variable will provide a thread-safety to variable's read/write operations.
But probably the most swifty way is to have a DispatchGroup. Will look something like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install BTLE
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page