Giter Club home page Giter Club logo

Comments (5)

puhitaku avatar puhitaku commented on June 3, 2024 1

The WebServer class extends Nanoweb from this repository, which means the original nenoweb is innocent about the problem, I think.

i have also try only to import the Nanoweb class directly from REPL and i get the same error, "memory allocation failed".

Your lib module has other stuff that might cause implicit side effects like additional memory allocation. Please erase all things in the ESP8266 and try importing the unmodified nanoweb.py solely.

from micropython-nanoweb.

puhitaku avatar puhitaku commented on June 3, 2024

It's not that strange because ESP8266 has small working memory. Bisecting the addition of lines and sharing the entire code (your extended Nanoweb and the main.py) with minimal additions that causes the error is necessary to find what's wrong.

from micropython-nanoweb.

SoulRaven avatar SoulRaven commented on June 3, 2024

hello.

main.py: https://pastebin.com/GaSQhByM
web_server.py: https://pastebin.com/waAYjSzf

i have also try only to import the Nanoweb class directly from REPL and i get the same error, "memory allocation failed".

MicroPython v1.20.0 on 2023-04-26; ESP module with ESP8266
Type "help()" for more information.
>>> from lib.nanoweb import Nanoweb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
MemoryError: memory allocation failed, allocating 584 bytes
>>> from lib.nanoweb import Nanoweb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: can't import name Nanoweb
>>> import gc
>>> gc.mem_free()
12576

from micropython-nanoweb.

SoulRaven avatar SoulRaven commented on June 3, 2024

hi,
i manage to found the problem inside another file, something is not working right on that file.
Now i am trying to make the nanoweb to work with captive portal in AP mode and regular web server in STA mode.

L.E.: If we add the '/hotspot-detect.html' inside the routes, on Apple phones if the host responds with 200 OK then will redirect the page to that content.

from micropython-nanoweb.

puhitaku avatar puhitaku commented on June 3, 2024

Good to hear that you find the root cause. I think this topic is now set and ready to close @SoulRaven

from micropython-nanoweb.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.