Search found 32 matches

by fdushin
Fri Dec 30, 2016 1:45 am
Forum: ESP8266 boards
Topic: Simple HTTP framework
Replies: 25
Views: 14340

Re: Simple HTTP framework

Interesting. You might try increasing the backlog on TCP connections. I've pushed a change to master which allows you to specify the backlog via config, e.g., server = uhttpd.Server([ ('/api', api_handler), ('/test', file_handler) ], { 'require_auth': True, 'backlog': 5 }) The backlog is now default...
by fdushin
Sat Dec 24, 2016 3:49 pm
Forum: ESP8266 boards
Topic: Simple HTTP framework
Replies: 25
Views: 14340

Re: Simple HTTP framework

Using the micropython-lib versions of os and socket gets me further, without using the unix-port branch, though os pull in a lot of additional micropython-lib modules, but that's okay. The problem is in our use of socket.setsockopt , which the uhttpd.TCPServer class is using (lifted shamelessly from...
by fdushin
Fri Dec 23, 2016 10:44 pm
Forum: ESP8266 boards
Topic: Simple HTTP framework
Replies: 25
Views: 14340

Re: Simple HTTP framework

I have not. I did a quick test to see if it would work, and while I could get some stuff to work by importing uos instead of os and usocket instead of socket , I did hit a snag with uos.listdir not being defined in unix micro python, which is strange, because I see it in the docs. We could work on f...
by fdushin
Thu Dec 22, 2016 5:33 pm
Forum: ESP8266 boards
Topic: Just a "Thank You" and my project update
Replies: 7
Views: 2221

Re: Just a "Thank You" and my project update

Also want to echo a big thank you to the micro python community. Learning about this exciting new platform has been extremely fun! If are looking for a socket library, feel free to pilfer the TCPServer class from here . Alternatively, you could just implement an API handler and do your uploads and d...
by fdushin
Wed Dec 21, 2016 12:15 am
Forum: ESP8266 boards
Topic: Firmware image size
Replies: 1
Views: 1381

Firmware image size

Is there any way to expand the size of the "irom0_0_seg" region when building an image? I am hitting a limit with too much frozen byte code at link time: xtensa-lx106-elf-ld: build/firmware.elf section `.irom0.text' will not fit in region `irom0_0_seg' xtensa-lx106-elf-ld: region `irom0_0_seg' overf...
by fdushin
Wed Dec 14, 2016 3:02 pm
Forum: ESP8266 boards
Topic: Simple HTTP framework
Replies: 25
Views: 14340

Re: Simple HTTP framework

@ernitron I appreciate the comments, but really the credit goes to the makers of the ESP8266, the ESP SDK, the developers of micropython, and the broader micropython community, which makes all of this possible. As far as adding handlers for templates, the framework certainly supports doing something...
by fdushin
Sun Dec 11, 2016 2:57 pm
Forum: ESP8266 boards
Topic: File Permission issues - OSError: [Errno 13] EACCES
Replies: 7
Views: 6054

Re: File Permission issues - OSError: [Errno 13] EACCES

I have sometimes had luck trying to rebuild the file system by hand from scratch: from flashbdev import bdev uos.VfsFat.mkfs(bdev) vfs = uos.VfsFat(bdev, "") with open("/boot.py", "w") as f: f.write("""\ # This file is executed on every boot (including wake-boot from deepsleep) #import esp #esp.osde...
by fdushin
Sun Dec 11, 2016 12:38 am
Forum: ESP8266 boards
Topic: Simple HTTP framework
Replies: 25
Views: 14340

Re: Simple HTTP framework

I moved the uhttpd module to https://github.com/fadushin/esp8266/tree/master/micropython/uhttpd and added support for HTTP Basic authentication. In manipulating HTML and Javascript files on the ESP8266, I found myself wanting a shell, so I wrote a very basic one called ush , which you can find at ht...
by fdushin
Wed Dec 07, 2016 11:59 am
Forum: ESP8266 boards
Topic: Simple HTTP framework
Replies: 25
Views: 14340

Re: Simple HTTP framework

Thanks for the info. How do I close open sockets ? (When they are embedded in a class). Are there some generic commands for closing any open sockets? When you start the uhttpd server, that will open a server-side socket which is listening on port 80 (by default) for connections from clients. That s...
by fdushin
Tue Dec 06, 2016 2:22 pm
Forum: ESP8266 boards
Topic: Simple HTTP framework
Replies: 25
Views: 14340

Re: Simple HTTP framework

I get that all the time during testing. That happens when you leave your code with open connections. If you close all sockets, then soft reboot works fine. Thanks @Roberthh. I almost never use soft reboots, so I had never seen this. @bitninja You can stop the server by using the stop() method, and ...