jczic / MicroWebSrv2

The last Micro Web Server for IoTs (MicroPython) or large servers (CPython), that supports WebSockets, routes, template engine and with really optimized architecture (mem allocations, async I/Os). Ready for ESP32, STM32 on Pyboard, Pycom's chipsets (WiPy, LoPy, ...). Robust, efficient and documented!
https://github.com/jczic/MicroWebSrv2
MIT License
656 stars 97 forks source link

MicroWebSrv2 on an ESP8266 gives a Memory Error #75

Closed chess-levin closed 2 years ago

chess-levin commented 2 years ago

Thank you for your two great MicroWebSrv-Libraries! I've create a project that controls staircase LED lights that are mounted inside wall boxes. The lights are triggered, by PIR , by lux-sensor or by RTC. The project is controlled by an arduino pro mini. The arduino is also mounted in one of the wall boxes behind one of the led lights. The only control is the wall light switch (power on/off). For more control I always have to open the wall box containing the arduino. In order to gain easier control over the arduino I want to add wifi-access. So I came across the ESP8266-12F (and I discoverd MicroPython!!! :-) My plan is to change from arduino pro mini to ESP8266-12F. The 8266 mcu matches my requirements for power and space. Now I'm looking for the right web server library, that allows me to use my mobile browser to read a few values from the mcu and to post/change some values. The main task of the mcu is still to keep several timers running, handle interrupts and control the pwm output for the led. Which web server would you recommend for my project? Is MicroWebSrv2 running on ESP8266? Is MicroWebSrv still maintained? Looking forward hearing from you.

chess-levin commented 2 years ago

I've tested to run MicroWebSrv2 on an ESP8266-12F ( with 4MB, MicroPython v1.17 on 2021-09-02; ESP module with ESP8266 ) by using your main.py and got this

>>> %Run -c $EDITOR_CONTENT

       ---------------------------
       - Python pkg MicroWebSrv2 -
       -      version 2.0.6      -
       -     by JC`zic & HC2     -
       ---------------------------

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "MicroWebSrv2/__init__.py", line 15, in <module>
MemoryError: memory a

As told before, I'm new to MicroPython and ESP8266. Could you give me any hint if there is a change to get your webserver running on my mcu or should I try the previos version or is there a lightweight alternative?

HonzaKubita commented 2 years ago

Have you found the solution yet? I'm stuck on the same thing.

chess-levin commented 2 years ago

Have you found the solution yet? I'm stuck on the same thing.

No, I gave up using MicroPython on ESP8266 and went back to good old c++