esp8266 icon indicating copy to clipboard operation
esp8266 copied to clipboard

filesystem problems?

Open carterw opened this issue 8 years ago • 3 comments

I've cross-compiled the modules and installed them on a esp8266, but after following the instructions I am getting errors.

`

import os os.listdir() ['boot.py', 'uhttpd.mpy', 'http_file_handler.mpy', 'ulog.mpy', 'console_sink.mpy', 'www'] import uhttpd loaded sink console import http_file_handler server = uhttpd.Server([('/', http_file_handler.Handler('/www'))]) Traceback (most recent call last): File "", line 1, in File "uhttpd/http_file_handler.py", line 55, in init Exception: Root path /www is not an existing directory `

If I try invoking the server without the preceding slash it comes up, but errors out on HTTP requests;

`

server = uhttpd.Server([('/', http_file_handler.Handler('www'))]) server.start() 2000-01-01T00:01:57.005 [info] esp8266: uhttpd-master started.

2000-01-01T00:08:47.005 [info] esp8266: FORBIDDEN ('192.168.4.2', 58349) /www 2000-01-01T00:08:48.005 [info] esp8266: FORBIDDEN ('192.168.4.2', 58351) /www/favicon.ico `

carterw avatar Feb 25 '17 16:02 carterw

You need to create the /www directory first, per the README.

The intent is that you would create a directory into which you put your HTML, Javascript, stylesheets, etc, and the server only serves from that directory (and does not permit access outside of it).

fadushin avatar May 18 '17 00:05 fadushin

@carterw okay to close? Sorry for not getting back sooner.

fadushin avatar May 18 '17 01:05 fadushin

But as you can see in my comment, there was a /www directory...

os.listdir() ['boot.py', 'uhttpd.mpy', 'http_file_handler.mpy', 'ulog.mpy', 'console_sink.mpy', 'www']

carterw avatar May 18 '17 14:05 carterw