Page 3 of 3

Denon & Globalcache

Posted: Monday 16 March 2015 10:22
by Iron Man
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:

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
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.

Denon & Globalcache

Posted: Monday 23 March 2015 16:33
by Iron Man
Today I was told that it might be possible to rewrite the python code as a JavaScript.

Does any of you have an idea how to rewrite thit:

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 hope someone could give me an example of the code rewritten in JavaScript.

Re: Denon & Globalcache

Posted: Monday 23 March 2015 18:35
by antwan

Re: Denon & Globalcache

Posted: Thursday 28 April 2016 2:08
by trixwood