I am trying to make an esp8266 talk to an esp32 using a softAP (no internet available). I am using the esp32 as the AP to wich the esp8266 connects to, and I am trying to use sockets to enstablish a fast comunication. I can successfully connect the esp8266 to the esp32 AP using those commands:
esp32 side:
Code: Select all
import network
wifi = network.WLAN(network.AP_IF)
wifi.config(essid='esp32-hello', password='1234')
wifi.active(True)
Code: Select all
import network
wifi = network.WLAN(network.STA_IF)
wifi.active(True)
wifi.connect('esp32-hello','1234')
wifi.isconnected()
>>> True
esp32 side:
Code: Select all
import socket
s = socket.socket()
s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
address = socket.getaddrinfo('0.0.0.0', 9000)[0][-1]
s.bind(address)
s.listen(1)
client_sock, client_addrs = s.accept()
>>>
Code: Select all
wifi.ifconfing()[0]
>>> '192.168.4.1'
Code: Select all
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('192.168.4.1',9000))
>>> Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 9] EBADF