I am trying to run a mini web server on my ESP32 feather huzzah32, but I hit an error every time I try to open the console. I tried several times, updated everything, erased the flash also few time to start over and the same.
The line 37 seems to have a problem I cannot figure out.
When I am done with compiling and upload the code, I see this error:
(IOError @[0047:0013:0000:0048:0000:0000:0000:0000]
oops, something wrong while linkin:
(IOError at line 37 of main raised at line 97 of wireless.wifi.link
Here is my code.
import streams
import socket
from wireless import wifi
from espressif.esp32net import esp32wifi as wifi_driver
streams.serial()
wifi_driver.auto_init()
wifi.link("my-ssid",wifi.WIFI_WPA2,"my-password")
except Exception as e:
print("ooops, something wrong while linking :(", e)
while True:
sleep(1000)
print("Linked!")
info = wifi.link_info()
print("My IP is:",info[0])
sock = socket.socket()
sock.bind(80)
sock.listen()
while True:
try:
client = streams.SocketStream(clientsock)
line = client.readline()
while line!="\n" and line!="\r\n":
line = client.readline()
print("HTTP request received!")
print("HTTP/1.1 200 OK\r",stream=client)
print("Content-Type: text/html\r",stream=client)
print("Connection: close\r\n\r",stream=client)
print("<html><body>Hello Zerynth!",random(0,100),"</body></html>",stream=client)
client.close()
except Exception as e:
print("ooops, something wrong:",e)
I am using Zerynth.
Any ideas?