NodeManager: plugin for a rapid development of battery-powered sensors



  • Hi, being a newbie in this wonderful MySensors world, I found myself excited about the flexibility of the overall platform but also somehow implementing the same common functionalities across my sensors over and over again. I decided then to spend some reasonable amount of time to expand the idea behind MyExtention (https://forum.mysensors.org/topic/6062/myextension) into something I have called NodeManager (I know, I'm bad with names!).

    NodeManager is intended to take care on your behalf of all those common tasks a MySensors node has to accomplish, speeding up the development cycle of your projects. It should help who is new to MySensors to get up to speed quicker and for those already into the matter to delegate to NodeManager common and boring tasks so to focus on more interesting scenarios.

    NodeManager main features are:

    • Manage all the aspects of a sleeping cycle by leveraging smart sleep
    • Allow configuring the sleep mode and the sleep duration remotely
    • Allow waking up a sleeping node remotely at the end of a sleeping cycle
    • Allow powering on each connected sensor only while the node is awake to save battery
    • Report battery level periodically and automatically
    • Calculate battery level without requiring an additional pin and the resistors
    • Report battery voltage through a built-in sensor
    • Can report battery level on demand
    • Allow rebooting the board remotely
    • Provide out-of-the-box sensors personalities and automatically execute their main task at each cycle

    Specifically on this last point, the idea behind providing built-in the functionalities of most common sensors is to simplify the development especially for somebody new to it.
    E.g. if I connect a thermistor to one of the pin, I just need a single line to have it working, as it was leveraging some sort of embedded firmware:

    nodeManager.registerSensor(SENSOR_THERMISTOR,A2);
    

    The following built-in sensors are available:

    • SENSOR_ANALOG_INPUT Generic analog sensor, return a pin's analog value or its percentage
    • SENSOR_LDR LDR sensor, return the light level of an attached light resistor in percentage
    • SENSOR_THERMISTOR Thermistor sensor, return the temperature based on the attached thermistor
    • SENSOR_DIGITAL_INPUT Generic digital sensor, return a pin's digital value
    • SENSOR_DIGITAL_OUTPUT Generic digital output sensor, allows setting the digital output of a pin to the requested value
    • SENSOR_RELAY Relay sensor, allows activating the relay
    • SENSOR_LATCHING_RELAY Latching Relay sensor, allows activating the relay with a pulse
    • SENSOR_DHT11 DHT11 sensor, return temperature/humidity based on the attached DHT sensor
    • SENSOR_DHT22 DHT22 sensor, return temperature/humidity based on the attached DHT sensor
    • SENSOR_SHT21 SHT21 sensor, return temperature/humidity based on the attached SHT21 sensor
    • SENSOR_SWITCH Generic switch, wake up the board when a pin changes status
    • SENSOR_DOOR Door sensor, wake up the board and report when an attached magnetic sensor has been opened/closed
    • SENSOR_MOTION Motion sensor, wake up the board and report when an attached PIR has triggered
    • SENSOR_DS18B20 DS18B20 sensor, return the temperature based on the attached sensor

    I put the package on Sourceforce so to avoid leaving here piece of code which may become obsolete in a short time.

    The project is here: https://sourceforge.net/projects/mynodemanager
    I've also tried to document everything the best as I could on https://sourceforge.net/p/mynodemanager/wiki

    Thanks



  • I'm amazed this hasn't got more attention. A superb contribution to the community and one which I'm sure has taken many hours... Thank you!



  • Thanks @Mark-Swift!
    By the way, if anybody is interested I've just fixed a few bugs and added some minor enhancements (for details: https://sourceforge.net/p/mynodemanager/tickets/milestone/v1.1/).

    The new version (v1.1) is available as always at https://sourceforge.net/projects/mynodemanager


  • Hero Member

    @Mark-Swift said in NodeManager: plugin for a rapid development of battery-powered sensors:

    I'm amazed this hasn't got more attention. A superb contribution to the community and one which I'm sure has taken many hours... Thank you!

    I agree with you, for a lot of beginners this is like the graal for sketch creation if I believe the many posts asking how to combine some sketches.



  • Hi, I've made an update of NodeManager in case can be of interest. Latest version v1.2 is available on https://sourceforge.net/projects/mynodemanager/.
    Short changelog:



  • ...and I've moved the repository (including tickets and documentation) under the MySensors community on https://github.com/mysensors/NodeManager (thanks again for your help @hek!).

    I'll keep the Sourceforge project open to avoid broken links but I will upload only new releases there in sync with github.



  • Cool stuff! was looking for a way to do some configuration of mysensors remotely!
    Gonna give it a spin this week!


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.