Page 1 of 1

ESP32 Wlan connect, but how to read IP Adress

Posted: Tue Dec 15, 2020 9:00 am
by stefan.erni
Hi Ben

To connect the ESP Wlan to my own wlan is working with connectToSSID , but how to read IP Adress with the command ReadIP?

it give just a Byte return.

it would also be possible to add a set command (WriteIP) in the future?

regards

Stefan

Re: ESP32 Wlan connect, but how to read IP Adress

Posted: Thu Dec 17, 2020 8:55 pm
by Alan_37
Hi ,

I think you have to read a byte at a time incrementing the index value but don't really know
how you would know where to put the point you will end up something like this 19216801 for 192.168.0.1

Re: ESP32 Wlan connect, but how to read IP Adress

Posted: Fri Dec 18, 2020 10:04 am
by LeighM
Yes, you can use ReadIP to populate a byte array.
Then use string conversion to get into human-readable notation ...
ip_addr.png
ip_addr.png (22.17 KiB) Viewed 6362 times

Re: ESP32 Wlan connect, but how to read IP Adress

Posted: Fri Dec 18, 2020 3:28 pm
by stefan.erni
Hi Alan, Hi Leigh

Perfect! Thank you both. It's working this way.

regards

Stefan