Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Doesn't work #2

Open
k-bharadwaj opened this issue Apr 22, 2017 · 14 comments
Open

Doesn't work #2

k-bharadwaj opened this issue Apr 22, 2017 · 14 comments

Comments

@k-bharadwaj
Copy link

  • Followed instructions, doesn't seem to work.

amazon-alexa-lg-tv submitter$ python alexa-tv.py
Traceback (most recent call last):
File "alexa-tv.py", line 49, in
u.init_socket()
File "/Users/submitter/amazon-alexa-lg-tv/fauxmo.py", line 300, in init_socket
dbg("Failed to initialize UPnP sockets:",e)
TypeError: dbg() takes exactly 1 argument (2 given)

@frekel
Copy link

frekel commented May 5, 2017

Can you tell me which version of python you are using?
Maybe I can help you a bit!

@efpe
Copy link
Owner

efpe commented May 8, 2017

That line is clearly wrong, you can try to replace it (and all the similar dbg lines) to:
dbg("Failed to initialize UPnP sockets: {}".format(e))

I will push the code when I have the time. Your problem is not coming from this line but at least you will see the error message.

@andrewdudex
Copy link

I'm having the same issues:

Traceback (most recent call last):

File "alexa-tv.py", line 49, in
u.init_socket()
File "/usr/bin/amazon-alexa-lg-tv/fauxmo.py", line 300, in init_socket
dbg("Failed to initialize UPnP sockets:",e)
TypeError: dbg() takes exactly 1 argument (2 given)

I tried changing that line of code you suggested, efpe, and it seemed to move forward but my echo could never mind the server...

@andrewdudex
Copy link

If it makes any difference I'm using a mac with python version 2.7

@edupin2
Copy link

edupin2 commented Sep 1, 2017

I receive too this error, anyone knows how to solve it?

Traceback (most recent call last):
File "/alexa-tv2/alexa-tv.py", line 69, in
u.init_socket()
File "/alexa-tv2/fauxmo.py", line 300, in init_socket
dbg("Failed to initialize UPnP sockets:",e)
TypeError: dbg() takes exactly 1 argument (2 given)

@edugc310
Copy link

edugc310 commented Oct 1, 2017

dbg("Failed to initialize UPnP sockets:",e)
TypeError: dbg() takes exactly 1 argument (2 given)

Same error over here. It was working before. Now it is not. What happened?

@edugc310
Copy link

edugc310 commented Oct 1, 2017

I use this line instead: dbg("Failed to initialize UPnP sockets: {}".format(e))

I get this DEBUG:root:Failed to initialize UPnP sockets: dbg() takes exactly 1 argument (2 given)

But all the others running.

@stevena9475
Copy link

i got the same, did you ever work out what was wrong

@stevena9475
Copy link

DEBUG:root:Failed to initialize UPnP sockets: dbg() takes exactly 1 argument (2 given)
DEBUG:root:got local address of 192.168.0.52
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'tv' ready on 192.168.0.52:52000
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'volume' ready on 192.168.0.52:52002
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'netflix' ready on 192.168.0.52:52003
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'playback' ready on 192.168.0.52:52004
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'plex' ready on 192.168.0.52:52001
DEBUG:root:Entering fauxmo polling loop

@paulojhsousa
Copy link

Hi efpe, Thanks for the code!

I got this running but it just enters in the loop but does not listen to any request.
You said that i shall grant access to the TV while running the script but i'm afraid that it is not happening.
Can you please brief me on what should be expected on that stage? Thanks and keed on with good work.

DEBUG:root:Listening for UPnP broadcasts
DEBUG:root:got local address of 192.168.0.64
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'Television' ready on 192.168.0.64:52000
DEBUG:root:Entering fauxmo polling loop

@edugc310
Copy link

I remember the code was running normally and suddenly stopped working. Let me know if anyone figures it out.

@Linweishengla
Copy link

bringing this old thread up again.

I have the script running but after DEBUG:root:Entering fauxmo polling loop nothing happens.
I am using an Echo Plus btw. It is not finding the TV but if I use the lgtv.py command in the terminal I can control the TV.

Also, the script pulls my laptops IP. shouldnt it be pulling the echos IP?

@phrogg
Copy link

phrogg commented Jan 30, 2019

Same error here. Did you get it fixed?

@w4qed
Copy link

w4qed commented Nov 8, 2020

Hello anyone ever find a way I changed to dbg("Failed to initialize UPnP sockets: {}".format(e))" and it does allow polling, but does not recognize the items:

DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'lights' ready on 127.0.0.1:52215
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'mike' ready on 127.0.0.1:53009
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'mesh' ready on 127.0.0.1:53013
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'power' ready on 127.0.0.1:53101
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'flex' ready on 127.0.0.1:52315
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'modem' ready on 127.0.0.1:53103
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'icom' ready on 127.0.0.1:53001
DEBUG:root:UPnP broadcast listener: new device registered
DEBUG:root:FauxMo device 'software' ready on 127.0.0.1:53015
DEBUG:root:Entering fauxmo polling loop
DEBUG:root:Responding to search for lights
DEBUG:root:Responding to search for mike
DEBUG:root:Responding to search for mesh
DEBUG:root:Responding to search for power
DEBUG:root:Responding to search for flex
DEBUG:root:Responding to search for modem
DEBUG:root:Responding to search for icom
DEBUG:root:Responding to search for software

part of my code that calls scripts:

224 if data.find('1') != -1:
225 # on
226 dbg("Responding to ON for %s" % self.name)
227
228 if (self.name == "lights"):
229 print "Command: screen -dm bash /home/w4qed/insteon/L141$
230 os.system("screen -dm bash /home/w4qed/insteon/L1416.on")
231
232 elif (self.name == "icom"):

I have tried on several different trigger words: lights, icom, flex, modem etc.

Alexa response: lights isn't responding, please check its network connection and power supply.

Maybe not finding self name? is it any longer passed? As the python code does seem to poll right past my requests.

Python 2.7.13 may have upgraded to this version on apt update, unsure, but most likely.
On a: cpuinfo: a020d3 3B Plus 1.3 1GB
Raspbian GNU/Linux 9.13 (stretch)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests