💬 NodeManager
-
@user2684 so which controler are you using?
https://www.mysensors.org/controller/myhouse but since I wrote it, my opinion would be biased :P
-
Hi
I have a led ir emitter can i send to my air contiotioner a code like x0284828 by digital output in nodemanager(with irremote library is simple)@mar.conte mmm not sure I got the use case. I think we need some sort of "IR" specific output. Btw if you prefer, feel free to open a new thread on https://forum.mysensors.org/category/43/nodemanager
-
Hi, nice work!
I have changed the code for REBOOT so there is no need for a reboot-pin.
like this...else if (strcmp(message, "REBOOT") == 0) {
#if DEBUG == 1
Serial.println(F("REBOOT"));
#endif
// Software reboot with watchdog timer
// Enter Watchdog Configuration mode:
WDTCSR |= (1<<WDCE) | (1<<WDE);
// Reset enable
WDTCSR= (1<<WDE);
// Infinite loop until watchdog reset after 16 ms
while(true){}
}Hi @Dencan @core_c I'm having trouble with both the solutions you recommended. When the reboot code is triggered, I have my pro mini 3.3v board freezing with the power led blinking continuously (https://github.com/mysensors/NodeManager/issues/133). Do you guys know what the issue could be? Thanks!
-
Hi @Dencan @core_c I'm having trouble with both the solutions you recommended. When the reboot code is triggered, I have my pro mini 3.3v board freezing with the power led blinking continuously (https://github.com/mysensors/NodeManager/issues/133). Do you guys know what the issue could be? Thanks!
@user2684 It appears that this problem is caused by a bug in bootloaders used in some Arduino boards.
The solution suggested is to flash optiboot bootloader to the Arduino Pro Mini. Or not using a bootloader.
I use mostly barebone atmega328's with optiboot bootloader, working perfectly with reboot function, so I haven't been aware of the problem until now when I used a pro mini.
Please read this article which explains the cause of the problem and suggested fix.
https://andreasrohner.at/posts/Electronics/How-to-make-the-Watchdog-Timer-work-on-an-Arduino-Pro-Mini-by-replacing-the-bootloader/I will try it on a pro mini when I have time.
-
@user2684 It appears that this problem is caused by a bug in bootloaders used in some Arduino boards.
The solution suggested is to flash optiboot bootloader to the Arduino Pro Mini. Or not using a bootloader.
I use mostly barebone atmega328's with optiboot bootloader, working perfectly with reboot function, so I haven't been aware of the problem until now when I used a pro mini.
Please read this article which explains the cause of the problem and suggested fix.
https://andreasrohner.at/posts/Electronics/How-to-make-the-Watchdog-Timer-work-on-an-Arduino-Pro-Mini-by-replacing-the-bootloader/I will try it on a pro mini when I have time.
@Dencan thanks, very good information. Based on what you are saying, I'd probably re-introduce the reboot pin as a backup solution just in case somebody doesn't want or can move away from the default bootloader. In this way both the approaches will be available. Thanks!
-
I have a hard time figuring out one simple thing... Is the NodeManager code supposed to be on the sensors? Or is it supposed to be on the Gateway? Or both??
-
I have a hard time figuring out one simple thing... Is the NodeManager code supposed to be on the sensors? Or is it supposed to be on the Gateway? Or both??
@ronnyandre With NodeManager you can build sensors but also configure a gateway. :+1:
-
@ronnyandre With NodeManager you can build sensors but also configure a gateway. :+1:
@Sergio-Rius I think I understood it correctly. Code goes on the sensors, not on the gateway itself? That means, the MySensors Serial Gateway I use is only a carrier of the messages that NodeManager receives on the sensors I implement the code?
-
@Ivan-Z if you mean an example with DHT22, you need first of all to enable the DHT module in config.h with:
#define MODULE_DHT 1Then just register the sensor in before() with:
nodeManager.registerSensor(SENSOR_DHT22,6);Where 6 is the pin where the sensor is attached to. NodeManager will then create automatically two child ids, one for temperature and the other for humidity.
As written in the documentation you need the DHT library from https://github.com/adafruit/DHT-sensor-library (or install it by using the arduino IDE). For some unknown (to me) reasons I had issues in using the library from the mysensors example.What do you mean by optimization flag?
As for avoid sending the same value, this is already available, have a look at setTackLastValue() from the documentation. When set to true, the value will not be send if the same as the previous (default is of course false). I also implemented setForceUpdate(), to force to send an update after the configured number of cycles, as many examples here are using this approach.@user2684 Hi, i am trying to get started with NodeManager, and I have a question about dht configuration?
I would like to set it to not update values if temperature is not changed, something like ((SensorLatchingRelay*)nodeManager.getSensor(1))->setTackLastValue(true);
But how do I select both sensors, are they numbers 1 and 2 (both temp and humidity)?
I would also like to add these settings to them.
((SensorLatchingRelay*)nodeManager.getSensor(1))->setForceUpdate(4);
((SensorLatchingRelay*)nodeManager.getSensor(1))->setFloatPrecision(1);Thanks!
-
@Sergio-Rius I think I understood it correctly. Code goes on the sensors, not on the gateway itself? That means, the MySensors Serial Gateway I use is only a carrier of the messages that NodeManager receives on the sensors I implement the code?
@ronnyandre NodeManager is a code wrapper. It's a collection of libraries, that has been join with a configuration script that automatically picks and does what is needed for your like.
You can make a common temperature sensor, but if you look at the documentation and the NodeManager.h code or the ino template itself, you have options for gateway configuration.
So you should be able to configure a gateway sketch and burn into your hardware.I hope this gives some light before the dinner ;)
-
@user2684 Hi, i am trying to get started with NodeManager, and I have a question about dht configuration?
I would like to set it to not update values if temperature is not changed, something like ((SensorLatchingRelay*)nodeManager.getSensor(1))->setTackLastValue(true);
But how do I select both sensors, are they numbers 1 and 2 (both temp and humidity)?
I would also like to add these settings to them.
((SensorLatchingRelay*)nodeManager.getSensor(1))->setForceUpdate(4);
((SensorLatchingRelay*)nodeManager.getSensor(1))->setFloatPrecision(1);Thanks!
@dakipro said in 💬 NodeManager:
((SensorLatchingRelay*)nodeManager.getSensor(1))->setForceUpdate(4);
((SensorLatchingRelay*)nodeManager.getSensor(1))->setFloatPrecision(1);SensorLatchingRelay is wrong here.
Try:int sensorDHT_Id = nodeManager.registerSensor(SENSOR_DHT22, PIN_DHT); SensorDHT* sensorDHT = (SensorDHT*)nodeManager.getSensor(sensorDHT_Id); sensorDHT->setSamples(5); sensorDHT->setSamplesInterval(2001); sensorDHT->setTackLastValue(true); sensorDHT->setForceUpdate(3);Those options refer to the whole device, should be applied also to humidity. There was a bug on this but I think it was already corrected. If not, try with development version.
-
Thanks, right after posting the question, I have found a example on the topic itself (search function on the forum does not search current topic anymore, I had to scroll down to be able to "find in page").
I am now using this
int sensorDHT_Id = nodeManager.registerSensor(SENSOR_DHT22,4);
SensorDHT* sensorDHT = (SensorDHT*)nodeManager.getSensor(sensorDHT_Id);Will see how it goes :)
-
@ronnyandre NodeManager is a code wrapper. It's a collection of libraries, that has been join with a configuration script that automatically picks and does what is needed for your like.
You can make a common temperature sensor, but if you look at the documentation and the NodeManager.h code or the ino template itself, you have options for gateway configuration.
So you should be able to configure a gateway sketch and burn into your hardware.I hope this gives some light before the dinner ;)
@Sergio-Rius Thanks man! I will definitely take a closer look. I just one silly last question....
Trying to use a simple DS18B20 temperature sensor, and I get the following error:
error: 'SENSOR_DS18B20' was not declared in this scope
nodeManager.registerSensor(SENSOR_DS18B20,3);Seems like it doesn't like me declaring it. I have installed Dallas Temperature and One Wire through Arduino libraries.
-
@ronnyandre you need to uninstall those libraries and install those mentioned in the heading: Installing the dependencies: NodeManager
-
@ronnyandre you need to uninstall those libraries and install those mentioned in the heading: Installing the dependencies: NodeManager
@mickecarlsson Thanks, I will try that later today :smiley:
-
@ronnyandre NodeManager is a code wrapper. It's a collection of libraries, that has been join with a configuration script that automatically picks and does what is needed for your like.
You can make a common temperature sensor, but if you look at the documentation and the NodeManager.h code or the ino template itself, you have options for gateway configuration.
So you should be able to configure a gateway sketch and burn into your hardware.I hope this gives some light before the dinner ;)
@Sergio-Rius @ronnyandre just to add something on top of what already discussed regarding the gateway thing, yes you can use NodeManager for the gateway as well or alternatively a standard gateway sketch, those are fully compatibile since NodeManager adds very little when running as a gateway, it just relies on the standard MySensors library and directives
-
@user2684 Hi, i am trying to get started with NodeManager, and I have a question about dht configuration?
I would like to set it to not update values if temperature is not changed, something like ((SensorLatchingRelay*)nodeManager.getSensor(1))->setTackLastValue(true);
But how do I select both sensors, are they numbers 1 and 2 (both temp and humidity)?
I would also like to add these settings to them.
((SensorLatchingRelay*)nodeManager.getSensor(1))->setForceUpdate(4);
((SensorLatchingRelay*)nodeManager.getSensor(1))->setFloatPrecision(1);Thanks!
@dakipro in addition to what @Sergio-Rius already pointed out correctly, consider when multiple child IDs are created, you would need to call those functions on EACH id. Have a look at https://github.com/mysensors/NodeManager/issues/176 for more details. Thanks
-
@Sergio-Rius Thanks man! I will definitely take a closer look. I just one silly last question....
Trying to use a simple DS18B20 temperature sensor, and I get the following error:
error: 'SENSOR_DS18B20' was not declared in this scope
nodeManager.registerSensor(SENSOR_DS18B20,3);Seems like it doesn't like me declaring it. I have installed Dallas Temperature and One Wire through Arduino libraries.
@ronnyandre ensure MODULE_DS18B20 is enabled in your config.h otherwise SENSOR_DS18B20 will not be made available. Thanks