fadushin / esp8266

This repository contains source code for the ESP8266.
BSD 2-Clause "Simplified" License
73 stars 22 forks source link

filesystem problems? #2

Open carterw opened 7 years ago

carterw commented 7 years ago

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 `

fadushin commented 7 years ago

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 commented 7 years ago

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

carterw commented 7 years ago

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']