Let's start out with a couple of simple things. What do you mean when you say that you "fail to get password?" Are you entering the correct password, then getting an error, or is there a chance that you are not entering all of the characters correctly?
It should be pretty straightforward to connect to a Wi-Fi network with your device. Usually a pop-up will give you an option of connecting to an open WiFi network if it detects one, and you just have to enter the password. You might want to check the "show password" box to double check that you enter it exactly.
If that option isn't appearing, just pull down the menu (swipe down from top of screen) and look for the Wi-Fi symbol (it looks like a little slice of pizza). Click on the network name just below below the Wi-Fi symbol (it will be a name like 2Wire508 or ATT401 or something similar if it's a home network and the name hasn't been changed). That will open a list of all nearby networks. Make certain that you are trying to connect to the network that you have the password to, and not a neighbors' network. Enter that password, then click connect and that should be all it takes.
I hope I'm not making it too elementary for you, so no offense intended if I am. If you still have trouble, try to note exactly what it says about the IP address and we can do some more troubleshooting.