Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: sendsocketdata1 Denon AV receiver Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
raven77
Groupie
Groupie
Avatar

Joined: January 02 2007
Location: United States
Online Status: Offline
Posts: 44
Posted: September 13 2010 at 04:10 | IP Logged Quote raven77

Well I'm gonna make this quick this time since I lost my last message...
ANNNDD I was actually trying to reply to an old post and also kept losing my message!

I am trying to control my Denon receiver using ph_sendsocketdata1 and I got it working fine but no feedback. I am using PHP to just send the command "PW?\013"
This is basically some of the things i tried...

ph_sendsocketdata1("192.168.1.7",23,3,"PWON\x0D")
ph_sendsocketdata1("192.168.1.7",23,3,"PWON\013")
ph_sendsocketdata1("192.168.1.7",23,3,"PWON\r")
ph_sendsocketdata1("192.168.1.7",23,7,"PWON\x0D")

And just about any other combination there could possibly be. Since I am only sending the command I did try encoding that too ""PWON$5c013" etc...
It works fine over telnet, I get a response back every time.
I also tried it using the default PH formula page. Still no feed back

Any ideas?
Thanks!
Back to Top View raven77's Profile Search for other posts by raven77
 
raven77
Groupie
Groupie
Avatar

Joined: January 02 2007
Location: United States
Online Status: Offline
Posts: 44
Posted: September 13 2010 at 04:15 | IP Logged Quote raven77

I forgot to add the Denon info...

"Protocol specification
The following three data forms are defined.
COMMAND : The message sent to a system(AVR) from a controller(Touch Panel etc.)
A command to a system is given from a controller.
EVENT : The message sent to a controller (Touch Panel etc.) from a system (AVR)
The result is sent, when a system is operated directly and a state changes.
*The form of EVENT presupposes that it is the same as that of COMMAND.
**Refer to the following table for the contents of COMMAND and EVENT.
RESPONSE : The message sent to a controller (Touch Panel etc.) from a system (AVR)
if the ‘request command’ (COMMAND+?+CR(0x0D)) has came from a controller.
The RESPONSE should be sent within 200ms of receiving the COMMAND.
*The form of RESPONSE presupposes that it is the same as that of EVENT.
Basic specification: The command by ASCII CODE, parameter expression
*ASCII CODE which can be used is from 0x20 to 0x7F: the alphabet and the number of 0-9, and space (0x20), some signs,
AND carriage return (0x0D) --- It is used only as a pause sign."
Back to Top View raven77's Profile Search for other posts by raven77
 
nadler
Super User
Super User


Joined: February 25 2006
Location: United States
Online Status: Offline
Posts: 354
Posted: September 13 2010 at 09:52 | IP Logged Quote nadler

I use RS232 to control my denon. It's imperfect however
especially with the presets for net streaming and the delay
in receiving a return message. So because of your post I
decided to try ph_sendsocketdata1. I have the same results
as you do. It controls the receiver but I get no return.
Perhaps Dave can help us out.

You might look at Command3808 (do a google search), a free
program that controls the Denon over IP. It confirms for
me that we should be getting a return in PH.

Noel
Back to Top View nadler's Profile Search for other posts by nadler
 
raven77m
Newbie
Newbie


Joined: December 31 2006
Online Status: Offline
Posts: 24
Posted: September 13 2010 at 15:03 | IP Logged Quote raven77m

Thanks for the reply.
I have command3808 and a few other HTML, PHP, Python, and SQL snippets.
I am already using the RS232 port with my Phillips remote so I need to use TCP/IP for my iPhone app.

If I get it working I will post it here...

Edit: Wow, I wonder why I have 2 user names?!? LOL
I guess I randomly decide to sometimes login is with an "m" at the end...
wierd

Edited by raven77m - September 13 2010 at 15:05
Back to Top View raven77m's Profile Search for other posts by raven77m
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: September 13 2010 at 15:22 | IP Logged Quote BeachBum

It was New Years eve and 2 days later you forgot…. Cheers.

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
raven77m
Newbie
Newbie


Joined: December 31 2006
Online Status: Offline
Posts: 24
Posted: September 13 2010 at 16:41 | IP Logged Quote raven77m

