microWebSrv on ESP8266, and general question

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
Akrobate
Posts: 6
Joined: Thu Jun 02, 2022 8:04 pm

microWebSrv on ESP8266, and general question

Post by Akrobate » Sun Jun 05, 2022 7:06 pm

Hello!

I would like to know if somebody was able to make the excellent library microWebSrv or microWebSrv2 working on an ESP8266?
Sorry if question was already asked, but I can't get clear information saying that it's impossible.

I tried to copy the library, but got a memory error, the solution seems to be to build my own firmware with this library embedded inside (frozen).

That's ok, but I would like to know if somebody has made it before and have some feed backs about?

Maybe is there some other libraries I could try? What are you usually using for a very simple and light web server?

Other question around micropython:
The problem of importing the microWebSrv is a memory problem. If I do understand right, it is because of the micropython uses to much memory compiling the raw py code during the runtime.

So does it means that if I write a quite big python module (or script), it is required to be embed it in my own compiled firmware?

Does it means that the source code written in pure python can't exceed the ram of the device to avoid importing problems? Or am I all wrong?

Thank you

User avatar
scruss
Posts: 360
Joined: Sat Aug 12, 2017 2:27 pm
Location: Toronto, Canada
Contact:

Re: microWebSrv on ESP8266, and general question

Post by scruss » Sun Jun 05, 2022 8:56 pm

esp8266 isn't on the MicroWebSrv2 list of supported platforms, and there are a few issues on the project github page that suggest it won't run.

Akrobate
Posts: 6
Joined: Thu Jun 02, 2022 8:04 pm

Re: microWebSrv on ESP8266, and general question

Post by Akrobate » Mon Jun 06, 2022 2:11 pm

Thank you for your answer,

Do you have any ideas about the second part of my question about the python scripts sizes?

Trikkitt
Posts: 10
Joined: Mon Aug 13, 2018 8:50 am

Re: microWebSrv on ESP8266, and general question

Post by Trikkitt » Wed Jun 15, 2022 9:12 pm

Akrobate wrote:
Mon Jun 06, 2022 2:11 pm
Thank you for your answer,

Do you have any ideas about the second part of my question about the python scripts sizes?
I've written programs for the ESP8266 and have had to break them in to multiple pre-compiled modules. The act of compiling is the most significant issue when you're trying to load many things in to the ESP8266. If I recall it generally fails when you hit 100 lines of code. So for my projects today I mpy-cross compile them and then load the .MPY files in.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: microWebSrv on ESP8266, and general question

Post by pythoncoder » Sat Jun 18, 2022 8:52 am

See this doc for information on freezing bytecode. Using this technique it is possible to install libraries comprising hundreds of lines of code and to run applications with plenty of free RAM.
Peter Hinch
Index to my micropython libraries.

Post Reply