How can I have a test environment separate from production
-
Howdy,
Title says it all. I'd like to have the ability to build and debug sensors with a test gateway and have a way to present to the production gateway when they've been tested.
I am mostly using SenseBenders in my production setup, with a few Nano's as repeaters.
Any ideas on how to be able to run up a sensor without it presenting to the production gateway?
Why do I want to do this? I've had issues when using HomeAssistant keeping the state of test child sensors that change while I'm still working and debugging the sketch. I'd like to run a test HomeAssistant with the test gateway.
Thanks,
Simon.
-
Hello, @simbo, I think the simple way is to just use a different radio channel for the test and the production environment ?
-
Ok....That sounds reasonable. I am assuming that is set with the #define MY_RF24_CHANNEL?
-
@simbo yes it is
-
Awesome...thanks.
-
I have in mind to use a DIP switch on my sensors to switch between production and test. If the DIP switch is set to TEST I want to transmit on the Test Channel.
Is it possible to set the MY_RF24_CHANNEL at run time, rather than at compile time?
-
@mljbr4 You can change it on the fly by calling
RF24_setChannel( c );
But, that's probably not going to work in your situation.... If you change it in before() it will be overwritten by the MySensors stack, if you do it in setup() you're already too late...
What you could try is define a variable holding the channel, and make sure this gets set to the right value before MySensors starts, e.g.:
uint8_t channel = 76; // default #define MY_RF24_CHANNEL (channel) #include <MySensors.h> void before() { channel = 90; // debug channel }
Suggested Topics
-
Update RF24 library to latest version
Bug Reports • 23 Mar 2014, 23:37 • andriej 24 Mar 2014, 22:52 -
Code Garage to the rescue.
General Discussion • 11 Jan 2025, 11:25 • skywatch 14 days ago -
Is it possible to extract child ID from a just sent message?
General Discussion • 8 Nov 2021, 09:21 • Nigel31 25 days ago -
No merge into master in the last 5 years, should we use development?
General Discussion • 23 Sept 2024, 17:48 • kiesel 25 Mar 2025, 15:30 -
Which device I have to use to connect with accelerometer before connecting to my pc?
General Discussion • 24 Jan 2023, 17:16 • Yada Kijsathan 16 Mar 2025, 20:17 -
Meet in Malmö, Summer 2016?
General Discussion • 1 Feb 2016, 15:34 • bjacobse 4 Mar 2025, 00:29