iwconfig not setting essid?

If iwconfig wlan0 essid blah is seemingly not working when connecting to a open wireless network, then try

  1. iwconfig wlan0 essid blah

  2. iwconfig wlan0 key open

  3. iwconfig wlan0 enc off

The above seems to work for me by turning off encryption. It would appear with encryption enabled, iwconfig won't work for a open network because of some magic or other. If it still doesn't work, then try stick the above in your /etc/network/interfaces and prefix the commands with "wireless-", like so:

allow-hotplug wlan0

iface wlan0 inet dhcp

wireless-essid blah

wireless-key open

wireless-enc off

Hope this help some people, it drove me nuts!