My Sensors Test environments


  • Hero Member

    Hey all.

    I had a problem recently where my prod Vera ran out of memory and this results in not being able to save any settings or create new devices as well as the Vera main process crashing and restarting!! I fixed this by cleaning up some unused plugins and devices...many of which were Arduino devices from testing...

    Anyway, as I have two Vera's i realised id better be more carefull and not use the production one for any testing....
    My "test" vera is on UI7 and my "production" is on UI5 - both are equipped with a Ethernet Gateway ( ver 1.4.1)

    I've just posted a multisensor sketch to codebender which has a method i use for setting which mysensors parameters apply to the sketch and to which mysensors network it should operate on. It means i dont need to make changes to the MyConfig file and remember to switch back..a pain when im tweeking a prod sketch...

    Anyway here is the snippet below - i just change the MySensorTESTBED from 0 to 1 :

    #define MySensorTESTBED 0
    
    #if MySensorTESTBED == 1
       #define CLIENT_ID 9  // Sets MYSensors client id
       #define RADIO_CH 96  // Sets MYSensors to use Radio Channel 96
       #define RELAY 4   // Set 4 for mini rboard
       #define TRIGGER	3	// On Mini Rboard there is D3 (Interupt 1) available on the RX Module pins
     #endif
    
    #if MySensorTESTBED == 0
       #define CLIENT_ID AUTO  // Sets MYSensors client id
       #define RADIO_CH 76  // Sets MYSensors to use Radio Channel
       #define RELAY 4   // Set 4 for mini rboard
       #define TRIGGER	3	// On Mini Rboard there is D3 (Interupt 1) available on the RX Module pins
    #endif
    

    these then get used in setup..

    gw.begin(incomingMessage, CLIENT_ID , false,AUTO,RF24_PA_MAX,RADIO_CH,RF24_250KBPS);
    

    I can also use the same to control which Pins are used or whatever other variables i need... very good for sleep variables!

    Hope this is of interest...

    Full sketch here:
    https://codebender.cc/sketch:61919


Log in to reply
 

Suggested Topics

1
Online

11.3k
Users

11.1k
Topics

112.5k
Posts