Marantz/Denon Plugin Development

Questions and comments specific to a particular plugin should go here.
User avatar
kgschlosser
Site Admin
Posts: 5145
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Marantz/Denon Plugin Development

Post by kgschlosser » Fri Jan 20, 2017 4:25 am

This is a thread for the development of a new Marantz/Denon plugin. The new plugin will have a lot of added features.

Anything you download from this thread is in development so don't expect it to work 100%. but if you have either a Marantz or a Denon AVR and would like to test go right ahead.
If you don't and just want to contribute some ideas, go right ahead.

This is going to be a large project as we are working on incorporating every single command. I do not believe there is a plugin for any Home automation system to date that can do this.

Also solves an issue of having simultaneous connections to the AVR, as the AVR does not allow this. This plugin acts as a go between passing data back and forth between any additional connections. all you would do is connect to the computer running EG on port 23. This Plugin allows for an unlimited number for additional connections, the only restriction would be the power of your computer.

We have also been chattering about adding a webUI which hopefully will also contain all of the commands. as the current one located on the AVR does not. but it will also have some customization features. colors ect...

If you have any python coding ability and wish to help... jump right on in.. take the plugin add something to it. and post it in here.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5145
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Marantz/Denon Plugin Development

Post by kgschlosser » Fri Jan 20, 2017 4:26 am

Here is a newer version. I have incorporated a connection error retry. there is a 5 second delay between each retry. on it's 6th time it will error out completely. I think that 30 seconds should be enough time for the AVR to figure out what it's doing.

I have also added more to the debugging routine. this will now put any traceback information into that debug file as well as any in and out data from the echo clients
Attachments
MarantzAVR-0.5b.egplugin
(37.04 KiB) Downloaded 166 times
If you like the work I have been doing then feel free to Image

kkl
Experienced User
Posts: 317
Joined: Wed May 04, 2011 9:32 pm

Re: Marantz/Denon Plugin Development

Post by kkl » Fri Jan 20, 2017 4:59 am

Looks like the connect/disconnect is working better in this version. I had no problems with closing/opening EG. Here are those MIA log files. It appears that the responses are spitting out, just way... later. The commands are being executing when they're issued, it's just the response/event that's happening later. It doesn't start out that way, but it doesn't take many commands before the lag is happening.
Attachments
MarantzDebugLog.txt
(4.83 KiB) Downloaded 137 times
MarantzDebugLog1.txt
(2.82 KiB) Downloaded 135 times

User avatar
kgschlosser
Site Admin
Posts: 5145
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Marantz/Denon Plugin Development

Post by kgschlosser » Fri Jan 20, 2017 7:39 am

I think i know what's causing it !!
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5145
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Marantz/Denon Plugin Development

Post by kgschlosser » Fri Jan 20, 2017 7:48 am

swap out these files

i am pretty sure what was happening is that a bunch of responses were coming in back to back. then i only did an If to check for one /r but if they were stacked on top of each other i would only grab the one. then go back to receiving. which is blocking. so it would sit there until another response came in and at which point it would pop out the first int he list.

so i changed the if to w while '/r' so it should process every single response in the queue if more then one of them cam in a single send by the AVR.. it could be that the avr stacks the messages and sends them as one send. instead of a send for each...

that is my mistake on how it functions.

i am pretty sure this will fix the foul up.. thank you for being patient while we test this bugger
Attachments
telnetclient.py
(3.24 KiB) Downloaded 122 times
telnetserver.py
(5.39 KiB) Downloaded 127 times
If you like the work I have been doing then feel free to Image

kkl
Experienced User
Posts: 317
Joined: Wed May 04, 2011 9:32 pm

Re: Marantz/Denon Plugin Development

Post by kkl » Fri Jan 20, 2017 5:29 pm

I suspect you're very close, but looks like similar problem to earlier: AttributeError: 'NoneType' object has no attribute 'send'

Code: Select all

Marantz Echo Server Started
Plugin: Marantz AVR Serial/TCP/Forwarding
Marantz AVR Serial/TCP/Forwarding: Master Power Status
   Error in Action: "Marantz AVR Serial/TCP/Forwarding: Master Power Status"
   Traceback (most recent call last) (1722):
     File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
       return self(*args)
     File "C:\ProgramData\EventGhost\plugins\MarantzAVR\actions.py", line 64, in __call__
       self.plugin.sendCommand(comm)
     File "C:\ProgramData\EventGhost\plugins\MarantzAVR\__init__.py", line 255, in sendCommand
       self.client.Send(cmd + '\r')
     File "C:\ProgramData\EventGhost\plugins\MarantzAVR\telnetclient.py", line 89, in Send
       self.sock.send(message)
   AttributeError: 'NoneType' object has no attribute 'send'
