Go Down

Topic: Feeling interest for a WiFi shield (Read 33450 times) previous topic - next topic

AsyncLabs

@TheTrustedOne
There's no need for formalities and asking to help.  Feel free to jump in.  All the code is on GitHub for everybody to partake in. :)

I picked up a Netgear router today to do some testing to mimic what some of you guys have, and I was able to reproduce the shield hang situation, so we'll be looking into it.  I'm actually on travel now, but will work on this as best I can remotely.

John_Ryan

#241
May 20, 2009, 11:48 am Last Edit: May 20, 2009, 11:48 am by John_Ryan Reason: 1
I've written this simple php script to run from the browser, or as a cron job from one of our hosted servers.

As a cron job, the script pings the shield every 5 minutes, and if it doesn't get a response, it sends me an email.

This is a hack that saves me remembering to run the network utility ping to keep the connection alive.. at least until that issue is properly identified and solved.

If the connection drops overnight, the email will tell me what time it happened to within 5 minutes.

The script can be adapted to run on a local host server, so it could be easily adapted to check the connectivity of a bunch of shields. It can also be adapted to take content from the server and run additional script functions on an external server depending on the input.

It's a cool shield, once the "tiny" glitches are ironed out the possibilities will be endless.

Code: [Select]

<?php
$timeout
=5;
$port=80;
$url"199.199.199.99";  (your IP that forwards to port 80)
$email_address "youraddress@yourdomain.com";
$headers "From: " "Shield Check" ." <" "monitor@yourexternalwebserver.com" ">\r\n";
$headers .= "Reply-To: " "ShieldCheck" ." <" "noreply@yourexternalwebserver.com" ">\r\n";
if(!
$fp = @fsockopen$url$port$errno$errstr$timeout ) ) &#123;
      
echo("Couldn't connect to the server.");
      
mail($email_address,"'$url' is down","'$url' is down.",$headers);
      &
#125; else &#123;
          
echo("Connected ok");
&
#125;
?>


BenQuark

@John_Ryan

After reading your experiences I think I know whats happening here. Some APs have this behavior where they send disconnect messages to all currently connected devices to refresh their connection table and remove devices which are not alive. In most of the cases the AP send out disconnects to devices which have had long periods of inactivity. The idea of having periodic data operation will cause the AP to refresh its connection table and delay its disconnect message.

We can actually add an ARP client to the stack and cause it to perform periodic refreshes which might solve this problem. The issue with the current setup is that once all data operations are complete the WiShield is very quiet. This might not be a good thing for some APs.

What I'm confused about is why the device does not reconnect when the AP sends a disconnect. The 168 should force a reconnect. I wonder if the driver is getting hosed.

fweens

#243
May 20, 2009, 08:01 pm Last Edit: May 20, 2009, 11:46 pm by fweens Reason: 1
Hi!

I'm trying to help while waiting for my Wifi board...

What happens if the Arduino calls a webpage at regular intervals? Instead of being called...

Franck

John_Ryan

BenQuark

A ping from the server every 5 minutes worked for a couple of hours, then the board locked up. The LED stayed on, but the shield stopped responding.

So I ran 1 second interval pings overnight and its still connected 29,000 pings later (8 hours).

I'm out of ideas, so if you can add an ARP client to the stack then periodic refreshes might solve the problem.

The reconnect sequence isn't working so can that be removed and the board programmatically reset if the connection drops?




Thomas Jespersen

I won't recommend doing a complete board-reset, as people could use some variables which would be removed!
If neccessary, you should be able to choose between board-reset or not (disconnect from AP, and then the Arduino is just on)
Need any help with your electronics projects?
TKJ Electronics, a consultancy company located in Denmark (Europe), has the required ex

TeamMCS

Hey guys,

I'm trying to decypher the library so I can open up a standard TCP port and send data to a remote host.

Can anyone give me any hints. Using a web-server on the arduino side seems very heavy for what I need

BenQuark

@John_Ryan

It would be great if you can capture some information regarding the case which causes the disconnection. In the code change I suggested, there are only three cases which cause the LED to go off when there is a disconnection event,
ZG_MAC_SUBTYPE_MGMT_IND_DISASSOC
ZG_MAC_SUBTYPE_MGMT_IND_DEAUTH
ZG_MAC_SUBTYPE_MGMT_IND_CONN_STATUS
if you can capture as to which case causes the disconnection, that might useful in debugging this issue. If it is ZG_MAC_SUBTYPE_MGMT_IND_CONN_STATUS, it would be great if you can also capture the value of the status variable.

You can just add some debug global variables to hold this info in the driver files (g2100.[ch]) and print out those variable in the sketch using Serial.print() conditioned on the state of the zg_conn_status variable. As soon as zg_conn_status goes to 0, you can print out the debug variables which should indicate the cause of the disconnection.

Thanks,
Ben

TheTrustedOne

Has anyone had any success in getting this shield to pull information from the internet, like listening to an RSS feed?

I have not gotten my shield yet so I have not started my attempt, just kinda want to hit the ground running when it gets here. :)

Mike

hbr2d2

Got mine today!,
Followed the guide, and the red led lights up. However it does not  respond on ping, and the web server are unreachable. The AP has registered that the wishield has connected, and the mac address is in the log of the AP.  

AP ip 192.168.2.1
wishield. 192.168.2.99

What could cause this?

Regards from Norway.

TeamMCS

I suspect you're not... but are you on the same subnet? Could be something simple :)


hbr2d2

Could be.... But how do i change that on the wishield?
On the AP its 255.255.255.0

Regards

John_Ryan

@BenQuark

I have my foot up in plaster after a fall on Saturday evening so once I'm up and about again I'll run the tests.

TeamMCS

@hbr2d2 Don't worry about the Arduino...

Sounds like your setup is fine in that case. Hmm, I assume your router and Arduino have authenticated correctly and are communicating at the right speed?

LiveRock

I am a newbie. I want use Arduino with Adafruit Waveshield and internet connections. Unfortunately, waveshield uses the SPI and my ethersheild conflicts with it.

Does this wifishield potentially have the same problem as conflicts with the waveshield?

Go Up