Quantity of services BLE RAK11720 RUI3

Hello.

I would like to know how many BLE services can be created with the RUI3 API. I currently need to implement two services with their respective features.

I have implemented one service with its features and it works fine, but when I try to create a second service, the program compiles and loads, but when I connect via BLE, it doesn’t display the services and disconnects the RAK11720. The application gets stuck on “connected.”

My questions are:

  1. How many BLE services can I create simultaneously on a RAK11720?

  2. What is the maximum number of features per service on the RAK11720?

  3. I am also evaluating the RAK11160. Is it possible that this microcontroller supports more BLE services?

I look forward to your comments.

Best regards.

RUI3 supports only one custom BLE service.

The RAK11160 is using the ESP32-C2 with Espressifs AT command firmware for WiFi and BLE. Best is to check the Espressif documentation for BLE support ==> AT Command Set - ESP32 - — ESP-AT User Guide latest documentation

Hi Begee, thanks for replying.

I was able to modify the uhal_cus.h file and increase the number of features per service, which was previously limited to 7.

It’s precisely in these definitions.

I modified the number of services, but it’s not working the same way.

Is there any way to modify uhal_cus.c so that RUI3 can support more than one service?

Best regards.

/*****************************************************************************
#define CUS_SERVICE_START_HDL 0x0600 // This is important!!!

#define MAXIMUM_CUS_SERVICE_SIZE 3
#define MAXIMUM_CUS_CHARACTERISTIC_SIZE 10 //MAXIMUM NUMBER OF FEATURES TO TEST

@sercan
Can you help?

1 Like

Hello @and-tecnipak

I will take a look and inform you.

Thanks,
Sercan.

Hello @and-tecnipak,

Please take a look attached zip. I added multi service support. Please take a look main.cpp file to learn how to use it.

cus.zip (7.1 KB)

Please be aware that these additions can cause problems. Testing is your responsibility.

Thanks,
Sercan.

Hello Sercan.

Thank you very much for your technical support. I will be testing this new functionality.

On another note, do you plan to add this support for future versions of RUI3? And also for RAK11160?

Best regards.

Thanks @and-tecnipak. I will inform R&D team to add it to future versions of RUI3. I cannot talk about the schedule. Also, I cannot talk for RAK11160. For RAK11160, please take a look the link shared by Bernd.

Best regards.

For RAK11160, the ESP32-C2 is running the original Espressif AT command firmware. It supports EITHER WiFi OR BLE, depending on the Espressif firmware used, check AT Command Set - ESP32 - — ESP-AT User Guide latest documentation as I shared before. You will have to flash the Espressif firmware you want to use.

Regarding number of BLE services that the Espressif AT command BLE firmware supports, I do not know. By default we ship the RAK11160 with the Espressif AT command WiFi firmware.

Hi @sercan, thanks for your help.

I’ve been testing your multi-service support, but when I try to connect with nrf connect on Android, it connects to the device but doesn’t discover any services. I also tried loading your main.cpp file directly, and it has the same problem.

Perhaps I’m missing something; can you help me?

Thanks, best regards.

Hi @beegee.

I’ve been looking into the RAK11160. I was able to program the STM32 with STLINKV2, but I haven’t been able to flash the AT commands provided by Espressif for the ESP32-C2. For some reason, I can’t enter the ESP’s boot mode. My goal is to install the latest version of the AT commands provided by Espressif.

Could you explain the step-by-step process?

Currently, I’m trying the following method:

  1. Using an FTDI CH340 UART, I connect to the debug pins of the RAK11160 breakout board on the ESP side. I hold down the boot button, press the reset button while still holding boot, release the reset button, and wait a few seconds before releasing boot.

  2. I’m using Arch Linux with ESPtool, with the following command: esptool --chip esp32c2 --port /dev/ttyUSB0 --baud 115200 write-flash 0x0 factory_ESP32C2-2MB.bin; but it’s not flashing it (I also tried using the Windows flashtool and it fails the same way).

  3. I’m wondering if the EN pin, which is PA0 of the STM32, needs to be HIGH to use the ESP32, even for flashing.

  4. Is it possible to do it through serial communication, or is there another method to put it into boot mode?

  5. Is there another method to flash the ESP32-C2? I also saw in a post that it needs a specific .BIN file for BLE, which is different from the Wi-Fi one; at least in the Espressif documentation, I haven’t seen anything like that.

I forgot to mention that I absolutely need to add support for BLE.

Thanks. Best regards.

@carlrowan
Can you help here?
I don’t think we have a written guide to flash the ESP32-C2 in the RAK11160.

Which RUI3 version are you using? I retested it and I am able to communicate over BLE.

Hi @sercan

I currently have version 4.2.3 of the RUI3, which appears to be the latest version available.

Hi @and-tecnipak

I am using same version and I am able to communicate with device over BLE. When you revert back these changes, are you able to communicate with RAK11720 again?

Thanks.