nassir-malik / IOT-Pi3-Alexa-Automation

Use Raspberry Pi 3 as home automation device with Alexa
108 stars 107 forks source link

getting errors while running the python program #8

Open hapra opened 6 years ago

hapra commented 6 years ago

this is the error.. Kindly do the needful

pi@raspberrypi:~/IOT-Pi3-Alexa-Automation-master $ sudo python RPi_name_port_gpio_8_Relays2.py DEBUG:root:Listening for UPnP broadcasts DEBUG:root:got local address of 192.168.0.110 DEBUG:root:UPnP broadcast listener: new device registered DEBUG:root:FauxMo device 'pc' ready on 192.168.0.110:52004 DEBUG:root:UPnP broadcast listener: new device registered DEBUG:root:FauxMo device 'living room' ready on 192.168.0.110:51000 DEBUG:root:UPnP broadcast listener: new device registered DEBUG:root:FauxMo device 'room' ready on 192.168.0.110:52002 DEBUG:root:UPnP broadcast listener: new device registered DEBUG:root:FauxMo device 'office' ready on 192.168.0.110:53000 DEBUG:root:UPnP broadcast listener: new device registered DEBUG:root:FauxMo device 'tv' ready on 192.168.0.110:52003 DEBUG:root:UPnP broadcast listener: new device registered DEBUG:root:FauxMo device 'light' ready on 192.168.0.110:52006 DEBUG:root:UPnP broadcast listener: new device registered DEBUG:root:FauxMo device 'xbox' ready on 192.168.0.110:52005 DEBUG:root:UPnP broadcast listener: new device registered DEBUG:root:FauxMo device 'kitchen' ready on 192.168.0.110:52000 DEBUG:root:Entering fauxmo polling loop DEBUG:root:Responding to search for pc Traceback (most recent call last): File "RPi_name_port_gpio_8_Relays2.py", line 102, in logging.critical("Critical exception: "+ e.args ) TypeError: cannot concatenate 'str' and 'tuple' objects

nassir-malik commented 6 years ago

What version of python you are running?

-Thanks

Nassir

On Sat, Jan 27, 2018 at 12:31 AM, hapra notifications@github.com wrote:

this is the error.. Kindly do the needful

pi@raspberrypi:~/IOT-Pi3-Alexa-Automation-master $ sudo python RPi_name_port_gpio_8_Relays2.py DEBUG:root:Listening for UPnP broadcasts DEBUG:root:got local address of 192.168.0.110 DEBUG:root:UPnP broadcast listener: new device registered DEBUG:root:FauxMo device 'pc' ready on 192.168.0.110:52004 DEBUG:root:UPnP broadcast listener: new device registered DEBUG:root:FauxMo device 'living room' ready on 192.168.0.110:51000 DEBUG:root:UPnP broadcast listener: new device registered DEBUG:root:FauxMo device 'room' ready on 192.168.0.110:52002 DEBUG:root:UPnP broadcast listener: new device registered DEBUG:root:FauxMo device 'office' ready on 192.168.0.110:53000 DEBUG:root:UPnP broadcast listener: new device registered DEBUG:root:FauxMo device 'tv' ready on 192.168.0.110:52003 DEBUG:root:UPnP broadcast listener: new device registered DEBUG:root:FauxMo device 'light' ready on 192.168.0.110:52006 DEBUG:root:UPnP broadcast listener: new device registered DEBUG:root:FauxMo device 'xbox' ready on 192.168.0.110:52005 DEBUG:root:UPnP broadcast listener: new device registered DEBUG:root:FauxMo device 'kitchen' ready on 192.168.0.110:52000 DEBUG:root:Entering fauxmo polling loop DEBUG:root:Responding to search for pc Traceback (most recent call last): File "RPi_name_port_gpio_8_Relays2.py", line 102, in logging.critical("Critical exception: "+ e.args ) TypeError: cannot concatenate 'str' and 'tuple' objects

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nassir-malik/IOT-Pi3-Alexa-Automation/issues/8, or mute the thread https://github.com/notifications/unsubscribe-auth/AL1FGdU2VNs86vp0m-CYexVmYrA_NxL7ks5tOsKygaJpZM4RvLLa .

jbabu commented 6 years ago

use this command sudo python3 RPi_name_port_gpio_8_Relays2.py

Tommy-Jack commented 6 years ago

