changed something
parent
167ef97546
commit
4fdd837110
5
main.py
5
main.py
|
@ -99,9 +99,7 @@ def socket_listener():
|
||||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
||||||
s.bind((SOCKET_BIND_IP, SOCKET_BIND_PORT))
|
s.bind((SOCKET_BIND_IP, SOCKET_BIND_PORT))
|
||||||
s.listen()
|
s.listen()
|
||||||
global conn
|
return s.accept()
|
||||||
global addr
|
|
||||||
conn, addr = s.accept()
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL)
|
strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL)
|
||||||
|
@ -116,6 +114,7 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
|
conn, addr = socket_listener()
|
||||||
socket_data = conn.recv(1024)
|
socket_data = conn.recv(1024)
|
||||||
print(socket_data)
|
print(socket_data)
|
||||||
print(type(socket_data))
|
print(type(socket_data))
|
||||||
|
|
Loading…
Reference in New Issue