<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Bluetooth Low Energy (BLE) Security via Encryption]]></title><description><![CDATA[<p dir="auto">Are there any plans to expand the Bluetooth Low Energy APIs to include pairing with authentication and encryption? Most of my experience is using BLE as-is. Can the ESP32 support more secure BLE data transfers?</p>
<p dir="auto"><strong>References</strong></p>
<ul>
<li><a href="https://github.com/espressif/esp-idf/blob/17e8d49/examples/bluetooth/gatt_security_client/tutorial/Gatt_Security_Client_Example_Walkthrough.md" target="_blank" rel="noopener noreferrer nofollow">https://github.com/espressif/esp-idf/blob/17e8d49/examples/bluetooth/gatt_security_client/tutorial/Gatt_Security_Client_Example_Walkthrough.md</a></li>
<li><a href="https://eewiki.net/display/Wireless/A+Basic+Introduction+to+BLE+Security" target="_blank" rel="noopener noreferrer nofollow">https://eewiki.net/display/Wireless/A+Basic+Introduction+to+BLE+Security</a></li>
<li><a href="https://duo.com/decipher/understanding-bluetooth-security" target="_blank" rel="noopener noreferrer nofollow">https://duo.com/decipher/understanding-bluetooth-security</a></li>
</ul>
]]></description><link>https://forum.pycom.io/topic/2780/bluetooth-low-energy-ble-security-via-encryption</link><generator>RSS for Node</generator><lastBuildDate>Mon, 09 Mar 2026 02:21:41 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/2780.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Mar 2018 20:20:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bluetooth Low Energy (BLE) Security via Encryption on Mon, 09 Apr 2018 23:38:19 GMT]]></title><description><![CDATA[<p dir="auto">Are there any plans to expand the Bluetooth Low Energy APIs to include pairing with authentication and encryption? Most of my experience is using BLE as-is. Can the ESP32 support more secure BLE data transfers?</p>
<p dir="auto"><strong>References</strong></p>
<ul>
<li><a href="https://github.com/espressif/esp-idf/blob/17e8d49/examples/bluetooth/gatt_security_client/tutorial/Gatt_Security_Client_Example_Walkthrough.md" target="_blank" rel="noopener noreferrer nofollow">https://github.com/espressif/esp-idf/blob/17e8d49/examples/bluetooth/gatt_security_client/tutorial/Gatt_Security_Client_Example_Walkthrough.md</a></li>
<li><a href="https://eewiki.net/display/Wireless/A+Basic+Introduction+to+BLE+Security" target="_blank" rel="noopener noreferrer nofollow">https://eewiki.net/display/Wireless/A+Basic+Introduction+to+BLE+Security</a></li>
<li><a href="https://duo.com/decipher/understanding-bluetooth-security" target="_blank" rel="noopener noreferrer nofollow">https://duo.com/decipher/understanding-bluetooth-security</a></li>
</ul>
]]></description><link>https://forum.pycom.io/post/16730</link><guid isPermaLink="true">https://forum.pycom.io/post/16730</guid><dc:creator><![CDATA[semireg]]></dc:creator><pubDate>Mon, 09 Apr 2018 23:38:19 GMT</pubDate></item><item><title><![CDATA[Reply to Bluetooth Low Energy (BLE) Security via Encryption on Mon, 05 Mar 2018 22:22:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/2175">@semireg</a><br />
The ESP32 and ESP-IDF support this it just hasnt’t been brought into Python yet. It is planned to be but I can’t offer an ETA.</p>
]]></description><link>https://forum.pycom.io/post/16734</link><guid isPermaLink="true">https://forum.pycom.io/post/16734</guid><dc:creator><![CDATA[jmarcelino]]></dc:creator><pubDate>Mon, 05 Mar 2018 22:22:16 GMT</pubDate></item><item><title><![CDATA[Reply to Bluetooth Low Energy (BLE) Security via Encryption on Wed, 11 Apr 2018 00:05:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/212">@jmarcelino</a>, I'm beginning to work on this. Quick question about the C toolchain...</p>
<p dir="auto">The function esp_ble_gap_set_security_param is within <a href="https://github.com/espressif/esp-idf/blob/393f3da37cee49c4658cee7d12a5536462099cb4/components/bt/bluedroid/api/include/esp_gap_ble_api.h" target="_blank" rel="noopener noreferrer nofollow">esp_gap_ble_api.h</a> but is gated by <code>#if (SMP_INCLUDED == TRUE)</code>.</p>
<p dir="auto">The only reference I see is in <code>esp32/build/WIPY/release/genhdr/qstr.i.last</code> which is obviously generated and looks like:</p>
<pre><code>#define BTC_PRF_QUEUE_INCLUDED FALSE
#define BTC_GAP_BT_INCLUDED FALSE
#define BTC_AV_INCLUDED FALSE




#define GATTS_INCLUDED TRUE





#define GATTC_INCLUDED TRUE
# 108 &quot;/home/user/pycom/pycom-esp-idf/components/bt/bluedroid/include/bt_target.h&quot;
#define SMP_INCLUDED FALSE
#define BLE_PRIVACY_SPT FALSE



#define MAX_ACL_CONNECTIONS CONFIG_BT_ACL_CONNECTIONS
#define GATT_MAX_PHY_CHANNEL CONFIG_BT_ACL_CONNECTIONS
</code></pre>
<p dir="auto">I also noticed that sdkconfig.h contains references to options such as <code>#define CONFIG_GATTC_ENABLE 1</code> but also reads <code>Automatically generated file; DO NOT EDIT.</code>.</p>
<p dir="auto">Can you offer any pointers on how to familiarize myself with the toolchain to enable the use of <code>esp_ble_gap_set_security_param</code>?</p>
<p dir="auto"><strong>Update 1</strong><br />
The dir <code>pycom-esp-idf</code> (ESP-IDF SDK) file <code>components/bt/bluedroid/include/bt_target.h</code> contains:</p>
<pre><code>#if (CONFIG_SMP_ENABLE)
#define SMP_INCLUDED              TRUE
#define BLE_PRIVACY_SPT           TRUE
#else
#define SMP_INCLUDED              FALSE
#define BLE_PRIVACY_SPT           FALSE
#endif  /* CONFIG_GATTC_ENABLE */
</code></pre>
<p dir="auto">Interestingly, <a href="https://community.platformio.org/t/espressif32-example-issues-cant-find-sdkconfig-h/1379/6" target="_blank" rel="noopener noreferrer nofollow">this thread</a> describes the relationships as:</p>
<blockquote>
<p dir="auto">The sdkconfig.h file is generated from the ESP32 environment. Assuming platformio wasn’t present, one would download the ESP-IDF SDK and then download an application template (both from Github). One would then run the make command to build a tool …<br />
<code>make menuconfig</code><br />
When run, this produces a terminal based application which shows menus for the configuration of an ESP32 environment. This contains a wealth of options and it is extremely common to modify these options on a project by project basis. For example, one can describe that one wants Bluetooth or WiFi or change the baud rate for upload or change the diagnostics logging levels. Once the tool has been run, a file called “sdkconfig” is generated which contains your saved settings. In addition, a file called “sdkconfig,h” is built which is the missing file needed for ESP32 ESP-IDF application compilation.</p>
</blockquote>
<p dir="auto">That said, it seems that for now it's safe to edit <strong>sdkconfig.h</strong> and add <code>#define CONFIG_SMP_ENABLE=1</code>. Running <code>make clean; make</code> regenerated <strong>build/WIPY/release/genhdr/qstr.i.last</strong> and tried to build the source but references to <code>esp_ble_gap_set_security_param</code> still create an undefined reference error when linking. Frustrating...</p>
<p dir="auto"><strong>Update 2</strong><br />
The lib/libbt.a that ships with pycom-micropython-sigfox isn't rebuilt from the ESP-IDF SDK. The symbols can be verified using <code>nm lib/libbt.a | grep esp_ble_gap_set_security_param</code>. If this symbol is missing then the result will be &quot;undefined reference&quot; when linking (above).</p>
<p dir="auto">One way to work-around this is to cd to <code>pycom-esp-idf/examples/bluetooth/gatt_security_server/</code> and run <strong>make</strong>. The resulting <code>build/bt/libbt.a</code> can be copied to <code>pycom-micropython-sigfox/esp32/lib/</code> and with that the build should succeed. The next step is to figure out how to setup the PyCom toolchain so that this process can be repeated within a &quot;normal&quot; build.</p>
]]></description><link>https://forum.pycom.io/post/18279</link><guid isPermaLink="true">https://forum.pycom.io/post/18279</guid><dc:creator><![CDATA[semireg]]></dc:creator><pubDate>Wed, 11 Apr 2018 00:05:31 GMT</pubDate></item><item><title><![CDATA[Reply to Bluetooth Low Energy (BLE) Security via Encryption on Wed, 11 Apr 2018 19:23:20 GMT]]></title><description><![CDATA[<p dir="auto">While implementing &quot;pairing failure reasons&quot; I came across a minor documentation issue upstream: <a href="https://github.com/espressif/esp-idf/issues/1845" target="_blank" rel="noopener noreferrer nofollow">https://github.com/espressif/esp-idf/issues/1845</a></p>
]]></description><link>https://forum.pycom.io/post/18346</link><guid isPermaLink="true">https://forum.pycom.io/post/18346</guid><dc:creator><![CDATA[semireg]]></dc:creator><pubDate>Wed, 11 Apr 2018 19:23:20 GMT</pubDate></item><item><title><![CDATA[Reply to Bluetooth Low Energy (BLE) Security via Encryption on Thu, 12 Apr 2018 17:38:36 GMT]]></title><description><![CDATA[<p dir="auto">My work so far looks promising. I'm able to assign characteristic properties that include encryption and iOS/MacOS/Android devices show the pairing prompt when the characteristic is accessed. The issue that I'm currently facing is a very short timeout that makes it impossible to enter the key. I've <a href="https://github.com/espressif/esp-idf/issues/1851" target="_blank" rel="noopener noreferrer nofollow">logged an issue</a> with the ESP-IDF project to see if they have any ideas.</p>
]]></description><link>https://forum.pycom.io/post/18416</link><guid isPermaLink="true">https://forum.pycom.io/post/18416</guid><dc:creator><![CDATA[semireg]]></dc:creator><pubDate>Thu, 12 Apr 2018 17:38:36 GMT</pubDate></item><item><title><![CDATA[Reply to Bluetooth Low Energy (BLE) Security via Encryption on Sat, 19 Feb 2022 18:21:26 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/212">@jmarcelino</a>, do you know if this is already available in any Pycom's firmware?</p>
]]></description><link>https://forum.pycom.io/post/39895</link><guid isPermaLink="true">https://forum.pycom.io/post/39895</guid><dc:creator><![CDATA[nestorld]]></dc:creator><pubDate>Sat, 19 Feb 2022 18:21:26 GMT</pubDate></item></channel></rss>