Closed limited660 closed 6 years ago
the necessary libraries are in the "frozen" into the build. Try removing everything in the CIRCUITPY/lib. a tleast remove adadruit_hid/ , adafruit_dotstar.mpy and adafruit_IRremore.mpy. I just tried this under the 4.0 alpha and it works.
Also verified it works on CP 3.0.2 when lib/ is empty
This may be related to https://github.com/adafruit/Adafruit_CircuitPython_Bundle/issues/93
Verified on my pIRkey, removing the "lib" folder and contents removes issue.
To see what is included or "frozen", at the REPL type help(‘modules’) that will show the built in modules. - @jerryneedell
OK great - we're working on a solution to this common issue :)
I know I'm kinda necroposting here, but I'm trying to use the CPX IR, getting the same error. Tried deleting files in /lib. When I REPL the modules though, adafruit_IRremote isn't showing up as frozen. So no IR functions work. What can I do?
@KaleidoscopeSci adafruit_irremote
is only frozen on the PirKey (which isn't for sale at the moment), so on the CPX you need your lib directory back (or at least that library). Also, as of CircuitPython 3.1.1, frozen modules will be imported first, so you don't need to delete the lib directory to save RAM anymore for frozen modules.
Sadly with the lib directory installed on CPX, I'm still getting the memory allocation error. Anything else I can try? I've tried changing maxlenth, setting different time. sleep amounts, still keep getting the same error. This is the only documentation I've been able to find that describes anything similar to what I'm experiencing.
OK, then, there's nothing really to be done, unfortunately. This issue is partly why the pirKey is not available right now - we haven't figured out an easy fix. Making the library frozen saves RAM, but there are still issues.
I'm having issues with (2) pIRkey's throwing the following error:
Traceback (most recent call last): File "main.py", line 57, in <module> File "adafruit_irremote.py", line 217, in read_pulses MemoryError: memory allocation failed, allocating 512 bytes
This occurs with the example provided on the pIRkey called "NEC Keyboard Example". One device is running 2.2.3 and I can trigger the error on unmodified code simply by pushing a button on an IR remote in quick succession, adding a
time.sleep(.1)
to the end does not prevent this from happening. The other device is running 3.0.2 with upgraded libraries (only replaced those that were already on the device) and it shows the same symptoms as 2.2.3 on unmodified code. When the 3.0.2 device hastime.sleep(.1)
at the end I get the error immediately after pushing a button.The code below is the "NEC Keyboard Example" that is included but with modifications that allow it to run without the memory error. It will not run without error until you comment out
import adafruit_dotstar
, I tried one by one with all the lines further in the code and it errors until the previously mentioned one is removed.