Cannot get connected devices to softAP

anihilator
Posts: 7
Joined: Wed Mar 25, 2015 12:35 am

Cannot get connected devices to softAP

Postby anihilator » Tue Mar 31, 2015 6:32 pm

Hi,

I just only need to get how many devices is connected to ESP8266 in softAP mode. I tried to use wifi_softap_get_station_info() but it tells me no devices connected (devices are connected and confirmed by "station: xx:xx:xx:xx:xx:xx join, AID = 1").

I'm using this code:

Code: Select all

      int count = 0;

      struct station_info * station = wifi_softap_get_station_info();
      while(station)
      {
         os_printf("bssid : "MACSTR", ip : "IPSTR"\n", MAC2STR(station->bssid), IP2STR(&station->ip));
         count++;
         station = STAILQ_NEXT(station, next);
      }

      wifi_softap_free_station_info();
      os_printf("count %d\r\n", count);


Thx for possible help.

anihilator
Posts: 7
Joined: Wed Mar 25, 2015 12:35 am

Re: Cannot get connected devices to softAP

Postby anihilator » Tue Apr 21, 2015 5:41 pm

I'm sad that after 3 weeks nobody tried this. Now I upgraded to latest SDK esp_iot_sdk_v1.0.1_b2_15_04_10 and again no success. Can someone explain it to me?

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

Re: Cannot get connected devices to softAP

Postby ESP_Faye » Tue Apr 21, 2015 7:25 pm

Hi,

So sorry that we missed your message.

I tried your test code, and it's fine, it can get the station infor ..

Here is my test log

Code: Select all

station: c8:3a:35:cc:14:94 join, AID = 1
bssid : c8:3a:35:cc:14:94, ip : 192.168.4.2
count 1


Test code is

Code: Select all


void check_station_info(void *arg)
{

int count = 0;

      struct station_info * station = wifi_softap_get_station_info();
      while(station)
      {
         os_printf("bssid : "MACSTR", ip : "IPSTR"\n", MAC2STR(station->bssid), IP2STR(&station->ip));
         count++;
         station = STAILQ_NEXT(station, next);
      }

      wifi_softap_free_station_info();
      os_printf("count %d\r\n", count);

}

void user_init(void)
{
    os_printf("Hello from ESP8266\n");
   
    wifi_set_opmode(STATIONAP_MODE);

    os_timer_disarm(&client_timer);
    os_timer_setfn(&client_timer, (os_timer_func_t *)check_station_info, 0);
    os_timer_arm(&client_timer, 5000, 1);
}

anihilator
Posts: 7
Joined: Wed Mar 25, 2015 12:35 am

Re: Cannot get connected devices to softAP

Postby anihilator » Wed Apr 22, 2015 4:07 pm

Hi, thx for reply.

I tried your code and no result. But Im not using DHCP but static IP addresses on both sides. Can it make sense?

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

Re: Cannot get connected devices to softAP

Postby ESP_Faye » Mon Apr 27, 2015 3:32 pm

Hi,

wifi_softap_get_station_info can only be used when DHCP on ,right now.

Thanks for your reporting , we will think over your request.

anihilator
Posts: 7
Joined: Wed Mar 25, 2015 12:35 am

Re: Cannot get connected devices to softAP

Postby anihilator » Mon Apr 27, 2015 4:26 pm

Hi

Thanks for replying (AFTER 1 MONTH). I sent bug report to this problem and I WANT that you will pay me money for bug reporting. Information about that this function only works in DHCP is nowhere written and I spent too much time with this problem and you answer me THIS?

anihilator
Posts: 7
Joined: Wed Mar 25, 2015 12:35 am

Re: Cannot get connected devices to softAP

Postby anihilator » Tue May 05, 2015 9:17 pm

Any news about reported bug?

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

Re: Cannot get connected devices to softAP

Postby ESP_Faye » Wed May 06, 2015 9:52 am

Hi,

wifi_softap_get_station_info can only be used when DHCP on ,right now.

BBS post topic wounld not be considered as bug bounty program, and I don't have the authority to decide to pay or not. :oops:

Join bug bounty program please refer to http://bbs.espressif.com/viewtopic.php?f=21&t=288

Sorry for the inconvenience.

Who is online

Users browsing this forum: No registered users and 144 guests