Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. cgeo
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    cgeo

    @cgeo

    0
    Reputation
    5
    Posts
    342
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    cgeo Follow

    Best posts made by cgeo

    This user hasn't posted anything yet.

    Latest posts made by cgeo

    • Gateway offline.

      Hello,

      Since 4 July I get the following message in the openhab logs

      2018-07-10 23:19:33.350 [WARN ] [ateway.MySensorsNetworkSanityChecker] - I_VERSION message response is not arrived. Remained attempts before disconnection 3
      2018-07-10 23:22:39.359 [WARN ] [ateway.MySensorsNetworkSanityChecker] - I_VERSION message response is not arrived. Remained attempts before disconnection 2
      2018-07-10 23:25:45.365 [WARN ] [ateway.MySensorsNetworkSanityChecker] - I_VERSION message response is not arrived. Remained attempts before disconnection 1
      2018-07-10 23:28:51.372 [WARN ] [ateway.MySensorsNetworkSanityChecker] - I_VERSION message response is not arrived. Remained attempts before disconnection 0
      2018-07-10 23:28:51.376 [ERROR] [ateway.MySensorsNetworkSanityChecker] - Retry period expired, gateway is down. Disconneting bridge...
      2018-07-10 23:28:54.350 [INFO ] [col.serial.MySensorsSerialConnection] - Connection request disconnection...
      2018-07-10 23:28:54.358 [WARN ] [rsAbstractConnection$MySensorsWriter] - Interrupted MySensorsWriter
      2018-07-10 23:28:54.374 [WARN ] [rsAbstractConnection$MySensorsReader] - Interrupted MySensorsReader
      2018-07-10 23:28:57.378 [INFO ] [ateway.MySensorsNetworkSanityChecker] - Network Sanity Checker thread stopped
      2018-07-10 23:28:57.667 [INFO ] [rs.internal.gateway.MySensorsGateway] - Node 0 available again!
      2018-07-10 23:28:57.672 [WARN ] [rs.internal.gateway.MySensorsGateway] - Presented child is alredy present in gateway
      2018-07-10 23:28:58.538 [INFO ] [col.serial.MySensorsSerialConnection] - Successfully connected to MySensors Bridge.
      

      I restarted openhab, restarted the rpi3 (where openhab is installed), uninstalled and reinstalled the binding but the error persists.
      The gateway is connected via serial connection to openhab

      I have some temp / humidity and motion sensors which are reporting their values just fine although I am guessing I will be missing some values if it happens to send the readings when this error occurs. I guess disabling the network sanity check will remote this error in the log but I would prefer to keep it

      I haven't changed anything recently so I am not sure what is causing this

      Openhab version is 2.3.0-1 and binding version is market:binding-3328323 - 1.0. I am running the stable version

      Anyone has any ideas on this ?

      edit: I noticed the following in the logs

      2018-07-10 23:47:38.742 [WARN ] [ateway.MySensorsNetworkSanityChecker] - Node 2 not receive excpected update
      2018-07-10 23:47:38.759 [WARN ] [ateway.MySensorsNetworkSanityChecker] - Node 3 not receive excpected update
      2018-07-10 23:47:38.775 [WARN ] [ateway.MySensorsNetworkSanityChecker] - Node 5 not receive excpected update
      

      I checked the gateway config and I saw that 'Send heartbeats to all nodes when network sanity checker is running'
      I disabled it and now I no longer see any such messages.

      Hopefully it will save somebody's time

      posted in OpenHAB
      cgeo
      cgeo
    • RE: 💬 Soil Moisture Sensor

      if you buy a capacitive sensor like this then it is extremely simple. Here are some sample sketches which work pretty good. Not sure why one should bother with corrosion and similar issues when you can buy a pretty cheap capacitive sensor. Are there any drawbacks I may have missed ? I just installed one in a pot and curious to see how it goes

      Here's the code that I use

      /*
       * The MySensors Arduino library handles the wireless radio link and protocol
       * between your home built sensors/actuators and HA controller of choice.
       * The sensors forms a self healing radio network with optional repeaters. Each
       * repeater and gateway builds a routing tables in EEPROM which keeps track of the
       * network topology allowing messages to be routed to nodes.
       *
       * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
       * Copyright (C) 2013-2015 Sensnology AB
       * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
       *
       * Documentation: http://www.mysensors.org
       * Support Forum: http://forum.mysensors.org
       *
       * This program is free software; you can redistribute it and/or
       * modify it under the terms of the GNU General Public License
       * version 2 as published by the Free Software Foundation.
       *
       *******************************
       *
       * DESCRIPTION
       *
       * Arduino soil moisture based on gypsum sensor/resistive sensor to avoid electric catalyse in soil
       *  Required to interface the sensor: 2 * 4.7kOhm + 2 * 1N4148
       *
       * Gypsum sensor and calibration:
       *    DIY: See http://vanderleevineyard.com/1/category/vinduino/1.html
       *    Built: Davis / Watermark 200SS
       *        http://www.cooking-hacks.com/watermark-soil-moisture-sensor?_bksrc=item2item&_bkloc=product
       *        http://www.irrometer.com/pdf/supportmaterial/sensors/voltage-WM-chart.pdf
       *        cb (centibar) http://www.irrometer.com/basics.html
       *            0-10 Saturated Soil. Occurs for a day or two after irrigation
       *            10-20 Soil is adequately wet (except coarse sands which are drying out at this range)
       *            30-60 Usual range to irrigate or water (except heavy clay soils).
       *            60-100 Usual range to irrigate heavy clay soils
       *            100-200 Soil is becoming dangerously dry for maximum production. Proceed with caution.
       *
       * Connection:
       * D6, D7: alternative powering to avoid sensor degradation
       * A0, A1: alternative resistance measuring
       *
       *  Based on:
       *  "Vinduino" portable soil moisture sensor code V3.00
       *   Date December 31, 2012
       *   Reinier van der Lee and Theodore Kaskalis
       *   www.vanderleevineyard.com
       * Contributor: epierre
       */
      
      // Copyright (C) 2015, Reinier van der Lee
      // www.vanderleevineyard.com
      
      // This program is free software: you can redistribute it and/or modify
      // it under the terms of the GNU General Public License as published by
      // the Free Software Foundation, either version 3 of the License, or
      // any later version.
      
      // This program is distributed in the hope that it will be useful,
      // but WITHOUT ANY WARRANTY; without even the implied warranty of
      // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      // GNU General Public License for more details.
      
      #define MY_NODE_ID 6
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      // Enable and select radio type attached
      //#define MY_RADIO_NRF24
      //#define MY_RADIO_NRF5_ESB
      #define MY_RADIO_RFM69
      //#define MY_RADIO_RFM95
      #define MY_RFM69_NEW_DRIVER
      
      
      #include <math.h>       // Conversion equation from resistance to %
      #include <MySensors.h>
      
      
      #define CHILD_ID 0
      
      MyMessage msg(CHILD_ID, V_LEVEL);
      static const uint64_t UPDATE_INTERVAL = 43200000;
      
      void setup()
      {
       Serial.begin(115200); // open serial port, set the baud rate as 115200 bps
      }
      
      void presentation()
      {
          sendSketchInfo("Soil Moisture Sensor", "1.0");
          present(CHILD_ID, S_MOISTURE);
      }
      
      void loop()
      {
          int moisture;
          moisture = analogRead(0);
          //Serial.println(moisture); //print the value to serial port
          send(msg.set(moisture));
          sleep(UPDATE_INTERVAL);
      }
      

      Regards,

      posted in Announcements
      cgeo
      cgeo
    • RE: Battery issue with whispernode

      Many thanks guys. I thought that waking up every minute is quite usual for battery sensors but probably I was wrong. I am forced to use the delays as you know the dht22 is not the fastest in the market. If there is nothing else wrong I will play with the wake up timer

      posted in Troubleshooting
      cgeo
      cgeo
    • Battery issue with whispernode

      Hello all,

      I recently created a simple temp/humidity sensor using whisper node. Obviously the drive is to power it up using a battery.
      I am using a cr123a battery at 3v and i was hoping this will last at least 6 months. I am measuring 20-30uA at standby using a multimeter so I thought this should be good. But the battery lasts 3 weeks (tried several batteries to be sure)
      So I suspect something on my code maybe makes it draw awfully lots of current during normal operation (not standby) but I am not sure. The code is below. As you can see I am using a dht22 and I am powering it up via a PIN A3 so that I can shut it down completely during standby. Could that be a problem ? Maybe the delays I introduce during power on ? The node reports temp/humidity just fine it is just that the battery does not last long

      // Enable debug prints
      //#define MY_DEBUG
      
      // Enable and select radio type attached 
      //#define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      //#define MY_RS485
      #define MY_RADIO_RFM69
      //#define MY_IS_RFM69HW
      #define RFM69_868MH
      #define MY_RFM69_NEW_DRIVER
      
      
      // ******* CUSTOM ENTRY *******
      // ***Set the node ID to 4*****
      // ****************************
      #define MY_NODE_ID 4
      
      
      #include <SPI.h>
      #include <MySensors.h>  
      #include <DHT.h>
      
      
      // Set this to the pin you connected the DHT's data pin to
      #define DHT_DATA_PIN A1
      #define DHT_PWR_PIN A3
      
      // Set this offset if the sensor has a permanent small offset to the real temperatures
      #define SENSOR_TEMP_OFFSET 0
      
      // Sleep time between sensor updates (in milliseconds)
      // Must be >1000ms for DHT22 and >2000ms for DHT11
      static const uint64_t UPDATE_INTERVAL = 60000;
      
      // Force sending an update of the temperature after n sensor reads, so a controller showing the
      // timestamp of the last update doesn't show something like 3 hours in the unlikely case, that
      // the value didn't change since;
      // i.e. the sensor would force sending an update every UPDATE_INTERVAL*FORCE_UPDATE_N_READS [ms]
      static const uint8_t FORCE_UPDATE_N_READS = 10;
      
      #define CHILD_ID_HUM 0
      #define CHILD_ID_TEMP 1
      
      float lastTemp;
      float lastHum;
      uint8_t nNoUpdatesTemp;
      uint8_t nNoUpdatesHum;
      bool metric = true;
      
      MyMessage msgHum(CHILD_ID_HUM, V_HUM);
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      DHT dht;
      
      
      void presentation()  
      { 
        // Send the sketch version information to the gateway
        sendSketchInfo("TemperatureAndHumidity", "1.1");
        
        // Register all sensors to gw (they will be created as child devices)
        present(CHILD_ID_HUM, S_HUM);
        present(CHILD_ID_TEMP, S_TEMP);
        
        metric = getControllerConfig().isMetric;
      }
      
      
      void setup() {
        // put your setup code here, to run once:
       pinMode(DHT_PWR_PIN,OUTPUT);
       //Serial.print("Delay 4 ");
       delay(2000);
       digitalWrite(DHT_PWR_PIN,HIGH);
       //Serial.print("Delay 5 ");
       delay(2000);
       dht.setup(DHT_DATA_PIN); // set data pin of DHT sensor
       if (UPDATE_INTERVAL <= dht.getMinimumSamplingPeriod()) {
        //  Serial.println("Warning: UPDATE_INTERVAL is smaller than supported by the sensor!");
        }
        // Sleep for the time of the minimum sampling period to give the sensor time to power up
        // (otherwise, timeout errors might occure for the first reading)
        sleep(dht.getMinimumSamplingPeriod());
          sleep(UPDATE_INTERVAL); 
      }
      
      void loop() {
          digitalWrite(DHT_PWR_PIN,HIGH);
          //Serial.print("Delay 1 ");
          delay(1000);
          digitalWrite(DHT_DATA_PIN,HIGH);
          //Serial.print("Delay 2");
          //delay(2000);
        // put your main code here, to run repeatedly:
        // Force reading sensor, so it works also after sleep()
        dht.readSensor(true);
        
        // Get temperature from DHT library
        float temperature = dht.getTemperature();
        if (isnan(temperature)) {
        //  Serial.println("Failed reading temperature from DHT!");
        } else if (abs(temperature - lastTemp) > 0.9 || nNoUpdatesTemp == FORCE_UPDATE_N_READS) {
          // Only send temperature if it changed since the last measurement or if we didn't send an update for n times
          lastTemp = temperature;
          if (!metric) {
            temperature = dht.toFahrenheit(temperature);
          }
          // Reset no updates counter
          nNoUpdatesTemp = 0;
          temperature += SENSOR_TEMP_OFFSET;
          send(msgTemp.set(temperature, 1));
      
          #ifdef MY_DEBUG
          Serial.print("T: ");
          Serial.println(temperature);
          #endif
        } else {
          // Increase no update counter if the temperature stayed the same
          nNoUpdatesTemp++;
        }
      
        // Get humidity from DHT library
        float humidity = dht.getHumidity();
          digitalWrite(DHT_DATA_PIN,LOW);
        digitalWrite(DHT_PWR_PIN,LOW);
        if (isnan(humidity)) {
          // Serial.println("Failed reading humidity from DHT");
        } else if (abs(humidity - lastHum > 0.9) || nNoUpdatesHum == FORCE_UPDATE_N_READS) {
          // Only send humidity if it changed since the last measurement or if we didn't send an update for n times
          lastHum = humidity;
          // Reset no updates counter
          nNoUpdatesHum = 0;
          send(msgHum.set(humidity, 1));
          
          #ifdef MY_DEBUG
          Serial.print("H: ");
          Serial.println(humidity);
          #endif
        } else {
          // Increase no update counter if the humidity stayed the same
          nNoUpdatesHum++;
        }
      
        // Sleep for a while to save energy
        sleep(UPDATE_INTERVAL); 
      }```
      

      Can anybody see if there is something in the code that results in draining the battery ?

      Many thanks!

      posted in Troubleshooting
      cgeo
      cgeo