2 Replies Latest reply on Oct 9, 2013 6:00 AM by nikvh

    Disconnecting without notification

    DaCi_2122796
      First off, Id like to say that WICED is one of the best architected pieces of software I have ever seen. If it werent for that, I would never have been able to create the bastardized version of the world I find myself in at this moment. It designed in a way that allows access to the fine grained control and low level access I need. Well done!

       

       

      Currently I have established a connection to an open AP (for reducing complexity) and am able to send and receive data. Simply put, Im attempting to make the module setup into a serial-to-wifi bridge. However, when I moderately load the connection, the device will eventually disconnect from the AP, without reporting it. Some caveats with my setup: I am hooking into the connect process in wiced_wifi_join() in wwd_wifi.c and not in any of the higher level systems (like wiced_join_ap() or wiced_network_up()). As such, the normal link notification callbacks will not run, due to the handler that calls them having not been registered for handling management events. I instead have my own management handler that handles WLC_E_LINK and WLC_E_DEAUTH_IND events to notify my application of link changes.

       

       

      Now, this process works under normal circumstances. If I connect to my router on my desk and subsequently disable the routers radio, it will notify me that link has been lost. If I then reenable the radio, a) if the disconnect was short, the Broadcom chip will automatically reconnect, and b) if it doesnt, due to the period being too long (unknown what that time period is), I can manually reconnect. However, when I find that Ive been disconnected for some reason when under load, I am not notified via the manage event callback that link has been lost.

       

       

      My questions would be:

       

         

      1. Why am I not being notified? I dont think Im running out of receive buffers, but this sounds like a possibility. Is there a good way to check that (FreeRTOS/LwIP)?
      2.  

      3. Can I directly query the Broadcom chip to get its connection state?
      4.  

       

       

      -Dan
        • 1. Re: Disconnecting without notification
          However, when I moderately load the connection, the device will eventually disconnect from the AP, without reporting it.

           

          How do you know the Wi-Fi interface is disconnected?

           

          Do you have a sniffer trace showing there is no WLAN activity?
          • 2. Re: Disconnecting without notification
            DaCi_2122796
            My access point no longer lists the device as associated. As of this morning, it looks like Im was/am having some buffer overruns corrupting the PCBs of other allocated buffers that is partially/potentially causing the problems.

             

             

            Related problem: is there a decent way to detect that a UART RX ring buffer overflow has occurred?
            • 3. Re: Disconnecting without notification
              Overflowing your packet buffers will definitely cause catastrophic problems so hopefully sorting that out will solve your problem.

               

               

              Currently we do not keep track of ring buffer overflows as its primary goal was to provide a simple buffer implementation to store characters entered from a PC into a terminal like application such as the test.console app. The ring buffer module is not an all purpose solution for UART character buffering.

               

              You are, however, free to take the code and modify it to suit your needs. If you take that path I would recommend copying the current implementation into a new library module and extending from there.