pythings / Drivers

Some drivers for MicroPython
Apache License 2.0
63 stars 22 forks source link

ESP 8266: MemoryError: memory allocation failed, allocating xxx bytes #21

Open ndinev opened 5 months ago

ndinev commented 5 months ago

I am trying to run the example on

MicroPython v1.21.0 on 2023-10-05; ESP module with ESP8266
gc.mem_free()
32736

when trying to start example I am getting MemoryError: memory allocation failed, allocating 234 bytes

Any help to get this working on ESP will be appreciated

sarusso commented 5 months ago

Hi @ndinev,

it't very unlikely that you will be able tu run this driver as-is on an ES8266, due to its very limited memory. If you can, switch to an ESP32.

Otherwise, here are a few things you can try:

In any case there will be a strong limit on the content you can access, since the driver loads the entire response in memory as well. This could be solved implementing a "streaming" mode, though.