Skip to content

Esp8266 based board has not enough RAM to load the module #17

Closed

Description

@Cinmay2014

When I tried from max30102 import MAX30102, always got importError: no module named 'max30102.MAX30102'
dir as below:
lib
-max30102
--circular_buffer.py
--init.py
I also tried from max30102.init import MAX30102, got another error:
Traceback(most recent call last):
File"", line1, in
MemoryError: memory allocation failed,allocating 416 bytes

Please help me.

Activity

  1. n-elia commented on Dec 5, 2022

    @n-elia
    Owner

    Hi,
    which board are you using? And which tools are you using to copy the files on it?
    You can also attach some screenshots if you want.
    Also, post the code you're trying to execute, please!

  2. Cinmay2014 commented on Dec 5, 2022

    @Cinmay2014
    Author

    Thanks for your quick reply.
    I am using esp8266
    And installed the driver as Thonny IDE plug-in, I also tried to install it directly to the board, and got the same issue.

    from max30102 import MAX30102
    Traceback (most recent call last):
    File "", line 1, in
    ImportError: no module named 'max30102'

  3. n-elia commented on Dec 5, 2022

    @n-elia
    Owner

    Hi,
    did you install the latest (v0.4.1) version?
    Are you absolutely sure that the files have been correctly written onto non-volatile memory? It seems like it cannot find the file.

    May you provide a wifi internet connection to your board? If so, can you try the example suggested in the readme here ?

  4. Cinmay2014 commented on Dec 5, 2022

    @Cinmay2014
    Author

    Yes, I installed the latest version.
    I tried the manual way and got a memory error.
    I will try the wifi-enable method and let you know the result.

  5. n-elia commented on Dec 6, 2022

    @n-elia
    Owner

    Ok, try that way.

    Remember to reset the board (Ctrl-D in Thonny) and let it run boot.py and main.py, do not play your scripts directly from Thonny.

    The online installation works fine, so if you will get the memory error, then it means that you have not enough RAM on your board to run this driver, and you could try to precompile or frozen the driver or try to write a lighter one on your own.

    Let me know what happens!

  6. Cinmay2014 commented on Dec 7, 2022

    @Cinmay2014
    Author

    Tried it and got the error:

    Trying to connect to the Internet to download the module.
    network config: ('192.168.1.216', '255.255.255.0', '192.168.1.1', '192.168.1.98')
    Installing to: /lib/
    Error installing 'micropython-max30102': memory allocation failed, allocating 15685 bytes, packages may be partially installed

    Can you tell me how to frozen the driver?

  7. n-elia commented on Dec 10, 2022

    @n-elia
    Owner

    Hi,
    Then your board has not enough RAM to load the library.
    Take a look here for instructions on freezing modules.

  8. changed the title [-]installed the driver for thonny but not able to import MAX30102[/-] [+]Esp8266 based board has not enough RAM to load the module[/+] on Dec 10, 2022
  9. Repository owner locked and limited conversation to collaborators on Dec 10, 2022
  10. converted this issue into a discussion #18 on Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions