DHCP server started message?

FrenkR
Posts: 44
Joined: Thu Dec 04, 2014 9:25 am

DHCP server started message?

Postby FrenkR » Thu Jun 23, 2016 10:50 pm

Hi,
when setting softAP mode, I am getting a message on debug interface as follows:

Code: Select all

mode : softAP(1a:fe:34:d5:a2:9a)
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100

It looks like DHCP server is somehow autostarted. Is there any way to disable auto-starting or do prevent starting it?
Rgds,
Frenk

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: DHCP server started message?

Postby ESP_Faye » Fri Jun 24, 2016 4:31 pm

Hi,

You can call wifi_softap_dhcps_stop in user_init.

Thanks for your interest in ESP8266 !

FrenkR
Posts: 44
Joined: Thu Dec 04, 2014 9:25 am

Re: DHCP server started message?

Postby FrenkR » Tue Jul 05, 2016 4:02 pm

I have a code like this:
in user_init() I have:

Code: Select all

   if (wifi_station_get_auto_connect() != 0)
      wifi_station_set_auto_connect(0);

   // register "init done callback"
   system_init_done_cb(userInitDoneCb);
   // MANDATORY INITIALIZATION BLOCK END

   // disable WiFi
   wifi_set_opmode_current(NULL_MODE);
   // disable DHCP server
   wifi_softap_dhcps_stop();


in "init done callback" I have:

Code: Select all

      ETS_UART_INTR_DISABLE();
      _bRes = wifi_set_opmode_current(SOFTAP_MODE);
      ETS_UART_INTR_ENABLE();
      // DHCP is automatically started, so it must be stopped
      wifi_softap_dhcps_stop(); /*

after setting wifi mode, dhcps stop() is called immediately. But message that DHCP is started still appears on debug output, before softAP IP address on if1 is set.

Is there something else missing to prevent autostarting DHCPS?

Who is online

Users browsing this forum: No registered users and 288 guests