Any issue with ESP-C3 BLE uart and Apple iOS devices ?

pataga
Posts: 73
Joined: Sat Aug 12, 2017 5:53 am

Any issue with ESP-C3 BLE uart and Apple iOS devices ?

Postby pataga » Sun Sep 11, 2022 2:52 am

I've been using a third party app on my Samsung Android phone to connect to my ESP32-C3 via BLE uart interface, and have no problem receiving data packets sent at 100mS intervals.

But a friend reports that he has not been able to connect with his iOS devices (phone, tablet). The BLE server is not visible.

I don't have any iOS devices to test with.
Is there anything special about iOS devices that needs to be taken care of ? This is the ble-uart initialization code

Code: Select all

#include <esp_gap_ble_api.h>
#include <esp_gattc_api.h>
#include <esp_gatt_defs.h>
#include <esp_bt_main.h>
#include <esp_gatt_common_api.h>
#include "config.h"
#include "ble_uart.h"


#define SERVICE_UUID           "6E400001-B5A3-F393-E0A9-E50E24DCCA9E" // UART service UUID

#define CHARACTERISTIC_UUID_RX "6E400002-B5A3-F393-E0A9-E50E24DCCA9E"
#define CHARACTERISTIC_UUID_TX "6E400003-B5A3-F393-E0A9-E50E24DCCA9E"

NimBLEServer* pBLEServer                = NULL;
NimBLEService* pService                 = NULL;
NimBLECharacteristic* pTxCharacteristic = NULL;
NimBLECharacteristic* pRxCharacteristic = NULL;

static uint8_t ble_uart_nmea_checksum(const char *szNMEA);

void ble_uart_init() {
	NimBLEDevice::init("BLE-Vario");
	NimBLEDevice::setMTU(46);
	NimBLEDevice::setPower(ESP_PWR_LVL_N27);
	NimBLEDevice::setSecurityAuth(true, true, true);
	NimBLEDevice::setSecurityPasskey(123456);
	NimBLEDevice::setSecurityIOCap(BLE_HS_IO_DISPLAY_ONLY);

	pBLEServer = NimBLEDevice::createServer();

	pService          = pBLEServer->createService(SERVICE_UUID);
	pTxCharacteristic = pService->createCharacteristic(CHARACTERISTIC_UUID_TX, NIMBLE_PROPERTY::NOTIFY);

	pRxCharacteristic = pService->createCharacteristic(
		CHARACTERISTIC_UUID_RX,
		NIMBLE_PROPERTY::WRITE | NIMBLE_PROPERTY::WRITE_ENC | NIMBLE_PROPERTY::WRITE_AUTHEN);

	pService->start();
	pBLEServer->getAdvertising()->start();
	}


pataga
Posts: 73
Joined: Sat Aug 12, 2017 5:53 am

Re: Any issue with ESP-C3 BLE uart and Apple iOS devices ?

Postby pataga » Mon Sep 12, 2022 8:53 am

Never mind, increasing tx power to 0dB fixed the problem with the specific app (XCDisplay). Another app "Bluefruit LE connect" was able to connect even with the lower tx power.

Who is online

Users browsing this forum: No registered users and 127 guests