Sample code to reproduce reconnection issue

Questions specifically regarding the WiShield 1.0 family driver.

Re: Sample code to reproduce reconnection issue

Postby aerodyno » Tue Apr 20, 2010 2:50 pm

Hi John, Greg, Hruska, and AsyncLabs,

So I tested Greg's fix with my code. You can read my research findings here:
http://docs.google.com/View?id=ddf9wrwd_157g9dkxks8

I have discovered that, with Greg's Fix, the code reliably reconnects if the AP is down for less than 1 minute. If it's down for more than 1 minute, the Black Widow's Blue Wifi light never comes back on.

This sounds a bit like what Hruska said when he added 'retry kick time' to his fix.

Again, my code uploads every 7 seconds. Any hints or suggestions?

Greg, you should be able to test the code without issue, the embeddeton.appspot.com site is up.

Heading out to dinner but will be back later (on east coast).

-s
aerodyno
 
Posts: 65
Joined: Tue Aug 04, 2009 8:42 pm

Re: Sample code to reproduce reconnection issue

Postby GregEigsti » Tue Apr 20, 2010 3:45 pm

Your findings do not suprise me; thanks for getting back. I think the concept of the fix is valid rather its just the hinky way that it is implemented. Actualy just had an idea about making things more solid; unfortunately it would be simple for the single request type use (e.g. just using a single POSTrequest object) but would require a little more work to maintain a list of multiple request objects being use together.

Since most of the WiServer sketches use a single request object I could send over a quick "give this a try" fix later on.

Greg
Check out the wiki!
uIP Stack Docs
Compatible Access Point List
WiShield user contrib branch - DNS, DHCP, AP Scanning, bug fixes, etc.
SlackLab.org - My geek projects blog.
User avatar
GregEigsti
 
Posts: 1067
Joined: Sun Aug 02, 2009 5:23 pm
Location: Sammamish WA USA (near Seattle)
  • Website

Re: Sample code to reproduce reconnection issue

Postby aerodyno » Tue Apr 20, 2010 5:10 pm

Hi Greg,

Thanks for your quick reply. I'm impressed that you have an idea of what's going on. I think that if you could provide a fix that worked in the single request case, it would be a huge help. At the moment my solution to the problem is a hack (tracking upload/download times) so that's why I'd like to reach a more general solution.

Thanks and catch you soon!

- s
aerodyno
 
Posts: 65
Joined: Tue Aug 04, 2009 8:42 pm

Re: Sample code to reproduce reconnection issue

Postby GregEigsti » Tue Apr 20, 2010 5:30 pm

Attached are minor tweaks to the WiServer stuff (WiServer.h, WiServer.cpp, request.cpp); basic gist is that WiServer.server_task() now returns boolean instead of void. If it returns true then a reset occured and you should setActiveState(false) for any of the *request objects that you are using. A bit brute force but will help narrow down the problem.

Here is how the new functionality is used within a sketch (SimpleClient sample):
Code: Select all
void loop(){

  // Check if it's time to get an update
  if (millis() >= updateTime) {
    getWeather.submit();   
    // Get another update one hour from now
    updateTime += 1000 * 60 * 60;
  }
 
  // CHANGED CODE BELOW =======================================================
  // Run WiServer
  if(true == WiServer.server_task()) {
    //WiShield reset occured; set request object's active state to false.
    getWeather.setActiveState(false);
  }
  // CHANGED CODE ABOVE =======================================================

  delay(10);
}


Let me know how this goes!

Oh yeah, it builds but I have not tested it :twisted:
Greg
Attachments
WiServer_GE_01.zip
(10.29 KiB) Downloaded 15 times
Check out the wiki!
uIP Stack Docs
Compatible Access Point List
WiShield user contrib branch - DNS, DHCP, AP Scanning, bug fixes, etc.
SlackLab.org - My geek projects blog.
User avatar
GregEigsti
 
Posts: 1067
Joined: Sun Aug 02, 2009 5:23 pm
Location: Sammamish WA USA (near Seattle)
  • Website

Re: Sample code to reproduce reconnection issue

Postby aerodyno » Wed Apr 21, 2010 9:01 am

Ok Greg, I tested your newest fix. It doesn't work in all cases. I took virgin async labs code and copied in the files in "wiserver_ge_01".

Latest research findings:
http://docs.google.com/View?id=ddf9wrwd_157g9dkxks8

In fact it may be less reliable as it sometimes returns, and sometimes does not return, from a 20-30 second router power-cycle.

Also of note, when the wishield does not come back, the serial.println("resetting") which gets printed when true==wiserver.server_task() never gets printed.

Any thoughts on this? I have some theories. But there's something difficult about detecting when the wifi has gone down, for some reason. Perhaps we get trapped in server_task for too long or something.

-s
aerodyno
 
Posts: 65
Joined: Tue Aug 04, 2009 8:42 pm

Re: Sample code to reproduce reconnection issue

Postby GregEigsti » Wed Apr 21, 2010 1:38 pm

Thanks for the update; no earthly idea why anything would, or would not, be working ;)
Would you say that this latest patch is less stable than the previous one?

Thanks
Greg
Check out the wiki!
uIP Stack Docs
Compatible Access Point List
WiShield user contrib branch - DNS, DHCP, AP Scanning, bug fixes, etc.
SlackLab.org - My geek projects blog.
User avatar
GregEigsti
 
Posts: 1067
Joined: Sun Aug 02, 2009 5:23 pm
Location: Sammamish WA USA (near Seattle)
  • Website

Re: Sample code to reproduce reconnection issue

Postby aerodyno » Thu Apr 22, 2010 10:55 am

Yes I think the latest patch is less stable.

-s
aerodyno
 
Posts: 65
Joined: Tue Aug 04, 2009 8:42 pm

Re: Sample code to reproduce reconnection issue

Postby Daemach » Wed May 12, 2010 8:14 am

I'm having the same problems here. I'm using a wishield 2.0 with an external antenna. The unit makes a connection and successfully transmits data for hours but then it drops offline and never comes back.

I tried downloading the current code from github then used Greg's zipped code from a previous post in this thread and there is no change :( It would be nice to store a log in that eeeprom and then download it somehow.
Daemach
 
Posts: 4
Joined: Tue Mar 09, 2010 4:39 pm

Re: Sample code to reproduce reconnection issue

Postby TechnoGuy » Tue Jun 29, 2010 11:43 am

Is there any news in this quest for a patch.
TechnoGuy
 
Posts: 2
Joined: Tue Jun 29, 2010 12:33 am

Re: Sample code to reproduce reconnection issue

Postby Daemach » Tue Jun 29, 2010 12:00 pm

I've been running this successfully for a while now. I ended up having to drill a hole through a wall and push the antenna through it to make a connection but it has been stable for weeks now. I think I was just at the limit of the device power.

BTW I'm using Greg's earlier code, not the patched one that another commenter says is less stable.
Daemach
 
Posts: 4
Joined: Tue Mar 09, 2010 4:39 pm

Previous

Return to WiShield 1.0 Driver

Who is online

Users browsing this forum: No registered users and 1 guest