Detect if WiFi is connected?

Postings related to the second version of the WiShield

Detect if WiFi is connected?

Postby Wavesonics » Thu Nov 11, 2010 5:07 pm

I'm looking for a way to detect if I'm actually connected to the WiFi, I don't care if I have an active connection to anyone, I just need to be sure someone can connect to me.

I'm using this to drive a little RC robot, so I want the robot to stop it's motors if it has lost WiFi signal.
Wavesonics
 
Posts: 2
Joined: Thu Nov 11, 2010 5:04 pm

Re: Detect if WiFi is connected?

Postby rock » Fri Nov 12, 2010 1:29 pm

That depends a bit on what you mean by "lost WiFi signal". Is it running in ad-hoc mode, or connected to an external WAP? Do you want to test being able to talk to a control device, or just have some idea that you are on a WiFi connection at all?

If connecting to a WAP, the simplest thing is probably just architect some kind of ping to the gateway of the WAP and see if you get a response. If connecting to a control device, maybe set up a heartbeat between them and just test that you are still receiving content.
rock
 
Posts: 13
Joined: Tue May 25, 2010 11:33 pm

Re: Detect if WiFi is connected?

Postby GregEigsti » Sat Nov 13, 2010 9:48 am

The WiShield driver file g2100.c has a zg_get_conn_state() function that might be useful ;)
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: Detect if WiFi is connected?

Postby Wavesonics » Sun Nov 14, 2010 10:48 pm

Right I'm connecting in Inf mode, and I just want to know if I have a WiFi connection what so ever, not a connection to a specific client.

but:
zg_get_conn_state()

Looks like just what I was looking for!

Thanks guys!
Wavesonics
 
Posts: 2
Joined: Thu Nov 11, 2010 5:04 pm


Return to WiShield 2.0

Who is online

Users browsing this forum: No registered users and 1 guest