victordibia / tjwave

Fun javascipt app to control the IBM TJBot Robot Arm (servo motor)
8 stars 20 forks source link

LED light no longer lights up upon wave.js run #2

Open selinakvle opened 7 years ago

selinakvle commented 7 years ago

Hello,

Whenever I run the command "sudo node wave.js" the LED does not light up. However, when I run "sudo node wavetest.js" the LED lights up fine and runs through the different colors. I thought maybe I had a short in the LED as it was a little bent, so I switched it out with a brand new one and I have the same result. It does not light up at all when I run the main js. Any ideas?

victordibia commented 7 years ago

Hi @selinakvle , The reason the led does not light up in the wave.js part is because I did not use/setup the led in that file. The main reason for this is that there is a known (hardware) issue with using both the LED and audio module on a raspberry Pi. In wave.js we use audio (speech to text) and hence do not use the LED.

There is a work around to this - namely you use usb audio (either via a usb to 3.5mm converter or a usb speaker ) and blacklist/disable the raspberry pi audio. To blacklist audio

creating a file at /etc/modprobe.d/snd-blacklist.conf with

blacklist snd_bcm2835

In wave_conversation.js (sudo node wave_conversation.js), both audio and led is used and assumes you have the usb workaround implemented.

Im happy to provide additional information if you need it.

-V

selinakvle commented 7 years ago

Hmm..I did see that under known issues when i first started but..what's weird is I had the LED working before on wave.js with the 3.5mm audio...I have video of this....

https://www.youtube.com/watch?v=SivsmtBEetk

Is it possible it worked before and now doesn't work because of this issue you mentioned? If so, I will go ahead and use your workaround...

victordibia commented 7 years ago

Hi @selinakvle ,

Thats a really awesome video you have there! Love it! Thanks for sharing. You pulsing you saw on your LED when you play a song was an artifact of the interference between audio and the LED pwm signal. This behaviour is pretty random hence its the issue where the led "does not light up".

-V.

vaso7 commented 7 years ago

Hello! i got a problem with the recipe and i was hoping you could help me. The thing is that when i type the sudo node wave.js command i get this error. TJ is listening, you may speak now. === Watson Speech to Text : An Error has occurred ===== You may have exceeded your payload quota. [object Object] Press +C to exit. I've kinda tried everything so i hope you could tell me what's the problem. Thank you :)

victordibia commented 7 years ago

Hi,

The above is a speech to text error. Generally occurs if you have

Its likely issue 1 or 2. Let me know if this helps.

-V.

vaso7 commented 7 years ago

Hi @victordibia
I think it had a bug 'cause i've let it rest for one day and then it worked. I have one more question about the conversation. I've updated with my credentials but when i test it it has the recipe. How can i change it to the conversation i've created?