New Marantz TCP Control Plugin

Questions and comments specific to a particular plugin should go here.

Re: New Marantz TCP Control Plugin

Postby yokel22 » Sun Jan 08, 2017 3:49 pm

So what would happen when another client connects? IE: WebUI, Android/iOS app. Would you just set a retry when it times out?
yokel22
Experienced User
 
Posts: 89
Joined: Thu Feb 05, 2015 5:56 pm
Location: U.S. - Kansas city

Re: New Marantz TCP Control Plugin

Postby kkl » Sun Jan 08, 2017 5:10 pm

If possible, I would suggest that all additional clients connect to computer 1. If computer 2 is off, computer 3 will have nothing to connect to.
kkl
Experienced User
 
Posts: 305
Joined: Wed May 04, 2011 9:32 pm

Re: New Marantz TCP Control Plugin

Postby kgschlosser » Mon Jan 09, 2017 5:36 am

because of the nature of the plugin and how I could set it up..

I know I know you are going to love me for this....


But I could have it set up to handle more then one connection. and to forward all the information back and forth.

what this would mean is that EG would essentially turn into a hub for the AVR. meaning that anything you want to use to control the thing. just point it to EG instead. and EG can handle simultaneous connections.

so what you would end up with is the ability to have android, ios, multiple EG computers all connected at the same time.

:-D

You leave EG connected to the AVR and anything else is pointed to EG. so there would not be an issue with EG connecting to the AVR, well there shouldn't be.
Brain Test:
How much dirt is in a hole 2' X 2' X 2' ???
-----------------------------------------------------
Your in a house with an all southern view. You look out a window and see a bear....
What color is it? And why?
User avatar
kgschlosser
Site Admin
 
Posts: 1578
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: New Marantz TCP Control Plugin

Postby kgschlosser » Mon Jan 09, 2017 5:38 am

kkl wrote:If possible, I would suggest that all additional clients connect to computer 1. If computer 2 is off, computer 3 will have nothing to connect to.


I know. I was just busting your ass. but you could daisy chain them like that if you wanted.

and I also think because the commands are really small and the communication is very limited. that i will be able to use non blocking sockets instead of select to handle the multiple connections. But i would have to use object locking and set up 2 threads to do this. one to just handle the communications and if an event comes in have it load the queue with the event. so the other thread it's sole purpose would be to empty the queue and process the data and trigger any events. If i run into an issue I could set up a 3rd to take care of the forwarding...

I think this is going to be the best for fast response.

1 thread set up to read data coming from the AVR and process any messages and trigger an event if needs be. but when it gets the data. that thread will place it into a queue. this can be a blocking socket connection. meaning it will just sit there and do nothing unless it gets something from the AVR.

a second thread will read that queue and send the data out to all of the other connected devices. and it will also take care of getting any data from any of the connected devices and sending it out to the AVR

I think this will be the best solution. but if for some reason there is an issue with speed i can figure something out.

I am going to hammer out the connection bits tonight..

@kkl. I have that list of commands if you want to do the ever so boring job of keying in nice friendly descriptions and event names. I just have to finish up keying in some comments but the way you see it laid out has to stay that way. for the time being. I can convert it from there. if this is something you wish to on take let me know.

Also I am going to add being able to use a serial connection as well. because the API is the same for TCP and Serial.
Brain Test:
How much dirt is in a hole 2' X 2' X 2' ???
-----------------------------------------------------
Your in a house with an all southern view. You look out a window and see a bear....
What color is it? And why?
User avatar
kgschlosser
Site Admin
 
Posts: 1578
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: New Marantz TCP Control Plugin

Postby kgschlosser » Mon Jan 09, 2017 6:03 am

I am also going to set up a set of commands specifically for the sole purpose of being able to key in a number from a remote.

for instance. if you marry a specific button on a remote to an action that sets a toggle the next button you press... like volume up will then put the plugin into a mode where it will wait for user input for the volume. and shut down all other actions from working. this way you can place the events into multiple actions for the plugin without having to disable or enable things. so the numbers on your remote will only work for the set volume action and by pressing the volume key again will cause the command to be sent and all the actions to be turned back on again
Brain Test:
How much dirt is in a hole 2' X 2' X 2' ???
-----------------------------------------------------
Your in a house with an all southern view. You look out a window and see a bear....
What color is it? And why?
User avatar
kgschlosser
Site Admin
 
Posts: 1578
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: New Marantz TCP Control Plugin

Postby kgschlosser » Mon Jan 09, 2017 7:36 am

**********EDIT THIS NOW HAS ALMOST ALL OF THE COMMANDS****************

I was going to add it as code but 62000 characters the forum didn't like LOL.

so it is attached as a file

well here is the command list.

