Posted by stancu.dan
What steps will reproduce the problem?
WebIOPi version used? =>WebIOPi-0.7.0
Python version used? =>python3.2
Distro used? (WebIOPi has only been tested on Raspbian Wheezy) =>Raspbian Whezzey January 2014
Raspberry Pi board revision? (1 or 2) => Raspberry Pi Rev.1
For Javascript side bugs, Browser? =>Chrome
Please provide any additional information below.
When I run sudo webiopi -d -c /etc/webiopi/config I get this
pi@raspberrypi ~ $ sudo webiopi -d -c /etc/webiopi/config 2014-04-05 07:25:43 - WebIOPi - INFO - Starting WebIOPi/0.7.0/Python3.2 2014-04-05 07:25:43 - WebIOPi - DEBUG - Mapping GPIO.digitalCount to REST GET /G PIO/count 2014-04-05 07:25:43 - WebIOPi - DEBUG - Mapping GPIO.digitalRead to REST GET /GP IO/%(channel)d/value 2014-04-05 07:25:43 - WebIOPi - DEBUG - Mapping GPIO.digitalWrite to REST POST / GPIO/%(channel)d/value/%(value)d 2014-04-05 07:25:43 - WebIOPi - DEBUG - Mapping GPIO.getFunctionString to REST G ET /GPIO/%(channel)d/function 2014-04-05 07:25:43 - WebIOPi - DEBUG - Mapping GPIO.getPulse to REST GET /GPIO/ %(channel)d/pulse 2014-04-05 07:25:43 - WebIOPi - DEBUG - Mapping GPIO.outputSequence to REST POST /GPIO/%(channel)d/sequence/%(args)s 2014-04-05 07:25:43 - WebIOPi - DEBUG - Mapping GPIO.portRead to REST GET /GPIO/ */integer 2014-04-05 07:25:43 - WebIOPi - DEBUG - Mapping GPIO.portWrite to REST POST /GPI O/*/integer/%(value)d 2014-04-05 07:25:43 - WebIOPi - DEBUG - Mapping GPIO.pulse to REST POST /GPIO/%( channel)d/pulse/ 2014-04-05 07:25:43 - WebIOPi - DEBUG - Mapping GPIO.pulseAngle to REST POST /GP IO/%(channel)d/pulseAngle/%(value)f 2014-04-05 07:25:43 - WebIOPi - DEBUG - Mapping GPIO.pulseRatio to REST POST /GP IO/%(channel)d/pulseRatio/%(value)f 2014-04-05 07:25:43 - WebIOPi - DEBUG - Mapping GPIO.setFunctionString to REST P OST /GPIO/%(channel)d/function/%(value)s 2014-04-05 07:25:43 - WebIOPi - DEBUG - Mapping GPIO.wildcard to REST GET /GPIO/ * 2014-04-05 07:25:43 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO 2014-04-05 07:25:43 - WebIOPi - INFO - Loading configuration from /etc/webiopi/c onfig 2014-04-05 07:25:43 - WebIOPi - INFO - Loading myproject from /home/pi/myproject /python/script.py 2014-04-05 07:25:43 - WebIOPi - ERROR - invalid character in identifier (script. py, line 14) 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/myproject/python/script.py", line 14 GPIO.setFunction(LIGHT, GPIO.OUT) ^ SyntaxError: invalid character in identifier
The config file is like this [GPIO]
[~GPIO]
[SCRIPTS]
myproject = /home/pi/myproject/python/script.py
[HTTP]
enabled = true port = 8000
passwd-file = /etc/webiopi/passwd
prompt = "WebIOPi"
doc-root = /home/pi/myproject/html
[COAP]
enabled = true port = 5683
multicast = true
[DEVICES]
[REST]
gpio-export = 21
gpio-post-value = true
gpio-post-function = false
[ROUTES]
Posted by theysj
Same problem ! Anybody can help ?
Posted by earthnback
If anyone runs into this issue it appears there are some illegal characters that in the file if you cut and paste right from the web page. I just went through and at the beginning of each line deleted any spaces and then just hit the tab key until the line was back to its original position. Worked for me and I was seeing exactly the same issue as the first post.