Open hathach opened 6 years ago
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.
@lefedor nrf52840 is coming to Adafruit store soon enough :D
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.
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.
Acknowledged. Will let you know what I find out.
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)this feature will help in my project alot. Thanks
@mharper thank you very much for your findings. I will do some simple tests here, but currently occupied by usb work.
any chance of progress here? thanks
@jps2000 no ETA
Sorry, folks. I was able to solve my problem by cranking up the tx power, so I haven't revisited this.
@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.
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?
The feature is not yet implemented.
@ApoorvaSheth the answer is above, if you post spam or nags again, you will get blocked
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.
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!
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.
@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
@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!
@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.
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
Is there any example code for read/write characteristics with Coded PHY enabled via arduino IDE?
Anyone tried to test this on iOS 15?
Has the Coded PHY feature been implemented?
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