Hi, i´m trying to send → s.send (“set_digital_out(2,False)” + “\n”) , but i get TypeError: a bytes-like object is required, not ‘str’.
Does anyone know a solution? Thanks!
Code:
Echo client program
import socket
import time
HOST = “172.16.200.62” # The remote host
PORT = 30002 # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.send (“set_digital_out(2,False)” + “\n”)
s.send (“running”+“\n”)
data = s.recv(1024)
s.close()
print (“Received”, repr(data))