Posts: 136
Threads: 18
Joined: Apr 2017
Reputation:
1
Hi,
Could some help with writing a TCP/IP protocol command?
I would like to send a command to ip address 1.1.1.1 with port 11.
The command is PWON and the regular expression is <CR>
This is so I can communicate with my Denon AVR.
Also for status I like know how to pull/request a status..?
Anyone?
BR
Mr.D
Posts: 184
Threads: 39
Joined: Sep 2015
Reputation:
4
(22.01.2018, 17:19)Mr. Danielsen Wrote: Hi,
Could some help with writing a TCP/IP protocol command?
I would like to send a command to ip address 1.1.1.1 with port 11.
The command is PWON and the regular expression is <CR>
This is so I can communicate with my Denon AVR.
Also for status I like know how to pull/request a status..?
Anyone?
BR
Mr.D
Try this:
Code: nextline = '\r\n'
local socket = require("socket")
local tcp = assert(socket.tcp())
tcp:settimeout(0.3)
connected,err = tcp:connect('1.1.1,1', '5000')
result,err = tcp:send('PWON' .. nextline)
local rec,status,partial = tcp:receive('*a')
closing = tcp:close()
Posts: 136
Threads: 18
Joined: Apr 2017
Reputation:
1
nextline = '\r\n'
What should be filled in for r and n?
Aslo, for the *a?
I tried it as it was, except I changed the IP address and the port to the AVR receiver, but the script did not work...
Br.
Mr.D
Posts: 184
Threads: 39
Joined: Sep 2015
Reputation:
4
(24.01.2018, 18:12)Mr. Danielsen Wrote: nextline = '\r\n'
What should be filled in for r and n?
Aslo, for the *a?
I tried it as it was, except I changed the IP address and the port to the AVR receiver, but the script did not work...
Br.
Mr.D
The '\r\n' is short for carriage return/newline. Nothing to change.
You should change nothing except the IP address.
This is an extract of a longer script I use to control my Denon.
Are you sure your Denon listens to another port? What port do you use?
BR
Posts: 136
Threads: 18
Joined: Apr 2017
Reputation:
1
Hi,
I re-did the process. It seems that there was a small error in the script for IP address.
I have used a , instead of .
Now it works
I am using port 23, using port 5000 does not work for me
The Denon I am using is AVR 3313...
How do I collect the status of the AVR?
Thanks for your help
BR,
Mr.D
Posts: 184
Threads: 39
Joined: Sep 2015
Reputation:
4
(24.01.2018, 18:38)Mr. Danielsen Wrote: Hi,
I re-did the process. It seems that there was a small error in the script for IP address.
I have used a , instead of .
Now it works
I am using port 23, using port 5000 does not work for me
The Denon I am using is AVR 3313...
How do I collect the status of the AVR?
Thanks for your help
BR,
Mr.D
Glad that it works.
So you are using the standard telnet port. I forgot why I am actually using port 5000...
Remember that you can only have one connection at the time.
I have an AVR X2200.
I believe that the response of the AVR is in the 'result' variable. I do nothing with it at the moment...
BR.
Posts: 136
Threads: 18
Joined: Apr 2017
Reputation:
1
Hi,
Ok Thanks for you help!
BR,
Mr.D
Posts: 4
Threads: 0
Joined: Jun 2018
Reputation:
0
Hello,
I also have a Denon Receiver. AVR-X2300W or the AVR-X2100W. I am trying to send it strings via RS232 and IP but it does not respond.
To increase the volume, I've tried MVUP, MVUP\r\n, MVUP<CR>, MVUP0x0D, MVUP^M^J (ELK-M1G Carraige Return), but nothing seems to cause a change in the receiver.
I can connect and then control the receiver via the factory Denon remote while I monitor the strings sent from the receiver. If I increase the volume from 45 to 45.5 I see MV455. I send MV46 to change the volume to 46 using all the types of carriage returns and I get nothing.
Sometimes the receiver will respond to a command out of the blue, but nothing consistent.
When I use the Denon App on iPhone, I also see the strings leaving the receiver, as I change the volume, so I am pretty sure if my phone can communicate over IP, then I should also be able to as well. As a test, I deleted the app because I read somewhere that the receiver can only handle one connection at a time. Still no change.
Any help is appreciated.
Thank You
Posts: 1764
Threads: 6
Joined: Jul 2015
Reputation:
117
Hi,
Have you tried this sample already? (not sure if it is also for your device)
http://openrb.com/example-use-lm2-as-tcp...e-theater/
BR,
Erwin
Posts: 4
Threads: 0
Joined: Jun 2018
Reputation:
0
(11.06.2018, 21:47)Erwin van der Zwart Wrote: Hi,
Have you tried this sample already? (not sure if it is also for your device)
http://openrb.com/example-use-lm2-as-tcp...e-theater/
BR,
Erwin
That could be where I am having issues. All I am doing is connecting to the IP Address of my Denon on Port 23. I am then sending individual commands. MVUP<CR> for example. After some more research, I cannot remember where, it said that the Denon is looking for a "packet" of information and it must be received in 40ms. I am only sending the single string.
What I am trying to accomplish is this... I have an M1G Security System with an M1XEP Ethernet Expander. I can send IP strings from the M1XEP to another IP Address and Port (hopefully the Denon Receiver). When I disarm the alarm, I want the M1XEP to send strings to the Denon to turn on, go to a specific source, and raise the volume to 45. I have accomplished this with an older Integra Receiver with no issues, so I am baffled by this on the Denon.
ELK Products also makes an M1XSP Serial Expander that I could connect straight serial to the Denon, but so far testing with my computer and a USB-Serial cable is not working either. The M1XSP also works with the Integra receiver.
This may also be the wrong community, but I am hoping some of this knowledge is transferable.
Posts: 184
Threads: 39
Joined: Sep 2015
Reputation:
4
(12.06.2018, 15:02)NLCarrII Wrote: (11.06.2018, 21:47)Erwin van der Zwart Wrote: Hi,
Have you tried this sample already? (not sure if it is also for your device)
http://openrb.com/example-use-lm2-as-tcp...e-theater/
BR,
Erwin
That could be where I am having issues. All I am doing is connecting to the IP Address of my Denon on Port 23. I am then sending individual commands. MVUP<CR> for example. After some more research, I cannot remember where, it said that the Denon is looking for a "packet" of information and it must be received in 40ms. I am only sending the single string.
What I am trying to accomplish is this... I have an M1G Security System with an M1XEP Ethernet Expander. I can send IP strings from the M1XEP to another IP Address and Port (hopefully the Denon Receiver). When I disarm the alarm, I want the M1XEP to send strings to the Denon to turn on, go to a specific source, and raise the volume to 45. I have accomplished this with an older Integra Receiver with no issues, so I am baffled by this on the Denon.
ELK Products also makes an M1XSP Serial Expander that I could connect straight serial to the Denon, but so far testing with my computer and a USB-Serial cable is not working either. The M1XSP also works with the Integra receiver.
This may also be the wrong community, but I am hoping some of this knowledge is transferable.
When you first send the command to turn the Denon ON (PWON) , you have to wait 1 second before sending the next command.
Posts: 4
Threads: 0
Joined: Jun 2018
Reputation:
0
Thanks everyone for your help. I tried more this morning and still had no luck. Just to be sure... Do I need a Carriage Return, or can I just send PWON?
I downloaded a program named Hercules HW and connected to the Denon on Port 23, and again I can see all the traffic. When I power on with the remote, I get something similar to PWON ZMON and when I power off with the remote, I get PWSTANDBY ZMOFF. I have tried sending the same commands in the same order with no luck.
I can post a screenshot of all the feedback I am receiving or sending, if needed.
Posts: 7758
Threads: 42
Joined: Jun 2015
Reputation:
447
CR (\r) is required for the device to distinguish each command
Posts: 4
Threads: 0
Joined: Jun 2018
Reputation:
0
14.06.2018, 13:31
(This post was last modified: 15.06.2018, 15:21 by NLCarrII.)
(14.06.2018, 05:58)admin Wrote: CR (\r) is required for the device to distinguish each command
OK. I will try sending PWON\r instead of PWON\r\n and go from there. Thank You.
Also... Does the Denon App for iPhone connect on Port 23 or on a different port, or would it create a conflict with the messages I am trying to send?
Last night my receiver requested I do a FW Update and I thought this may fix it if something is jammed up in the memory. After the update, no change. Found out how to do a Factory Default, still no change. I am going to try and contact Denon Technical Support. Maybe I am missing something glaringly obvious that they can point out to me.
|