commclient/udp_socket_client.py

17 lines
276 B
Python
Executable File

#!/usr/bin/python2
import socket
import time
import wireless
target = "192.168.178.21"
port = 5005
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
w = wireless.wireless("wlan0")
while 1:
msg = "#WIFI:LEVEL:" + w.level()
s.sendto(msg, (target, port))
time.sleep(1)