Have two Xiao esp32s3 boards and Arduino IDE 2.3.6.
Want to do BLE communication between the boards. Done some search and more research. Basic code below for server and client as an example.
Issue is that the setValue() and notify() mechanism does not seem to work. The client does not get a notification that the new value has been set by the server. Everything else seems to work well.
Code is very straight forward copied from the web as a test. Apparently it has worked in the past for someone.
Questions:
what is missing from this code?
is there an issue with the esp32s3 board and/or firmware?
Note: new to the forum, the site does not allow me to post the code for some reason… I will try as a reply to my own post.
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0xb (SPI_FAST_FLASH_BOOT)
Saved PC:0x4037ebca
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce2820,len:0x1064
load:0x403c8700,len:0xaf4
load:0x403cb700,len:0x2e90
entry 0x403c8898
Chip Model: ESP32-S3
Number of Cores: 2
Silicon Revision: v0.2
Features: Features Bitmap: 00000000000000000000000000010010
Embedded Flash: No
Embedded PSRAM: No
Wi-Fi 2.4GHz support: Yes
IEEE 802.15.4 support: No
Bluetooth Classic support: No
Bluetooth LE (BLE) support: Yes
WiFi BLE
Flash Size: 8MB
Minimum Free Heap Size: 8666204 bytes
CPU Clock Source: PLL
Source Clock Frequency: 480 MHz
Divider: 2
Effective CPU Frequency: 240 MHz
Found App partition
Partition Label: app0
Partition Type: 0
Partition Subtype: 16
Partition Size: 3342336 bytes
PSRAM Size: 8388608 bytes
Total DRAM (internal memory): 326780 bytes
Free DRAM (internal memory): 285376 bytes
Largest free contiguous DRAM block: 229364bytes
ESP-IDF Version: v5.5-1-gb66b5448e0
ESP32 Chip ID = ...
In any case, the server code is a version of the Arduino * notify* example code.
Server code snippet:
// Update the value periodically
value++;
pCharacteristic->setValue(String(value).c_str());
pCharacteristic->notify(); // Notify clients of updated value
The client implements the regular notify callback:
The result is that there is no notification taking place. All else is working well. I wonder if there is a known issue with the esp32s3 board and the current Arduino (IDE v.2.3.6) Espressif board manager (v. 3.3.0) and/or the current BLE stack.
On the other hand, if you do have a simple proven and working example of an Arduino client/server BLE code and would like to share it, that would be great. I cannot share/post my own code for some reason.
And Welcome here, Just reply or comment on this thread or another that is close to build some forum cred, then you can do everything.
It’s a spammer control/prevention… they got hit a while back so it may not be updated in the FAQ,
Which Board support package file are you compiling with?
also if using Arduino IDE be sure ArduinoBLE is NOT an installed LIB on the system.
HTH
GL PJ
I have a example I’ll be posting that uses the S3 with 3 Concurrent BLE connections and 6 Notifies… all working, and the Round Display. so Stay tuned.
Excellent , sometimes it takes a while for it to percolate to the surface, “Rolling back the BSP” often it will shake it loose or reveal something in the compiler output too.
Your contribution and testing helps us all verify what is working
The BLE stuff on Espressif is always changing, they are trying to optimise a lot to compete with the Softdevice nordic has.
Check out the Nordic $9 BLE dongle, Nrf_connect for Desktops. (BLE_Prog) is the Best tool for testing anything BLE .
HTH
GL PJ
ALso do us a solid and mark it as the Solution so others can find it Fast!
Thank you for all the helpful information. Most appreciated.
I wonder what I may be missing. I do not seem to find a way to mark an answer as a solution. How exactly do you mark an answer as a solution? Did not find this in the site documentation or FAQ.
I am not sure that (a) I know how to mark an answer as a solution since I have no button to press or obvious way to mark as a solution, or (b) I may not have enough privileges yet?
The BLE setValue() / notify() mechanism not working with the Arduino based BSP v.3.3.x has been reported to Espressif, and it has officially been marked as a bug. See below for details.
Good old Asspreso , rug-pull or bait and switch … So the Solution mark, Should be on the post bottom. I would concur on the use of NimBLE LIB for some of the more advanced BLE capabilities and robustness, I use it in the Multiconnect (3) to (1) with 6 concurrent Notifications. 2 for each Peripheral.
Time permitting tonight I will post it up. Demonstrating the connectivity and the Caveats when using it.