Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Bug Reports
  3. Out of memory in pressureSensor example

Out of memory in pressureSensor example

Scheduled Pinned Locked Moved Bug Reports
3 Posts 2 Posters 2.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    portals
    wrote on last edited by
    #1

    Hello,
    I've tried to use a pressureSensor example but Arduino nano clone didn't send any data. During compilation i have seen:

    Sketch uses 23,540 bytes (76%) of program storage space. Maximum is 30,720 bytes.
    Global variables use 1,677 bytes (81%) of dynamic memory, leaving 371 bytes for local variables. Maximum is 2,048 bytes.
    Low memory available, stability problems may occur.

    Serial was looped:
    send:sensor started, id 1
    send:sensor started, id 1
    send:sensor started, id 1
    send:sensor started, id 1

    I solved this problem by disable weather forecast. I suppose device run out of memory with enabled weather forecast.

    N 1 Reply Last reply
    0
    • P portals

      Hello,
      I've tried to use a pressureSensor example but Arduino nano clone didn't send any data. During compilation i have seen:

      Sketch uses 23,540 bytes (76%) of program storage space. Maximum is 30,720 bytes.
      Global variables use 1,677 bytes (81%) of dynamic memory, leaving 371 bytes for local variables. Maximum is 2,048 bytes.
      Low memory available, stability problems may occur.

      Serial was looped:
      send:sensor started, id 1
      send:sensor started, id 1
      send:sensor started, id 1
      send:sensor started, id 1

      I solved this problem by disable weather forecast. I suppose device run out of memory with enabled weather forecast.

      N Offline
      N Offline
      niccodemi
      wrote on last edited by
      #2

      @portals I had same issue - see this thread.

      Download latest library, disable debug and follow @BulldogLowell advice. I managed to get dynamic memory to 75% and that seems sufficient - it has been running for a week now without issues.

      1 Reply Last reply
      1
      • P Offline
        P Offline
        portals
        wrote on last edited by portals
        #3

        For now i found this solution:
        I changed a pressureAvg and pressureSamples to unsigned int. Next changed int forecast = sample(pressure) to int forecast = sample(pressure * 10) to avoid big precision lost. Sample function still may need correction but probably it is a good and easy way to fix this problem.

        Result:
        Sketch uses 18,636 bytes (60%) of program storage space. Maximum is 30,720 bytes.
        Global variables use 1,268 bytes (61%) of dynamic memory, leaving 780 bytes for local variables. Maximum is 2,048 bytes.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        11

        Online

        11.7k

        Users

        11.2k

        Topics

        113.1k

        Posts


        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • MySensors
        • OpenHardware.io
        • Categories
        • Recent
        • Tags
        • Popular