Marantz AVR connection error
Traceback (most recent call last):
  File "C:\ProgramData\EventGhost\plugins\MarantzAVR\telnetclient.py", line 45, in Connect
    s.connect((self.host, self.port))
  File "<string>", line 1, in connect
error: [Errno 10061] No connection could be made because the target machine actively refused it
Attachments
MarantzDebugLog.txt
(4.26 KiB) Downloaded 129 times

User avatar
kgschlosser
Site Admin
Posts: 5145
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Marantz/Denon Plugin Development

Post by kgschlosser » Fri Jan 20, 2017 6:54 pm

i need to see the whole log.. that is just a piece of it.. there is nothing in there with it attempting or making it's initial connection


EDIT****


OK i see it now.. never mind...

I have to add a cache for sent commands... or an event/notification that the AVR is not connected yet maybe a return value of False from the action so that way you can use eg.result to check and if it hasn't sent to run another action that i will make that will create a thread to try sending the command when the connection has been made.

but at the moment
You have to wait until you see the AVR connected notification. you are trying to send data before it has even established a connection... I do not know why it is taking so long for your AVR to drop the connection..I will poke around the code some more just to make sure that i am closing the socket in a manner that the AVR has no issues with... calling socketclose() does not appear to be doing the job. and there is no reference to any kind of a command to be sent that will close it down from the AVR end of things. maybe just slamming the door shut is what it wants.. i will try that. but other wise i am at a loss as to why it takes so long for the AVR to realize there is no one connected. when i connect to my telnet client i have running it connects and disconnects cleanly.
If you like the work I have been doing then feel free to Image

kkl
Experienced User
Posts: 317
Joined: Wed May 04, 2011 9:32 pm

Re: Marantz/Denon Plugin Development

Post by kkl » Fri Jan 20, 2017 8:59 pm

Hmmm. Even after waiting a very long time, it never connected. I finally had to pull the plug on the receiver and after plugging it back in, the connection took.

The good news is that the responses/events are now coming out in a timely manner and proper order. There are many, many unknown events, presumably because they don't exist in the spreadsheet. But at least now you're on the home stretch of minor cleanup.

I'll do some more testing of specific commands now. Anything in particular you want to see?
Attachments
MarantzDebugLog - Copy (2).txt
(18.06 KiB) Downloaded 119 times

User avatar
kgschlosser
Site Admin
Posts: 5145
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Marantz/Denon Plugin Development

Post by kgschlosser » Fri Jan 20, 2017 10:00 pm

hell 3/4 of it is not going to work right.

but if you send me the log so i can take a look see at these incoming responses to see what they are...

and I still haven't heard anything back from Marantz yet.. if i don't by the end of the day. this weekend i will locate the North America CEO's e-mail. and blast him.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5145
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Marantz/Denon Plugin Development

Post by kgschlosser » Fri Jan 20, 2017 10:23 pm

SYMOAVR = system model number
SYMOAVR-X3200WUSA = the model number of the AVR you are using

SYMODTUN - system model local
SYMODTUN USA = USA version

SS - system settings
SSLANG - language (SSLAN ENG)

SSSO - system settings source this is whether or not you want to allow use of a specific source input but is also useful i knowing what source inputs are available on the AVR
SSSODDVD USE
SSSODBD USE
SSSODTV USE
SSSODSAT/CBL USE
SSSODMPLAY USE
SSSODBT USE
SSSODGAME USE
SSSODAUX1 USE
SSSODCD USE
SSSODAUX2 USE
SSSODTUNER USE
SSSODUSB/IPOD USE
SSSODFAVORITES USE
SSSODIRADIO USE
'SSSODPANDORA USE
SSSODSIRIUSXM USE
SSSODSERVER USE

MVMAX - what the max main volume level is for that avr

SSOSDVOL BOT - Volume OSD location
SSOSDTXT ON - OSD text is turned On
SSOSDFMT NTS - OSD ?
SSOSDPBS ALW - OSD ?

NSFRN Denon AVR-X3200W - model number friendly name

SSLOC OFF - ?

SSFUN - system settings source input user name
this is the name that you assigned to an input
SSFUNDVD (assigned name)
SSFUNBD
SSFUNTV
SSFUNSAT/CBL
SSFUNMPLAY
SSFUNGAME
SSFUNAUX1
SSFUNCD
SSFUNAUX2

PD0000 - ?
SSVCTZMADIS ABS - ?
SSVCTZMAMLV MUT - ?
SSVCTZMALIM OFF - ?
SSVCTZMAPON LAS - ?
SSPAAMOD NOR - ?
R1MAIN ZONE - ?
R2ZONE2 - ?

