Setting up webiopi files

482 views
Skip to first unread message

Gulfboy

unread,
Apr 13, 2015, 3:50:31 PM4/13/15
to web...@googlegroups.com
I've been trying to set up index.html and script.py files in my webiopi project. My project is set up as follows: /home/pi/myproject/html/index.html and myproject/python/script.py


I started webiopi running using: sudo webiopi -d -c /etc/webiopi/config
I'm expecting to view my index.html on http://myraspberrypi-ip:8000. but, I either get a 404 error, or the IOT Framework display pops up?

I have also seen this in a tutorial on Code:Google: "You can also put your HTML file in /usr/share/webiopi/htdocs " Webiopi seems to be getting the index.html  file from htdocs not the config file?
Any idea why the webiopi/ config file settings are not being used?
The /etc/webiopi/config file is as follows:

[SCRIPTS]
# Load custom scripts syntax :
# name = sourcefile
#   each sourcefile may have setup, loop and destroy functions and macros
myscript = /home/pi/myrobot/python/mybrobot.py

#------------------------------------------------------------------------#

[HTTP]
# HTTP Server configuration
enabled = true
port = 8000

# File containing sha256(base64("user:password"))
# Use webiopi-passwd command to generate it
passwd-file = /etc/webiopi/passwd

# Change login prompt message
prompt = "WebIOPi"

# Use doc-root to change default HTML and resource files location
doc-root = /home/pi/mybrobot/html/index.html

# Use welcome-file to change the default "Welcome" file
welcome-file = index.html

Gulfboy

craisondigital

unread,
Apr 14, 2015, 9:59:31 AM4/14/15
to web...@googlegroups.com
Try changing the doc-root line to..

doc-root = /home/pi/mybrobot/html/ 

Adam S

unread,
Apr 16, 2015, 9:35:51 AM4/16/15
to web...@googlegroups.com
I may be getting confused but it looks like you are using the wrong path in your config.  You have /home/pi/mybrobot/html/index.html but in the post you say it is located at /home/pi/myproject/html/index.html  Additionally, you only want to specify the directory, not the file itself.  If you mistyped in your first post just replace the paths below with the real path. 

Change your config to read: doc-root = /home/pi/myproject/html

You will also need to make sure this line is under the [SCRIPTS] section (files does need to be specified):

myscript = /home/pi/myproject/python/script.py

Gulfboy

unread,
Apr 16, 2015, 3:04:43 PM4/16/15
to web...@googlegroups.com
Thanks, that seemed to do the trick. I still had some html errors, but i got it to work.
Reply all
Reply to author
Forward
0 new messages