San Jose, CA USA
Offline
Jr. Member
Karma: 0
Posts: 81
Arduino rocks
|
 |
« Reply #240 on: May 20, 2009, 03:47:46 am » |
@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.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
God Member
Karma: 0
Posts: 731
skcor oniudrA
|
 |
« Reply #241 on: May 20, 2009, 04:48:21 am » |
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. <?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 ) ) { echo("Couldn't connect to the server."); mail($email_address,"'$url' is down","'$url' is down.",$headers); } else { echo("Connected ok"); } ?>
|
|
|
|
« Last Edit: May 20, 2009, 04:48:48 am by John_Ryan »
|
Logged
|
|
|
|
|
San Jose, CA
Offline
Newbie
Karma: 0
Posts: 26
Arduino rocks
|
 |
« Reply #242 on: May 20, 2009, 12:41:09 pm » |
@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.
|
|
|
|
|
Logged
|
|
|
|
|
Paris, France
Offline
Jr. Member
Karma: 0
Posts: 69
Arduino + Wishield
|
 |
« Reply #243 on: May 20, 2009, 01:01:22 pm » |
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
|
|
|
|
« Last Edit: May 20, 2009, 04:46:58 pm by fweens »
|
Logged
|
|
|
|
|
0
Offline
God Member
Karma: 0
Posts: 731
skcor oniudrA
|
 |
« Reply #244 on: May 20, 2009, 05:11:39 pm » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
Denmark (Europe)
Offline
Full Member
Karma: 0
Posts: 198
Electronics Designer & Consultant
|
 |
« Reply #245 on: May 22, 2009, 10:07:04 am » |
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)
|
|
|
|
|
Logged
|
Need any help with your electronics projects?TKJ Electronics, a consultancy company located in Denmark (Europe), has the required expertice, knowlegde and development tools, to do the development for you. Do not hesitate contacting us by visiting our website: http://www.tkjelectronics.dk
|
|
|
|
The Big Smoke
Offline
Sr. Member
Karma: 0
Posts: 259
Hacking and Slashing
|
 |
« Reply #246 on: May 22, 2009, 04:27:07 pm » |
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
|
|
|
|
|
Logged
|
|
|
|
|
San Jose, CA
Offline
Newbie
Karma: 0
Posts: 26
Arduino rocks
|
 |
« Reply #247 on: May 23, 2009, 04:42:38 pm » |
@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
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 3
Arduino rocks
|
 |
« Reply #248 on: May 24, 2009, 01:55:20 pm » |
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
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 3
Arduino rocks
|
 |
« Reply #249 on: May 25, 2009, 04:30:07 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
The Big Smoke
Offline
Sr. Member
Karma: 0
Posts: 259
Hacking and Slashing
|
 |
« Reply #250 on: May 25, 2009, 04:36:15 pm » |
I suspect you're not... but are you on the same subnet? Could be something simple 
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 3
Arduino rocks
|
 |
« Reply #251 on: May 25, 2009, 04:43:06 pm » |
Could be.... But how do i change that on the wishield? On the AP its 255.255.255.0
Regards
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
God Member
Karma: 0
Posts: 731
skcor oniudrA
|
 |
« Reply #252 on: May 25, 2009, 06:11:25 pm » |
@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.
|
|
|
|
|
Logged
|
|
|
|
|
The Big Smoke
Offline
Sr. Member
Karma: 0
Posts: 259
Hacking and Slashing
|
 |
« Reply #253 on: May 25, 2009, 06:36:52 pm » |
@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?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 8
Arduino rocks
|
 |
« Reply #254 on: May 25, 2009, 09:47:25 pm » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
|