<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to activate LongRange using PlatformIO/Arduino/Bluefruit</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119329/how-to-activate-longrange-using-platformio-arduino-bluefruit</link><description>I would really like to use Bluefruit and make a Long Range connection between Servers and my Central. I know that it is not build in Bluefruit by default, but there must be a way to get that done. Who can help me what to change to get Long Range to work</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 05 Mar 2025 13:42:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119329/how-to-activate-longrange-using-platformio-arduino-bluefruit" /><item><title>RE: How to activate LongRange using PlatformIO/Arduino/Bluefruit</title><link>https://devzone.nordicsemi.com/thread/525996?ContentTypeID=1</link><pubDate>Wed, 05 Mar 2025 13:42:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:372c91db-5abe-4d09-9b7f-bf7af09c9d2c</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Dirk,&amp;nbsp;&lt;br /&gt;It&amp;#39;s been a while I haven&amp;#39;t looked into this. Please try to do some search for CODED PHY in nRF5 SDK on google, you should be able to find the example.&amp;nbsp;&lt;br /&gt;For example:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/90781/nrf52833-coded-phy"&gt;devzone.nordicsemi.com/.../nrf52833-coded-phy&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to activate LongRange using PlatformIO/Arduino/Bluefruit</title><link>https://devzone.nordicsemi.com/thread/525991?ContentTypeID=1</link><pubDate>Wed, 05 Mar 2025 13:29:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bdcb1ea-50ce-4413-a471-bf0019ceeaac</guid><dc:creator>DJ de Haan</dc:creator><description>&lt;p&gt;Thanks Hung, that example is what I am looking for. I see the diff file, guess the b-variant is the good variant? Do you have a reference to the full version of blynky Peripheral and central?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to activate LongRange using PlatformIO/Arduino/Bluefruit</title><link>https://devzone.nordicsemi.com/thread/525958?ContentTypeID=1</link><pubDate>Wed, 05 Mar 2025 11:53:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97351cef-c59b-4b23-83ee-114658e3a401</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Dirk,&amp;nbsp;&lt;br /&gt;Please be aware that to be able to do CODED PHY advertising you need Extended Advertising. I am not sure if the library&amp;nbsp; you have support that.&amp;nbsp;&lt;br /&gt;You can take a look here:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/75549/coded-phy-for-blinky-peripheral-and-central"&gt;Coded PHY for blinky peripheral and central&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to activate LongRange using PlatformIO/Arduino/Bluefruit</title><link>https://devzone.nordicsemi.com/thread/525600?ContentTypeID=1</link><pubDate>Mon, 03 Mar 2025 20:19:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c8fc7a0-173d-433e-ab2c-343c4cda01b5</guid><dc:creator>DJ de Haan</dc:creator><description>&lt;p&gt;Thanks for the update. I succeeded in setting CODED PHY after a connection is set up. If you try too early, it raises an error. Also you must change the 2 len parameters in bluefruit.h:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;in bluefruit.cpp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;#160; _sd_cfg.prph.mtu_max &amp;#160; &amp;#160; = BLE_GATT_ATT_MTU_DEFAULT;
&amp;#160; _sd_cfg.prph.event_len &amp;#160; = BLE_GAP_EVENT_LENGTH_CODED_PHY_MIN; //BLE_GAP_EVENT_LENGTH_DEFAULT;
&amp;#160; _sd_cfg.prph.hvn_qsize &amp;#160; = BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT;
&amp;#160; _sd_cfg.prph.wrcmd_qsize = BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT;

