rgh
Posts: 212
Joined: Fri Nov 25, 2011 3:53 pm

Re: Pi2 B and Pi-Pan (ServoBlaster)

Thu Feb 19, 2015 8:20 pm

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
Attachments
ServoBlaster-20150219.tgz
ServoBlaster with Pi2 support for testing
(16.57 KiB) Downloaded 8738 times

User avatar
B.Goode
Posts: 8987
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Pi2 B and Pi-Pan (ServoBlaster)

Thu Feb 19, 2015 10:51 pm

Not tested yet, but thanks for your efforts and support Richard.

Jonny_A
Posts: 6
Joined: Mon Feb 16, 2015 4:55 pm

Re: Pi2 B and Pi-Pan (ServoBlaster)

Sat Feb 21, 2015 11:34 am

Hi Richard,
wow thanks a lot for your support, it works for me :-))!
Kind regards!
Johannes

cgaudin
Posts: 1
Joined: Mon Feb 23, 2015 7:38 pm

Re: Pi2 B and Pi-Pan (ServoBlaster)

Mon Feb 23, 2015 9:48 pm

Hello,

I have a RaspBerry Pi 2.

I have tried your archive.

No problem to compile and load it:

Output:

Code: Select all

[email protected] ~/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
[email protected] ~/dev/ServoBlaster $
Then my servos are moving as expected.

:)

This is great.
Thank you,

Best regards,
Cédric

aerophilic
Posts: 1
Joined: Sun Feb 22, 2015 4:25 am

Re: Pi2 B and Pi-Pan (ServoBlaster)

Sun Mar 08, 2015 7:49 am

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...

Raspiflip
Posts: 1
Joined: Fri May 31, 2013 1:03 am

Re: Pi2 B and Pi-Pan (ServoBlaster)

Sat Apr 04, 2015 6:06 pm

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

leoloco
Posts: 1
Joined: Wed Apr 29, 2015 10:35 am

Re: Pi2 B and Pi-Pan (ServoBlaster)

Wed Apr 29, 2015 10:45 am

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

User avatar
B.Goode
Posts: 8987
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Pi2 B and Pi-Pan (ServoBlaster)

Wed Apr 29, 2015 1:40 pm

From: https://github.com/richardghirst/PiBits ... rvoBlaster

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.
and

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

I think that means you need to invoke it as

Code: Select all

sudo ./servod --p1pins=29,31,32,33,35,36,37,40

User avatar
skalada
Posts: 7
Joined: Sun Feb 22, 2015 2:19 pm
Location: Germany
Contact: Website

Re: Pi2 B and Pi-Pan (ServoBlaster)

Wed Apr 29, 2015 10:15 pm

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!

bruno71
Posts: 1
Joined: Fri May 15, 2015 7:39 am

Re: Pi2 B and Pi-Pan (ServoBlaster)

Fri May 15, 2015 8:13 am

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 :P ...

Bruno

stephenpaulraj
Posts: 11
Joined: Sun Jul 26, 2015 3:12 am

Re: Pi2 B and Pi-Pan (ServoBlaster)

Sun Jul 26, 2015 3:15 am

The Working ServoBlaster for Raspberry Pi 2 Boards. Follow the instructions here.

http://stephenpaulraj.com/raspberry-pi-2-servoblaster/

-Stephen Paulraj
http://stephenpaulraj.com

TaterPi
Posts: 2
Joined: Sun Jul 19, 2015 12:51 am

Re: Pi2 B and Pi-Pan (ServoBlaster)

Thu Jul 30, 2015 2:28 am

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:

Code: Select all

echo P1-16=+10 > /dev/servoblaster
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:

Code: Select all

echo P1-18=+10 > /dev/servoblaster
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 ;)

BadPanda
Posts: 2
Joined: Sun Aug 09, 2015 6:20 pm

Re: Pi2 B and Pi-Pan (ServoBlaster)

Sun Aug 09, 2015 6:27 pm

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?

nico81
Posts: 2
Joined: Fri Sep 11, 2015 10:02 pm

Re: Pi2 B and Pi-Pan (ServoBlaster)

Fri Sep 11, 2015 10:07 pm

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

nico81
Posts: 2
Joined: Fri Sep 11, 2015 10:02 pm

Re: Pi2 B and Pi-Pan (ServoBlaster)

Sat Sep 12, 2015 6:23 am

I did it again from scratch, now it's working!
Thanks!!!!

larnera
Posts: 1
Joined: Sun Sep 13, 2015 2:00 pm

Re: Pi2 B and Pi-Pan (ServoBlaster)

Sun Sep 13, 2015 2:03 pm

Yay! finally working. Richard, you are a legend!!

joche11
Posts: 2
Joined: Mon Sep 28, 2015 10:34 am

Re: Pi2 B and Pi-Pan (ServoBlaster)

Mon Sep 28, 2015 10:40 am

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

joche11
Posts: 2
Joined: Mon Sep 28, 2015 10:34 am

Re: Pi2 B and Pi-Pan (ServoBlaster)

Mon Sep 28, 2015 8:14 pm

I manege to do it but did not help my servo is still buzzing terribly :(

User avatar
joan
Posts: 14470
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Pi2 B and Pi-Pan (ServoBlaster)

Mon Sep 28, 2015 8:18 pm

joche11 wrote:I manege to do it but did not help my servo is still buzzing terribly :(
Are you trying to move the servo beyond its end stops?

Ema
Posts: 34
Joined: Mon Apr 20, 2015 10:08 am

Re: Pi2 B and Pi-Pan (ServoBlaster)

Thu Nov 12, 2015 3:35 pm

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

User avatar
joan
Posts: 14470
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Pi2 B and Pi-Pan (ServoBlaster)

Thu Nov 12, 2015 3:54 pm

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
Follow the instructions at https://github.com/richardghirst/PiBits ... rvoBlaster to install the user space daemon.

i.e.
The user space daemon
---------------------

To use this daemon grab the servod.c source and Makefile and:

$ make servod
$ ./servod --help

Ema
Posts: 34
Joined: Mon Apr 20, 2015 10:08 am

Re: Pi2 B and Pi-Pan (ServoBlaster)

Thu Nov 12, 2015 5:52 pm

thanks :D

pageauc
Posts: 224
Joined: Fri Jan 04, 2013 10:52 pm

Re: Pi2 B and Pi-Pan (ServoBlaster)

Fri Nov 25, 2016 7:22 pm

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 ...
GitHub - https://github.com/pageauc
YouTube - https://www.youtube.com/user/pageaucp

Return to “Troubleshooting”