BeachBum wrote:
It was New Years eve and 2 days later you forgot…. Cheers.

LOL!!!!
Good catch!! haha wow, I guess I had a rough one that year!!
Dave, you can delete one of them if ya get a chance.
Back to Top View raven77m's Profile Search for other posts by raven77m
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: September 13 2010 at 17:21 | IP Logged Quote dhoward

Hmmm...Ive looked at all the info above and I don't think the ph_sendsocketdata1 command is going to work in this situation. This function will basically return when the connection is closed by the Denon (which I doubt happens, I think the connection probably remains open for continous communication) or when sending is complete (in which case the Denon hasnt had time to respond so you get no data back). I could probably make a mod for an additional flag to return when data is received.

In the meantime, you should be able to accomplish this using the PH Raw Socket plugin. Its pretty easy to setup and should give you alot more control. To do this, open the PowerHome Explorer and go to Setup|Plugins. Create a new line and set the data as follows:

ID: DENON
Launch Data: PH_Socket.phsocket
Init Data: 192.168.1.7 23

The above is all explained in the help file under plugins. Reinitialize and verify your plugin started by checking Help|About|Plugins.

To send your command, use the following:

ph_picmd(5,"DENON",1,0,0,"PWON~r","")

To get responses, create a trigger of type "Generic Plugin", "DENON" for Trigger ID, Command 1 for Trigger ID Number, and Option 1 for Trigger Value. This trigger will fire whenever data is received from the DENON and will be contained in one of the [TEMP??] variables.

Hope this helps,

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
nadler
Super User
Super User


Joined: February 25 2006
Location: United States
Online Status: Offline
Posts: 354
Posted: September 13 2010 at 17:51 | IP Logged Quote nadler

Thanks Dave. I'm going to try this when I get a few
minutes. BTW the RS232 issue is not a PH issue but a Denon
issue. They have a very awkward implementation for
streaming audio.

Noel
Back to Top View nadler's Profile Search for other posts by nadler
 
raven77m
Newbie
Newbie


Joined: December 31 2006
Online Status: Offline
Posts: 24
Posted: September 13 2010 at 17:53 | IP Logged Quote raven77m

dhoward wrote:
Hmmm...Ive looked at all the info above and I don't think the ph_sendsocketdata1 command is going to work in this situation. This function will basically return when the connection is closed by the Denon (which I doubt happens, I think the connection probably remains open for continous communication) or when sending is complete (in which case the Denon hasnt had time to respond so you get no data back). I could probably make a mod for an additional flag to return when data is received.

In the meantime, you should be able to accomplish this using the PH Raw Socket plugin. Its pretty easy to setup and should give you alot more control. To do this, open the PowerHome Explorer and go to Setup|Plugins. Create a new line and set the data as follows:

ID: DENON
Launch Data: PH_Socket.phsocket
Init Data: 192.168.1.7 23

The above is all explained in the help file under plugins. Reinitialize and verify your plugin started by checking Help|About|Plugins.

To send your command, use the following:

ph_picmd(5,"DENON",1,0,0,"PWON~r","")

To get responses, create a trigger of type "Generic Plugin", "DENON" for Trigger ID, Command 1 for Trigger ID Number, and Option 1 for Trigger Value. This trigger will fire whenever data is received from the DENON and will be contained in one of the [TEMP??] variables.

Hope this helps,

Dave.

