Issue #111 [New/open] - Servo control

Posted by risto.teurokoski

What steps will reproduce the problem?

I've been trying to control my servo directly from Raspberry Pi with PWM

  1. Cambot works fine directly from example folder (when the folder path is changed in config file
  2. Cambot doesn't work at all when I copy&pasted all the code (python and html) from examples into my own project folders and files. ...

WebIOPi version used? => 0.7.0

Python version used? => 2.7.3

Distro used? (WebIOPi has only been tested on Raspbian Wheezy) => wheezy

Raspberry Pi board revision? (1 or 2) => Model B

For Javascript side bugs, Browser? => chrome and firefox

In debugging almost everything goes fine but in the end some errors comes up:

2014-07-27 15:51:36 - WebIOPi - INFO - Loading myscript from /home/pi/projects/python/ 2014-07-27 15:51:36 - WebIOPi - ERROR - unexpected indent (, line 2) Traceback (most recent call last): File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.7.0-py3.2-linux-armv6l.egg/webiopi/", line 75, in <module> main(sys.argv) File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.7.0-py3.2-linux-armv6l.egg/webiopi/", line 69, in main server = Server(port=port, configfile=configfile, scriptfile=scriptfile) File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.7.0-py3.2-linux-armv6l.egg/webiopi/server/", line 75, in __init__ loader.loadScript(name, source, self.restHandler) File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.7.0-py3.2-linux-armv6l.egg/webiopi/utils/", line 8, in loadScript script = imp.load_source(name, source) File "/home/pi/projects/python/", line 2 from time import sleep ^ IndentationError: unexpected indent

I've been trying to control my servo with help of wiki tutorials and examples (pwmAngle, pwmPulse but without luck. My servo however makes some movement with the default webiopi ui GPIO list and also cambot example when using it from /examples/.

Any idea how to get servo to move and why cambot doesn't work with copy/paste?

Is it even possible to control servos with webiopi?