It has to be cleaned up. descriptions that are blank filled in or descriptions that are incorrect to be fixed. this is going to require going back and forth between the excel command list. because of how they made that list and spread the description across multiple commands in the same group it cause some issues with formatting. so you can understand what is going on if you read through the descriptions in the group to be able to key in proper descriptions for each item.

the layout is like this

Code: Select all

Zone / Device Control / Other

    Command Group

        Command1
        Command2
        Command3
        .......


and the layout of each command is like so

EventGhost Action, Description, AVR Command, AVR Responses

the EventGhost Action is dynamically created at EG startup so any characters you see in it other then letters and numbers and underscore cannot be there. so i would note it and i will go and look.

the description may have double quotes in it they need to be removed. and any other garbage formatting. this is the actual action name that appears in the EG tree. so the shorter the better

the AVR Command or in any of the responses if you see <CR> mark it and let me know. if you see any numbers as well let me know. ** is normal, so is \r
Attachments
Marantz-Commands.Py
(67.32 KiB) Downloaded 20 times
Brain Test:
How much dirt is in a hole 2' X 2' X 2' ???
-----------------------------------------------------
Your in a house with an all southern view. You look out a window and see a bear....
What color is it? And why?
User avatar
kgschlosser
Site Admin
 
Posts: 1578
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: New Marantz TCP Control Plugin

Postby kkl » Mon Jan 09, 2017 3:28 pm

kgschlosser wrote:Also I am going to add being able to use a serial connection as well. because the API is the same for TCP and Serial.


That's very interesting. Perhaps you'd make this portion a standalone so that people can use it for other devices that can have only one serial or telnet connection at a time. Most of what you said went way over my head, but it's clear you think way outside the box and have the skills to match.

I'll test the basic functionality today and work on editing the descriptions that need it. Edit: OK, I see the attachment is just the command list. I will edit those.
kkl
Experienced User
 
Posts: 305
Joined: Wed May 04, 2011 9:32 pm

Re: New Marantz TCP Control Plugin

Postby kgschlosser » Mon Jan 09, 2017 7:36 pm

that is all the atgtachment is... took me long time to get it to that point. that was a lot of code to write up to parse that damned file. I am sure i could have had it be a little better. but ya have to weight it.. amount of time reading it for errors. then code to fix the error. then build and read again. it gets to a point if it was only one error of the kind far easier to just fix it manually. LOL
Brain Test:
How much dirt is in a hole 2' X 2' X 2' ???
-----------------------------------------------------
Your in a house with an all southern view. You look out a window and see a bear....
What color is it? And why?
User avatar
kgschlosser
Site Admin
 
Posts: 1578
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: New Marantz TCP Control Plugin

Postby kgschlosser » Mon Jan 09, 2017 7:38 pm

what i have done so far on the plugin side is i have the whole socket portion set up with the echoing.. i decided to go by route of making a new thread to handle each new connection. this way there is no possibility of any kind of a degradation in performance.
Brain Test:
How much dirt is in a hole 2' X 2' X 2' ???
-----------------------------------------------------
Your in a house with an all southern view. You look out a window and see a bear....
What color is it? And why?
User avatar
kgschlosser
Site Admin
 
Posts: 1578
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: New Marantz TCP Control Plugin

Postby kkl » Tue Jan 10, 2017 1:55 am

Wow, that was mind-numbingly tedious. I think it would have been easier to edit the spreadsheet first. I know there are things I've screwed up, but I'm uncertain of some of the Denon command syntax.

Do all of the EG Actions need to be unique? There are some entries that are just a hyphen. See spreadsheet lines 408, 409, 416 for examples. Those 'commands' are all 'MS -'. Not sure what those are supposed to be.

There were still some <CR> entries, most from multi-line response examples. I changed them to \r. Example at line 693+ of the spreadsheet. Not sure what is appropriate.

Lots of command groupings of the same pattern: Up, Down, Input #, Status. For example, PS BAS (line 462 of spreadsheet). As I understand it, the Denon commands are PSBAS UP, PSBAS DOWN, and PSBAS ** where two digit number is entered. You have all of them as PSBAS **. Will that work, or should the first two be PSBAS UP and PSBAS DOWN? Similarly, the PSLFL discrete commands are all PSLFL **. Probably just my lack of understanding.

The "USB/iPod Control" section is empty.

"Zone 3 Control" seems to have gotten into the wrong section, Zone2Stdby. I started to edit, but got confused, so need some help there.

There are other entries I'm unsure of, but I think it will be easier once there is a draft plug-in to view in action.

Since you don't have a Denon/Marantz receiver, would be helpful to you if I opened a port to mine so that you can make sure the basic I/O works?
Attachments
Marantz-Commands5.Py
(77.91 KiB) Downloaded 21 times
kkl
Experienced User
 
Posts: 305
Joined: Wed May 04, 2011 9:32 pm

Re: New Marantz TCP Control Plugin

Postby kgschlosser » Tue Jan 10, 2017 2:44 am