Hello Nassir,

i am have the same Problem but i cant found a solution. I am have Python 2 and 3.

Thanks

nassir-malik commented 6 years ago

Can you share the errors- thanks

DharmeshRathod712 commented 5 years ago

Hello Sir,

I am also facing the same issue. Here is my log.

CRITICAL:root:('utf8', 'NOTIFY * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\nCACHE-CONTROL: max-age=300\r\nLOCATION: http://XXX.1XX.1.X:55578/devices/636XXX34-3930-3XX8-3964-643XXXX03431/desc\r\nNT: upnp:rootdevice\r\nNTS: ssdp:alive\r\nSERVER: 1.1 DLNADOC/1.50 UPnP/1.0 SITEVIEW/1.0\r\nUSN: uuid:63613734-3930-3838-3964-643039303431::upnp:rootdevice\r\nCUSTOM:\xa0\x8e\x1c\xed\xae\xf1[]\r\n\r\n', 319, 320, 'invalid start byte')

Thanks

nassir-malik commented 5 years ago

Are you using echo 2nd gen or plus?

DharmeshRathod712 commented 5 years ago

I am using Amazon Echo Dot 2nd generation

sherwood65633 commented 5 years ago

Thank you Mr. Nassir for your work. I have having a similar issue with tuple convert error in line 102.the error is as follows:

"Traceback (most recent call last): File "RPi_name_port_gpio_8_Relays2.py", line 102, in logging.critical("Critical exception: "+ e.args ) TypeError: Can't convert 'tuple' object to str implicitly"

I have found a message on the boards suggesting changing the GPIO.Output line to"

