Denon & Globalcache

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

User avatar
Iron Man
Posts: 17
Joined: Wednesday 05 March 2014 21:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherland
Contact:

Denon & Globalcache

Post 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.
User avatar
Iron Man
Posts: 17
Joined: Wednesday 05 March 2014 21:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherland
Contact:

Denon & Globalcache

Post 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.
antwan
Posts: 116
Joined: Saturday 13 July 2013 13:28
Target OS: Linux
Domoticz version: Latest
Location: Hilversum, The Netherlands
Contact:

Re: Denon & Globalcache

Post by antwan »

Rasp Pi 2B: 3x DS18S20 (1-wire), BME280 (i2c)
Cubietruck 1: Aeotec Z-Wave+, RFXtrx433XL+P1, RFXtrx868, TE923 display, SolarEdge API
Cubietruck 2: Aeotec Z-Wave, Voltcraft CO-20
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest