I'm writing to figure out if there are tools available to watch an iPhone attempt to connect via wifi. I'm looking for either something like tcpdump for the actual wifi protocol or some way to turn up logging and debug failed connection attempts.

Summary:

I have an iPhone4 that will connect fine to my WEP home network. Connect fine to my WPA2+TKIP network at work, but will fail to re-connect to the home wifi after that work connection is made, eventually asking for the key to be re-entered. That often does not work until multiple attempts or forcing the iPhone to forget the network and re-try—and even that doesn't always work.

I would like to know what the tomato-usb router is seeing during those failed attempts.

Home wifi needs to be WEP because of my son's Nintendo DSL, which only supports WEP. So, I have added MAC filtering on the wifi.

With the same phone at the same patch level, I did not experience this with an ancient DD-WRT on a Linksys WRT54GS. When I say ancient, I mean 3 or more years old.

I finally purchased an ASUS RT-N16 and installed tomato-usb (tomato-K26USB-1.28.9054MIPSR2-beta-Ext) on Sunday. I've seen the problem both Monday and Tuesday after returning from work.

Some other things I can add:

When the iPhone does connect, it does a DHCPREQUEST for the address it had at work, the router returns a DHCPNAK and then the phone requests a new IP and all goes well.

The phone seems to ignore the DHCP lease time and excessively requests (21 times in the last 50 minutes and I have lease time of 10080 minutes.)

I really suspect it is some problem the firmware on the phone is having after moving from WPA2-TKIP to WEP. And, I bet there is some way of getting wifi debugging info that may offer more insight, but I can't figure out what that is.

Any chance that something like WireShark and Etherape (run in linux - Ubuntu, for instance) … ? these show the contents, flow and traffic on a network.

Not really wifi-specific, but certainly might offer a bit more detail to you than what you see in your rtn16's log.

Also, have you tried simplifying your home network, and just using (yes, I know it is not secure…) just MAC filtering, for a short while, to see if you can maintain a viable/reliable connection and reconnect similarly, when no/fewer security measures are on?
(reducing the # of variables is always a good way to start…solve the simplest problem first, add layers as you go…)

hth,

davy

EHHRRR: I guess I didn't realize that it is also available for both Windows and Mac OS X. There is a command-line-version of it, IIRC… maybe called Ethereal?

EDIT #2: I just remembered that tshark and snort are available via Optware- to run on your TomatoUSB router. (perhaps only try this method if you are comfortable w/ CLI stuff and Linux, as a whole).