"GPIO.output(int(11), true) time.sleep(1) GPIO.output(int(11), false)"👍 but I am getting a syntax error. ( Im sorry, I'm still new to python, but i dont see an error in that line).

could you please assist me with this?

sherwood65633 commented 5 years ago

Sir, there are two more question I'd like to ask.

nassir-malik commented 5 years ago

Are you using python 3?

Send via mobile device

On Sun, Jan 13, 2019, 3:38 PM sherwood65633 <notifications@github.com wrote:

Thank you Mr. Nassir for your work. I have having a similar issue with tuple convert error in line 102.the error is as follows:

"Traceback (most recent call last): File "RPi_name_port_gpio_8_Relays2.py", line 102, in logging.critical("Critical exception: "+ e.args ) TypeError: Can't convert 'tuple' object to str implicitly"

I have found a message on the boards suggesting changing the GPIO.Output line to"

"GPIO.output(int(11), true) time.sleep(1) GPIO.output(int(11), false)"👍 but I am getting a syntax error. ( Im sorry, I'm still new to python, but i dont see an error in that line).

could you please assist me with this?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nassir-malik/IOT-Pi3-Alexa-Automation/issues/8#issuecomment-453867942, or mute the thread https://github.com/notifications/unsubscribe-auth/AL1FGfEbRbOQLeQ2CsLWq9esJTpVVj03ks5vC6dfgaJpZM4RvLLa .

sherwood65633 commented 5 years ago

yes python 3 :) It errors at " except Exception as e: logging.critical("Critical exception: "+ e.args ) break" TypeError: Can't convert 'tuple' object to str implicitly thank you very much for your help I don't have any idea :(

nassir-malik commented 5 years ago

Please make sure use python 3.4.4 or above. I have seen this issue when tried to run it with python 2.7.

-Thanks

Nassir

On Sat, Jan 26, 2019 at 11:27 PM sherwood65633 notifications@github.com wrote:

yes python 3 :) It errors at " except Exception as e: logging.critical("Critical exception: "+ e.args ) break" TypeError: Can't convert 'tuple' object to str implicitly thank you very much for your help I don't have any idea :(

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nassir-malik/IOT-Pi3-Alexa-Automation/issues/8#issuecomment-457890426, or mute the thread https://github.com/notifications/unsubscribe-auth/AL1FGbOTgwfU1lM1r_VUW4Flwb8Q2HyPks5vHTi1gaJpZM4RvLLa .

sherwood65633 commented 5 years ago

running it in python 3.5.3. I ran it in Thonny, and got the following errors: DEBUG:root:Responding to search for pc Traceback (most recent call last): File "/home/pi/IOT-Pi3-Alexa-Automation-master/RPi_name_port_gpio_8_Relays.py", line 98, in p.poll(100) File "/home/pi/IOT-Pi3-Alexa-Automation-master/fauxmo.py", line 99, in poll target.do_read(one_ready[0]) File "/home/pi/IOT-Pi3-Alexa-Automation-master/fauxmo.py", line 158, in do_read data, sender = self.client_sockets[fileno][0].recvfrom(4096) ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/pi/IOT-Pi3-Alexa-Automation-master/RPi_name_port_gpio_8_Relays.py", line 101, in logging.critical("Critical exception: "+ e.args ) TypeError: Can't convert 'tuple' object to str implicitly

sherwood65633 commented 5 years ago

I don't know what it is, but it's better and will run consistently for days. Operating relys correctly then throw the same error. File "/home/pi/IOT-Pi3-Alexa-Automation-master/fauxmo.py", line 99, in poll target.do_read(one_ready[0]) File "/home/pi/IOT-Pi3-Alexa-Automation-master/fauxmo.py", line 158, in do_read data, sender = self.client_sockets[fileno][0].recvfrom(4096) ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/pi/IOT-Pi3-Alexa-Automation-master/RPi_name_port_gpio_8_Relays.py", line 101, in logging.critical("Critical exception: "+ e.args ) TypeError: Can't convert 'tuple' object to str implicitly. Any more ideas?

sherwood65633 commented 5 years ago

I don't know what it is, but it's better and will run consistently for days. Operating relys correctly then throw the same error. File "/home/pi/IOT-Pi3-Alexa-Automation-master/fauxmo.py", line 99, in poll target.do_read(one_ready[0]) File "/home/pi/IOT-Pi3-Alexa-Automation-master/fauxmo.py", line 158, in do_read data, sender = self.client_sockets[fileno][0].recvfrom(4096) ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/pi/IOT-Pi3-Alexa-Automation-master/RPi_name_port_gpio_8_Relays.py", line 101, in logging.critical("Critical exception: "+ e.args ) TypeError: Can't convert 'tuple' object to str implicitly. Any more ideas?

sherwood65633 commented 5 years ago

sorry duplicate post.

stevenbowyer commented 5 years ago

Try changing GPIO.output(int(11), true) time.sleep(1) GPIO.output(int(11), false)

to:


if state == 1:
    GPIO.output(11,GPIO.LOW)
else:
    GPIO.output(11,GPIO.HIGH)

Worked for me after getting the "TypeError: Can't convert 'tuple' object to str implicitly" error. Seems something has changed, either amazon side or pi GPIO side?

sherwood65633 commented 5 years ago

Thank you so much. I'll try this tomorrow

On Mon, Apr 29, 2019, 12:59 PM stevenbowyer notifications@github.com wrote:

Try changing GPIO.output(int(11), true) time.sleep(1) GPIO.output(int(11), false)

to:

if state == 1: GPIO.output(11,GPIO.LOW) else: GPIO.output(11,GPIO.HIGH)

Worked for me after getting the "TypeError: Can't convert 'tuple' object to str implicitly" error. Seems something has changed, either amazon side or pi GPIO side?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nassir-malik/IOT-Pi3-Alexa-Automation/issues/8#issuecomment-487681581, or mute the thread https://github.com/notifications/unsubscribe-auth/AJKCWDL6ZVU7RAVZHOMHX6TPS4ZQZANCNFSM4EN4WLNA .

stevenbowyer commented 5 years ago

You will need proper indents for the if statement.

It seems like the code is using the "state" variable directly to set the GPIO to either high or low, but rpi.GPIO doesn't like the value. The if statement bypasses this by setting the GPIO values directly after testing the value of the "state" variable.

davidsbright commented 4 years ago

Did it work? i'm having the same issue...

Thank you so much. I'll try this tomorrow On Mon, Apr 29, 2019, 12:59 PM stevenbowyer @.***> wrote: Try changing GPIO.output(int(11), true) time.sleep(1) GPIO.output(int(11), false) to: if state == 1: GPIO.output(11,GPIO.LOW) else: GPIO.output(11,GPIO.HIGH) Worked for me after getting the "TypeError: Can't convert 'tuple' object to str implicitly" error. Seems something has changed, either amazon side or pi GPIO side? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#8 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AJKCWDL6ZVU7RAVZHOMHX6TPS4ZQZANCNFSM4EN4WLNA .