SSSMG MUS - ?
SSINFAISSIG 02 - ?
SSINFAISFSV 48K - ?

OPTPN01 thru OPTPN0156 - ?
OPTPSTUNER01 thru OPTPSTUNER56 - ?
OPTPSTUNERBLA thru OPTPSTUNERBLG - ?


the Zone 2 and Zone 3 volumes are not working properly


most of these are system setting options and parameters. there is a system menu on the AVR. look for a setting that has 48K in it or something that has a value where MUS would be apart of the value

and the actual name of the setting will in some way align with the response from the AVR.. and you can shoot those back over to me.. I can add them. but this information only seems to come out when when you do a status query of the power. some of them show up for others but not as many. this is a really good thing because on a new connection i can set up the pluigin to turn on or off specific actions based on what the acr supports. but also include whatever user friendly name a user may have given to an input. I can deep six the setting for the max volume because the MVMAX tells me where the limit is
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5145
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Marantz/Denon Plugin Development

Post by kgschlosser » Fri Jan 20, 2017 10:34 pm

it looks as tho it is working as it should now.. I just have to deal with that connection thing..
and you have to remember the plugin will only try to connect for 30 seconds then it will throw an error.
If you like the work I have been doing then feel free to Image

kkl
Experienced User
Posts: 317
Joined: Wed May 04, 2011 9:32 pm

Re: Marantz/Denon Plugin Development

Post by kkl » Sun Jan 22, 2017 8:59 pm

It seems to be working well. I just went through a bunch of commands to capture a log for you. Some commands don't get a response, but I think most of those are either because my receiver doesn't support it or because that input isn't active. You can see the "unknown message" responses. There may not be a reason to deal with many of them if they aren't part of a documented response.
Attachments
MarantzDebugLog - Copy.txt
(41.82 KiB) Downloaded 115 times

User avatar
kgschlosser
Site Admin
Posts: 5145
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Marantz/Denon Plugin Development

Post by kgschlosser » Mon Jan 23, 2017 1:29 am

it has nothing to do with the documented responses it has to do with the fact they didn't add them all. their API is so messed up. It would have been nice to have a complete API for this.. But we will be able to figure them all out.. so it shouldn't be an issue..
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5145
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Marantz/Denon Plugin Development

Post by kgschlosser » Mon Jan 23, 2017 1:30 am

funny how it stacks the responses into one send instead of doing a send for each of them..
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5145
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Marantz/Denon Plugin Development

Post by kgschlosser » Tue Jan 31, 2017 5:01 am

OK I wanted to post an update... after 2 weeks Marantz finally got back to me.. and sent me the same &@*&^% sheet i already have... and didn't address any of my other questions... so i sent a reply back asking where the "FULL" API documentation is.. with a copy of all the "Undocumented" responses and I also asked once again for something that would tell me what firmware allows for what commands.. And i stated once again to them that using the model number is useless because if they aren't running a specific firmware that supports a specific command then their AVR will not respond to it. there for I should not offer the button as an option..

and their answer to the whole API mess is they didn't want to break backwards compatibility with 3rd party software.. so I stated to them... I really do not think a single sole would have any kind of an issue with remaking something because of the current mess they are dealing with and keep adding onto. and I stated "If you make the API in a manner that would be easy to parse the responses and commands without the need to address each one specifically it would lessen the work that has to be done.." and then i went on to explain laying out each specific zone the first 2 letters/numbers are the identifier for that... the next 2 would be the grouping... say like volume or mute and if nested further like with the channel volumes another 2 letters and so on and so forth.. but what identifies the command would be a : or a . then the command..
example:
ZMVL:DOWN
ZMSI:CD
ZMCVFL:UP
Z2CVLF:UP

with commands like that it would be a snap.. because all you would have to do is associate the 2 character digits with a name/description it would cut down the code to less then 25% of what it currently has to be..

all responses should be exactly the mirror image of this exact routine.. except replace the : or . with some other identifier like a space or a pipe. i also told them to deep six the backwards use of the 18 - -80 to some unknown value for max volume and either a .5 or a 0 depending on the model for the lowest... they need to use the same format as what gets displayed on the AVR OSD and front panel.

Maybe in the future they will do something about it.. but I also stated to them again people buy equipment based on what is available to connect with it.. and because they have an over complicated API no one has made a complete functioning control not even them LOL. I know what i look for something new I do my due diligence to see what is available to control the thing. that is one of the reasons i will never buy another samsung product. because when they bought smarthings they closed the doors on their API and only their stuff can talk to their stuff.. I have a very expensive washing machine and dryer that I am unable to have anything other then their 1/2 working application to control the things.

and they app doesn't even run on a lot of their own product.. how ya like that one.
If you like the work I have been doing then feel free to Image

Post Reply