[SOLVED] Gateway with signing = low memory



  • Hi,
    I use MySensors V2.3.1 in an arduino nano has gateway.
    my code is

    #define MY_RADIO_RF24
    #define MY_GATEWAY_SERIAL
    #define MY_SIGNING_ATSHA204
    
    #include <MySensors.h>
    
    void setup()
    {
    }
    
    void presentation()
    {
    }
    
    void loop()
    {
    	delay(10);
    }
    

    but when i upload with arduino IDE i have a warning message: "Low memory available, stability problems may occur"

    how can i solve this issue ?

    thank you for your help


  • Mod

    @snyfir use hardware signing or use an Arduino with more memory.
    Edit: sorry, I see you are already using hardware signing.



  • @mfalkvidd said in Gateway with signing = low memory:

    @snyfir use hardware signing or use an Arduino with more memory.

    MY_SIGNING_ATSHA204 is not hardware signing ? i have connected an ATSHA204 to the arduino pin.


  • Mod

    @snyfir sorry, I see you are already using hardware signing.



  • @mfalkvidd
    So my only solution is to use an arduino with more memory ? do you have an exemple of arduino board i can use ?


  • Mod

    @snyfir what is the full output of the verify step? This is what I get when using your sketch:

    Using library MySensors at version 2.3.2-beta in folder: R:\Documents\Arduino\libraries\MySensors 
    Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI 
    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-size" -A "C:\\Users\\Micke\\AppData\\Local\\Temp\\ArduinoBuild/sketch_apr08a.ino.elf"
    Sketch uses 15574 bytes (50%) of program storage space. Maximum is 30720 bytes.
    Global variables use 1026 bytes (50%) of dynamic memory, leaving 1022 bytes for local variables. Maximum is 2048 bytes.
    

    On 2.3.1 I get this:

    Using library MySensors at version 2.3.1 in folder: R:\Documents\Arduino\libraries\MySensors 
    Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI 
    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-size" -A "C:\\Users\\Micke\\AppData\\Local\\Temp\\ArduinoBuild/sketch_apr08a.ino.elf"
    Sketch uses 15650 bytes (50%) of program storage space. Maximum is 30720 bytes.
    Global variables use 1022 bytes (49%) of dynamic memory, leaving 1026 bytes for local variables. Maximum is 2048 bytes.
    

    So plenty of ram left.
    You might need to check this in preferences to get useful output
    0_1554732172388_b2bf1cee-a1b9-4095-a8f3-4884ee574c46-image.png



  • I had the same result but when i add the two lines:

    #define MY_RX_MESSAGE_BUFFER_FEATURE
    #define MY_RF24_IRQ_PIN (2)
    

    i have

    Sketch uses 16296 bytes (50%) of program storage space. Maximum is 32256 bytes.
    Global variables use 1693 bytes (82%) of dynamic memory, leaving 355 bytes for local variables. Maximum is 2048 bytes.
    Low memory available, stability problems may occur.
    

    A gateway without MY_RX_MESSAGE_BUFFER_FEATURE defined, can be problematic non ?


  • Mod

    @snyfir said in Gateway with signing = low memory:

    MY_RX_MESSAGE_BUFFER_FEATURE

    It's hard to have it all with an Arduino Nano, but you could try with a smaller receive buffer, by defining

    #define MY_RX_MESSAGE_BUFFER_SIZE (10)
    

    Here it is changed to 10, default is 20, which is rather large.
    Each buffer entry reserves 33 bytes, so you'll save 330 going back to 10 entries.



  • @yveaux said in Gateway with signing = low memory:

    #define MY_RX_MESSAGE_BUFFER_SIZE (10)

    thank you @Yveaux et @mfalkvidd


  • Plugin Developer

    I've created a lot of devices on Arduino Nano's with soft signing. You have to learn how to manage memory, and then it works great.

    A gateway on a nano with nothing in the code except it being a gateway, that should work fine. I've never seen that error message when I used the SIMPLE SECURITY option.

    Low memory warning might also not really be a problem in practise. If your sketch is empty, then there may not be much to worry about: there are no functions in your code that suddenly need a lot of memory. The only question then is how much MySensors needs which isn't globally defined. I don't know the answer to that, but someone else might.

    In the end I'd say: test it. If all seems to work ok, then there's really not a problem.


 

187
Online

8.7k
Users

9.5k
Topics

99.9k
Posts