Skip to content

Instantly share code, notes, and snippets.

@hierophect
Created December 20, 2020 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hierophect/b6bcdca453166038307b40d5647d9352 to your computer and use it in GitHub Desktop.
Save hierophect/b6bcdca453166038307b40d5647d9352 to your computer and use it in GitHub Desktop.
Client on Host
import socket
HOST = '192.168.10.115' # ESP32S2 IP ADDRESS
PORT = 80 # The port used by the server
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST, PORT))
s.sendall(b'Hello, world')
data = s.recv(1024)
print('Received', repr(data))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment