Cynical Denon - Denon and Marantz AV Receiver control

Posted on
Sun Sep 30, 2012 2:44 pm
automaton offline
Posts: 88
Joined: May 23, 2008

Re: Cynical Denon - Denon and Marantz AV Receiver control

Perry,

I'm trying to use the plug-in with a AVR-2113ci receiver.

It communicates with the receiver OK, but when I try to create an action of type "Use Preset" and press the "Edit Action Settings" button, I get the following errors:

Error (client) getXmlFromPlugin() caught exception: empty XML string returned
Cynical Denon Error in getIOMConfigUiXml:
File ".../Server Plugin/cyin/plug.py", line 269, in getIOMConfigUiXmlself._ui = cls.UI(cls)
File ".../Server Plugin/cyin/configui.py", line 59, in __init__self.type = cls
File ".../Server Plugin/cyin/configui.py", line 171, in __setattr__self._ui_values[desc.name] = value
TypeError: 'NoneType' object does not support item assignment

I have also tried to work around this using the "Set Anything" action with field "network_preset" using "00" or "A1" (trying to get the first preset), but this also returns an error:

Trigger Denon Test
Cynical Denon Error 00

Actions like "Select Source", "Audio Volume", etc. work OK.
Any idea what's going on here? I'm just trying to create an action to play specific presets.

Thanks.

Posted on
Sun Sep 30, 2012 3:15 pm
automaton offline
Posts: 88
Joined: May 23, 2008

Re: Cynical Denon - Denon and Marantz AV Receiver control

Perry,

I got the "Set Anything" action with field "network_preset" to work... I guess I did not have anything preset in the location. I still have the previously described issue with the "Use Preset" action.

Posted on
Mon Oct 01, 2012 10:23 pm
automaton offline
Posts: 88
Joined: May 23, 2008

Re: Cynical Denon - Denon and Marantz AV Receiver control

Hi Perry,

I've also noticed that the plug-in doesn't recover when the Denon is unplugged. The state does not change to unavailable as I would have expected, and then when power is restored the plug-in no longer tracks the state of the Denon.

Let me know if I can collect more data for you on this.

Posted on
Tue Oct 02, 2012 8:45 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Denon - Denon and Marantz AV Receiver control

automaton wrote:
Perry,

I'm trying to use the plug-in with a AVR-2113ci receiver.

It communicates with the receiver OK, but when I try to create an action of type "Use Preset" and press the "Edit Action Settings" button, I get the following errors:

Error (client) getXmlFromPlugin() caught exception: empty XML string returned
Cynical Denon Error in getIOMConfigUiXml:
File ".../Server Plugin/cyin/plug.py", line 269, in getIOMConfigUiXmlself._ui = cls.UI(cls)
File ".../Server Plugin/cyin/configui.py", line 59, in __init__self.type = cls
File ".../Server Plugin/cyin/configui.py", line 171, in __setattr__self._ui_values[desc.name] = value
TypeError: 'NoneType' object does not support item assignment


That was an... oversight. Yeah, that's the word. :-) Version 1.0.0b3 should fix that particular issue. Download it from the usual place.

Thanks for the bug report.
-- perry

Posted on
Tue Oct 02, 2012 9:01 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Denon - Denon and Marantz AV Receiver control

automaton wrote:
Hi Perry,

I've also noticed that the plug-in doesn't recover when the Denon is unplugged. The state does not change to unavailable as I would have expected, and then when power is restored the plug-in no longer tracks the state of the Denon.

Let me know if I can collect more data for you on this.


Cynical Denon does not regularly "ping" the device to see if it's still around. As such, it won't notice that the Denon has disconnected (or lost power, or whatever) until it tries to talk to it next time. At that point, we're at the mercy of certain network timeout timers, which will eventually return an error to the plugin, at which point it will change the state to Disconnected momentarily and then immediately try to reconnect (the state will switch to Connecting), and if the Denon makes it back to the network, it will switch back to connected status (after checking it out thoroughly to see what state it's in now). At least that's what happened when I pulled the plug on my Denon's Ethernet just now.

How long is eventually? That depends on a lot of very technical details of how your network switches and routers operate. It can be anywhere from a few seconds to more than a minute. In practice, it's probably 2-10 seconds in most cases.

Give it a try and be patient. If you get no status change after two minutes, let me know and we can take a look at your network and see what's going on.

If you can't live with the uncertainty, you can certainly write your own scheduled "pinger" in Indigo - just a timed action, running every second or minute or whatever strikes your fancy, doing something, anything to your receiver. It doesn't matter what; any communication will find out that it's disappeared from the network. Do keep in mind that the Denons are small, slow boxes (as computers go) that are easily overwhelmed with requests, so don't overdo it.

Cheers
-- perry

Posted on
Tue Oct 02, 2012 9:04 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Denon - Denon and Marantz AV Receiver control

automaton wrote:
Hi Perry,

I've also noticed that the plug-in doesn't recover when the Denon is unplugged. The state does not change to unavailable as I would have expected, and then when power is restored the plug-in no longer tracks the state of the Denon.

Let me know if I can collect more data for you on this.


Oh, and I should note that the above comments are for network connections - they detect when the network interface goes down (which includes network trouble and power loss in a network-connected Denon). There is currently no death detection on a serially connected Denon, and the only answer for those is to disable and re-enable the device.

Cheers
-- perry

Posted on
Wed Oct 03, 2012 8:30 am
automaton offline
Posts: 88
Joined: May 23, 2008

Re: Cynical Denon - Denon and Marantz AV Receiver control

Hi Perry,

Thanks, that fixed the preset selection. I did have some issues loading the plug-in. It told me I already had 1.0b3 installed (when I had 1.0b2 installed), so I had to delete the b2 version and then install b3.

I am using a network connection.

The plug-in becomes out-of-sync with the receiver from time-to-time. I noticed it when I unplugged the receiver and it didn't recover, but now I've noticed that it will get out of sync sometimes after a few hours or overnight. When it gets out of sync, it doesn't recover; the plug-in needs to be reloaded. The plug-in sticks to a state (typically On or standby) and it doesn't change, no matter what you do to the receiver. I can't seem to identify any events that trigger this issue, other than time passing. Sometime it gets out of sync when the receiver is on, and sometimes after a night in standby. Other times it works perfectly. I don't have any [known] network issues, the Denon is operating on DHCP with a reserved address, Indigo server is a fixed IP. When the Denon is out of sync with the plug-in, the Denon is still reachable via the web interface, so connectivity to the Denon seems to be OK.

Let me know how I can help get more information for you.

Posted on
Wed Oct 03, 2012 10:30 am
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Denon - Denon and Marantz AV Receiver control

automaton wrote:
Let me know how I can help get more information for you.

In the plugin configuration dialog, check the Debug checkbox. In the Debug Modules field enter this string:
Code: Select all
denon.avr

Then reload the plugin and use it normally. The Indigo log will now contain a record of all data sent to and from the device. Wait until things have gone wrong, then exercise it a bit to show how sending commands doesn't work right. Finally reload the plugin without resetting or otherwise disturbing the Denon, package up the whole (rather voluminous) log, and send it to me. (Don't post it here. :-))

Cheers
-- perry

Posted on
Sun Oct 21, 2012 11:47 am
BeNoOne offline
Posts: 30
Joined: Oct 11, 2006
Location: Netherlands

Re: Cynical Denon - Denon and Marantz AV Receiver control

perry,

Just stumbled upon this plugin and trying to get to grips with it. I was using a hacked up Cynical Network plugin to do something similar with my AVR4308a, but this one looks much better.
Now I have some questions/observations.
The device states are a bit unclear to me. For example Mute has a True/False state in the device "States:" window, a yes/no state in the "Edit Control Page" window and I think I also saw an on/off and a mute/unmute state. But the biggest problem is that the real state is True/False. The capitals seems to prevent me to use a picture to represent the device's state. So "mute.png" and "mute+on.png" on a control page doesn't work. After some testing I'm convinced that the true/on/yes/false/off/no states are case sensitive. Is it possible to to change this in a future release?

To keep it on the, mute, subject.
In the old plugin is used the following code:

Code: Select all
netId = "org.cynic.indigo.network"
netPlugin = indigo.server.getPlugin(netId)
if netPlugin.isEnabled():
   myDenon = indigo.devices[1079715836]
   if myDenon.states['denonmu'] == 'off':
      netPlugin.executeAction("sendtext", deviceId=1079715836, props={'text':"MUON"})
   else:
      netPlugin.executeAction("sendtext", deviceId=1079715836, props={'text':"MUOFF"})

This way I toggle mute on/off with one button.
I'm a bit lost with the new plugin to get the same result. I tried the following:

Code: Select all
netId = "org.cynic.indigo.denon-av"
netPlugin = indigo.server.getPlugin(netId)
if netPlugin.isEnabled():
   myDenon = indigo.devices[1659533353]
   if myDenon.states['muted'] == 'False':
      netPlugin.executeAction("set_muted", deviceId=1659533353, props={'value':"on"})
   else:
      netPlugin.executeAction("set_muted", deviceId=1659533353, props={'value':"off"})

Obviously this doesn't work. The mute state I can find but I can not change it. Problem is where can I find what attributes and methods the device supports.
Could you shine a light on this?

Thnx,

Bert

Posted on
Sun Oct 21, 2012 1:30 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Denon - Denon and Marantz AV Receiver control

There was some confusion about the handling of boolean values in the plugin. I've released a new version (1.0.0b4) that should fix that. Your sample code for muting should now work.

The boolean state values in AVR devices are actual (Python) bool values, not strings. I was expecting Indigo to honor the "booltype=yesno" clause in the state description and produce "yes" or "no" strings out of that; is that not working?

Cheers
-- perry

Posted on
Mon Oct 22, 2012 12:16 am
BeNoOne offline
Posts: 30
Joined: Oct 11, 2006
Location: Netherlands

Re: Cynical Denon - Denon and Marantz AV Receiver control

Perry,

Installed beta 4 and this version is muting with my code. I'm a bit surprised because I just did some wild guessing on what to put in the "props", but hey sometimes you get lucky.

In the past I had some similar problems with booleans and capitals in relation to control page graphics. And after making them lowercase it seems to work fine. So in short, no it's not working, at least not for me.

I still find Indigo a bit dodgy with control page graphics and variables/device states. Often I have to restart Indigo server or worse reinstall Indigo Touch on my iOS devices to get things working right after I made some changes to the graphic files.

Thnx for the quick b4 update!

Posted on
Wed Oct 31, 2012 11:24 pm
asw24b offline
Posts: 222
Joined: Dec 30, 2007
Location: Los Altos Hills, CA

Re: Cynical Denon - Denon and Marantz AV Receiver control

I am trying to use the plug in with my AVR-4308CI.

When I create the new device, it seems to run into trouble. Here is the debug output:


Reloading plugin "Cynical Denon 1.0.0b4"
Stopping plugin "Cynical Denon 1.0.0b4" (pid 75399)
Plugin "Cynical Denon" disconnected
Starting plugin "Cynical Denon 1.0.0b4" (pid 75414)
Plugin "Cynical Denon" connected
Plugin "Cynical Denon 1.0.0b4" started
Cynical Denon mapping device "Denon in TV Room" 82496423(avreceiver)
Cynical Denon Denon in TV Room starting
Cynical Denon Denon in TV Room connecting to host
Cynical Denon plugin starting asyn operation
Cynical Denon Denon in TV Room is now exploring
Cynical Denon Error in runConcurrentThread: Traceback (most recent call last):
File ".../Server Plugin/cyin/debugging.py", line 46, in diagnostic_log
yield
File ".../Server Plugin/cyin/debugging.py", line 56, in diagnose_call
return method(*args, **kwargs)
File ".../Server Plugin/cyin/asynplugin.py", line 51, in runConcurrentThread
self.run()
File ".../Server Plugin/asyn/inject.py", line 49, in run
asyn.Controller.run(self)
File ".../Server Plugin/asyn/controller.py", line 88, in run
item._can_read()
File ".../Server Plugin/asyn/selectable.py", line 227, in _can_read
result = scan(self._rbuf, self.callout)
File ".../Server Plugin/asyn/scan.py", line 68, in scan
callout(ctx, *m.groups())
File ".../Server Plugin/asyn/core.py", line 140, in callout
results = [cb(ctx, *args) for cb in list(self._callbacks)] # latch callback list
File ".../Server Plugin/denon/avr.py", line 313, in _event
args = filter(self, args)
File ".../Server Plugin/denon/avr.py", line 150, in radio_filter
assert radio == self.radio_type
AssertionError

Cynical Denon Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
Cynical Denon plugin starting asyn operation
Cynical Denon Error in runConcurrentThread: Traceback (most recent call last):
File ".../Server Plugin/cyin/debugging.py", line 46, in diagnostic_log
yield
File ".../Server Plugin/cyin/debugging.py", line 56, in diagnose_call
return method(*args, **kwargs)
File ".../Server Plugin/cyin/asynplugin.py", line 51, in runConcurrentThread
self.run()
File ".../Server Plugin/asyn/inject.py", line 49, in run
asyn.Controller.run(self)
File ".../Server Plugin/asyn/controller.py", line 88, in run
item._can_read()
File ".../Server Plugin/asyn/selectable.py", line 227, in _can_read
result = scan(self._rbuf, self.callout)
File ".../Server Plugin/asyn/scan.py", line 68, in scan
callout(ctx, *m.groups())
File ".../Server Plugin/asyn/core.py", line 140, in callout
results = [cb(ctx, *args) for cb in list(self._callbacks)] # latch callback list
File ".../Server Plugin/denon/avr.py", line 313, in _event
args = filter(self, args)
File ".../Server Plugin/denon/avr.py", line 150, in radio_filter
assert radio == self.radio_type
AssertionError

Cynical Denon Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)





I haven't had a chance to debug it yet; Any ideas ?

Mike

Posted on
Thu Nov 01, 2012 1:17 am
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Denon - Denon and Marantz AV Receiver control

File ".../Server Plugin/denon/avr.py", line 150, in radio_filter
assert radio == self.radio_type
AssertionError
...
I haven't had a chance to debug it yet; Any ideas ?

You've hit a safety check that suggests that your receiver claims to both operate an HD radio and a "normal" one. I wrote the code to expect either one or the other. Interesting. (Of course, I don't have your model, so I was working from general assumptions.)

In the plugin settings, in the Debug Modules field enter the string denon.avr. Reload the plugin; it should now log all messages sent to and from the receiver. Take the whole output and send it to me. That'll help me figure out what your receiver is saying.

If you just want to take your chances, you can remove the assertion (in line 150 of denon/avr.py) and see how far that gets you. It may only affect the radio function.

Cheers
-- perry

Posted on
Fri Nov 02, 2012 9:26 pm
asw24b offline
Posts: 222
Joined: Dec 30, 2007
Location: Los Altos Hills, CA

Re: Cynical Denon - Denon and Marantz AV Receiver control

Perry The Cynic wrote:
File ".../Server Plugin/denon/avr.py", line 150, in radio_filter
assert radio == self.radio_type
AssertionError
...
I haven't had a chance to debug it yet; Any ideas ?

You've hit a safety check that suggests that your receiver claims to both operate an HD radio and a "normal" one. I wrote the code to expect either one or the other. Interesting. (Of course, I don't have your model, so I was working from general assumptions.)

In the plugin settings, in the Debug Modules field enter the string denon.avr. Reload the plugin; it should now log all messages sent to and from the receiver. Take the whole output and send it to me. That'll help me figure out what your receiver is saying.

If you just want to take your chances, you can remove the assertion (in line 150 of denon/avr.py) and see how far that gets you. It may only affect the radio function.

Cheers
-- perry



Enabling plugin "Cynical Denon 1.0.0b4"
Starting plugin "Cynical Denon 1.0.0b4" (pid 79739)
Plugin "Cynical Denon" connected
Cynical Denon module denon.avr enabled debugging
Plugin "Cynical Denon 1.0.0b4" started
Cynical Denon mapping device "Denon in TV Room" 82496423(avreceiver)
Cynical Denon Denon in TV Room starting
Cynical Denon Denon in TV Room connecting to host
Cynical Denon plugin starting asyn operation
Cynical Denon Denon in TV Room is now exploring
Cynical Denon AVR -> TFHD?
Cynical Denon AVR <- <Ctx:<attr:tuner_frequency>> HD 008750
Cynical Denon AVR <- <Ctx:unknown> TFHDMCA
Cynical Denon AVR -> TFAN?
Cynical Denon AVR -> Z2?
Cynical Denon AVR <- <Ctx:<attr:tuner_frequency>> AN 052000
Cynical Denon Error in runConcurrentThread: Traceback (most recent call last):
File ".../Server Plugin/cyin/debugging.py", line 46, in diagnostic_log
yield
File ".../Server Plugin/cyin/debugging.py", line 56, in diagnose_call
return method(*args, **kwargs)
File ".../Server Plugin/cyin/asynplugin.py", line 51, in runConcurrentThread
self.run()
File ".../Server Plugin/asyn/inject.py", line 49, in run
asyn.Controller.run(self)
File ".../Server Plugin/asyn/controller.py", line 88, in run
item._can_read()
File ".../Server Plugin/asyn/selectable.py", line 227, in _can_read
result = scan(self._rbuf, self.callout)
File ".../Server Plugin/asyn/scan.py", line 68, in scan
callout(ctx, *m.groups())
File ".../Server Plugin/asyn/core.py", line 140, in callout
results = [cb(ctx, *args) for cb in list(self._callbacks)] # latch callback list
File ".../Server Plugin/denon/avr.py", line 313, in _event
args = filter(self, args)
File ".../Server Plugin/denon/avr.py", line 150, in radio_filter
assert radio == self.radio_type
AssertionError

Cynical Denon Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
Cynical Denon plugin starting asyn operation
Cynical Denon AVR -> Z3?
Cynical Denon AVR <- <Ctx:<attr:tuner_frequency>> AN 052000
Cynical Denon Error in runConcurrentThread: Traceback (most recent call last):
File ".../Server Plugin/cyin/debugging.py", line 46, in diagnostic_log
yield
File ".../Server Plugin/cyin/debugging.py", line 56, in diagnose_call
return method(*args, **kwargs)
File ".../Server Plugin/cyin/asynplugin.py", line 51, in runConcurrentThread
self.run()
File ".../Server Plugin/asyn/inject.py", line 49, in run
asyn.Controller.run(self)
File ".../Server Plugin/asyn/controller.py", line 88, in run
item._can_read()
File ".../Server Plugin/asyn/selectable.py", line 227, in _can_read
result = scan(self._rbuf, self.callout)
File ".../Server Plugin/asyn/scan.py", line 68, in scan
callout(ctx, *m.groups())
File ".../Server Plugin/asyn/core.py", line 140, in callout
results = [cb(ctx, *args) for cb in list(self._callbacks)] # latch callback list
File ".../Server Plugin/denon/avr.py", line 313, in _event
args = filter(self, args)
File ".../Server Plugin/denon/avr.py", line 150, in radio_filter
assert radio == self.radio_type
AssertionError

Cynical Denon Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
Cynical Denon plugin starting asyn operation
Cynical Denon AVR -> Z4?
Cynical Denon AVR <- <Ctx:<attr:tuner_frequency>> AN 052000
Cynical Denon Error in runConcurrentThread: Traceback (most recent call last):
File ".../Server Plugin/cyin/debugging.py", line 46, in diagnostic_log
yield
File ".../Server Plugin/cyin/debugging.py", line 56, in diagnose_call
return method(*args, **kwargs)
File ".../Server Plugin/cyin/asynplugin.py", line 51, in runConcurrentThread
self.run()
File ".../Server Plugin/asyn/inject.py", line 49, in run
asyn.Controller.run(self)
File ".../Server Plugin/asyn/controller.py", line 88, in run
item._can_read()
File ".../Server Plugin/asyn/selectable.py", line 227, in _can_read
result = scan(self._rbuf, self.callout)
File ".../Server Plugin/asyn/scan.py", line 68, in scan
callout(ctx, *m.groups())
File ".../Server Plugin/asyn/core.py", line 140, in callout
results = [cb(ctx, *args) for cb in list(self._callbacks)] # latch callback list
File ".../Server Plugin/denon/avr.py", line 313, in _event
args = filter(self, args)
File ".../Server Plugin/denon/avr.py", line 150, in radio_filter
assert radio == self.radio_type
AssertionError

Cynical Denon Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
Disabling plugin "Cynical Denon 1.0.0b4"
Stopping plugin "Cynical Denon 1.0.0b4" (pid 79739)
Plugin "Cynical Denon" disconnected

Posted on
Fri Nov 02, 2012 10:26 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Denon - Denon and Marantz AV Receiver control

Sure enough. My plugin's strategy is to ask for both the HD and AN ("analog", i.e. old-style radio) frequencies and see which one the tuner replies to. Denons basically have no error reporting; they just eat anything they don't understand. So here we go:
Cynical Denon AVR -> TFHD?

"Hey, Denon, what's your HD radio frequency?"
Cynical Denon AVR <- <Ctx:<attr:tuner_frequency>> HD 008750

"I've got an HD radio tuned to 87.5FM!"
Cynical Denon AVR <- <Ctx:unknown> TFHDMCA
Cynical Denon AVR -> TFAN?

"Hey Denon, what's your analog frequency?"
Cynical Denon AVR <- <Ctx:<attr:tuner_frequency>> AN 052000

"My analog frequency is 520KHz."
And the plugin panics (wisely - it's not written for what's reported as two different tuners).

Now I can't find a protocol description for the AVR-4308CI anywhere online (how old is this thing?). Is it supposed to really have two radios, or is the firmware just getting a bit, well, confused?

Cheers
-- perry

Who is online

Users browsing this forum: No registered users and 1 guest

cron