&amp;#160; _sd_cfg.central.mtu_max &amp;#160; &amp;#160; = BLE_GATT_ATT_MTU_DEFAULT;
&amp;#160; _sd_cfg.central.event_len &amp;#160; = BLE_GAP_EVENT_LENGTH_CODED_PHY_MIN; //BLE_GAP_EVENT_LENGTH_DEFAULT;
&amp;#160; _sd_cfg.central.hvn_qsize &amp;#160; = BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT;
&amp;#160; _sd_cfg.central.wrcmd_qsize = BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I am not able to have devices advertise, scan or connect in CODED PHY using Bluefruit lib, unfortunately. I tried the academy, but that is based on the Zephyr SDK, and that is all all new. And buggy (got strange errors compiling samples). Too complex for now.&amp;nbsp;&lt;/p&gt;
&lt;div id="gtx-anchor" style="height:13.6364px;left:14.6591px;position:absolute;top:74.5312px;width:125.773px;"&gt;&lt;/div&gt;
&lt;div class="jfk-bubble gtx-bubble" style="left:63px;top:99px;"&gt;
&lt;div id="bubble-3" class="jfk-bubble-content-id"&gt;
&lt;div id="gtx-host" style="max-width:400px;"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="jfk-bubble-closebtn-id jfk-bubble-closebtn"&gt;&lt;/div&gt;
&lt;div class="jfk-bubble-arrow-id jfk-bubble-arrow jfk-bubble-arrowup" style="left:69.6619px;"&gt;
&lt;div class="jfk-bubble-arrowimplbefore"&gt;&lt;/div&gt;
&lt;div class="jfk-bubble-arrowimplafter"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to activate LongRange using PlatformIO/Arduino/Bluefruit</title><link>https://devzone.nordicsemi.com/thread/524866?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2025 15:10:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9820126-c873-457a-8986-d5e1e52f5633</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry I didn&amp;#39;t notice that you receive error 19 ( NRF_ERROR_RESOURCES) when calling&amp;nbsp;sd_ble_gap_phy_update()&lt;br /&gt;I checked the function and don&amp;#39;t see that error in the&amp;nbsp;possible list of error when calling that function:&amp;nbsp;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**@brief Initiate or respond to a PHY Update Procedure
 *
 * @details   This function is used to initiate or respond to a PHY Update Procedure. It will always
 *            generate a @ref BLE_GAP_EVT_PHY_UPDATE event if successfully executed.
 *            If this function is used to initiate a PHY Update procedure and the only option
 *            provided in @ref ble_gap_phys_t::tx_phys and @ref ble_gap_phys_t::rx_phys is the
 *            currently active PHYs in the respective directions, the SoftDevice will generate a
 *            @ref BLE_GAP_EVT_PHY_UPDATE with the current PHYs set and will not initiate the
 *            procedure in the Link Layer.
 *
 *            If @ref ble_gap_phys_t::tx_phys or @ref ble_gap_phys_t::rx_phys is @ref BLE_GAP_PHY_AUTO,
 *            then the stack will select PHYs based on the peer&amp;#39;s PHY preferences and the local link
 *            configuration. The PHY Update procedure will for this case result in a PHY combination
 *            that respects the time constraints configured with @ref sd_ble_cfg_set and the current
 *            link layer data length.
 *
 *            When acting as a central, the SoftDevice will select the fastest common PHY in each direction.
 *
 *            If the peer does not support the PHY Update Procedure, then the resulting
 *            @ref BLE_GAP_EVT_PHY_UPDATE event will have a status set to
 *            @ref BLE_HCI_UNSUPPORTED_REMOTE_FEATURE.
 *
 *            If the PHY Update procedure was rejected by the peer due to a procedure collision, the status
 *            will be @ref BLE_HCI_STATUS_CODE_LMP_ERROR_TRANSACTION_COLLISION or
 *            @ref BLE_HCI_DIFFERENT_TRANSACTION_COLLISION.
 *            If the peer responds to the PHY Update procedure with invalid parameters, the status
 *            will be @ref BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS.
 *            If the PHY Update procedure was rejected by the peer for a different reason, the status will
 *            contain the reason as specified by the peer.
 *
 * @events
 * @event{@ref BLE_GAP_EVT_PHY_UPDATE, Result of the PHY Update Procedure.}
 * @endevents
 *
 * @mscs
 * @mmsc{@ref BLE_GAP_CENTRAL_PHY_UPDATE}
 * @mmsc{@ref BLE_GAP_PERIPHERAL_PHY_UPDATE}
 * @endmscs
 *
 * @param[in] conn_handle   Connection handle to indicate the connection for which the PHY Update is requested.
 * @param[in] p_gap_phys    Pointer to PHY structure.
 *
 * @retval ::NRF_SUCCESS Successfully requested a PHY Update.
 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
 * @retval ::NRF_ERROR_NOT_SUPPORTED Unsupported PHYs supplied to the call.
 * @retval ::NRF_ERROR_INVALID_STATE No link has been established.
 * @retval ::NRF_ERROR_BUSY Procedure is already in progress or not allowed at this time. Process pending events and wait for the pending procedure to complete and retry.
 *
 */
SVCALL(SD_BLE_GAP_PHY_UPDATE, uint32_t, sd_ble_gap_phy_update(uint16_t conn_handle, ble_gap_phys_t const *p_gap_phys));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So it&amp;#39;s quite strange that you are seeing that. Have you tried to change to request 1Mbps instead of Coded PHY to see if you get the same error.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I don&amp;#39;t see a problem if the peripheral send the request to switch to CODED PHY. The question is if the central support CODED PHY and accept switching to CODED PHY.&amp;nbsp;&lt;br /&gt;But you first need to check why error 19 is returned.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;My suggestion is to get started with a DK and you can start with nRF Connect SDK . It &amp;#39;s a much updated platform and&amp;nbsp;from my point of view much easier to get started with.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;We have this Dev Academy here that you can follow along: &lt;a href="https://academy.nordicsemi.com/"&gt;academy.nordicsemi.com/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to activate LongRange using PlatformIO/Arduino/Bluefruit</title><link>https://devzone.nordicsemi.com/thread/524810?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2025 13:00:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5060b22-d47e-4970-b061-da75b55a171b</guid><dc:creator>DJ de Haan</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;Thanks for your reply. It looks indeed like the Bluefruit API is build on NRF5 SDK, but in the Bluefruit sources I cannot find the SDK headers (only few I can find). In above example, the central is requesting to switch to CODED PHY. &lt;strong&gt;Is that wrong, should the peripheral request CODED PHY?&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am not using a default Bluefruit device, I am using an&amp;nbsp;&lt;span&gt;EBYTE E73-2G4M08S1CX (with the nRF52840 inside), have added a crystal and load bootloader Bluefruit + Softdevice&amp;nbsp; &amp;nbsp;feather_nrf52840_sense_bootloader-0.9.2_s140_6.1.1.hex. That works fine on all examples with Bluefruit.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I will try the sniffer, good idea!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to activate LongRange using PlatformIO/Arduino/Bluefruit</title><link>https://devzone.nordicsemi.com/thread/524808?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2025 12:48:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93b5a4a5-08bf-4183-8993-1a095771b881</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Dirk,&amp;nbsp;&lt;br /&gt;I&amp;#39;m not so familiar with the&amp;nbsp;Bluefruit board and the Adafruit ecosystem. But can you tell which SDK you are developing on ?&amp;nbsp;&lt;br /&gt;From what you provided in the code, it seems it&amp;#39;s NRF5 SDK?&amp;nbsp;&lt;br /&gt;Note that when you call&amp;nbsp;sd_ble_gap_phy_update() as a peripheral, it can only request the central to switch PHY. If the central doesn&amp;#39;t want to switch PHY you will not be able to update to CODED PHY.&amp;nbsp;&lt;br /&gt;Please try using a &lt;a href="https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-6-bluetooth-le-sniffer/"&gt;nRF sniffer&lt;/a&gt; to check if the request is actually sent.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>