WOW sweet!!
I will try it when I get home! (or maybe I will remote home after I fix this darn contrologix problem, shh don't tell)
Thanks for taking the time Dave, you rock!
Back to Top View raven77m's Profile Search for other posts by raven77m
 
raven77m
Newbie
Newbie


Joined: December 31 2006
Online Status: Offline
Posts: 24
Posted: September 15 2010 at 14:04 | IP Logged Quote raven77m

Dave,
Sending commands with this method worked great!
I have 2 questions tho...
I can't have a constant open connection to that port or it locks out my
main remote. I looked through the docs and I seen I can let the ip out
of the plugin and use command 2 to send and 3 to close the port.
But I'm not sure how to do both without using a macro...

Also I create a trigger as described and it fires when it should but I'm
not sure how to get the temp var. to display or which one it is?
I will keep playin with it, I didn't have much time.
Thanks again for your help!

PS one more quick one...
I installed a few plugins with no issue. Bur I tried everything to get the
xpl one to work.
I registered the proper files and followed directions word for word!
I know that's kinda vague, but any ideas
Thanks!$
Back to Top View raven77m's Profile Search for other posts by raven77m
 
MrGibbage
Super User
Super User
Avatar

Joined: October 23 2006
Location: United States
Online Status: Offline
Posts: 513
Posted: September 17 2010 at 13:46 | IP Logged Quote MrGibbage

I've got the 3808 also (awesome receiver, and apparently quite popular among us here in
this forum). Anyway, I was thinking about a way to boost the accuracy of my occupancy
detection system in my house. One current shortfall is that while I am watching tv, I
might be laying on the couch more or less motionless for an hour or two (no couch potato
jokes, please). My occupancy sensors don't detect any movement, and eventually trigger an
empty room condition, which is not actually the case. So, I was thinking, what if I could
figure out if the tv or stereo are turned on? That would trigger an exception and
everything would work then. So, is there a way to detect the on/off state of the 3808?

Failing that, are there audio occupancy sensors that I could use to detect a certain audio
level in the family room?
Back to Top View MrGibbage's Profile Search for other posts by MrGibbage
 
nadler
Super User
Super User


Joined: February 25 2006
Location: United States
Online Status: Offline
Posts: 354
Posted: September 17 2010 at 13:56 | IP Logged Quote nadler

I have a Denon 3310ci but I think the 3808ci will also
allow you to do what you want to do. Use either RS232 or
Dave's super PH_Socket plugin and write a macro or trigger
to set a global variable to ON or OFF depending on the
status of the Denon. Then you can check for the status of
the GV in your occupancy macro.
Back to Top View nadler's Profile Search for other posts by nadler
 
nadler
Super User
Super User


Joined: February 25 2006
Location: United States
Online Status: Offline
Posts: 354
Posted: September 17 2010 at 14:00 | IP Logged Quote nadler

Raven
[temp5] is the variable that returns the info from the
trigger.
You can set a Global variable from the trigger with that
info. For example, in the action field of the trigger:

ph_setglobal_s("RECEIVER","[TEMP5]") where "RECEIVER" is
the global variable name. You can then parse out what you
need from the return using the info in the global variable.

Noel
Back to Top View nadler's Profile Search for other posts by nadler
 
MrGibbage
Super User
Super User
Avatar

Joined: October 23 2006
Location: United States
Online Status: Offline
Posts: 513
Posted: September 17 2010 at 22:16 | IP Logged Quote MrGibbage

I have this working in my house now, and the instructions posted above are PERFECT. Spot
on, guys!

Skip
Back to Top View MrGibbage's Profile Search for other posts by MrGibbage
 
MrGibbage
Super User
Super User
Avatar

Joined: October 23 2006
Location: United States
Online Status: Offline
Posts: 513
Posted: September 22 2010 at 13:58 | IP Logged Quote MrGibbage

This is so cool! I now have a page on my CC web site that I can use to control my receiver.

I was thinking it would be uber cool if I could have my receiver play a siren sound when my burglar alarm
goes off. Anyone know of a clever way to make that happen? I was thinking I could load a mp3 of a siren on
a USB stick, but I thought I'd ask here to see if anyone had any other ideas.

Skip
Back to Top View MrGibbage's Profile Search for other posts by MrGibbage
 
nadler
Super User
Super User


Joined: February 25 2006
Location: United States
Online Status: Offline
Posts: 354
Posted: September 22 2010 at 14:06 | IP Logged Quote nadler

Skip, is the PC's audio output connected to the receiver?
Is the alarm connected to the PC?

Noel

Back to Top View nadler's Profile Search for other posts by nadler
 
MrGibbage
Super User
Super User
Avatar

Joined: October 23 2006
Location: United States
Online Status: Offline
Posts: 513
Posted: September 22 2010 at 17:24 | IP Logged Quote MrGibbage

Duh. That's why I asked. Silly me. Yes, my pc is connected to my
stereo. And my elk alarm is connected to my pc too. It will be easy to
have PH play the sound. Much better than leaving a thumb drive in
the receiver. Thanks :)

