I am trying to save esp32 local ip address to my apps via bluetooth. Need kind support in this regards. my apps show only 2 digit like 48 or 49 or 50 instead of local ip address 192.168.1.1
my device is esp32 dev module. my apps is uploaded here for reference and arduino
SyncIP (1).aia (4.5 KB)
code given below-
#include "BluetoothSerial.h"
#include <WiFi.h>
BluetoothSerial ESP_BT;
WiFiServer server(80);
const char* ssid = "abc"; //replace
const char* password = "abc123"; //replace
char switchstate;
void setup() {
Serial.begin(115200);
ESP_BT.begin("ESP32");
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {delay(1000); Serial.println("Connecting to WiFi..");} Serial.println(WiFi.localIP());
server.begin();
}
void loop(){
while(ESP_BT.available()>0){
switchstate = ESP_BT.read();
Serial.println(switchstate);
//if(switchstate == '1'){IPAddress localIP = WiFi.localIP(); String ipString = localIP.toString(); ESP_BT.print(ipString); Serial.println(ipString); delay(1000);}}}
if(switchstate == '1'){IPAddress localIP = WiFi.localIP(); unsigned long ipAddressValue = localIP; ESP_BT.print(ipAddressValue); Serial.println(ipAddressValue); delay(1000);}}}
//if(switchstate == '1'){String ipAddress = WiFi.localIP().toString(); ESP_BT.println(ipAddress); Serial.println(ipAddress);}}}
SyncIP.txt (1.1 KB)
SyncIP (1).aia (4.5 KB)