ESP8266 doesn't connect to WiFi using WPA2/TKIP
Posted: Tue May 10, 2016 1:27 am
This is the module I'm using: http://www.electrodragon.com/product/wi ... d-esp8266/
WiFi Router is MikroTik 951-2n
It connects OK to my android phone's AP, and also to the neighbor's free network. Get's an IP address and all, but when I connect it to my router, it has a weird problem.
My router has two WiFi networks - A WPA2 one and an open one.
When I connect to the open one everything seems OK and the DHCP client works but no packets get in or out of the module.
Looks like this:
[code]>>> w.connect('Public-Internet', '')
f 0, >>> scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
connected with Public-Internet, channel 6
dhcp client start...
cnt
ip:10.0.1.200,mask:255.255.255.0,gw:10.0.1.1
pm open,type:2 0
>>> w.isconnected()
True
>>> w.ifconfig()
('10.0.1.200', '255.255.255.0', '10.0.1.1', '10.0.1.1')
>>> import socket
>>> socket.getaddrinfo('google.com', 80)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: -2[/code]
When I connect to the WPA2 network, it doesn't even really connect, even though the router logs a connection attempt:
[code]>>> w.connect('Zeev', 'asdfqwer')
f r0, >>> scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
cnt
pm open,type:2 0
>>> w.isconnected()
False
>>> w.ifconfig()
('0.0.0.0', '0.0.0.0', '0.0.0.0', '10.0.1.1')
>>> socket.getaddrinfo('google.com', 80)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: -2
[/code]
Anyone has any ideas? I tried everything. Erased and reflashed several times with --flash_size=32m, changed MTU, channel and encryption settings on the router. I'm stumped.
Thanks for any help.
WiFi Router is MikroTik 951-2n
It connects OK to my android phone's AP, and also to the neighbor's free network. Get's an IP address and all, but when I connect it to my router, it has a weird problem.
My router has two WiFi networks - A WPA2 one and an open one.
When I connect to the open one everything seems OK and the DHCP client works but no packets get in or out of the module.
Looks like this:
[code]>>> w.connect('Public-Internet', '')
f 0, >>> scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
connected with Public-Internet, channel 6
dhcp client start...
cnt
ip:10.0.1.200,mask:255.255.255.0,gw:10.0.1.1
pm open,type:2 0
>>> w.isconnected()
True
>>> w.ifconfig()
('10.0.1.200', '255.255.255.0', '10.0.1.1', '10.0.1.1')
>>> import socket
>>> socket.getaddrinfo('google.com', 80)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: -2[/code]
When I connect to the WPA2 network, it doesn't even really connect, even though the router logs a connection attempt:
[code]>>> w.connect('Zeev', 'asdfqwer')
f r0, >>> scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
cnt
pm open,type:2 0
>>> w.isconnected()
False
>>> w.ifconfig()
('0.0.0.0', '0.0.0.0', '0.0.0.0', '10.0.1.1')
>>> socket.getaddrinfo('google.com', 80)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: -2
[/code]
Anyone has any ideas? I tried everything. Erased and reflashed several times with --flash_size=32m, changed MTU, channel and encryption settings on the router. I'm stumped.
Thanks for any help.