Edited by MrGibbage - September 22 2010 at 17:26
Back to Top View MrGibbage's Profile Search for other posts by MrGibbage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: September 29 2010 at 11:06 | IP Logged Quote dhoward

Raven,

In your setup, since you want to open the port, send a command, receive the result, then close the port...you would be best served by declaring the plugin without parameters. Then, when you want to send a command, use the following:

ph_picmd(5,"DENON",2,23,0,"192.168.1.7","") + ph_picmd(5,"DENON",1,0,0,"PWON~r","")

Then, in the trigger for the plugin, you can use a formula like Noel has specified to copy the [TEMP5] variable to a global or similar and issue the command to close the port. This would look like:

ph_setglobal_s("DENONOUTPUT",ph_getvar_s(2,5)) + ph_picmd(5,"DENON",3,0,0,"","")

Concerning the xPL plugin...let me know what errors or returns you're getting when you try to set it up. With this info, I should be able to find where the problem lies.

Dave.

192.168.1.7 23
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
raven77
Groupie
Groupie
Avatar

Joined: January 02 2007
Location: United States
Online Status: Offline
Posts: 44
Posted: October 10 2010 at 16:47 | IP Logged Quote raven77

dhoward wrote:
Raven,

In your setup, since you want to open the port, send a command, receive the result, then close the port...you would be best served by declaring the plugin without parameters. Then, when you want to send a command, use the following:

ph_picmd(5,"DENON",2,23,0,"192.168.1.7","") + ph_picmd(5,"DENON",1,0,0,"PWON~r","")

Then, in the trigger for the plugin, you can use a formula like Noel has specified to copy the [TEMP5] variable to a global or similar and issue the command to close the port. This would look like:

ph_setglobal_s("DENONOUTPUT",ph_getvar_s(2,5)) + ph_picmd(5,"DENON",3,0,0,"","")

Concerning the xPL plugin...let me know what errors or returns you're getting when you try to set it up. With this info, I should be able to find where the problem lies.

Dave.

192.168.1.7 23

Thanks again for the help Dave!
I finally got time to play around with this again...
The above works, but for only one command. After the socket closes
ph_picmd(5,"DENON",2,23,0,"192.168.1.7","")
does not open it again, I just get a "1*ERROR - PLUGIN TIMEOUT" error.
Any ideas?
After I send the command the plugin looks like this...

1
PowerHome Plugin ID: DENON
Plugin Version: 1
SDK Version: 1
Current Status: Enabled.

And while we are on the subject...
my xpl plugin looks like this no matter what I do.

0
PowerHome Plugin ID: XPL
Plugin Version: 0
SDK Version: 0
Current Status: Disabled.

I tried a few different settings but my .ini files currently looks like this.

[setup]
instance=xpl
target=*
interval=5
passhbeat=no
passconfig=no

[filters]
1=*.*.*.*.*.*
2=
3=
4=
5=
6=
7=
8=
9=
10=
11=
12=
13=
14=
15=
16=

thanks again for all your help!!!

Oh and FYI I did register these files
regsvr32 "c:\program files\powerhome\plugins\xplpha.ocx"
regsvr32 "c:\program files\powerhome\plugins\ph_xpl.ocx"

another quick bit of info...
I disabled the trigger so the port wouldnt close and I can still only send this command once before it dies..

ph_picmd(5,"DENON",2,23,0,"192.168.1.7","") + ph_picmd(5,"DENON",1,0,0,"PWON~r","")


Edited by raven77 - October 10 2010 at 16:58
Back to Top View raven77's Profile Search for other posts by raven77
 
MrGibbage
Super User
Super User
Avatar

Joined: October 23 2006
Location: United States
Online Status: Offline
Posts: 513
Posted: April 27 2012 at 11:59 | IP Logged Quote MrGibbage

Old thread here, but I started playing with my Denon this past week, and I am running
into the same problems mentioned here. Has anyone figured out how to maintain a proper
network connection here? You know, open the connection, send a command, receive a
response, close the connection and then be able to do it again as needed?

__________________
Skip
Back to Top View MrGibbage's Profile Search for other posts by MrGibbage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum