# wlan-station-webserver-03.py.txt from wlan_connect import s, led import web_pages_neu cnt = 0 print(dir(web_pages)) try: # beendet bei 'OSError: [Errno 22] EINVAL' while True: print(".", end = "") conn, addr = s.accept() #print('Habe ein Verbindung: ', str(addr)) request = str(conn.recv(1024), "UTF-8") request = request[0:request.find("\n")]; if request.find("/favicon.ico")==-1: print(request) cnt += 1 if request.find("GET /led_on")==0: led.value(1) response = web_pages.led_status(cnt,1) elif request.find("GET /led_off")==0: led.value(0) response = web_pages.led_status(cnt,0) elif request.find("GET /seite")==0: response = web_pages.seite1(cnt) elif request.find("GET / HTTP/1.1")==0: response = web_pages.startseite(cnt) else: print("UNKONW") led.value( not led.value() ) response = web_pages.unknown(cnt) conn.send(response) else: pass conn.close() except OSError: print("\n\nHardreset ausführen")