• 0 Votes
    3 Posts
    83 Views
    T
    @jcaron Thanks for the clarification. Okay, Then how about the second part of my question? If I import a library, does the whole library (including unused functions) get loaded into / waste memory? Thanks, Troy
  • memory problems LoPy Pybytes

    LoPy lopy lora memoryerror pybytes
    3
    0 Votes
    3 Posts
    59 Views
    G
    Hi, As you see, the Lopy1 has 4MB of flash memory. All our newer products sport larger Flash memory as the firmware size is ever increasing with new features. The problem is that the files you are trying to upload will fill up the Flash to its maximum. You can either install one of the older (smaller) firmwares using the firmware updater tool, or do something with the mpy files. That is a pretty advanced procedure where you build your own firmware, there is some discussion around it in multiple places, I link one here: https://forum.pycom.io/topic/2686/requesting-manual-flashing-procedure/5?_=1597228804264
  • MEmoryError: memory allocation failed

    LoPy lopy memoryerror
    2
    0 Votes
    2 Posts
    503 Views
    C
    Depends. 2k on a LoPy is a lot of memory. If it occurs during compilation time, precompiling your code with mpy_cross is the solution. Otherwise it is not that easy. You have to reduce memory fragmentation. You can see the fragmentation with micropython.mem_info() Precompile as many files as you can. So the memory of the LoPy is not fragmented after boot time. Allocate huge buffers as early as you can. Reuse them instead of reallocate. You can try to call the garbage collector in front of your memory allocation. But this does not help in many situations. The garbage collector does not relocated objects in use, so the memory is still fragmented. If there is a background thread, it may fill your memory faster than you can free it. For example if it calculate float objects in a loop.
  • 0 Votes
    5 Posts
    839 Views
    V
    @martinnn lib_imu is a library that I wrote and in this function give only data from IMU and there aren't any delay. if I wrote data immediately on a file.txt in SD card it employ 0,2 s so the sample became 0,4. but if I collect data and insert them in a list to save data at the end of acquisition it gives me the error 'Memory allocation'.
  • Requesting Manual Flashing procedure

    LoPy firmware update memoryerror
    5
    0 Votes
    5 Posts
    1k Views
    S
    @robert-hh Thanks will try and come back to you,
  • 0 Votes
    4 Posts
    2k Views
    robert-hhR
    @gruia-nichita I do not work with the pymakr plugin. It's too obscure for my opinion. You can always copy the file to the board with ftp, using FileZilla or FireFTP. Instructions on how to do that are in the docs: https://docs.pycom.io/chapter/toolsandfeatures/FTP.html
  • wlan.scan() errno 12 ENOMEM

    MicroPython wifi memoryerror esp32 micropython
    2
    0 Votes
    2 Posts
    1k Views
    robert-hhR
    @dhblumenfeld1989 This cannot be the full script. At least a two lines are missing upfront, like: from network import WLAN wlan = WLAN(mode=WLAN.STA) And as a side note: The flash size you get with uos.getfree() is not relevant for memory errors. These are caused by RAM shortage. The size of free RAM is told by gc.mem_free(). And for all people trying to help it is useful to know the firmware version, which can be obtained by uos.uname().
  • PyTrack GPS - MemoryError

    Expansion Board pytrack lopy memoryerror gps
    1
    0 Votes
    1 Posts
    822 Views
    No one has replied
  • 0 Votes
    16 Posts
    6k Views
    A
    @meirssv I've managed to construct a GPS tracker with a SiPy module. But I've use this gps lib ( https://forum.pycom.io/post/16183 ) from neuromistyx. Works great. because L76 is slow I've added a timeout of 3 minutes.
  • How do I diagnose MemoryError?

    Getting Started memoryerror
    18
    0 Votes
    18 Posts
    5k Views
    B
    @robert-hh said in How do I diagnose MemoryError?: b) follow the instructions in https://github.com/pycom/pycom-micropython-sigfox/README.md, section ESP32 (not Pyboard) Correct URL https://github.com/pycom/pycom-micropython-sigfox/blob/master/README.md