Could you pls post the entirely code that worked for you. I have tried the exakt code below but It wont work. Of course I┬┤ve changed the IP, Port and sendir post.
1. I ran the script in Eventgost as a pyton spript
2. I┬┤ve opened the port, 4998 in my routers firewall
Code: Select all
import socket
HOST = 192.168.0.13
PORT = 4998
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.settimeout(5.0)
s.connect((HOST, PORT)) # the Host in " " works too.
s.sendall("sendir,1:1,4,38000,11,342,172,22,22,22,64,22,22,22,22,22,64,22,22,22,64,22,64,22,64,22,22,22,64,22,64,22,22,22,64,22,64,22,22,22,22,22,22,22,64,22,22,22,22,22,22,22,22,22,22,22,64,22,64,22,22,22,64,22,64,22,64,22,64,22,64,22,1484,342,85,22,3677"+"\r\n") rsp = s.recv(4096)
print rsp
s.close()
except socket.error, e:
print e
I get this:
Error compiling script.
Traceback (most recent call last):
SyntaxError: invalid syntax (7, line 14)
Can someone pls help me to fins whats wrong or just give me some guidance!
Thanks