You can set the interval of Bluetooth Low Energy advertisement (20ms is the shortest).
Is there a way to advert one time only?
I tried stopping advertisement just after starting the advertisement but sometimes two advertisements are done.
I'm using bleno node.js library.
No there is no such thing even in the HCI protocol. You can maybe set a large advertising interval, start and then stop within this time.
Related
I am using BLE v4.1 for my application where I am able to transfer 200 packets of length 20 bytes each from peripheral to central side.
I want to transfer data via BLE and play some music while the data is being transferred. The music file is available locally and will be played on earphones(can be wired or wireless BlueTooth earphones)
I am facing an issue of packet drops around 15-20% when I am playing audio through wireless earphones while data is being transferred via BLE and audio is played on phone Bluetooth earphones(tried on Android and iOS, both) simultaneously.
With wired earphones connected; there is no issue, I can transfer data via BLE and play audio smoothly without any issue but things are different with wireless Bluetooth earphones case. I tried it with different Android phones(Android 11, different manufacturers) and different BlueTooth earphones, the issue still exists.
What could be a cause for the same and how can I debug it?
Bluetooth and Bluetooth Low Energy has only one radio that can only do one thing at a time. The connection events are scheduled and cannot overlap. This means the throughput is shared among all connected devices. You will get a higher throughput per device with only one connection than with two connections.
You will have to experiment with connection interval and connection event length to find parameters that seems to work, and test with multiple Bluetooth controllers (phones), since all have different scheduling algorithms.
I have a small BLE beacon which is configured to send iBeacon packets every 1000ms.
In my usecase i want to detect the signal on multiple recievers every time it is sent. However the detection is not reliable no matter which receiving device and software i use (phone, computer, raspberry). The signal is sometimes detected after 2 seconds, another time 5, 6 or whatever. It seems like there is no pattern behind it.
Also it seems that sometimes the signal is received on one receiver but not on the others while definetly being in range! Also the area i am testing in is not "problematic".
What could be the problem?
Not 100% of beacon packets transmitted are ever received. There are a number of reasons for this, including radio noise, packet collisions and channel hopping. That said, the typical detection rate in a quiet radio environment is around 90 percent.
If you are seeing a much lower rate than this on multiple receivers I would check the transmitter. First, use one of.your devices to transmit a software beacon (Android and iOS have free apps like Locate Beacon that do this.) If you get a higher detection rate with a different device transmitting, the issue may be your transmitter.
A few possible issues with it:
Bad antenna sending out a very weak signal. (Measure the received RSSI when you do get a detection and verify it is over -60 dBm)
Weak transmitter power setting. See if you can configure this higher.
Advertising on wrong channels
Advertising is stopped before packet can go out. Try to leave the advertiser on for at least 2x the transmission rate to ensure at least on packet gets out.
I assume you use a large enough scan window for your scan interval so your receiver radio is actually turned on most of the time.
You could try to send advertising packets of the type ADV_NONCONN_IND (non-connectable and no scan response packet). That way if the receiver radio scans with 100% duty it should see the packet.
Otherwise if you use normal ADV_IND packets, then at least Android always waits for the SCAN_RSP packet before it sends anything to the scanning app. But if the are multiple scanners nearby, your peripheral can only respond to a single scanner's SCAN_REQ for each advertising packet. To avoid collisions of SCAN_REQ packets in the air, Bluetooth controllers also back off if they don't get a SCAN_RSP in return. If you use a BLE sniffer you can see all three kinds of packets and what happens when you have multiple scanners nearby.
Read the BLE Link Layer part of the Bluetooth Core specification for more details.
I am pretty new to IoT and BLE. What I want to achieve is to write on GATT characteristic of at least 100 peripheral devices simultaneously or in a very short period of time(i.e. less than 100ms). Currently my peripherals are Ble nano (nRF51822) with custom GATT service running on them. I am using my Mac as central BLE. I am using Node.js and noble to implement the central. I want to know if such thing is possible at all and if possible, please link me to an example code. :)
You should note that Bluetooth chips for computers are usually (quite arbitrarily) limited to only a few simultaneous connections. Common values are between 3 and 14. Even if you connect a few at a time, send the characteristic value, disconnect and then connect next devices it would be impossible to do this within 100 ms. If you want to send the same data to everyone you should instead let your computer advertise and the nrf devices scan. That way you broadcast the data instead.
I have a BLE beacon that have some sensors embedded. This beacon should read every minutes all the sensors value and update the characteristics. These characteristics have theirs notifications enabled.
In the other side my phone should read these characteristics, analyze them and notify the user if something wrong.
The beacon has his own embedded RTC (real time clock) that trigger an interruption to inform the beacon that minute has passed and he should start reading sensors data and update characteristics values.
This beacon work on battery and I'm worried a lot about the power efficiency. The most things that i'm worried about is the antenna transmission and reception which consume a lot of power compared to the rest of the system.
So I'm looking for a method to save power. My idea is to limit the antenna transmission and let the antenna in inactive mode and only active it once per minute when the beacon should read the sensors value and update the characteristic value.
Is that possible to do that without loosing connection between the beacon and my phone. And how the phone know exactly when he should listen to the updated characteristic values.
For example if the beacon and the phone are working fine and exchanging data every minutes , in case I move away with my phone for example for 30 minutes and I come back did the connection reestablish automatically ??
in the actual situation when I move away from the beacon from my phone for 5 seconds or more I lose connection in both side.
Is there any communication method that save my beacon power consumption ?
My BLE beacon chip is the nrf51822.
All your suggestions/idea are welcomed.
Consider not creating a connection and instead make nrf51822 send the sensor data in ADVERTISE packets once every minute.
I couldn't find a clear explanation what is Bluetooth le multi advertising.
For example, in Specification of the Bluetooth System, I see only
description of BLE advertising but not multi advertising.
What the difference between BLE advertising and multi advertising?
Thanks
LE Multi advertising refers to a specific offload (non bluetooth specification) feature that has been implemented in the Android releases by Google, starting from the L release.
What multi advertising means is, that your Android phone or a device with Android stack, can enable multiple advertisement trains at the same time. For instance, one specific app can set certain advertisement data (example supported services etc.), advertisement parameters and enable advertisement, and so can N number of other apps, on the same device.
At the hardware level (or physical layer), these advertisement trains are interleaved between the three advertisement channels (37, 38, 39) and thus your phone behaves as multiple peripheral devices at the same time. All these advertisement trains also have a separate Random private address, so they are seen distinctly by the remote scanner.
Bluetooth Smart has two ways of communicating. The first one is using advertisements, where a BLE peripheral device broadcasts packets to every device around it. The receiving device can then act on this information or connect to receive more information. The second way to communicate is to receive packets using a connection, where both the peripheral and central send packets. We will focus on advertisement for several reasons:
You can’t create a connection between two devices without using advertisements. Defining the data and format of advertisement packets is usually the first thing you work on when developing a BLE device.
A large number of BLE products sleep most of the time, waking up only to advertise and connect when needed. This means advertisements have a big impact on power consumption.
Users want responsive products, and the advertising interval is critical in quick connections.
Advertising is by design unidirectional. A Central device can’t send any data to the Peripheral device without a connection. But a single peripheral can advertise to multiple masters in the area.
ref:http://www.argenox.com/bluetooth-low-energy-ble-v4-0-development/library/a-ble-advertising-primer/