question

Marco Di Lorenzo avatar image
Marco Di Lorenzo asked

Interfacing Alexa with Marantz device via telnet

Hello,


I would like to send some commands to my Marantz NR1504 amplifier from my Echo. Consider that newest Marantz device with HEOS are natively interfaced with Alexa but not this one; still, it can accept commands via telnet protocol on port 23, so I was thinking to somehow take advantage of this from a custom skill but:

1) I see no available skill / tool to send telnet commands from Alexa

2) even worse, the Marantz device is not exposed on internet and it is only reachable from a local address (192.168.1.xxx), so it cannot be reached easily from - say - a lambda function.


Any idea on how to accomplish this? I was thinking of having an old android phone repurposed, installing a telnet client there and somehow having Alexa invoking it but still I can't think of a way to do it.

Thanks!

alexa
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Andy Whitworth avatar image
Andy Whitworth answered

If you write a custom skill then there will be a telnet client library available e.g. for Node then https://www.npmjs.com/package/telnet-client

So that's the lambda side of things sorted. Regarding your local network, you would need to add port forwarding to your home router to expose the amplifier to the internet. Using a dynamicDNS provider will give you a fixed internet address which you can then access the amplifier through. HOWEVER! You are now exposing the amplifier to the internet and that raises security issues which you would need to consider and decide on your risk tolerance!

So it's quite easy, but there are security issues.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Marco Di Lorenzo avatar image
Marco Di Lorenzo answered

Thanks a lot Andy. I did a quick test and I'm having some troubles enabling the port fwding but I am confident it just takes some time to get it right on my router.

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Andy Whitworth avatar image Andy Whitworth commented ·
I'm sure you'll get there! One tip is to expose a different port number to the internet rather than the internal telnet default port (23). Let the port forwarding map the external port number to the internal port 23. This is because hackers run scripts which look for open well known ports such as telnet port 23. If you've exposed a port externally of say "8050" then it's not obvious what is connected to it. Your telnet client in your Alexa lambda code can then be configured to connect to port 8050 at your dynamicDNS domain name.
1 Like 1 ·