How to save Esp32 local dynamic ip address in tinydb of MIT app inventor via bluetooth

Need help to store Esp32 local ip address in tinydb of MIT app inventor via bluetooth

Hello Md Rahman

Well, you would firstly need to set a fixed (Static) Address for your ESP32:

ESP32 Static/Fixed IP Address | Random Nerd Tutorials.

You will obviously then know what the IP Address is and simply store it in TinyDB - if your App is only for your own use, you could store the Address as a Global Variable.

Hello ChrisWard:
Thanks for your quick reply. i am try to store my esp32 random local ip address to tinydb of my app. i want to set a button in my apps in mit app inventor, that i press the button then it will store the random ip address of esp32 to tinydb via bluetooth.

There would be no point in doing so? - a random address is only used once........

Hello ChrisWard:
First convert WiFi.localIP(); in String, Then it passes it to the app via BT. i have used BLE connection. library used "BluetoothSerial.h" . bluetooth client for mit app inventor. I have used esp32 dev module. i want to store ip in tinydb. Need assistance in this regards.
my code is:
if (id == 25 && value == 25){String ipAddress = WiFi.localIP().toString(); ESP_BT.println(ipAddress); Serial.println(ipAddress);}



"Bytes available to receive" is not necessarily the total bytes available - think of it as a flag indicating availability. To ensure you receive the total bytes available, use a math block:

NumberOfBytes

If you want to store the IP address in TinyDb, you should not set the received text to a List, set it to a text Variable. That value can then be saved in TinyDb, use a simple Tag name.

Thanks for your guideline. i have try below code:
if (id == 25 && value == 25){String ipAddress = WiFi.localIP().toString(); ESP_BT.println(ipAddress); Serial.println(ipAddress);}

Veriable1

but not working. Need your kind help.

b8b4380792213b28f43a343b73a56b7757eb3da7_2_690x349

Here is a simple BlueTooth text receiver sample, for single value per line:
blocks
initialize global message to


1 Like