ESP-32 and nRF52 communication

pgonzalez
Posts: 2
Joined: Thu Jan 27, 2022 8:46 am

ESP-32 and nRF52 communication

Postby pgonzalez » Thu Jan 27, 2022 9:11 am

Hi all,

I have 2 devices ESP32 which manage the connection to wifi, and nRF52 DK which manage the BLE connection.
When connecting my app to the nRF52, one of the characteristics I created must receive the IP that the wifi is connected to.
Both codes are based on Arduino.
On the ESP32 I'm using the library "WiFi.h" and the function WiFi.localIP() to obtain the IP.
This IP comes with this format(as an example): 192.168.1.77.
On the nRF52 DK I'm using "BLEPeripheral.h"
The next lines of code create the service and characteristics I need.

Code: Select all

BLEService wifiIP_service = BLEService("faa0");
BLEIntCharacteristic wifiIP_Char("faa1", BLERead | BLEWriteWithoutResponse | BLENotify);
BLEDescriptor wifiIP_Descriptor = BLEDescriptor("2901", "WIFI_IP");
The first question here is: is the type of characteristic correct? (BLEIntCharacteristic)
After this I can write a value in the characteristic like this:

Code: Select all

wifiIP_Char.setValue(valueNeeded);
My question is: how can I do this? I tried SPI (didn't manage with pins and libraries), Serial (Work but I have problems with the format probably because of not sending it correctly), BLE (works but gives me problems if there's more than one ESP32)

Thank you,
Pablo.

Who is online

Users browsing this forum: Masoud123456 and 73 guests