I love my X10, but the frustration with getting it to connect to my Netgear DG834 router was getting to me, so I dedicated an afternoon to working out a solution and I've found one that works for me, so I hope it'll work for you too.
Summary of problem
The phone will connect to the Router once, and once only. Any attempt to re-connect to the wifi will result in the phone disconnecting, scanning again, then discinnecting until the user gives up. Nothing will cause the phone to reconnect (telling it to forget the connection for example). The only surefire way to reconnect is to reboot the router each time - not ideal.
Manually adding a Static IP also doesn't work - which is weird as that is how I've solved it, see below.
Scale of problem
The problem seems to be with the router and not necessarily the phone as it appears to be on a wide range of phones (Hero, Droid, Touch HD etc.). Seeing at the DG834 is the most popular router in the world, and Android is growing all the time, there are a large number of people affected.
However Iphone and Symbian phones appear to be unaffected.
Reason for the problem
Currently unknown, but appears to be something to do with the handshaking procedure when a device asks the router for an address (DHCP) - though as to what I don't know.
1) Download an app called WiFiStatic from the App Market. WiFiStatic takes each DHCP assigned IP address and stores it in a small database to be re-applied whenever you are back in range of the same Router again. It is not an ideal solution as you may have to re-scan and re-assign if you visit a busy hotspot, but this is a two press function, so it's not that onerous.
2) Turn off your Router. Make sure the WiFi on your phone is off too.
3) With the router off, clear your Remembered WiFi connections (or at the very least the Netgear connection). Once that's done, turn the Router on again and wait until it is full back up again.
4) When the Router is fully operational again, turn on your wifi on the phone and let is scan for and connect to the Netgear Router. You may need to tell it to connect from the Wireless Settings menu on the phone.
5) The phone should now connect to the Router successfully. If it doesn't, repeat the above procedure.
6) With the phone connected to the router, fire up WiFiStatic. Check Auto Switch and Show Visual Prompt if they are not already selected, then Tap Add configuration at the bottom of the screen.
7) The IP address and other settings assigned by your router should be displayed at the top of the screen, at the bottom should be the name of your router and its MAC address. If not then tap Menu > Generate to populate the form.
8)Tap Menu > Done when everything is ok.
That's it. Now when you move into range of your Netgear, you should get connected, though it does take a bit longer than normal (the Router still wants to assign an address first before accepting the static IP). You can speed this up by changing the Device table on the router to always keep the Phone's static IP open.
This shouldn't work as all my other attempts with Static IP failed, but I've had five days now of instant connection to WiFi at home, so something has been freed up.