Oct-22-2017, 08:08 PM
(This post was last modified: Oct-22-2017, 08:57 PM by sparkz_alot.)
I was able to get rid of the error messages, but it still does not turn on the stereo receiver? Here is the latest code:
import time
import telnetlib
HOST = "192.168.1.140"
VSXCommand = "PO"
telnet = telnetlib.Telnet("192.168.1.140", 23)
time.sleep(3)
telnet.write((VSXCommand + "\n").encode('ascii'))
telnet.close()
I started a new session manually with telnet 192.168.1.140 and then typed PO and it worked fine, so I know that it works with Telnet...not sure what I have wrong in the code?
Also tried without telnetlib and does not work?
import sys
import socket
import time
hostname = "192.168.1.140"
VSXCommand = "PO"
connect = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connect.connect((hostname, 23))
time.sleep(3)
connect.send((VSXCommand).encode('ascii'))
connect.send(("\n").encode('ascii'))
connect.close()
import time
import telnetlib
HOST = "192.168.1.140"
VSXCommand = "PO"
telnet = telnetlib.Telnet("192.168.1.140", 23)
time.sleep(3)
telnet.write((VSXCommand + "\n").encode('ascii'))
telnet.close()
I started a new session manually with telnet 192.168.1.140 and then typed PO and it worked fine, so I know that it works with Telnet...not sure what I have wrong in the code?
Also tried without telnetlib and does not work?
import sys
import socket
import time
hostname = "192.168.1.140"
VSXCommand = "PO"
connect = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connect.connect((hostname, 23))
time.sleep(3)
connect.send((VSXCommand).encode('ascii'))
connect.send(("\n").encode('ascii'))
connect.close()