I've attached a version of ServoBlaster that works for me on a Pi2B, please test and report back. I've fixed it by using the mailbox interface to request memory from the VC, like the GPU FFT stuff Dom pointed to does. This much cleaner than what I was doing before and works on rev 1 and rev 2 for me. Unpack the file with "tar -xzf filename.tgz", "cd ServoBlaster", "make", "sudo ./servod".
Richard
Re: Pi2 B and Pi-Pan (ServoBlaster)
- Attachments
-
- ServoBlaster-20150219.tgz
- ServoBlaster with Pi2 support for testing
- (16.57 KiB) Downloaded 9126 times
Re: Pi2 B and Pi-Pan (ServoBlaster)
Not tested yet, but thanks for your efforts and support Richard.
Re: Pi2 B and Pi-Pan (ServoBlaster)
Hi Richard,
wow thanks a lot for your support, it works for me
)!
Kind regards!
Johannes
wow thanks a lot for your support, it works for me

Kind regards!
Johannes
Re: Pi2 B and Pi-Pan (ServoBlaster)
Hello,
I have a RaspBerry Pi 2.
I have tried your archive.
No problem to compile and load it:
Output:
Then my servos are moving as expected.
This is great.
Thank you,
Best regards,
Cédric
I have a RaspBerry Pi 2.
I have tried your archive.
No problem to compile and load it:
Output:
Code: Select all
pi@raspberrypi ~/dev/ServoBlaster $ sudo ./servod --idle-timeout=2000
Board model: 2
Board revision: 2
Using hardware: PWM
Using DMA channel: 14
Idle timeout: 2000ms
Number of servos: 8
Servo cycle time: 20000us
Pulse increment step size: 10us
Minimum width value: 50 (500us)
Maximum width value: 250 (2500us)
Output levels: Normal
Using P1 pins: 7,11,12,13,15,16,18,22
Using P5 pins:
Servo mapping:
0 on P1-7 GPIO-4
1 on P1-11 GPIO-17
2 on P1-12 GPIO-18
3 on P1-13 GPIO-27
4 on P1-15 GPIO-22
5 on P1-16 GPIO-23
6 on P1-18 GPIO-24
7 on P1-22 GPIO-25
Requesting 139264 bytes
mem_ref 5
bus_addr = 4253503488
virt_addr 0x76d7a000
pi@raspberrypi ~/dev/ServoBlaster $

This is great.
Thank you,
Best regards,
Cédric
-
- Posts: 1
- Joined: Sun Feb 22, 2015 4:25 am
Re: Pi2 B and Pi-Pan (ServoBlaster)
Has anyone had any trouble with ServoBlaster and wicd-curses/opencv?
I seem to be getting corrupted memory, and I strongly suspect it is the new servoblaster code (specifically how it interacts with memory needed by other usb devices).
Can anyone validate success using this version of servoblaster with either opencv or wicd-curses? I just want to verify that it is this new code, and not something else. Currently using the latest pull from opencv + Microsoft HD Lifecam 3000, with an edimax wifi dongle.
Any help appreciated...
I seem to be getting corrupted memory, and I strongly suspect it is the new servoblaster code (specifically how it interacts with memory needed by other usb devices).
Can anyone validate success using this version of servoblaster with either opencv or wicd-curses? I just want to verify that it is this new code, and not something else. Currently using the latest pull from opencv + Microsoft HD Lifecam 3000, with an edimax wifi dongle.
Any help appreciated...
Re: Pi2 B and Pi-Pan (ServoBlaster)
Thank you so much, Richard!
I am working on a 12x1212 RGB LED Cube controlled by a Raspberry Pi, and I was so frustrated because of the increased and modified cache on the Pi 2 Model B. The cache interfered with my DMA based control of LED drivers, fans, sensors, power supplies and delayed data exchange by up to 1s, ... so that I was close to return to the old Pi 1. Now thanks to your mailbox code I finally managed to overcome the cache and to get the DMA control in my project running smoothly.
Maybe in another life I'll understand what _ioctl really does, but for now it's enough for me to believe in miracles and to smile gladly.
Thanks again,
Dirk
I am working on a 12x1212 RGB LED Cube controlled by a Raspberry Pi, and I was so frustrated because of the increased and modified cache on the Pi 2 Model B. The cache interfered with my DMA based control of LED drivers, fans, sensors, power supplies and delayed data exchange by up to 1s, ... so that I was close to return to the old Pi 1. Now thanks to your mailbox code I finally managed to overcome the cache and to get the DMA control in my project running smoothly.
Maybe in another life I'll understand what _ioctl really does, but for now it's enough for me to believe in miracles and to smile gladly.
Thanks again,
Dirk
Re: Pi2 B and Pi-Pan (ServoBlaster)
Hi !
First thank you richard for your work.
I've downloaded your version of ServoBlaster and I'm trying to control two servos with my raspberry Pi 2 B.
But the problem is that I'm using a Touchshield that uses the 26 first pins.
When I launch servod the screen crashes and I suppose that this is because servo.c is by default using some of those 26 Pins.
Do you know what i could do?
I'm kind of a beginner in raspberry.
Thanks
Edit : I've tried to run servod like this
sudo ./servod --p1pins29,31,32,33,35,36,37,40
In order to configurate the pins that I have access to but it returns Invalid pin number, any idea?
Thanks
First thank you richard for your work.
I've downloaded your version of ServoBlaster and I'm trying to control two servos with my raspberry Pi 2 B.
But the problem is that I'm using a Touchshield that uses the 26 first pins.
When I launch servod the screen crashes and I suppose that this is because servo.c is by default using some of those 26 Pins.
Do you know what i could do?
I'm kind of a beginner in raspberry.
Thanks
Edit : I've tried to run servod like this
sudo ./servod --p1pins29,31,32,33,35,36,37,40
In order to configurate the pins that I have access to but it returns Invalid pin number, any idea?
Thanks
Re: Pi2 B and Pi-Pan (ServoBlaster)
From: https://github.com/richardghirst/PiBits ... rvoBlaster
and
I think that means you need to invoke it as
Code: Select all
Usage: ./servod <options>
Options:
--pcm tells servod to use PCM rather than PWM hardware
to implement delays
--idle-timeout=Nms tells servod to stop sending servo pulses for a
given output N milliseconds after the last update
--cycle-time=Nus Control pulse cycle time in microseconds, default
20000us
--step-size=Nus Pulse width increment step size in microseconds,
default 10us
--min={N|Nus|N%} specifies the minimum allowed pulse width, default
50 steps or 500us
--max={N|Nus|N%} specifies the maximum allowed pulse width, default
250 steps or 2500us
--invert Inverts outputs
--dma-chan=N tells servod which dma channel to use, default 14
--p1pins=<list> tells servod which pins on the P1 header to use
--p5pins=<list> tells servod which pins on the P5 header to use
where <list> defaults to "7,11,12,13,15,16,18,22" for p1pins and
"" for p5pins. p5pins is only valid on rev 2 boards.
Code: Select all
The final options relate to which header pins you want to use to drive your
servos. On a Rev 1 board you can use up to 17 pins on the P1 header, and on a
Rev 2 board there are an additional 4 pins available on the P5 header. The
default option is the equivalent of specifying
--p1pins=7,11,12,13,15,16,18,22
As another example, if for some reason you want only two servos but you want
them to be referenced as servos 4 and 5 (perhaps you have existing software
that uses those servo numbers), you can use '0' as a placeholder for unused
servo IDs, as follows:
$ sudo ./servod --p1pins=0,0,0,0,15,16
...
Using P1 pins: 0,0,0,0,15,16
Servo mapping:
4 on P1-15 GPIO-22
5 on P1-16 GPIO-23
If you wanted to refer to the servos by their P1 header pins you could do
something like this, which gives you servos 7, 11, 12 and 15 on P1 header
pins 7, 11, 12 and 15:
--p1pins=0,0,0,0,0,0,0,7,0,0,0,11,12,0,0,15
Code: Select all
sudo ./servod --p1pins=29,31,32,33,35,36,37,40
Re: Pi2 B and Pi-Pan (ServoBlaster)
I confirm that it works very fine in model Pi 2 with Raspbian for me too.
After looking and testing many options for controlling servos by software, at the moment this was the only solution that worked for me.
Thanks a lot!
After looking and testing many options for controlling servos by software, at the moment this was the only solution that worked for me.
Thanks a lot!
Re: Pi2 B and Pi-Pan (ServoBlaster)
hi, i'm bruno From France.
recent user of pib and pi2 board
first ....
thank you Richard for your rapidity to code a new servo blaster software for the Pi2 board
i've test your new servoblaster source ! it's work for me too
but i want to tell some little thing for users who uses sources like facetracker.py or other... to command servo with python file to make face tracking by servos
sudo ./servod use all gpio input.output and me, i use some of them with Webiopi ...
all gpio are blocked, thus i use .... sudo ./servod --p1pins=12,16
but my software do not work, servo are no controlled .however servo blaster work fine by sending directly command to servo like :
echo 0=150 > /dev/servoblaster
Because servo mapping show :
0 on P1-7 GPIO-4
1 on P1-11 GPIO-17
2 on P1-12 GPIO-18
3 on P1-13 GPIO-27
4 on P1-15 GPIO-22
5 on P1-16 GPIO-23
6 on P1-18 GPIO-24
7 on P1-22 GPIO-25
to see where output is used by my software, i launch y python file and see outputs changing state when soft sending command to servo ...
- gpio readall is not in real time
- so i install Webiopi, which in real time show pin state.
sudo ./servod --p1pins=12,16 allow servo 0 and 1to work and to liberate other gpio pin.
so my soft originaly use servo n°2 et n°5 !
i notice used pin and to resolve the problem, i've modify my source file and changed line as
before :
panGpioPin = 2 # servoblaster pin 2 : gpio pin 18
tiltGpioPin = 5 # servoblaster pin 5 : gpio pin 23
after :
panGpioPin = 0 # servoblaster pin 2 : gpio pin 18
tiltGpioPin = 1 # servoblaster pin 5 : gpio pin 23
that's all my friends
i hope that this post will help someone
...
Bruno
recent user of pib and pi2 board
first ....
thank you Richard for your rapidity to code a new servo blaster software for the Pi2 board
i've test your new servoblaster source ! it's work for me too
but i want to tell some little thing for users who uses sources like facetracker.py or other... to command servo with python file to make face tracking by servos
sudo ./servod use all gpio input.output and me, i use some of them with Webiopi ...
all gpio are blocked, thus i use .... sudo ./servod --p1pins=12,16
but my software do not work, servo are no controlled .however servo blaster work fine by sending directly command to servo like :
echo 0=150 > /dev/servoblaster
Because servo mapping show :
0 on P1-7 GPIO-4
1 on P1-11 GPIO-17
2 on P1-12 GPIO-18
3 on P1-13 GPIO-27
4 on P1-15 GPIO-22
5 on P1-16 GPIO-23
6 on P1-18 GPIO-24
7 on P1-22 GPIO-25
to see where output is used by my software, i launch y python file and see outputs changing state when soft sending command to servo ...
- gpio readall is not in real time

- so i install Webiopi, which in real time show pin state.
sudo ./servod --p1pins=12,16 allow servo 0 and 1to work and to liberate other gpio pin.
so my soft originaly use servo n°2 et n°5 !
i notice used pin and to resolve the problem, i've modify my source file and changed line as
before :
panGpioPin = 2 # servoblaster pin 2 : gpio pin 18
tiltGpioPin = 5 # servoblaster pin 5 : gpio pin 23
after :
panGpioPin = 0 # servoblaster pin 2 : gpio pin 18
tiltGpioPin = 1 # servoblaster pin 5 : gpio pin 23
that's all my friends
i hope that this post will help someone

Bruno
-
- Posts: 11
- Joined: Sun Jul 26, 2015 3:12 am
Re: Pi2 B and Pi-Pan (ServoBlaster)
The Working ServoBlaster for Raspberry Pi 2 Boards. Follow the instructions here.
http://stephenpaulraj.com/raspberry-pi-2-servoblaster/
-Stephen Paulraj
http://stephenpaulraj.com
http://stephenpaulraj.com/raspberry-pi-2-servoblaster/
-Stephen Paulraj
http://stephenpaulraj.com
Re: Pi2 B and Pi-Pan (ServoBlaster)
Hello - another newbie here with some issues...
So I am running Raspian on a Pi2 B and attempted to follow the step-by-step(very helpful by the way) but I am now running into a problem with controlling the servos. I get as far as running:
This successfully moves the servo as expected. When I try to replace the pin16 with any other pin number I get nothing. So right now I have a servo on pin16 and pin18 when I try the same command only changing the pin number:
The result is nothing. I have swapped out servos so I know both work when receiving a signal from pin16, but I am very puzzled as to why this is only working on pin16 and none of the other pins. Any suggestions would be appreciated!
Thanks.
PS - This is my first attempt at anything Pi, Linux, or Python for that matter so be gentle
So I am running Raspian on a Pi2 B and attempted to follow the step-by-step(very helpful by the way) but I am now running into a problem with controlling the servos. I get as far as running:
Code: Select all
echo P1-16=+10 > /dev/servoblaster
Code: Select all
echo P1-18=+10 > /dev/servoblaster
Thanks.
PS - This is my first attempt at anything Pi, Linux, or Python for that matter so be gentle

Re: Pi2 B and Pi-Pan (ServoBlaster)
Thanks for the updated code. Now my pi does not crash when I run ./servod.
Now I am a total newcase, but after compiling everything as instructed. I run sudo ./servod just to see what happens. I see my gpio stuff but then on the bottom I get "can not access /dev/servoblaster-mb. Then it tries to suggest I make the file with certain permissions. I will follow up with a screen shot if needed. Any suggestions?
Now I am a total newcase, but after compiling everything as instructed. I run sudo ./servod just to see what happens. I see my gpio stuff but then on the bottom I get "can not access /dev/servoblaster-mb. Then it tries to suggest I make the file with certain permissions. I will follow up with a screen shot if needed. Any suggestions?
Re: Pi2 B and Pi-Pan (ServoBlaster)
Hi, I grabbed my RPI2, the updated code, I replace the 100 with 249 in the makedev function, but when I start servod my RPI die!
Kernel is 4.1.6-v7+, I need only two servos working, do I need to edit something else?
Please help me
Thanks
Nico
Kernel is 4.1.6-v7+, I need only two servos working, do I need to edit something else?
Please help me

Thanks
Nico
Re: Pi2 B and Pi-Pan (ServoBlaster)
I did it again from scratch, now it's working!
Thanks!!!!
Thanks!!!!
Re: Pi2 B and Pi-Pan (ServoBlaster)
Yay! finally working. Richard, you are a legend!!
Re: Pi2 B and Pi-Pan (ServoBlaster)
Hi i hop im posting this in the right spot. I am trying to enable the Idle time in my servoblaster (using a raspberry pi 2)
sudo insmod ./servoblaster.ko idle_timeout=2000
return Error
thanks in advance
sudo insmod ./servoblaster.ko idle_timeout=2000
return Error
thanks in advance
Re: Pi2 B and Pi-Pan (ServoBlaster)
I manege to do it but did not help my servo is still buzzing terribly 

Re: Pi2 B and Pi-Pan (ServoBlaster)
Are you trying to move the servo beyond its end stops?joche11 wrote:I manege to do it but did not help my servo is still buzzing terribly
Re: Pi2 B and Pi-Pan (ServoBlaster)
hi, someone can explain step by step how to install servoblaster raspberry pi 2.
I'm going crazy with these servo!!
Thanks a lot
Ema
I'm going crazy with these servo!!
Thanks a lot
Ema
Re: Pi2 B and Pi-Pan (ServoBlaster)
Follow the instructions at https://github.com/richardghirst/PiBits ... rvoBlaster to install the user space daemon.Ema wrote:hi, someone can explain step by step how to install servoblaster raspberry pi 2.
I'm going crazy with these servo!!
Thanks a lot
Ema
i.e.
The user space daemon
---------------------
To use this daemon grab the servod.c source and Makefile and:
$ make servod
$ ./servod --help
Re: Pi2 B and Pi-Pan (ServoBlaster)
Raspberry Pi Camera Face and Motion Tracking Demo
Using an openelectrons pan/tilt assembly http://www.mindsensors.com/rpi/33-pi-pan
and python2 and Opencv to Track x,y position of object in camera view
I have a face and motion tracking demo using ServoBlaster and Pi-Pan with an openelectrons pan/tilt assembly. If you are interested, I have an auto install script on my github repo here https://github.com/pageauc/face-track-demo
FYI - one issue that I have been having on a RPI 3 is that after a fairly long time I get a system hang. message indicates servod issue. If you have a similar problem , let me know via github issue
Regards Claude ...
Using an openelectrons pan/tilt assembly http://www.mindsensors.com/rpi/33-pi-pan
and python2 and Opencv to Track x,y position of object in camera view
I have a face and motion tracking demo using ServoBlaster and Pi-Pan with an openelectrons pan/tilt assembly. If you are interested, I have an auto install script on my github repo here https://github.com/pageauc/face-track-demo
FYI - one issue that I have been having on a RPI 3 is that after a fairly long time I get a system hang. message indicates servod issue. If you have a similar problem , let me know via github issue
Regards Claude ...
GitHub - https://github.com/pageauc
YouTube - https://www.youtube.com/user/pageaucp
YouTube - https://www.youtube.com/user/pageaucp