I do tend to code up intil about 3 AM or so Mountain Standard Time -7 hours. and I don't want you to hear click click click from the AVR in the middle of the night. LOL

so it's up to you

Here is an egplugin file with the connection bits done. This will work along side of your existing plugin so no need to remove it. but you will have to disable it.

the forwarding is also done as well. tho you will have to test it to let me know if you get any errors. as i do not own a receiver this is going to be a tedious process.

yeah and I know the output wasn't perfect as far as the action list...

the ** is a flag so the plugin knows that command needs user input.

i will take a look at what you have shortly
Attachments
MarantzAVR - 0.0.4b.egplugin
(5.7 KiB) Downloaded 20 times
Brain Test:
How much dirt is in a hole 2' X 2' X 2' ???
-----------------------------------------------------
Your in a house with an all southern view. You look out a window and see a bear....
What color is it? And why?
User avatar
kgschlosser
Site Admin
 
Posts: 1578
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: New Marantz TCP Control Plugin

Postby kkl » Tue Jan 10, 2017 5:56 am

Installed fine. Bug on sending commands:

Capture20.JPG


I don't have time to setup remote access tonight, but can do tomorrow if needed to resolve.
kkl
Experienced User
 
Posts: 305
Joined: Wed May 04, 2011 9:32 pm

Re: New Marantz TCP Control Plugin

Postby kgschlosser » Tue Jan 10, 2017 9:08 am

Yeah it was a fat finger.. supposed to be Send. not send


fixed version is attached.. I can only test as far as opening the plugin. unless i set up a couple of telnet servers. but i will not get answers and what have you. so it's really pointless

update on the actions:

I have 700 of the 950+ completely formatted. been at it for 4 hours now.. i said screw it and started from scratch and have been keying each one so there will be less issues.. I think it will be better this way..

but what I did discover is that everything seems to be in a pattern. so the event portion should be a breeze. because i can use the description of the action in the event just remove the spaces from it.. and if the response has any digits in it to add them to the end of the event. there are a very small number of actions that can trigger a response that is not identical to a send command. so what i will have the plugin do is to iterate the whole list of actions and create a dict with all possible responses translated out to an event
payload for the event would be something like this
Code: Select all
[-32, 'Main Zone Volume'']


the purpose for this would be you can use the actual number separate from the text like the example below. Which produces a very nice OSD mind you for the volume.
This code converts the volume range from -80, -18 to a 0, 100 to make the bar. something like this would be useful if the computer that controls the AVR is in a different room. and you wanted a nice purdy display on that computer

Code: Select all
osdFill = '|'
osdEmpty - '.'
volumeMax = -18
volumeMin = -80
actualVolume, volumeText = eg.event.payload

volume = (((actualVolume - volumeMax) * 100) / (volumeMax - volumeMin)) + 100

osdText = '%s %s%s  %ddB' % (volumeText , osdFill  * volume, osdEmpty * (100 - volume), actualVolume)
eg.plugins.EventGhost.ShowOSD(osdText, u'0;-64;0;0;0;700;255;0;0;0;3;2;1;82;Gabriola', (37, 251, 32), (0, 0, 0), 5, (0, 0), 0, 5.0, False)
Attachments
MarantzAVR - 0.0.5b.egplugin
(5.7 KiB) Downloaded 21 times
Brain Test:
How much dirt is in a hole 2' X 2' X 2' ???
-----------------------------------------------------
Your in a house with an all southern view. You look out a window and see a bear....
What color is it? And why?
User avatar
kgschlosser
Site Admin
 
Posts: 1578
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: New Marantz TCP Control Plugin

Postby kgschlosser » Tue Jan 10, 2017 6:59 pm

I only have 1 section left. and that's the net audio. everything else is done with the actions. then i have to rewrite the rest of the plugin and bring the actions into the plugin.. that is going to take time. but the crap work is almost done...

YAY!!

I need to know if the forwarding is working properly. and I am also going to look into seeing if the AVR broadcasts any UPNP information. if it does i will be able to have the plugin automatically capture the AVR
Brain Test:
How much dirt is in a hole 2' X 2' X 2' ???
-----------------------------------------------------
Your in a house with an all southern view. You look out a window and see a bear....
What color is it? And why?
User avatar
kgschlosser
Site Admin
 
Posts: 1578
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: New Marantz TCP Control Plugin

Postby kkl » Tue Jan 10, 2017 11:27 pm

VERY cool. Installed on PC1; ticked EchoServer. Everything appeared to be working fine. Installed on PC2 and configured for IP of PC1. Again, everything worked fine. Duplicate events appearing on both PCs and both able to send commands. I'll PM you the IP so you can see for yourself and check for UPNP. Edit: Yes, all Denon network capable products are DLNA and UPnP compliant.
kkl
Experienced User
 
Posts: 305
Joined: Wed May 04, 2011 9:32 pm

PreviousNext

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 11 guests