Denon & Globalcache
Posted: Monday 16 March 2015 10:22
I am using my Raspberry Pi with Domoticz on it, that’s also the place where my python codes are stored on. The python codes are used to control my Denon amplifier.
De python codes look like this:
For the PHP support, I think it can be installed on the raspberry if it isn’t already on it.
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.
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.