Setting mac address and hostname using functions.

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: Setting mac address and hostname using functions.

Postby snahmad75 » Tue May 08, 2018 10:36 am

I cannot set host name programmatically.

I cannot ping using default host name espressif to my esp32 device. I can ping using ipv4 address.

I need this feature to allow our clients to access web pages using unique host name. Default host name espressif is not good for us.

I am also using mdns to discover my device and show device lists with ip address. but to using web browser you need to type in host name. my WiFi shows all devices along with espressif in its client list.


MyWiFiEventHandler *eventHandler = new MyWiFiEventHandler();

wifi = new WiFi();
wifi->setWifiEventHandler(eventHandler);

bool is_connected = wifi->connectAP("...", "...");

Do need to use startAP to start my own access point?

Any idea share please. I am struggling.

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: Setting mac address and hostname using functions.

Postby snahmad75 » Wed May 09, 2018 3:35 pm

Hi,

I did try to set dns server ip address to give esp32 option to communicate with dns server to resolve its ip address to name

MyWiFiEventHandler *eventHandler = new MyWiFiEventHandler();

wifi = new WiFi();
wifi->setWifiEventHandler(eventHandler);

bool is_connected = wifi->connectAP("...", "...");
wifi->addDNSServer("192.168.0.254");

No luck. still cannot ping using name.

Who is online

Users browsing this forum: endi83, Google [Bot] and 158 guests