ESP32 IDF Ble Gatt Server Example - esp32

I am trying to use esp32 IoT development framework. It is a bit complicated for me especially BLE examples. I am trying to understand gatts_service_table example but it has huge code inside and too hard for the first BLE APP. Is there any simple Ble example on IDF? I know kolbans libraries and I tried that but my aim is IDF. But to learn IDF I have to improve my programming skills first.
I want to create a profile. After add service inside, and characteristic. After creating my BLE architecture, send receive data with a phone app.

BLE looks simple from the user's point-of-view but is quite complex under the hood. It took me several months to wrap my head around it.
This example is organized much better than the example from Espressif (BlueDroid-based, it's what I'm using in my product):
https://github.com/eagi223/esp-idf_Bluetooth_Multi-Service
(vs. the Espressif example: https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/bluedroid/ble/gatt_server_service_table )
BTW, Now NimBLE is available in ESP-IDF 4+, which is supposed to be more memory efficient and simple to use, but I haven't tried it yet. https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/bluetooth/nimble/index.html

The examples of nimble ble given in espressif documents are quite difficult to follow. It took me some time to understand nimble BLE use with esp32. After referring many other sources, I finally succeeded in its use.
So I have written a tutorial which I think is easier to follow than examples given in espressif documents.
https://github.com/Zeni241/ESP32-NimbleBLE-For-Dummies
Hope it will help someone.

Related

Is ESP32 (including SDK) stable for making commercial products?

I'm studying ESP32 for a wifi project, although there are alternatives like CC3200 (TI), because of its price. But I suspect the reliability of ESP32's hardware or SDK.
I found some bugs while developing simple projects. I reported these to ESP but, they just delivered it to the development team, there was no additional response.
I would like to use a big company product like TI, but the price competitiveness of ESP32 is too good.
I would like to hear from those who have developed commercial products with ESP32.
I'm not sure that just saying that because Espressif has shipped 100 Million ESP32 chips is the best answer to the question of whether it is stable enough for implementation in a product. I will say that my company is using it, but the newness of the chip has definitely added some hurdles. However, I do believe it is stable enough for use in products. I'm not sure if you were using the Arduino libraries or the IDF, but my experience with the IDF has been pretty good.
The ESP-IDF v3 (which is currently in pre-release) appears to have added substantial stability as well as opening up new features such as Light Sleep. I would recommend implementing Over The Air updates if you plan on using wifi, just in case though. That way you can update your customers' firmware if you end up finding any bugs later.
Something else to consider is the amount of documentation on the chip and the idf that you'll need. Both are pretty well documented, but I've ocassionaly found myself wishing there were more examples or guides for some function sets. The documentation is definitely improving though, so as time goes on this will get better. Espressif is extremely active on the ESP-IDF GitHub.
Also, the chip has had a couple of silicon revisions, so that may be something you want to look into as well to see if anything revised will hinder you in one version of the chip vs. another.
You can check a lot of this out for yourself in the ESP32 Docs: https://esp-idf.readthedocs.io/en/latest/index.html and ESP-IDF GitHub: https://github.com/espressif/esp-idf
Side-Note: I don't agree that this should be posted in arduino.stackexchange.com at all... Why would the fact that the ESP32 has Arduino wrapper libraries make this specific question only relevant to the Arduino Stackexchange?
This is a good developer question. I would say : Is ESP32 SDK reliable enough to make a "professional" product? Then I would say simply YES. Just because Espressif shipt 100 Million chips in one year. 100 Millions of SDK/application cannot be only lab and DIY buggy IoT... Therefore, the "SDK" Github is very alive...

First Windows driver development exercise: dev/random or dev/null?

What follows is really a learning exercise and not necessarily a search for a production solution. I've recently done a bunch of reading about Windows driver development and am looking for a first good exercise in practical application before potentially proceeding toward a future win10 mobile device family project.
Just to get my feet wet with win10 driver development, I was thinking it would be interesting to develop (and then publish) a filesystem driver project that implemented a dumb Windows equivalent of /dev/null or /dev/random - really, any virtual device that I can read a stream of data from.
I haven't done much Windows development in the past, but after reading through a couple books on Safari I've landed on MS's driver samples GitHub page, which seems like a good start, but doesn't seem to provide a clear way forward from what I've read so far.
Right now I'm still casting about with web searches and would sure appreciate some guidance in how to proceed toward this goal (references, reading materials, etc) I'll be happy to publish whatever silly project(s) I wind up generating for others to learn from in the future.
One of the best way to start Windows driver development is with toaster sample . It will provide you basic workable understanding of Windows driver development. You will be able to understand basics for writing bus driver, function driver and filter drivers(upper, lower) in Windows.

Linux driver: example scatterlist usage for DMA/PCIe

Has anyone found an example driver that uses the new-ish scatterlist API (dma_map_sg, etc, for 2.6.26+)?
I have lots of disjoint documentation but no example code. I'd rather not have to download the entire kernel tree and search for drivers which may, or may not, use the API correctly.
After several hours searching for PCIe drivers I've got the Altera Avalon code, which doesn't do anything complicated and which is a great example of keep-your-code-propietary-by-not-commenting-it, and the Opencores pexdrv, which doesn't use scatterlists. I couldn't find anything useful at Xilinx. Thanks.
EDIT
Before I get any more close votes, "how to use an API" is a perfectly legitimate programming question, and if the only concrete example is code which is out there somewhere, then surely "where is that example code" is also a legitimate question.

Windows function map?

Is there some sort of thing like a layout/plan of the windows api? A clear overview of which api depends on another? Or a website where they are linked in a hierarchical way (starting with the most dependable, ending with the core function)
e.g Kerenel32.dll!CreateFile() -> ntdll.dll!ntCreateFIle() -> ntoskrnl32.exe!zwCreateFile()
I can link them all by hand with a dependency walker but it takes much time. So I was just wondering if something like this already existed.
I don't have the answer to your question, but I think an even more interesting road would be to read what Geoff Chappell has found out regarding the Windows Kernel and the Win32 API. I have not read those sections, but so far everything I've read on that website has filled me with wonder and awe at how thoroughly things can be analysed given a disciplined and talented investigator.
You can always take a look at ReactOS:
ReactOS® is a free, modern operating system based on the design of Windows® XP/2003. Written completely from scratch, it aims to follow the Windows-NT® architecture designed by Microsoft from the hardware level right through to the application level.
Simply search for whatever function in the documentation and look at its source. 99% of the time you can just pretend to be looking at the actual Windows source :) Very helpful when playing around with a debugger too.

How do I integrate an Audio Unit to an app

How do I integrate an audio unit into an application. I may not be familiar with the concept of components. I can open them in AUlab but I want to use it with a main.
Programming an AudioUnit host is a good amount of work. A couple of resources to get you started:
The Core Audio Overview has a section on Hosting which scratches the surface of what you need to learn. I would start by reading the entire guide, and examining the provied sample code.
Also, check out the ardour code base for some example code on how they host audio units in their application.
This is not a trivial question. You have a fair amount of work ahead of you.
Start here with the Apple documentation.
You will need to learn to configure CoreAudio, and then build AU "graphs".

Resources