Controlling Denon AVR with Send/Expect

143 views
Skip to first unread message

R Arslanian

unread,
Apr 9, 2018, 5:24:13 PM4/9/18
to Android Send/Expect

I am exploring send/expect in hopes I can use it through tasker to control my AVR (and possibly my smart tv).  Using the Denon AVR (telnet) protocol commands I am able to send commands to it with PuTTy.  The reason I want to use Send/Expect is so I can write tasks that check the state of the AVR and send the appropriate control command(s).  For instance the power commands are either power on (PWON) or power standby (PWSTANDBY) so I would need two buttons on my smartphone remote.  But if I could ask the power state first (PW?) in a task I could have a power toggle button in my remote. The commands all work in PuTTy perfectly. When I run the power state command (PW?) in PuTTy it immediately returns the power state. In the example below the AVR is ON response "PWON".

In send/expect the control commands work by I do not see the response to any state command that I send.  I have tried adding a pause after send but nothing shows up in a toast or in the log. What am I doing wrong?

Thanks,
Bob

Bob

unread,
Apr 9, 2018, 5:46:54 PM4/9/18
to Android Send/Expect
Here is the log from tasker for the send power state request.

  {
    "timestamp": 0,
    "recordType": "Start",
    "recordData": "Tasker"
  },
  {
    "timestamp": 0,
    "recordType": "Version",
    "recordData": "2020050"
  },
  {
    "timestamp": 0,
    "recordType": "Send/Expect Data",
    "recordData": "Timeout seconds: 2\nSend (original): PW?\\r\nSend (variables replaced): PW?\\r\n"
  },
  {
    "timestamp": 0,
    "recordType": "Connection Started",
    "recordData": "192.168.4.52:23"
  },
  {
    "timestamp": 12,
    "recordType": "Connection Completed",
    "recordData": "192.168.4.52:23"
  },
  {
    "timestamp": 12,
    "recordType": "Send",
    "recordData": "PW?\\r"
  },
  {
    "timestamp": 13,
    "recordType": "Data Sent",
    "recordData": null
  },
  {
    "timestamp": 13,
    "recordType": "Disconnect",
    "recordData": null
  },
  {
    "timestamp": 13,
    "recordType": "Succeeded",
    "recordData": null
  }
]

David

unread,
Apr 9, 2018, 6:25:49 PM4/9/18
to android-s...@googlegroups.com
Hello.

How long a pause did you try after the send?

Also, looking at your profile, it looks like your send has an extra backslash in it.   \\r\n instead of \r\n.

Also, do you want an expect, after the send, in order to grab the response?

David

Bob

unread,
Apr 9, 2018, 7:07:52 PM4/9/18
to Android Send/Expect
David,
Sorry I am new to this.  I realized after that I did not apply changes to tasker and there was no pause or expect.. Typo on the second backslash. I did another search on the google group thread for hints for syntax (especially for expect). I found another post controlling a Denon/Marantz AVR and was able to understand what I did wrong.  https://groups.google.com/forum/#!topicsearchin/android-send-expect/PW$3F;context-place=searchin/android-send-expect/PW$3F|sort:date/android-send-expect/UsI3lrIEOT4 
It seems to working properly now. Time to read up on syntax and regular expressions.

Thanks for the quick response.
Bob
Reply all
Reply to author
Forward
0 new messages