De python codes look like this:
Code: Select all
#!/usr/bin/python
import socket
# set host and port
HOST = 'IP amplifier'
PORT = 23
# connect to Denon
s = socket.socket( socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
# Send Command - Denon - Power On
s.sendall("PWON\r")
# disconnect from Denon
s.close()
# Delay Timer 10 Sec
time.sleep(10)
return
I have also been thinking to use something as node.js to shell execute the python code on the raspberry pi. But I didn’t found a good Linux shell execute program/script/method that works with JavaScript and has the ability to launch the python code.