Adafruit servo tutorial for raspberry pi

Forum Administrative - NOT PROJECT OR "HELP"

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
gheciobanu
 
Posts: 12
Joined: Tue Jan 07, 2014 11:35 pm

Adafruit servo tutorial for raspberry pi

Post by gheciobanu »

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?? :(

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Adafruit servo tutorial for raspberry pi

Post by adafruit_support_rick »

Check your wiring again.

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

Re: Adafruit servo tutorial for raspberry pi

Post by gheciobanu »

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?

User avatar
adafruit_support_bill
 
Posts: 88136
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit servo tutorial for raspberry pi

Post by adafruit_support_bill »

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

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

Re: Adafruit servo tutorial for raspberry pi

Post by gheciobanu »

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.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit servo tutorial for raspberry pi

Post by adafruit_support_mike »

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?

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

Re: Adafruit servo tutorial for raspberry pi

Post by gheciobanu »

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

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Adafruit servo tutorial for raspberry pi

Post by adafruit_support_rick »

Try sudo python servo.py

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

Re: Adafruit servo tutorial for raspberry pi

Post by gheciobanu »

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

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit servo tutorial for raspberry pi

Post by adafruit_support_mike »

Let's check the GPIO path:

What do you get from the following commands?

Code: Select all

ls -l /sys/
ls -l /sys/class/
ls -l /sys/class/rpi-pwm/

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

Re: Adafruit servo tutorial for raspberry pi

Post by gheciobanu »

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

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit servo tutorial for raspberry pi

Post by adafruit_support_mike »

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.

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

Re: Adafruit servo tutorial for raspberry pi

Post by gheciobanu »

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

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit servo tutorial for raspberry pi

Post by adafruit_support_mike »

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.

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

Re: Adafruit servo tutorial for raspberry pi

Post by seaman55 »

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.

Locked
Please be positive and constructive with your questions and comments.

Return to “Administrative (closed)”