Sending telnet commands to Denon/Marantz?

Discussion in 'Mac Programming' started by blueroom, Feb 11, 2015.

  1. blueroom macrumors 603

    blueroom

    Joined:
    Feb 15, 2009
    Location:
    Toronto, Canada
    #1
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    There is a telnet shell command. Here's its man page:
    https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/telnet.1.html

    You can invoke telnet in a "Run Shell Script" Automator action. The specific commands to send over the network would be given in the shell command.

    You can also enter the telnet command in a Terminal window, and that's where I recommend you do your testing and experiments.


    First, is your Marantz receiver correctly connected to your network? This is the first step to connecting to it using telnet.

    If it's correctly connected, then what is its IP address? You'll need this in order to tell the telnet command where to connect.

    If you have the receiver's IP address, enter this in a Terminal window:
    Code:
    telnet PUT_YOUR_ACTUAL_IP_ADDRESS_HERE
    
    You should then see a connection progress indication like:
    Code:
    Trying 192.168.1.1...
    Connected to 192.168.1.1.
    
    You should then see a telnet> prompt, indicating it's waiting for your command.

    If you don't see a telnet> prompt, then no connection was made. Copy and paste the complete command you entered, and the complete output it produced into a reply and post it here.


    According to the PDF reference doc you listed, the PW command controls power. There are two possible parameters, ON and STANDBY.

    Enter the following exactly at your telnet> prompt:
    Code:
    PWON
    
    then press your RETURN key.

    What happens? Does the receiver turn on?

    Then enter the following at your telnet> prompt:
    Code:
    PWSTANDBY
    
    and again end with the RETURN key.

    Again, what happens? The receiver should go to standby mode (off).

    You should also be able to ask the receiver what its power state is:
    Code:
    PW?
    
    and it will tell you.


    Once you have a live telnet connection, you can experiment with the different commands the receiver accepts. You'll need to do this to figure things out.

    You should also experiment with the mode where you put the receiver's commands on the command-line along with the 'telnet' command. E.g.
    Code:
    telnet YOUR__IP_ADDRESS "PWSTANDBY"
    
    Note this is a completely fabricated and untested example. You'll need to familiarize yourself with telnet and with your receiver to know what command-line to use.

    Once you have a specific command ready and tested, then you can put it into an Automator workflow by adding a "Run Shell Script" and typing in the exact telnet command.
     
  3. blueroom, Feb 11, 2015
    Last edited: Feb 11, 2015

    blueroom thread starter macrumors 603

    blueroom

    Joined:
    Feb 15, 2009
    Location:
    Toronto, Canada
    #3
    Hmm, doesn't seem to do anything on the Consolette.
    Code:
    telnet 10.0.1.79
    Trying 10.0.1.79...
    Connected to 10.0.1.79.
    Escape character is '^]'.
    PW?
    
    Nothing is returned.

    Hmm, MV? returns the volume level...
    e.g.
    MV?
    returns
    MV28

    and
    MV30
    sets the volume to 30
     
  4. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #4
    I don't know why PW? doesn't return the power state. Maybe you have to enter an empty line before the first command. That's a guess, and I can't tell just by reading the manual.

    The manual shows PW? as returning the current power state. I don't have any Marantz equipment here, so I'm not in a position to test anything. All I've got is what I see in the manual.
     
  5. blueroom thread starter macrumors 603

    blueroom

    Joined:
    Feb 15, 2009
    Location:
    Toronto, Canada
    #5
    Thanks for the help, many of the commands work but seems the Consolette uses a variation on the Denon theme.

    Any advice on how to automate the process, in an ideal world I wish I could write an OSX app that sits in the menubar much like OSX's volume control.
     
  6. ratsg macrumors 6502

    Joined:
    Dec 6, 2010
    #6
  7. Ganesha macrumors regular

    Joined:
    Aug 4, 2009
    #7
    This example of a regular Cocoa app will get you started with network sockets using Swift.

    Look at the various Swift demos out there and get to the point where you know how to tie a button to an action.

    Here is a lousy example of what to do. Simple 3 button program, 1 button opens, 1 button closes and 1 sends text.

    Lousy means at the very least: does not read inStream, no checking for network errors, everything is done in one class which just wrong but fine for examples.

    Code:
    class ViewController: NSViewController {
        var inStream :NSInputStream?
        var outStream :NSOutputStream?
    
        @IBAction func openConnectionButton(sender: NSButton) {
            NSStream.getStreamsToHostWithName("localhost", port: 23, inputStream: &inStream, outputStream: &outStream)
            
            inStream!.open()
            outStream!.open()
            
            while (inStream!.streamStatus == NSStreamStatus.Opening) {}
        }
        
        @IBAction func closeConnectionButton(sender: NSButton) {
            if (inStream == nil) {
                return
            }
            inStream!.close()
            outStream!.close()
        }
        
        
        @IBAction func sendTextButton(sender: NSButton) {
            sendText("test string\r\n");
        }
        
        
        func sendText(commandString: String) {
            if (inStream == nil) {
                return
            }
            
            switch (inStream!.streamStatus) {
            case .Open:
                outStream!.write(commandString, maxLength: countElements(commandString) + 1)
                break;
                
            default:
                break;
            }
        }
    }
    
     
  8. blueroom thread starter macrumors 603

    blueroom

    Joined:
    Feb 15, 2009
    Location:
    Toronto, Canada
  9. Jonas97 macrumors newbie

    Jonas97

    Joined:
    Jul 26, 2015
    #9
    Because writing this message in a conversation was considered as Spam, I try to ask you directly in your topic.
    I read your topic around communicating with your AVR via Telnet commands
    http://forums.macrumors.com/threads/sending-telnet-commands-to-denon-marantz.1846063/, where you informed yourself about a possible Automator or Swift Solutions and now I want to know how far you got.
    Because sometimes I thought about controlling my Pioneer AVR via my Mac and so I found many topics about the terminal solution, but like you I want to build a (graphical) Swift-Solution. I started with working on some code but I haven't come far. If you came to a solution or if you have an attempt or some advice for me to build a program like this, or just the whole program, I would appreciate to get it.

    Yours Sincerely

    Jonas
     
  10. robvas macrumors 68020

    Joined:
    Mar 29, 2009
    Location:
    USA
    #10
    I wrote a similar program in Python using Pyserial it was pretty easy. Used Tkinter for the graphical interface (just a few buttons)

    Talks to a tester we have at work, you give it commands like RD1? and then you get results out of it with another command.
     
  11. bouchal macrumors newbie

    Joined:
    Jan 31, 2016
    #11
    hello,
    I am lookingfor some information to enable the PANDORA icon in the Menu.
    I have bought a denon x2200 in europe, and the pandora menu does not show up in the "One Line Music" Menu.
    I think this would be possible to activate it by telnet.
    When i telnet to the box, i have: "BridgeCo AG Telnet server"
    i can not enter any command, it seems that it does not answer to my SIPANDORA command or PWON command....
    Any help?
    Tx
    B
     

Share This Page