WINC1500 AP Mode WiFi Provisioning with HTTP Redirect

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a HTTP Web Server that handles the WiFi Provisioning among some other system setups. It works in both the AP Mode and Station Mode. To activate the AP Mode, I do:

    strcpy((char *)apConfig.au8SSID, SSID);
    apConfig.u8SsidHide = SSID_MODE_VISIBLE;
    apConfig.u8ListenChannel = M2M_WIFI_CH_1;
    apConfig.u8SecType = M2M_WIFI_SEC_OPEN;
    apConfig.au8DHCPServerIP[0] = 192;
    apConfig.au8DHCPServerIP[1] = 168;
    apConfig.au8DHCPServerIP[2] = 1;
    apConfig.au8DHCPServerIP[3] = 3;
        
    /* Start AP Mode */
    ret = m2m_wifi_enable_ap(&apConfig);

So everything is good. Out of curiosity, I change the m2m_wifi_enable_ap() call to:

ret = m2m_wifi_start_provision_mode(&apConfig, "wificonfig.net", true);

which, according to the API, should activate the internal WiFi HTTP Provision Web Server with HTTP Redirection. However, what I am experiencing is that once "wificonfig.net" is typed into a browser, my own web server's home page pops up.  This HTTP redirect is a very nice feature that I was looking for.  On the other hand, I am concerned because this seems to suggest I have two competing web servers running, one is my own and one is the internal WINC version. Would this become a problem? I know what I really need is to enable the HTTP Redirect without enabling the internal HTTP Web Server.  What the HTTP Redirect does, I think, is to run a DNS server inside the WINC, that answers every DNS query with 192.168.13. I haven't seen any problem yet but I am afraid I may have created one. Any thoughts?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My FAE got me back on this issue. Basically what happens is that when I use the listen() API in my web server after the internal HTTP server has already been started, the WINC reuses the same socket the internal HTTP server is using, causing the internal server to stop working. It is really a bug, but Atmel is not going to fix it. I can "exploit" it at my own risk. They recommend to run a DNS server on the host MCU side. The problem with running my own DNS server is that the DNS query traffic is heavy, either from a computer or a smartphone, and my DNS server may not be able to answer fast enough.

Last Edited: Wed. Apr 4, 2018 - 11:32 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi!

I am looking the way to configure the DHCP Server in AP mode on the WINC1500 module.

I need to:

  • Enable/disable the DHCP server on demand.
  • Configure the DHCP parameters (ex: the ip pool).

 

Reading the APIs, I have found the way to configure the DHCP server IP only. Moreover the server is automatically started when AP mode is turned on, . i am using lwip as its socket layer can anyone guide how to do

Thank you!