Due to high demand, expect some shipping delays at this time - orders may not ship for up to 2-3 business days.
0

Adafruit servo tutorial for raspberry pi
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit servo tutorial for raspberry pi

by gheciobanu on Mon Feb 03, 2014 9:39 pm

I tried doing the servo tutorial and it worked, then i cleaned everything off my breadboard and did another project then when i went back to my servo and plugged everything back in the bread board the terminal window said Error writing to: servo value: (here go numbers from 0 to 179) What can i do i checked if the battery pack is working and it does work! Please help what can i do?? :(

gheciobanu
 
Posts: 12
Joined: Tue Jan 07, 2014 11:35 pm

Re: Adafruit servo tutorial for raspberry pi

by adafruit_support_rick on Tue Feb 04, 2014 12:12 pm

Check your wiring again.

adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Adafruit servo tutorial for raspberry pi

by gheciobanu on Sun Feb 09, 2014 11:13 pm

i did over and over again.
servo black goes to breadboard negative,
servo red goes to breadboard positive,
servo white goes to pin 18 on cobbler,
batter pack black goes to breadboard negative,
batter pack red goes to breadboard red,
pi cobbler GND pin goes to bread board negative.
i checked everything, is there anything else that i might be doing wrong?

gheciobanu
 
Posts: 12
Joined: Tue Jan 07, 2014 11:35 pm

Re: Adafruit servo tutorial for raspberry pi

by adafruit_support_bill on Mon Feb 10, 2014 7:04 am

The wiring sounds right. From the error message you are getting, I suspect it is a software problem. Are you running occidentalis?

adafruit_support_bill
 
Posts: 83814
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit servo tutorial for raspberry pi

by gheciobanu on Mon Feb 10, 2014 5:46 pm

Yes the newest version of occidentals, and the funny thing is that i wired it and it worked, then i restarted the pi and the i ran the script again that's the message i was getting, and i tried deleting the script and making a new one, ans i still got the error message.

gheciobanu
 
Posts: 12
Joined: Tue Jan 07, 2014 11:35 pm

Re: Adafruit servo tutorial for raspberry pi

by adafruit_support_mike on Mon Feb 10, 2014 7:46 pm

Let's see.. that error message shows up when the script can't open /sys/class/rpi-pwm/pwm0/, and errors like that are usually permissions problems.

Are you using `sudo` to invoke the script?
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.

adafruit_support_mike
 
Posts: 64527
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit servo tutorial for raspberry pi

by gheciobanu on Tue Feb 11, 2014 12:14 am

in the tutorial it says to do python servo.py, but i also tried doing sudo servo.py and sudo ./servo.py and when i do sudo it says command not found, but when i do python servo.py it gives me the error servo value

gheciobanu
 
Posts: 12
Joined: Tue Jan 07, 2014 11:35 pm

Re: Adafruit servo tutorial for raspberry pi

by adafruit_support_rick on Tue Feb 11, 2014 10:20 am

Try sudo python servo.py

adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Adafruit servo tutorial for raspberry pi

by gheciobanu on Tue Feb 11, 2014 4:26 pm

I still get the same error message as if i did python servo.py
Attachments
Untitled.png
screenshot of error
Untitled.png (99.18 KiB) Viewed 839 times

gheciobanu
 
Posts: 12
Joined: Tue Jan 07, 2014 11:35 pm

Re: Adafruit servo tutorial for raspberry pi

by adafruit_support_mike on Wed Feb 12, 2014 3:44 pm

Let's check the GPIO path:

What do you get from the following commands?

Code: Select all | TOGGLE FULL SIZE
ls -l /sys/
ls -l /sys/class/
ls -l /sys/class/rpi-pwm/
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.

adafruit_support_mike
 
Posts: 64527
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit servo tutorial for raspberry pi

by gheciobanu on Wed Feb 12, 2014 4:57 pm

I got some information about some files, i attached a screenshot of my ssh window
Attachments
Untitled.png
Untitled.png (94.53 KiB) Viewed 826 times

gheciobanu
 
Posts: 12
Joined: Tue Jan 07, 2014 11:35 pm

Re: Adafruit servo tutorial for raspberry pi

by adafruit_support_mike on Thu Feb 13, 2014 4:12 pm

That's the information I was looking for. According to those directory listings, you no longer have kernel support for PWM.

It would probably be easiest to get it back by installing a fresh version of Occidentalis on your SD card.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.

adafruit_support_mike
 
Posts: 64527
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit servo tutorial for raspberry pi

by gheciobanu on Thu Feb 13, 2014 4:14 pm

OK, ill uninstall and install it again, but why did that happen?

gheciobanu
 
Posts: 12
Joined: Tue Jan 07, 2014 11:35 pm

Re: Adafruit servo tutorial for raspberry pi

by adafruit_support_mike on Sun Feb 16, 2014 3:46 pm

There are too many possibilities to say right now. You'd need to repeat everything you did after disconnecting the first servo experiment and check at each step to see if PWM support is still there.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.

adafruit_support_mike
 
Posts: 64527
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit servo tutorial for raspberry pi

by seaman55 on Wed Mar 04, 2015 1:27 am

Does the latest version of Occidentalis (V0.3) no longer support PWM? After updating with a new version from bootstrap, or apt-get, the /sys/class/rpi-pwm directory does not exist. This generates the same results as the OP had.

This Friday I am teaching a class following Lesson 8 on how to use the servo in hopes that they can use them in their science fair projects.

I Could use a fast resolution.

seaman55
 
Posts: 6
Joined: Wed May 01, 2013 12:45 am

Please be positive and constructive with your questions and comments.