hacklab-in / webiopi

Automatically exported from code.google.com/p/webiopi
0 stars 1 forks source link

Servo control #111

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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/script.py
2014-07-27 15:51:36 - WebIOPi - ERROR - unexpected indent (script.py, 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/__main__.py", 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/__main__.py", 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/__init__.py", 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/loader.py", line 8, in loadScript
    script = imp.load_source(name, source)
  File "/home/pi/projects/python/script.py", 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?

-Risto

Original issue reported on code.google.com by risto.te...@gmail.com on 27 Jul 2014 at 4:11