BLE with ESP32 tutorial part 3: many characteristics and Server Callback for Client commands

Поділитися
Вставка
  • Опубліковано 27 жов 2024

КОМЕНТАРІ • 45

  • @alicizationalicization9621
    @alicizationalicization9621 Рік тому

    I am now writing a flutter ble app to connect to the arduino. Pretty impressed by your tutorials, APPRECIATE IT

    • @mothunderz
      @mothunderz  Рік тому +1

      Thank you for your feedback, happy it is useful! Let me know if you post your code online. I am now making a video on Xamarin and BLE as per request. I have not looked into Flutter yet.

    • @mothunderz
      @mothunderz  Рік тому

      FYI: just uploaded my video on Xamarin and BLE
      ua-cam.com/video/SfGuLsKeOeE/v-deo.html

    • @alicizationalicization9621
      @alicizationalicization9621 Рік тому +1

      Great video

  • @veedonfleece3694
    @veedonfleece3694 Рік тому

    Once again, clear and well explained, especially the reason for and logic of the callback.
    thank you!

    • @mothunderz
      @mothunderz  Рік тому

      My pleasure, glad you liked it!

  • @ghislainborremans3708
    @ghislainborremans3708 11 місяців тому

    Perfect clear explanation. What i miss is a video or tutorial where a ESP32 server sends a long string or array to the client ( on pc or tablet). In my case i want to getthe IMU data grouped in measurements of 100+ points of 9 DOF, added with microphone info. These infos have to be sent every minute.
    I cannot find a good example on this. If you find the time, that would be great and help a lot of people.

    • @mothunderz
      @mothunderz  9 місяців тому

      Thank you very much for your feedback. The problem you raise is indeed not very straightforward. Unfortunately I am completely swamped with work (hence the late response) and I have no time for creating content. I hope this will change in the mid-term, but for now I unfortunately cannot assist.

  • @davidkempton2894
    @davidkempton2894 7 місяців тому

    Thanks for sharing your knowledge 👍

  • @MikeWadewitz
    @MikeWadewitz 7 місяців тому

    Very well done. You break the process down into small enough chunks to understand the communications between server and client.
    If I have a system which one of the two devices has to run on battery. And I will be putting the remote device into sleep mode. Would it be best to make that device the server or client, as far as power consumption goes ? I only need to be concerned with communications between those two devices.

  • @jak_k
    @jak_k Рік тому

    Great video as usual. Fixed my problem running out of characteristics which was also hidden by a problem with App Inventor where creating a 4th RegisterForBytes caused the phone emulator to crash. Unfortunately now registering a 5th characteristicUuid causes it to crash although strangely not if I set it's global to a previous global Uuid. Very frustrating without log files.

    • @mothunderz
      @mothunderz  Рік тому

      Great to hear that you were able to solve the problem on the server side for scaling characteristics. When you say the phone emulator crashes, do you mean the nRF app? That would be a bit surprising to me as it has been quite stable for me.

  • @MariaMoita-f5w
    @MariaMoita-f5w 3 місяці тому

    Hello! Have you tried to connect 2 clients to 2 characteristics of one server?

  • @MariaMoita-f5w
    @MariaMoita-f5w 3 місяці тому

    Hello! Do you know if it is possible to connect 2 esp32 to 2 different characteristics of one server?

  • @piotrolczyk2679
    @piotrolczyk2679 8 місяців тому

    Do you have any example of communication between a BLE server and a BLE client in INDICATE characteristic mode. Any hint?

  • @kommzu187
    @kommzu187 Рік тому

    Thank you so much for the videos, it helps a lot! One Question pls. How can I work with the Value in server, that the client sent(notify) with the CharacteristicCallback function?

    • @mothunderz
      @mothunderz  Рік тому

      Let me make sure I understand the question correctly: you are asking how you can use the value received in the CharacteristicCallback function in the main loop on the server? Basically you can make a global variable, assign it in the callback and use it in the loop. See as well:
      arduino.stackexchange.com/questions/77882/how-to-get-variable-from-callback-function
      Hope this helps

  • @AtenIndustries
    @AtenIndustries Рік тому

    Thanks for your tutorials. I learned a lot from this.
    One question: do I have to create a separate class for each characteristic that I monitor with a CallbackFunction, or can I write all callbacks in one class?

    • @mothunderz
      @mothunderz  Рік тому

      I have not tried that yet, but it should be possible to use the same callback function for multiple characteristics

    • @mothunderz
      @mothunderz  Рік тому

      I would recommend to write all callbacks in the same class. You can read the UUID from pChar to figure out which Characteristic was received.

  • @shanishah7131
    @shanishah7131 10 місяців тому

    hi sir I want to connect the esp32 to other esp32 through BLE but i want the server to connect with client manually. and how can i send data from serial monitor by user to the client.

    • @mothunderz
      @mothunderz  9 місяців тому

      It definitely is possible to take data from the serial monitor and the forward it through BLE. However, I have not looked into this myself yet. As I am swamped with work at the moment I cannot assist here. My apologies.

  • @TOGAMANYAMA-jt7kr
    @TOGAMANYAMA-jt7kr Рік тому

    Sir, thank you! for your tutorials, I watched your previous tutorials about webpage with json but I stuck to move on this, please! can you give advantages BLE at least 5 to understand?

    • @mothunderz
      @mothunderz  Рік тому

      My apologies, but I do not understand your request. What do you mean with "can you give advantages BLE at least 5"? Do you mean examples?

    • @TOGAMANYAMA-jt7kr
      @TOGAMANYAMA-jt7kr Рік тому

      sorry Sir, am new in these learning, but I need just short written importance of using BLE or anyway Sir if I have questions about previous tutorials can I ask? and where? I worry to comment on past several months, please! help me.

    • @mothunderz
      @mothunderz  Рік тому

      It is unclear to me what exactly you need help with. BLE is useful for applications where you need to be energy efficient. Wifi consumes a lot more energy but provides a higher bandwidth. As for your question on where to ask questions: best is to ask these with the video that covers that topic. I do check questions with older videos as well. However, please try to be specific. Thank you

    • @TOGAMANYAMA-jt7kr
      @TOGAMANYAMA-jt7kr Рік тому

      ok, thank you! Sir, I understand

  • @maser9433
    @maser9433 Рік тому

    could you please share a code, or atleast a resource, for ESP32-ESP32 two way communication(half duplex) via router? I am looking into UDP and TCP protocols but am not able to code on my own.

    • @mothunderz
      @mothunderz  Рік тому +1

      Pls check out this series on WiFi with the ESP32:
      ua-cam.com/video/15X0WvGaVg8/v-deo.html
      I still have not had time to make the video on ESP32 to ESP32 communication with WiFi, but that should be relatively straightforward if you follow Part 2 and Part 3 of this series. Am now finishing a video on Xamarin, but will upload it after that.

  • @LinconNS
    @LinconNS Рік тому

    Hi nice video!
    Thanks, it helped me so much.
    Is it possible to a ESP32 server connect to 2 clients?
    If it is do you have an example code or could you make an video about it? I would appreciate so so much...
    I want to make an ESP32 wifi gateway, I already tried it with espnow, but apparently it blocks one each oder, perhaps I could use ble instead espnow.

    • @mothunderz
      @mothunderz  Рік тому +1

      Yes, it is possible to connect 2 clients to a single server with BLE. However, I have not tested this yet myself. At the moment I am quite busy with work, but will look into it when I have some free time again.

  • @SA-oj3bo
    @SA-oj3bo Рік тому

    Hi I try to replace the HM10 by the ESP32 BLE, can you help me? I want to use APP's that work with HM10 also with the ESP32 BLE. Stuck now. Can we mail? Thx

    • @mothunderz
      @mothunderz  Рік тому

      My apologies, but I unfortunately do not have the time at the moment to re-write code from HM10 to ESP32.

  • @WeiHuang-kc1zf
    @WeiHuang-kc1zf Рік тому

    Hi; are we be able to use nordic app upload a video and read that data?

    • @mothunderz
      @mothunderz  Рік тому

      In general I have only tested with nordic whether the BLE server is setup correctly. It is a very powerful tool, but I have not yet looked into the functionality you are asking for. Hope you find a good solution.

  • @josephdallinplania7536
    @josephdallinplania7536 Рік тому

    The 37th person who liked this vid. Thank you Engr MoThunderz! 💫

    • @mothunderz
      @mothunderz  Рік тому

      Thank you very much for your feedback! Very much appreciated

  • @johantandberg4304
    @johantandberg4304 Рік тому

    Thank you for yet another great video 👍 I have gotten my server (a Wii Nunchuck communicating over BLE) to work with eight characteristics, as per your tutorial. However, I get kind of the same problem on the client side. It only reads the four first (out of my eight) charateristics, and I can't find any way to increase this, analogus to increasing the numHandles parameter in "createService" on the server side. Do you know how this could be fixed?

    • @mothunderz
      @mothunderz  Рік тому +1

      Thank you for your comment. I will look into this, however, I am traveling this week, so it will take me some time

    • @mothunderz
      @mothunderz  Рік тому

      I just tried to read more characteristics and this worked without a problem. Please refer to my github page for the code I used. It read in all 9 Characteristics without a problem.

    • @johantandberg4304
      @johantandberg4304 Рік тому

      @@mothunderz Thank you for your swift reply. I have looked at your code in "BLE_client_many_char.ino" and as far as I can see , in the notifyCallback() function you only look for the first UUID. I have expanded upon your code, looking for seven differnet UUID notifications, and only the first four gets detected. Have you tried to detect all nine UUID notifications in the callback function?

    • @mothunderz
      @mothunderz  Рік тому +1

      @Johan Thank you for coming back to me with this. I could reproduce the limitation you describe above. I created a server with 8 notifications and could only detect four at the receiver. However, after a bit more investigation I saw that this is a receiver problem -> when I tested with the nRF app as receiver everything was working fine. After (quite) a bit of Googling it seems that the reason is that the ESP32 is limited in HW to receive only 4 notifications. However, I did create a workaround for you. Please navigate to:
      github.com/mo-thunderz/Esp32BleManyChars
      and download BLE_many_notify_workaround_server/client. In this example I use one notification to read out 8 characteristics. I hope this works for you.

    • @johantandberg4304
      @johantandberg4304 Рік тому

      @@mothunderz You are brilliant. Good detective work! And a smart work around, that should work for me, as I control both the server and the client. Thank you for helping me out and for your good videos.