💬 NodeManager
-
-
Done! I've updated the documentation with four comprehensive examples including the full sketches
-
How make not sleep sensor?
void NodeManager::loop() {
#if SLEEP_MANAGER == 1
Only for sleep
#end
}May be to make wait logic
-
@Ivan-Z there should be already something in this direction available. You still need to load the sleep module and set sleep time but you have to set sleep mode like this:
nodeManager.setSleepMode(WAIT);And the library will use wait() instead of sleep(). All the rest will stay the same.
I probably need to double check if there is anythig in the code which will use sleep instead of wait outside loop() so I've opened https://github.com/mysensors/NodeManager/issues/38 for this but you should be ready to go even with the current version.
Thanks -
Please show my sample with DHT22
Append optimization flag.
For save battery life, do not send the same values -
@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. -
Hi, I've updated the project (including files and documentation) to version 1.4.
Main changes are:- Added support for ML8511 UV intensity sensor
- Added support for MQ air quality sensor
- Added ability to manually assign a child id to a sensor
- Ensured compatibility for non-sleeping nodes
- Ability to control if waking up from an interrupt counts for a battery level report
- When power pins are set the sensor is powered on just after
- Service messages are disabled by default
- Bug fixes
Thanks!
-
@openhardware.io Great idea. Can we expect to see support for Sonoff/ESP8266(without SLEEP) in a near future?
Also, would love to see an example of a custom sensor/HC-SR04 distance sensor, 3-pin implementation.
Keep up the great work. -
@openhardware.io Great idea. Can we expect to see support for Sonoff/ESP8266(without SLEEP) in a near future?
Also, would love to see an example of a custom sensor/HC-SR04 distance sensor, 3-pin implementation.
Keep up the great work.@Straydog said in 💬 NodeManager:
Great idea. Can we expect to see support for Sonoff/ESP8266(without SLEEP) in a near future?
Also, would love to see an example of a custom sensor/HC-SR04 distance sensor, 3-pin implementation.
Keep up the great work.Thanks for the advice! I'd be very happy to support any sensor which would be useful for the community! I've opened https://github.com/mysensors/NodeManager/issues/63 and https://github.com/mysensors/NodeManager/issues/62.
Since I don't have those sensors and delivery is kind of a pain, would you like to give me a hand in testing the code I can put together? If so, please add a comment on git with some sample code and I'll integrate it into NodeManager straight away for your testing.
Thanks! -
This version already allows wizard (.php) to generate a sketch
-
@openhardware.io Great idea. Can we expect to see support for Sonoff/ESP8266(without SLEEP) in a near future?
Also, would love to see an example of a custom sensor/HC-SR04 distance sensor, 3-pin implementation.
Keep up the great work.@Straydog said in 💬 NodeManager:
Can we expect to see support for Sonoff/ESP8266(without SLEEP) in a near future?
I spend some time in the forum but still I'm struggling a bit to understand the Sonoff use case to then buy the right piece to test. Is it related to what has been discussed in this thread?
https://forum.mysensors.org/topic/5858/sonoff-relay-using-mysensors-esp8266-wifi-or-mqtt-gateway
Thanks! -
@Straydog said in 💬 NodeManager:
Can we expect to see support for Sonoff/ESP8266(without SLEEP) in a near future?
I spend some time in the forum but still I'm struggling a bit to understand the Sonoff use case to then buy the right piece to test. Is it related to what has been discussed in this thread?
https://forum.mysensors.org/topic/5858/sonoff-relay-using-mysensors-esp8266-wifi-or-mqtt-gateway
Thanks!@user2684 I have a sonoff and have posted a few examples here https://www.mysensors.org/build/sonoff, nodeManager would maybe save a few lines of code for the end user but you will have quite a lot to code :smile: I guess if you add esp8266 support, the sonoff is just a relay with a LED and a button which nodeManager already supports.
-
@openhardware.io Great idea. Can we expect to see support for Sonoff/ESP8266(without SLEEP) in a near future?
Also, would love to see an example of a custom sensor/HC-SR04 distance sensor, 3-pin implementation.
Keep up the great work. -
@user2684 I have a sonoff and have posted a few examples here https://www.mysensors.org/build/sonoff, nodeManager would maybe save a few lines of code for the end user but you will have quite a lot to code :smile: I guess if you add esp8266 support, the sonoff is just a relay with a LED and a button which nodeManager already supports.
@Efflon said in 💬 NodeManager:
@user2684 I have a sonoff and have posted a few examples here https://www.mysensors.org/build/sonoff,
Cool project, I wonder how I've missed it so far! I understand the idea, basically the sonoff runs as a gateway (otherwise would require a radio attached which is not possible/easy) and has a relay type of sensor attached. I think I can make it easily, I'm ordering a sonoff right now so to test the implementation. I need this https://github.com/mysensors/NodeManager/issues/65 first of all and then I can adapt the SENSOR_RELAY which is already available in NodeManager. I'll keep you posted while I will progress.
Thanks! -
@Straydog just to be sure I'm buying the right sensor, I can only see HC-SR04 with 4 pins on aliexpress I guess this is the right sensor but I will use only three of the four pins, is it the case?
Thanks@user2684 It's the regular HC-SR04, with ECHO & TRIGGER soldered together. I believe you can get them in either 5 or 3.3V
There are only 3 exposed pins on the SonOff SV, I need the other pins for other sensors.
Would like to help you test this project, tried to sign up to GIT yesterday but all Usernames came back as in use, will try again.
Two issues 1) AVR/EEPROM is not found, with PERSIST 0 & board ESP8266. 2) Don't know how to define HC-SR04 as a custom sensor, or can disguise it as another sensor type, with a PulseWidth.Great job