Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth 5 Long Range support #82

Open
hathach opened this issue Oct 10, 2017 · 25 comments
Open

Bluetooth 5 Long Range support #82

hathach opened this issue Oct 10, 2017 · 25 comments
Milestone

Comments

@hathach
Copy link
Member

hathach commented Oct 10, 2017

ref https://www.nordicsemi.com/eng/Products/Bluetooth-5
ref https://www.novelbits.io/bluetooth-5-speed-maximum-throughput/

Update 1: iOS 13.4 could enable long range feature on compatible device https://www.reddit.com/r/iOSBeta/comments/fcww2x/feature_ios_134_beta_enables_ble_long_range/

Update 2: advertising on Coded PHY https://devzone.nordicsemi.com/f/nordic-q-a/49799/issue-regarding-nrf52840-long-range-mode

Update 3: SDK example is ble_app_att_mtu_throughput

Update 4: nRF Connect App on Android support seem to support Long Range already !!

Update : list of mobile device that is known to support Long Range, source
https://devzone.nordicsemi.com/f/nordic-q-a/33060/is-there-any-smartphone-with-supporting-of-bluetooth-5-long-range-feature/221305#221305

Apple Iphone XS
Apple Iphone XS MAX
Apple Iphone XR
Apple Iphone 11
Apple Iphone 11 PRO
Apple Iphone 11 PRO MAX

Samsung Galaxy S10
Samsung Galaxy S10E
Samsung Galaxy S10+
Samsung Galaxy Note 10
Samsung Galaxy Note 10 PLUS
Samsung Galaxy Fold 

OnePlus 6
OnePlus 7 
OnePlus 7 PRO

Google Pixel 4 XL 
Google Pixel 4 

Huawei P30
Huawei P30 Pro
Huawei Mate 20
Huawei Mate 20 Pro

Edit:

Xiaomi Mi 9
@hathach hathach added this to the 1.0.0 milestone Oct 10, 2017
@hathach hathach added this to TODO in Next Release Oct 10, 2017
@lefedor
Copy link

lefedor commented Jun 27, 2018

https://www.nordicsemi.com/eng/Products/Bluetooth-5
Have interest in this myself.
Want mention that long range is not in the nRF52832 feature list, only for the nRF52840.

@hathach
Copy link
Member Author

hathach commented Jul 12, 2018

@lefedor nrf52840 is coming to Adafruit store soon enough :D

@mharper
Copy link
Contributor

mharper commented Jan 24, 2019

I have a relatively immediate need for this feature and have a nRF52840 Feather landing here in a few days. @hathach if you can give me a vector or two on how to implement this, I can do it.

@hathach
Copy link
Member Author

hathach commented Jan 24, 2019

This is new to me as well, you need to dive into Nordic docs and code to get it work. Please let us know what you figure out.

@mharper
Copy link
Contributor

mharper commented Jan 24, 2019

Acknowledged. Will let you know what I find out.

@mharper
Copy link
Contributor

mharper commented Jan 29, 2019

Based on what I've pieced together so far, the best example of how to do this is in the nRF SDK example found here:

examples/ble_central_and_peripheral/experimental/ble_app_att_mtu_throughput

Relevant struct: ble_gap_phys_t
Therein lie: tx_phys and rx_phys. The value to use there for extended range appears to be BLE_GAP_PHY_CODED.
Relevant API call: sd_ble_gap_phy_update

So in the context of bluefruit.cpp, I imagine the call might look like this to set the PHY:

bool AdafruitBluefruit::setPhy(int8_t phy) {
  ble_gap_phys_t phys;
  phys.tx_phys = phy;
  phys.rx_phys = phy;
  VERIFY_STATUS( sd_ble_gap_phy_update(_conn_hdl, &phys), false );
  return true;
}

Enabling extended range would then look like:

Bluefruit.setPhy(BLE_GAP_PHY_CODED);

You can set the PHY to any one of:

  • BLE_GAP_PHY_AUTO
  • BLE_GAP_PHY_1MBPS
  • BLE_GAP_PHY_2MBPS
  • BLE_GAP_PHY_CODED (nRF52840 only)

