WiFi connection lost after time

A 40 Pin Dip packaged development board enabling you to create internet connected products

WiFi connection lost after time

Postby Sailing_Nut » Mon Jun 16, 2014 3:34 pm

I have an application where I wait for the chip to connect to an access point, then I send a UDP broadcast packet on port 1900. After that I just listen for packets on port 1900. At some point the chip stop receiving packets and it also becomes unresponsive to ping requests. Here is a snippet of how I am receiving packets:

Code: Select all
    UDPSocket sock;
    Endpoint client;
   
    int rc = sock.bind(SSDP_PORT);
    if(rc == 0)
    {
        //pc.printf("Waiting for SSDP M-SEARCH\r\n");
        int n = sock.receiveFrom(client, search, sizeof(search));
        pc.printf("Packet count = %i\r", cnt++);
        sock.close();
        return;
    }
    else
    {
        pc.printf("Error '%i' binding to SSDP port\r\n");
    }
    sock.close();



I believe that it is probably some mistake on my part in how I am dealing with the CC3000 chip but I have been unable to find anything in the documentation.

Thanks in advance for help on this!
Sailing_Nut
 
Posts: 35
Joined: Fri Nov 29, 2013 9:43 pm

Re: WiFi connection lost after time

Postby Carl-SolderSplash » Tue Jun 17, 2014 11:43 pm

Hi,

Will try to find some time to look at this for you, please be do bear with me though, I'm currently working like crazy to delivery a project for a client.
User avatar
Carl-SolderSplash
Site Admin
 
Posts: 223
Joined: Sun Mar 17, 2013 11:15 pm

Re: WiFi connection lost after time

Postby Carl-SolderSplash » Wed Jul 09, 2014 8:32 pm

Hi,

What firmware version are you using? TI have released an update that apparently fixes a few issue in the module that may have stopped it responding to arp requests (stopping you from pinging it) viewtopic.php?f=15&t=97 (Please note this is still being tested)

Also, We have a new UDP demo here that listens for UDP messages and sends them. Which might be worth trying/comparing with your code.

http://mbed.org/users/SolderSplashLabs/ ... i/Homepage

Just one last thought, if you loose connection you may have to forget the sockets you have open and open new ones. I shall investigate that for you.
User avatar
Carl-SolderSplash
Site Admin
 
Posts: 223
Joined: Sun Mar 17, 2013 11:15 pm

Re: WiFi connection lost after time

Postby Sailing_Nut » Thu Jul 10, 2014 4:05 pm

Carl-SolderSplash wrote:Hi,

What firmware version are you using? TI have released an update that apparently fixes a few issue in the module that may have stopped it responding to arp requests (stopping you from pinging it) viewtopic.php?f=15&t=97 (Please note this is still being tested)


I was having the problem with the original firmware and then I updated to the 1.28 firmware and the problem is also present in that version as well.

Carl-SolderSplash wrote:Also, We have a new UDP demo here that listens for UDP messages and sends them. Which might be worth trying/comparing with your code.

http://mbed.org/users/SolderSplashLabs/ ... i/Homepage

Just one last thought, if you loose connection you may have to forget the sockets you have open and open new ones. I shall investigate that for you.


My code is using the blocking call presently. I will update it to use the non-blocking strategy that you are using and see if that makes an improvement. I'll post results as soon as I have them.
Sailing_Nut
 
Posts: 35
Joined: Fri Nov 29, 2013 9:43 pm

Re: WiFi connection lost after time

Postby Sailing_Nut » Mon Jul 14, 2014 6:25 pm

Carl,

It seems to crash much more quickly with the non-blocking code. In 5 tests the most I have seen it receive is 3 packets. With the blocking code I had seen as high as in the 20's.

One interesting thing that I have seen is that it seems to respond to pings for a while (several seconds) after it stops receiving the UDP packets. But it does eventually stop responding to pings.

Let me know if you find anything or have anything else that I should try.

Thanks!

Tim
Sailing_Nut
 
Posts: 35
Joined: Fri Nov 29, 2013 9:43 pm

Re: WiFi connection lost after time

Postby Carl-SolderSplash » Mon Jul 14, 2014 6:31 pm

Hrmm,

I've had the current udp mbed example running for two days without an issue.

Did you run the example as is?
User avatar
Carl-SolderSplash
Site Admin
 
Posts: 223
Joined: Sun Mar 17, 2013 11:15 pm

Re: WiFi connection lost after time

Postby Sailing_Nut » Mon Jul 14, 2014 6:53 pm

I ran my hang test converted to use non-blocking UDP reads.

My example waits for SSDP messages on port 1900 and just sends a serial message when it gets one. I'll try your code as is except I'll switch to port 1900 for listening for traffic.
Sailing_Nut
 
Posts: 35
Joined: Fri Nov 29, 2013 9:43 pm

Re: WiFi connection lost after time

Postby Sailing_Nut » Mon Jul 14, 2014 7:11 pm

Carl,

I ran your UDP demo and changed the port to 1900. It hung not too long after receiving it's 1st UDP message. After the receive, it sent 2 packets then the . characters stopped printing to the serial terminal (I'm using Terra Term) then shortly after that it stopped responding to pings.
Sailing_Nut
 
Posts: 35
Joined: Fri Nov 29, 2013 9:43 pm

Re: WiFi connection lost after time

Postby Carl-SolderSplash » Mon Jul 14, 2014 11:30 pm

How large is the packet that you are sending?

Fired up mine before going to bed and have found a large packet size can cause a hangup.

EDIT : Which is solved by increasing the CC3000 library CC3000_MAXIMAL_RX_SIZE define. in cc3000_common.h change it to :
#define CC3000_MAXIMAL_RX_SIZE (1519 + 1)

I can now spam it with UDP messages of 1.4k in size and it's fine, messages over 1.5k are ignored by the module as it doesn't support fragmentation.
User avatar
Carl-SolderSplash
Site Admin
 
Posts: 223
Joined: Sun Mar 17, 2013 11:15 pm

Re: WiFi connection lost after time

Postby Sailing_Nut » Tue Jul 15, 2014 12:39 am

It may be the packet size. I'm just receiving SSDP traffic on my network. I seem to remember some large packets in the Wireshark traces. I'll re test and see if I can correlate it to a large packet.

Thanks!
Sailing_Nut
 
Posts: 35
Joined: Fri Nov 29, 2013 9:43 pm

Next

Return to WiFi DipCortex

Who is online

Users browsing this forum: No registered users and 3 guests

cron