richardghirst / PiBits

819 stars 565 forks source link

bash: /dev/servoblaster: Permission denied #102

Closed thunderfangepic closed 6 years ago

thunderfangepic commented 6 years ago

Hello, I am a newer pi user, and I am having some trouble using the ServoBlaster. I have already run the make servod commands, and am trying to control the servo using

echo P1-18=120 > /dev/servoblaster

But I am getting this error right away:

bash: /dev/servoblaster: Permission denied

If anyone could help I would very much apreciate it. Thanks!

amigatommy commented 6 years ago

Hi, you must write: sudo echo P1-18=120 > /dev/servoblaster Greetings

srcshelton commented 6 years ago

Redirection doesn't work like that :( Try: echo 'P1-18=120' | sudo tee /dev/servoblaster >/dev/null

thunderfangepic commented 6 years ago

Hi, thanks for the help, but when I type echo 'P1-18=120' | sudo tee /dev/servoblaster >/dev/null it doesn't take the argument as complete. It gives me a new line to enter more. Am I doing something wrong?

srcshelton commented 6 years ago

@thunderfangepic Did you type the above, or copy/paste? Make sure nothing is changing the ' from your keyboard into smart-quotes which look nice but aren't actually understood by a shell! Trying the above but with " double-quotes may also help...

thunderfangepic commented 6 years ago

It worked, Thanks!