Global variables without compile again



  • Hi all,

    I'm trying to find a solution for the following scenario.

    Right now I have deloyed ~10 sensor boxes with Motion, Temperature, Humidity & Light level. All of them working without issue.

    I'd like to find a way to have some variables outside the Arduino Code that I can change in realtime and that Arduinos will use (let's say by restarting) without needed to recompile and flash them.

    My first thinking is to have something in the GW that I can customize and that each and every node will consume.

    I think the usage example will be for Sleep timers. When everything is in 'running mode' well, sleeptimer for Temp & Huidity gathering can be high (let's say 1 measurement every 5 minutes). But if I'm testing something or want to investigate if the system works or something being able to alter this value to 10 seconds would be great

    Not sure if I'm explaining enough what I'm trying to address but please feel free to help me scope it.

    Is there any way I can do this?

    Thanks in advance.


  • Mod

    I'd say OTA firmware updates is the right solution. OTA provides full flexibility and is fully supported.

    You could get away with custom or text variables (text requires 2.x though) but that means you need to predict all changes you'll want to make.



  • Actually, now reading the GW code, I think I'm asking for something like the 'metric' variable usually checked in the setup method.


  • Hero Member

    @Dave-Dan A simple solution would be to create a basic 'test' switch "V_STATUS" for each node.


Log in to reply
 

Suggested Topics

  • 1
  • 2
  • 2
  • 2
  • 198
  • 5

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts