What's new

Python script on RT-AC68U

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

will2383

New Around Here
Hi folks,

Recently picked up an Echo Dot, which apparently does not have a native skill to interact with my LG TVOS 3 television. However, there's this nifty Python script that seems to act as an interpretation layer on a separate system: https://github.com/akhan23wgu/amazon-alexa-lg-tv

I was hoping to try to run this on my RT-AC68U on asuswrt-merlin 384.5, as I don't have any other systems that are 'always' on. I'm a bit of a newbie to custom scripts on Asuswrt-merlin. I've got entware and python installed on the router, but I'm not quite sure how to go about the next steps.

First, does it even seem like this script will run on the router? Second, is it as easy as following this for Python scripts? Just put the
Code:
python alexa-tv.py
in the post-mount shell script after putting everything in its correct place in storage?

If I had a spare router then I'd just go to town on testing, but I don't so I'm a little hesitant to just throw things in there without some confirmation that it's the right track. Sorry if this seems basic.

Thanks!
 
That's the backup plan, but would prefer to run it on the router if that's at all possible.

Pi3 should be your primary plan - 2 to 4 times the memory, and it has a full-on Linux distro... and the SD Card is going to be faster than NAND on the Router, and you can choose what size from there - 32GB San Disk cards are reasonably priced these days...

Python on AsusWRT is a tight fit at best...
 
Pi3 should be your primary plan - 2 to 4 times the memory, and it has a full-on Linux distro... and the SD Card is going to be faster than NAND on the Router, and you can choose what size from there - 32GB San Disk cards are reasonably priced these days...

Python on AsusWRT is a tight fit at best...

I figured the one script/function wouldn't over-tax the router. If that's not the case then I'll look into the Pi3.
 
I figured the one script/function wouldn't over-tax the router. If that's not the case then I'll look into the Pi3.

Install Python 2.7 from Entware
Code:
opkg install python

There is Python 3 available too but 2.7 shall serve you well and save resource.

fyi. I'm running a few huge PERL processes on my 56U. Perfectly fine. But note that I'm using 56U as an AP + always-on low-power server.
 
Geez Louise. Why would you want to risk compromising your router by connecting it to a web service you have no control over and that is voice triggered?

It's bad enough Alexa skills are being added to routers to control router functions themselves. This just opens up another attack surface.
 
Geez Louise. Why would you want to risk compromising your router by connecting it to a web service you have no control over and that is voice triggered?

It's bad enough Alexa skills are being added to routers to control router functions themselves. This just opens up another attack surface.

I'm not the smartest fella but it doesn't seem to be connecting the router to a web service for that web service to do whatever it wants... it just has the router look like an IoT device via the python script, and act as an intermediary to control the television with very precise limits on what Alexa can do (turn on/off the TV, change some inputs basically).

Install Python 2.7 from Entware
Code:
opkg install python

There is Python 3 available too but 2.7 shall serve you well and save resource.

fyi. I'm running a few huge PERL processes on my 56U. Perfectly fine. But note that I'm using 56U as an AP + always-on low-power server.

As mentioned previously, I already had python installed, just wasn't completely sure of the steps forward regarding where to put the script, etc.
 
As mentioned previously, I already had python installed, just wasn't completely sure of the steps forward regarding where to put the script, etc.

Take a look in /opt/etc/init.d.

Create your own by modelling one of the Sxxx scripts there. Rename & modify its content for your purpose. Then your custom "server" that runs the python script will start with your router.
 
I'm not the smartest fella but it doesn't seem to be connecting the router to a web service for that web service to do whatever it wants... it just has the router look like an IoT device via the python script, and act as an intermediary to control the television with very precise limits on what Alexa can do (turn on/off the TV, change some inputs basically).



As mentioned previously, I already had python installed, just wasn't completely sure of the steps forward regarding where to put the script, etc.

Those IFTTT services require the router to be remotely accessible over the Internet. Enabling these services will enable WAN access to the webui, which is a bad idea.
 
Those IFTTT services require the router to be remotely accessible over the Internet. Enabling these services will enable WAN access to the webui, which is a bad idea.

I realize on the surface that it may sound like that, but this isn't IFTTT, nor do I think it's an IFTTT-like service. The python script looks like a controllable IoT device to Alexa. Alexa sends a command and the python script is interpreting it, and then sending the correct command/packet to the TV for control. Nothing seems to be getting sent out to the open Internet nor returned as far as the script is concerned -- only Alexa's voice recognition.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top