Sleep support in Gateway



  • Hi,
    I've built a sensor node that can sleep for most of the time except it receives a



  • Sorry for the typo above.

    I've created a sensor node that could sleep most of the time but needs to receive messages occasionally. I'm eager to reduce the power draw since it is solar/battery powered. The controller is Domoticz.
    Sleep mode doesn't work for incoming messages (to the sensor) because Domoticz doesn't support message delaying.

    My question : is it feasible to create a gateway that buffers messages from the controller to the sensor until the sensor node wakes up ? That way sleep mode can be supported without any changes to the controller software.


  • Admin

    With something a bit more powerful than an ATmega328, yes, probably.


  • Hero Member

    @stefaanv what you can do is send a request for the data to domoticz and keep the node alive for a limited time until it receives the data or times out. Be aware that domoticz only accepts requests FOR a few data types. V_STATUS, V_TEXT, V_VAR



  • @hek What is missing in the AtMega328 ? In my case the messages are only spurious door open/close instructions. I expect only a couple of message a day which can be picked up by the sensor node every 10 seconds or so.
    Is it possible in that case ? Can it be done in sketch code using the current library ?



  • @AWI Thought about that, but I can't figure out how instruct to store V_TEST or V_VAR information in Domoticz nodes for sending it to the MySensors node. I've searched the Domoticz forum over and over without success. Can you point me in the right direction ?


  • Hero Member

    @stefaanv you can fill the V_TEXT device from a lua script in Domoticz.


  • Admin

    @stefaanv

    The atmega 328p doesn't have much ram memory, if you want to store messages on the GW for a node. Also the framework for doing so is not developed yet, and would probably also have a problem with the limited flash storage for programs


  • Hero Member

    @stefaanv if you look for lua in Domoticz there are many examples for lua scripting. You can read the values from sensors and "publish" these in a Text (V_TEXT) device. Although this belongs in the domoticz forum/ section: A lua example excerpt line where a text device "887" is fillled with three values; temp (float) ; humidity (int) ; pressure(float). These values are filled from a generic weather device..

    commandArray = {} ;
    sWeatherTemp, sWeatherHumidity, sWeatherUV, sWeatherPressure, sWeatherUV2 = otherdevices_svalues['AlmereWeer']:match("([^;]+);([^;]+);([^;]+);([^;]+);([^;]+)") ;
    sWeatherTemp = tonumber(sWeatherTemp);
    sWeatherHumidity = tonumber(sWeatherHumidity);
    sWeatherUV = tonumber(sWeatherUV);
    sWeatherPressure = tonumber(sWeatherPressure);
    sWeatherUV2 = tonumber(sWeatherUV2);
    commandArray[1] = {['UpdateDevice'] = string.format ("887|0|%2.1f:%3d:%4.1f", sWeatherTemp, sWeatherHumidity, sWeatherPressure)}
    return commandArray
    


  • @tbowmo Can a ESP8266 kind of device be helpful here? Especially the kinds of NodeMCU V3 with huge memory and flash mem size? And these days they are getting quite economical too... (in terms of both costs and power requirements)


  • Admin

    @vikasjee

    it could probably be done with the ESP, or the new GW device for the "masses", that is coming later this year. It is build on a atmel SAMD (same MCU as used on arduino Zero), currently being evaluated by our manufacturing partner in China.


Log in to reply
 

Suggested Topics

  • 4
  • 20
  • 8
  • 17
  • 9
  • 2

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts