<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Zen Zeni on Medium]]></title>
        <description><![CDATA[Stories by Zen Zeni on Medium]]></description>
        <link>https://medium.com/@zeni241?source=rss-4fa0c16e0917------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*R4xcge1fUqVCd99b.jpg</url>
            <title>Stories by Zen Zeni on Medium</title>
            <link>https://medium.com/@zeni241?source=rss-4fa0c16e0917------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 20:59:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zeni241/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[NimBLE with ESP32 for Dummies]]></title>
            <link>https://medium.com/@zeni241/nimble-with-esp32-for-dummies-6974613136b7?source=rss-4fa0c16e0917------2</link>
            <guid isPermaLink="false">https://medium.com/p/6974613136b7</guid>
            <category><![CDATA[bluetooth-nimble-esp32]]></category>
            <dc:creator><![CDATA[Zen Zeni]]></dc:creator>
            <pubDate>Fri, 11 Nov 2022 11:11:48 GMT</pubDate>
            <atom:updated>2022-11-11T11:24:50.036Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IHTUpnFsWzw4IOdlcQtnSA.jpeg" /></figure><p>BLE and WiFi are lifeline of IoT world.</p><p>NimBLE has much smaller heap and flash requirements as compared to Bluedroid.</p><p>Lets admit it, Espressif people has created examples of nimble in esp-idf documentation for <strong>martian only</strong> (or at least this is my impression).</p><p>I had hard time understanding nimble examples in esp-idf documentation and had to consult many other sources before I got there.</p><p>So I decided to write down this tutorial for my future reference.</p><p>I would be pleased if it could help any one. Everyone is free to comment and suggest improvement in it.</p><p>I have combined two examples in esp-idf documentation, “blephr” and “blehr”. I have also modified and simplified these examples to some extend for clear understanding.</p><p>I expect that you already have understanding of concept of GAP, GATT, services and characteristics. Here is a link where these concepts are explained very well. <a href="https://learn.adafruit.com/introduction-to-bluetooth-low-energy/introduction">https://learn.adafruit.com/introduction-to-bluetooth-low-energy/introduction</a> .</p><p>So as they always say, lets get started!</p><p>In this tutorial we will create one service and two characteristics of this service.</p><p>Client will be able read or write to the first characteristic. This characteristic is created only to show how to handle when client read or write to same characteristic.</p><p>In second characteristic we will learn to notify the client.</p><p>For this, first we will create UUIDs (for distinct identification) for each service and characteristics. As we are going to create custom service and characteristics so the UUIDs will be 128 bits.</p><p>Go to <a href="https://www.uuidgenerator.net/">https://www.uuidgenerator.net</a> and generate three 128 bit UUIDs in bulk, one for service and two for two characteristics. UUID will be of format (8–4–4–4–12). I have generated this UUID for service: b2bbc642–46da-11ed-b878–0242ac120002 .</p><p>To use these UUIDs in our code, we have to convert this HEX format UUID by reversing the order. The above UUID will become: 0x02, 0x00, 0x12, 0xac, 0x42, 0x02, 0x78, 0xb8, 0xed, 0x11, 0xda, 0x46, 0x42, 0xc6, 0xbb, 0xb2 . (quit a boring exercise.)</p><p>As we are planning to have two characteristics for this service, we will create two more UUIDs.</p><p>Characteristic 1 UUID: c9af9c76–46de-11ed-b878–0242ac120002</p><p>0x02, 0x00, 0x12, 0xac, 0x42, 0x02, 0x78, 0xb8, 0xed, 0x11, 0xde, 0x46, 0x76, 0x9c, 0xaf, 0xc9</p><p>Characteristic 2 UUID:94f85bd8–46e5–11ed-b878–0242ac120002</p><p>0x02, 0x00, 0x12, 0xac, 0x42, 0x02, 0x78, 0xb8, 0xed, 0x11, 0xe5, 0x46, 0xd8, 0x5b, 0xf8, 0x94</p><p>The rest I have explained in form of comments in the code.</p><p>You will find all the code in github repository bellow.</p><p><a href="https://github.com/Zeni241/ESP32-NimbleBLE-For-Dummies">GitHub - Zeni241/ESP32-NimbleBLE-For-Dummies: NimbleBLE for Dummies!!</a></p><p>Forgive me for over verbose comments and naming convention, but my emphasis is the clear explanation of what is happening in the code.</p><p>I hope my this attempt will get you started in use of nimble BLE. Later you would be able to go further on your own, Thanks.</p><p>Bellow are some very useful links for working with BLE.</p><p>chrome://bluetooth-internals/#adapter</p><p><a href="https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web">https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web</a> <a href="https://mynewt.apache.org/latest/network/index.html">https://mynewt.apache.org/latest/network/index.html</a> <a href="https://mynewt.apache.org/latest/tutorials/ble/bleprph/bleprph.html">https://mynewt.apache.org/latest/tutorials/ble/bleprph/bleprph.html</a> <a href="https://mynewt.apache.org/latest/network/ble_hs/ble_hs.html">https://mynewt.apache.org/latest/network/ble_hs/ble_hs.html</a> <a href="https://mynewt.apache.org/latest/network/ble_hs/ble_gatts.html">https://mynewt.apache.org/latest/network/ble_hs/ble_gatts.html</a> <a href="https://mynewt.apache.org/latest/network/ble_sec.html">https://mynewt.apache.org/latest/network/ble_sec.html</a> <a href="https://mynewt.apache.org/latest/get_started/index.html">https://mynewt.apache.org/latest/get_started/index.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6974613136b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>