@syed93uthman
Copy link

this feature will help in my project alot. Thanks

@hathach
Copy link
Member Author

hathach commented Apr 11, 2019

@mharper thank you very much for your findings. I will do some simple tests here, but currently occupied by usb work.

@jps2000
Copy link

jps2000 commented Jul 5, 2019

any chance of progress here?
thanks

@ladyada
Copy link
Member

ladyada commented Jul 7, 2019

@jps2000 no ETA

@mharper
Copy link
Contributor

mharper commented Jul 7, 2019

Sorry, folks. I was able to solve my problem by cranking up the tx power, so I haven't revisited this.

@hathach
Copy link
Member Author

hathach commented Jul 7, 2019

@mharper you have nothing to sorry about 😉😉. We are busy with usb as well. Also long range need a bit of field testing imho. We are in no hurry, still lots of other work to do.

@ApoorvaSheth
Copy link

I want to test the long range of Adafruit nRF52840 express feather(BLE 5.0) board. I did the setup on arduino IDE. My question is can I perform the long range test of BLE using an arduino ide on adafruit nRF52840 express feather board?

@hathach
Copy link
Member Author

hathach commented Nov 25, 2019

The feature is not yet implemented.

@adafruit adafruit deleted a comment from ApoorvaSheth Nov 27, 2019
@adafruit adafruit deleted a comment from ApoorvaSheth Nov 27, 2019
@ladyada
Copy link
Member

ladyada commented Nov 27, 2019

@ApoorvaSheth the answer is above, if you post spam or nags again, you will get blocked

@adafruit adafruit deleted a comment from ApoorvaSheth Nov 27, 2019
@orhanyor
Copy link

orhanyor commented Feb 6, 2020

this would be a good addition, i was looking how to add pa lna to 52840s to improve the range but long range support might be a better and neater solution.

@path9263
Copy link

I am curious if someone can roughly outline what else is required to get this working. I have some time to try get it going but am unsure where to start. Thanks!

@hathach
Copy link
Member Author

hathach commented Apr 29, 2020

I am curious if someone can roughly outline what else is required to get this working. I have some time to try get it going but am unsure where to start. Thanks!

You probably need to advertise and connect using CODED PHY, check out articles in my 1st post, nordic devzone and sdk are a good source of reference.

@vladkozlov69
Copy link

@path9263 you can find some ideas in my fork where I added some very basic implementation for long range, see https://github.com/vladkozlov69/Adafruit_nRF52_Arduino/pull/17/commits

@path9263
Copy link

path9263 commented May 1, 2020

@vladkozlov69 thanks for that, very helpful. I feel like I am pretty close but I am wondering if you overcame the problem I am having. My central sees my peripheral advertising on Coded Phy and attempts to connect but the central fails and reports: bool BLECentral::connect(const ble_gap_addr_t*): 78: verify failed, error = NRF_ERROR_RESOURCES which seems to point to setting a larger value for _sd_cfg.central.event_len. Tried several values and not having any luck with that though, same error. I see you added uint32_t _ram_start; to bluefruit.h but couldn't find it used anywhere and am wondering if that has something to do with this. I do not get an error about SoftDevice config requires more SRAM though. Thanks!

@vladkozlov69
Copy link

@path9263 I had the similar issue with NRF_ERROR_RESOURCES, and when I increased the event_len, it has gone. Usually, Coded Phy requires bigger event_len than a regular connection.

@Colas-Lepoutre
Copy link

Hi,
I was wondering if there were any news about the long range feature. I basically only need to have a "setPhy" function in order to make the device advertise and connect using phy coded.
Is this something easily feasable ? Did you already get this working ?

Thanks in advance,
Colas LEPOUTRE

@gernot1972
Copy link

Is there any example code for read/write characteristics with Coded PHY enabled via arduino IDE?

@adafruit adafruit deleted a comment from iamcalledusman Mar 7, 2021
@maziarzamani
Copy link

Anyone tried to test this on iOS 15?

@bfribush
Copy link

Has the Coded PHY feature been implemented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Next Release
  
TODO
Development

No branches or pull requests