import network

station = network.WLAN(network.STA_IF) # Konfiguration des Network-Interfaces
station.active(True)
station.connect('mipa_devolo', 'asdfghjkl1234') # hier Ihre WLan-Daten eintragen!
while station.isconnected() == False:
  pass
print('WLAN connected')
print(station.ifconfig()) # zur Information


import socket

server_addr = ('time.fu-berlin.de', 13)
# server_addr = ('130.133.1.10', 13) # IP mit socket.getaddrinfo ermittelt
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(server_addr)
print('Socket connected')

data = client.recv(1024) # max. Anz. der Bytes
print(str(data,'UTF-8'))
client.close()
print('Socket closed')
station.active(False)
print('Wlan deactivated')







