hopkira / k9-chess-angular

Angular JS K9 robot controller, designed primarily for use on a iPad or Android touch device as a virtual joystick. Also visualizes the robot's surroundings using camera and sensor data.
http://k9-build.blogspot.co.uk/
The Unlicense
14 stars 10 forks source link

Twisted error Reactor not Restartable #41

Closed DrTardis1963 closed 6 years ago

DrTardis1963 commented 6 years ago

So Everything works :) :1st_place_medal: Also Happy Easter :) So I run the program whether it be the loop or the program itself, I say K9 and snowboy detects it, then I say Hello, He says Hello I am K9, then snowboy waits to detect again, I say K9 and snowboy detects it, then it says lights on I say What time is it, but the transcription doesnt show up, it says lights off and then this error appears. I know the error is about the Speech to Text service because I copied the code below and pasted it after tts is called and it gives the same error The error is happening after it detects k9 and second time and begins to transcribe or in the case where i pasted it happens immediately upon running the code below Error is further down with open('my_voice.wav') as f: speech_to_text.recognize_with_websocket(audio=f,content_type='audio/l16; rate=44100', recognize_callback=mycallback) while not finished: time.sleep(0.1)

Traceback (most recent call last): File "/home/pi/K9/k9-chess-angular-master/python/working.py", line 10, in import os, sys, subprocess, threading, time, json, re, signal, snowboydecoder, working File "/home/pi/K9/k9-chess-angular-master/python/working.py", line 139, in speech_to_text.recognize_with_websocket(audio=f,content_type='audio/l16; rate=44100', recognize_callback=mycallback) File "/usr/local/lib/python2.7/dist-packages/watson_developer_cloud/speech_to_text_v1.py", line 279, in recognize_with_websocket RecognizeListener(audio, options, recognize_callback, url, headers) File "/usr/local/lib/python2.7/dist-packages/watson_developer_cloud/websocket/speech_to_text_websocket_listener.py", line 47, in init reactor.run() # pylint: disable=E1101 File "/home/pi/.local/lib/python2.7/site-packages/twisted/internet/base.py", line 1242, in run self.startRunning(installSignalHandlers=installSignalHandlers) File "/home/pi/.local/lib/python2.7/site-packages/twisted/internet/base.py", line 1222, in startRunning ReactorBase.startRunning(self) File "/home/pi/.local/lib/python2.7/site-packages/twisted/internet/base.py", line 730, in startRunning raise error.ReactorNotRestartable() ReactorNotRestartable

DrTardis1963 commented 6 years ago

Ran the assistant program got this

200 Calling listen_for_K9 Listening for K9 keyword... press Ctrl+C to exit INFO:snowboy:Keyword 1 detected at time: 2018-04-02 09:04:26 K9 detected

Calling speech_to_text stt_client initialisation opened(self) and self.send Received: {u'state': u'listening'} Speak now... Received: {u'error': u'Session timed out.'} no speech heard for 30 seconds, exiting Exception in thread WebSocketClient: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.target(*self.args, **self.__kwargs) File "/home/pi/.local/lib/python2.7/site-packages/ws4py/websocket.py", line 528, in run if not self.once(): File "/home/pi/.local/lib/python2.7/site-packages/ws4py/websocket.py", line 410, in once if not self.process(self.buf[:requested]): File "/home/pi/.local/lib/python2.7/site-packages/ws4py/websocket.py", line 480, in process self.received_message(s.message) File "/home/pi/K9/k9-chess-angular-master/python/assistant.py", line 117, in received_message self.close() File "/home/pi/K9/k9-chess-angular-master/python/assistant.py", line 139, in close self.stream_audio_thread.join() AttributeError: 'SpeechToTextClient' object has no attribute 'stream_audio_thread' To conversation: silence

Traceback (most recent call last): File "/home/pi/K9/k9-chess-angular-master/python/assistant.py", line 197, in answer = results.group(1) AttributeError: 'NoneType' object has no attribute 'group'

DrTardis1963 commented 6 years ago

Sorry I didn't read your blog post I just read it then and followed all the steps and It works splendidly, with no errors whatsoever just had a decent conversation with K9 but I still need to add a lot to watson on my end THANKYOU for all the help you have given me these past few days I know it must have been annoying having a new error to deal with every other 2 hours so thank you. Looking forward to seeing more amazing stuff that you will definetely achieve if your past work is anything to go by. Sincerely, Blake