Navigation

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

    Posts made by flopp

    • Selling: Temp, Hum Si7021

      I have some self designed Circuit boards with NRF and Si7021.
      I do not use them anymore.
      Battery is CR123 used in Visonic alarm.
      When I replaced the battery on the IR sensor I continued to use it in these sensors.

      Contact me if you are interested so I can tel you more about it.

      48BFD28A-EF1B-48CF-A391-1BD9A1DAAC27.jpeg DEDAE29B-12E7-4CAD-A050-0B940B43AF03.jpeg

      posted in Hardware
      flopp
      flopp
    • RE: How To - Doorbell Automation Hack

      @flopp
      Found one mistake. I wrote some Serial.print to see where in the code my problem was and I wrote in a wrong place, so the code was looping on a wrong way.

      When that was corrected I found out that my relay needed to get 1 when it was off, so I just changed to below and now I don't get a green light as soon as I power on the arduino

      #define RELAY_ON 0
      #define RELAY_OFF 1
      
      posted in My Project
      flopp
      flopp
    • RE: How To - Doorbell Automation Hack

      Very long time ago this was active.

      I tried the code for MySensors 2.0 but it triggers my relay all the time.

      When I press simulate a button-press the relay goes off, then on and then stays on.

      I have the stuff on my desk so it is not connected to my button.

      Only differene is that I am using a Arduino nano, so the signal from PIN 4 is 5 volt.

      I think the micro is only giving 3.3 volt out on pins?

      posted in My Project
      flopp
      flopp
    • RE: Error: Serial Port closed!... Error: End of file..

      I tried to reprogram the Arduino Nano but that didn't helped.
      Changed com port on computer and that seems to solve my problem

      posted in Troubleshooting
      flopp
      flopp
    • RE: Error: Serial Port closed!... Error: End of file..

      To which unit did you add the 5->3.3v?
      Gateway or Motion?

      posted in Troubleshooting
      flopp
      flopp
    • Shunt motor/valve

      My heating system was not putting out any heated water to our radiators. A friend gave the idea to put an accelerator-meter to the pin.

      This is what I made.
      MySensors - Shunt motor valve – 00:27
      — Daniel Nilsson

      On the monitor you see 2666, that is the raw value from the sensor, below that you see how much the shunt is opened in percent.

      Grapg from Grafana, top graph shows raw value from accelerator-meter, bottom graph with percent opened and outdoor temp:
      0_1557840289633_db87a8e8-79cb-4596-8661-3f5019c8e26f-image.png

      The code I am using:

      // I2C device class (I2Cdev) demonstration Arduino sketch for MPU6050 class
      // 10/7/2011 by Jeff Rowberg <jeff@rowberg.net>
      // Updates should (hopefully) always be available at https://github.com/jrowberg/i2cdevlib
      //
      // Changelog:
      //      2013-05-08 - added multiple output formats
      //                 - added seamless Fastwire support
      //      2011-10-07 - initial release
      
      /* ============================================
      I2Cdev device library code is placed under the MIT license
      Copyright (c) 2011 Jeff Rowberg
      
      Permission is hereby granted, free of charge, to any person obtaining a copy
      of this software and associated documentation files (the "Software"), to deal
      in the Software without restriction, including without limitation the rights
      to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
      copies of the Software, and to permit persons to whom the Software is
      furnished to do so, subject to the following conditions:
      
      The above copyright notice and this permission notice shall be included in
      all copies or substantial portions of the Software.
      
      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
      IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
      FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
      AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
      LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
      OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
      THE SOFTWARE.
      ===============================================
      */
      
      /**
       * 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.
       *
       *******************************
      */
      
      // Enable and select radio type attached
      #define MY_RADIO_RF24
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      #include <SPI.h>
      #include <MySensors.h>
      #include <Wire.h>
      
      #define CHILD_SHUNT 0
      #define CHILD_SHUNTDATA 1
      
      #define CHILD_FAILS 250
      #define CHILD_PARENT 251
      #define CHILD_DISTANCE 252
      
      //NRF
      int Fails = 0;
      int OldFails = -1;
      int FailsLoopCount = 10;
      int OldParentNode = -1;
      int ParentNodeLoopCount = 10;
      int OldDistanceNode = -1;
      int DistanceLoopCount = 10;
      
      MyMessage msgShunt(CHILD_SHUNT, V_WATT);
      MyMessage msgShuntData(CHILD_SHUNTDATA, V_WATT);
      
      MyMessage msgFails(CHILD_FAILS, V_VA);
      MyMessage msgParent(CHILD_PARENT, V_VA);
      MyMessage msgDistance(CHILD_DISTANCE, V_VA);
      
      // I2Cdev and MPU6050 must be installed as libraries, or else the .cpp/.h files
      // for both classes must be in the include path of your project
      #include "I2Cdev.h"
      #include "MPU6050.h"
      
      // Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation
      // is used in I2Cdev.h
      #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
          #include "Wire.h"
      #endif
      
      // class default I2C address is 0x68
      // specific I2C addresses may be passed as a parameter here
      // AD0 low = 0x68 (default for InvenSense evaluation board)
      // AD0 high = 0x69
      MPU6050 accelgyro;
      //MPU6050 accelgyro(0x69); // <-- use for AD0 high
      
      int16_t ax, count;
      long axx;
      
      
      
      // uncomment "OUTPUT_READABLE_ACCELGYRO" if you want to see a tab-separated
      // list of the accel X/Y/Z and then gyro X/Y/Z values in decimal. Easy to read,
      // not so easy to parse, and slow(er) over UART.
      #define OUTPUT_READABLE_ACCELGYRO
      
      // uncomment "OUTPUT_BINARY_ACCELGYRO" to send all 6 axes of data as 16-bit
      // binary, one right after the other. This is very fast (as fast as possible
      // without compression or data loss), and easy to parse, but impossible to read
      // for a human.
      //#define OUTPUT_BINARY_ACCELGYRO
      
      void setup() {
          // join I2C bus (I2Cdev library doesn't do this automatically)
          #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
              Wire.begin();
          #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
              Fastwire::setup(400, true);
          #endif
      
          // initialize serial communication
          // (38400 chosen because it works as well at 8MHz as it does at 16MHz, but
          // it's really up to you depending on your project)
          //Serial.begin(38400);
      
          // initialize device
          Serial.println("Initializing I2C devices...");
          accelgyro.initialize();
      
          // verify connection
          Serial.println("Testing device connections...");
          Serial.println(accelgyro.testConnection() ? "MPU6050 connection successful" : "MPU6050 connection failed");
      
          // use the code below to change accel/gyro offset values
          /*
          Serial.println("Updating internal sensor offsets...");
          // -76	-2359	1688	0	0	0
          Serial.print(accelgyro.getXAccelOffset()); Serial.print("\t"); // -76
          Serial.print(accelgyro.getYAccelOffset()); Serial.print("\t"); // -2359
          Serial.print(accelgyro.getZAccelOffset()); Serial.print("\t"); // 1688
          Serial.print(accelgyro.getXGyroOffset()); Serial.print("\t"); // 0
          Serial.print(accelgyro.getYGyroOffset()); Serial.print("\t"); // 0
          Serial.print(accelgyro.getZGyroOffset()); Serial.print("\t"); // 0
          Serial.print("\n");
          accelgyro.setXGyroOffset(220);
          accelgyro.setYGyroOffset(76);
          accelgyro.setZGyroOffset(-85);
          Serial.print(accelgyro.getXAccelOffset()); Serial.print("\t"); // -76
          Serial.print(accelgyro.getYAccelOffset()); Serial.print("\t"); // -2359
          Serial.print(accelgyro.getZAccelOffset()); Serial.print("\t"); // 1688
          Serial.print(accelgyro.getXGyroOffset()); Serial.print("\t"); // 0
          Serial.print(accelgyro.getYGyroOffset()); Serial.print("\t"); // 0
          Serial.print(accelgyro.getZGyroOffset()); Serial.print("\t"); // 0
          Serial.print("\n");
          */
      
      }
      
      void presentation() {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Shuntventil", "20190505");
        // Register all sensors to gateway (they will be created as child devices)
        present(CHILD_SHUNT, S_POWER, "Procent");
        present(CHILD_SHUNTDATA, S_POWER, "ShuntData");  
        present(CHILD_FAILS, S_POWER, "Fails");
        present(CHILD_PARENT, S_POWER, "Parent");
        present(CHILD_DISTANCE, S_POWER, "Distance");  
      }
      
      void loop() {
          for (count = 0 ; count < 10 ; count++) {
          
          // read raw accel/gyro measurements from device
          //accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
      
          // these methods (and a few others) are also available
          //accelgyro.getAcceleration(&ax, &ay, &az);
          //accelgyro.getRotation(&gx, &gy, &gz);
          ax = accelgyro.getAccelerationX();
          #ifdef OUTPUT_READABLE_ACCELGYRO
              // display tab-separated accel/gyro x/y/z values
              //Serial.print("a/g:\t");
              //Serial.print(ax);// Serial.print("\t");
              //Serial.println(axa);// Serial.print("\t");
              //Serial.print(az); Serial.print("\t");
              //Serial.print(gx); Serial.print("\t");
              //Serial.print(gy); Serial.print("\t");
              //Serial.println(gz);
          #endif
      
          
          axx = axx + ax;  
         
          }
          axx = axx / 10;
          //Serial.println(axx);
          resend((msgShuntData.set(axx)),3);
          long y = map(axx,-12300,12500,0,100);
          //Serial.println(y);
          resend((msgShunt.set(y)),3);
          axx = 0;
      
          if ((OldParentNode != _transportConfig.parentNodeId) | (ParentNodeLoopCount >= 10))
        {
          resend((msgParent.set(_transportConfig.parentNodeId)),3);
          OldParentNode = _transportConfig.parentNodeId;
          ParentNodeLoopCount = 0;
        }
          
        if ((OldDistanceNode != _transportConfig.distanceGW) | (DistanceLoopCount >= 10))
        {
          resend((msgDistance.set(_transportConfig.distanceGW)),3);
          OldDistanceNode = _transportConfig.distanceGW;
          DistanceLoopCount = 0;
        }
      
        if ((OldFails != Fails) | (FailsLoopCount >= 3))
        {
          failsend((msgFails.set(Fails)),3);
          OldFails = Fails;
          FailsLoopCount = 0;
        }
           
        ParentNodeLoopCount++;
        DistanceLoopCount++;
        FailsLoopCount++;
      
          sleep(30000);
      }
      
      //skicka axx(som är delat på 10) till DZ, så man kan kalibrera värden
      
      
      void resend(MyMessage & msg, int repeats) {
        int repeat = 0;
        int repeatdelay = 0;
        boolean sendOK = false;
        while ((sendOK == false) and(repeat < repeats))
        {
          if (send(msg))
          {
            sendOK = true;
          }
          else
          {
            Fails++;
            sendOK = false;
            Serial.print("Error ");
            Serial.println(repeat);
            repeatdelay += 250;
            repeat++;
            sleep(repeatdelay);
          }
        }
      }
      
      void failsend(MyMessage &msg, int repeats) {
        int repeat = 1;
        int repeatdelay = 0;
        boolean sendOK = false;
      
        while ((sendOK == false) and (repeat < repeats)) {
          if (send(msg))
          {
            Fails = 0;
            sendOK = true;
          }
          else
          {
            Fails++;
            sendOK = false;
            Serial.print("Error ");
            Serial.println(repeat);
            repeatdelay += 250;
            repeat++;
            sleep(repeatdelay);
          }
        }
      }
      
      posted in My Project
      flopp
      flopp
    • RE: Repeater getting NACK

      Thanks for all answers.

      Node 25 send its value every 30 second (before I said every 2 minutes)

      So my conclusion is that GW is not sending ACK back to my repeater.

      value 96637 has already been sent before so GW will not send ACK

      7957760 TSF:MSG:READ,25-25-0,s=0,c=1,t=24,pt=5,l=4,sg=0:96637
      7957766 TSF:MSG:REL MSG
      7957806 !TSF:MSG:SEND,25-7-0-0,s=0,c=1,t=24,pt=5,l=4,sg=0,ft=0,st=NACK:96637
      

      30 seconds later, now Node 25 sends new values(96638) that is different since last send, so this time GW will send ACK

      7987763 TSF:MSG:READ,25-25-0,s=0,c=1,t=34,pt=7,l=5,sg=0:0.01
      7987768 TSF:MSG:REL MSG
      7987808 TSF:MSG:SEND,25-7-0-0,s=0,c=1,t=34,pt=7,l=5,sg=0,ft=1,st=OK:0.01
      7987819 TSF:MSG:READ,25-25-0,s=0,c=1,t=35,pt=7,l=5,sg=0:96.638
      7987825 TSF:MSG:REL MSG
      7987829 TSF:MSG:SEND,25-7-0-0,s=0,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:96.638
      

      30 seconds later, same values so GW will not send ACK

      8017766 TSF:MSG:READ,25-25-0,s=0,c=1,t=24,pt=5,l=4,sg=0:96638
      8017771 TSF:MSG:REL MSG
      8017811 !TSF:MSG:SEND,25-7-0-0,s=0,c=1,t=24,pt=5,l=4,sg=0,ft=0,st=NACK:96638
      

      30 seconds later, same values so GW will not send ACK

      8047768 TSF:MSG:READ,25-25-0,s=0,c=1,t=24,pt=5,l=4,sg=0:96638
      8047774 TSF:MSG:REL MSG
      8047813 !TSF:MSG:SEND,25-7-0-0,s=0,c=1,t=24,pt=5,l=4,sg=0,ft=1,st=NACK:96638
      

      or can it be that when it sends two values it will be ACK fro GW?

      look at 7987763, this value is water flow
      at 8017766 it is only the incremental value for my water meter, no flow is sent

      posted in Domoticz
      flopp
      flopp
    • RE: Repeater getting NACK

      This is a water counter node.
      It will send the value every 2 minutes, even if there isn’t a new value.
      But when we use water it will be a increased value, then I get OK from Controller.

      posted in Domoticz
      flopp
      flopp
    • RE: Repeater getting NACK

      @mfalkvidd said in Repeater getting NACK:

      @flopp said in Repeater getting NACK:

      Is looks like when the value is same as already sent, Gateway or controller is not accepting the value

      I can't see anything in the posted log that supports this conclusion. Could you elaborate?

      Node 7 can send and gets OK, but when Node 25 send its values it gets NACK.
      When the value is new from Node 25 it gets OK

      Could you grab a log from the repeater and node25 at the same time?

      I will try

      Could you post the sketch for node25?

      Is node25 sending more data immediately after sending the meter reading? Maybe a second send causes a collision with the the message sent by the repeater.

      /**
       * 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.
       *
       *******************************
       *
       * REVISION HISTORY
       * Version 1.0 - Henrik Ekblad
       * Version 1.1 - GizMoCuz
       *
       * DESCRIPTION
       * Use this sensor to measure volume and flow of your house watermeter.
       * You need to set the correct pulsefactor of your meter (pulses per m3).
       * The sensor starts by fetching current volume reading from gateway (VAR 1).
       * Reports both volume and flow back to gateway.
       *
       * Unfortunately millis() won't increment when the Arduino is in
       * sleepmode. So we cannot make this sensor sleep if we also want
       * to calculate/report flow.
       * http://www.mysensors.org/build/pulse_water
       */
      
      // 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
      
      #include <MySensors.h>
      
      #define DIGITAL_INPUT_SENSOR 2                  // The digital input you attached your sensor.  (Only 2 and 3 generates interrupt!)
      
      #define PULSE_FACTOR 1000                       // Nummber of blinks per m3 of your meter (One rotation/liter)
      
      #define SLEEP_MODE false                        // flowvalue can only be reported when sleep mode is false.
      
      #define MAX_FLOW 40                             // Max flow (l/min) value to report. This filters outliers.
      
      #define CHILD_ID 0                              // Id of the sensor child
      
      uint32_t SEND_FREQUENCY =
          30000;           // Minimum time between send (in milliseconds). We don't want to spam the gateway.
      
      MyMessage flowMsg(CHILD_ID,V_FLOW);
      MyMessage volumeMsg(CHILD_ID,V_VOLUME);
      MyMessage lastCounterMsg(CHILD_ID,V_VAR1);
      
      double ppl = ((double)PULSE_FACTOR)/1000;        // Pulses per liter
      
      volatile uint32_t pulseCount = 0;
      volatile uint32_t lastBlink = 0;
      volatile double flow = 0;
      bool pcReceived = false;
      uint32_t oldPulseCount = 0;
      uint32_t newBlink = 0;
      double oldflow = 0;
      double volume =0;
      double oldvolume =0;
      uint32_t lastSend =0;
      uint32_t lastPulse =0;
      
      void setup()
      {
      	// initialize our digital pins internal pullup resistor so one pulse switches from high to low (less distortion)
      	pinMode(DIGITAL_INPUT_SENSOR, INPUT_PULLUP);
      
      	pulseCount = oldPulseCount = 0;
      
      	// Fetch last known pulse count value from gw
      	request(CHILD_ID, V_VAR1);
      
      	lastSend = lastPulse = millis();
      
      	attachInterrupt(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), onPulse, FALLING);
      }
      
      void presentation()
      {
      	// Send the sketch version information to the gateway and Controller
      	sendSketchInfo("Water Meter", "1.0");
      
      	// Register this device as Waterflow sensor
      	present(CHILD_ID, S_WATER);
      }
      
      void loop()
      {
      	uint32_t currentTime = millis();
      
      	// Only send values at a maximum frequency or woken up from sleep
      	if (SLEEP_MODE || (currentTime - lastSend > SEND_FREQUENCY)) {
      		lastSend=currentTime;
      
      		if (!pcReceived) {
      			//Last Pulsecount not yet received from controller, request it again
      			request(CHILD_ID, V_VAR1);
      			return;
      		}
      
      		if (!SLEEP_MODE && flow != oldflow) {
      			oldflow = flow;
      
      			Serial.print("l/min:");
      			Serial.println(flow);
      
      			// Check that we dont get unresonable large flow value.
      			// could hapen when long wraps or false interrupt triggered
      			if (flow<((uint32_t)MAX_FLOW)) {
      				send(flowMsg.set(flow, 2));                   // Send flow value to gw
      			}
      		}
      
      		// No Pulse count received in 2min
      		if(currentTime - lastPulse > 120000) {
      			flow = 0;
      		}
      
      		// Pulse count has changed
      		if ((pulseCount != oldPulseCount)||(!SLEEP_MODE)) {
      			oldPulseCount = pulseCount;
      
      			Serial.print("pulsecount:");
      			Serial.println(pulseCount);
      
      			send(lastCounterMsg.set(pulseCount));                  // Send  pulsecount value to gw in VAR1
      
      			double volume = ((double)pulseCount/((double)PULSE_FACTOR));
      			if ((volume != oldvolume)||(!SLEEP_MODE)) {
      				oldvolume = volume;
      
      				Serial.print("volume:");
      				Serial.println(volume, 3);
      
      				send(volumeMsg.set(volume, 3));               // Send volume value to gw
      			}
      		}
      	}
      	if (SLEEP_MODE) {
      		sleep(SEND_FREQUENCY);
      	}
      }
      
      void receive(const MyMessage &message)
      {
      	if (message.type==V_VAR1) {
      		uint32_t gwPulseCount=message.getULong();
      		pulseCount += gwPulseCount;
      		flow=oldflow=0;
      		Serial.print("Received last pulse count from gw:");
      		Serial.println(pulseCount);
      		pcReceived = true;
      	}
      }
      
      void onPulse()
      {
      	if (!SLEEP_MODE) {
      		uint32_t newBlink = micros();
      		uint32_t interval = newBlink-lastBlink;
      
      		if (interval!=0) {
      			lastPulse = millis();
      			if (interval<500000L) {
      				// Sometimes we get interrupt on RISING,  500000 = 0.5sek debounce ( max 120 l/min)
      				return;
      			}
      			flow = (60000000.0 /interval) / ppl;
      		}
      		lastBlink = newBlink;
      	}
      	pulseCount++;
      }
      
      posted in Domoticz
      flopp
      flopp
    • RE: Measure a node's NRF signal or distance value

      Thanks.

      I was thinking about the level that you define in beginning of sketch.

      RF24_PA_LEVEL

      posted in General Discussion
      flopp
      flopp
    • Repeater getting NACK
      7935368 TSF:MSG:SEND,7-7-0-0,s=3,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=OK:1
      7935375 TSF:MSG:SEND,7-7-0-0,s=251,c=1,t=55,pt=1,l=1,sg=0,ft=0,st=OK:0
      7935383 TSF:MSG:SEND,7-7-0-0,s=252,c=1,t=55,pt=1,l=1,sg=0,ft=0,st=OK:1
      7957760 TSF:MSG:READ,25-25-0,s=0,c=1,t=24,pt=5,l=4,sg=0:96637
      7957766 TSF:MSG:REL MSG
      7957806 !TSF:MSG:SEND,25-7-0-0,s=0,c=1,t=24,pt=5,l=4,sg=0,ft=0,st=NACK:96637
      7987763 TSF:MSG:READ,25-25-0,s=0,c=1,t=34,pt=7,l=5,sg=0:0.01
      7987768 TSF:MSG:REL MSG
      7987808 TSF:MSG:SEND,25-7-0-0,s=0,c=1,t=34,pt=7,l=5,sg=0,ft=1,st=OK:0.01
      7987819 TSF:MSG:READ,25-25-0,s=0,c=1,t=35,pt=7,l=5,sg=0:96.638
      7987825 TSF:MSG:REL MSG
      7987829 TSF:MSG:SEND,25-7-0-0,s=0,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:96.638
      7995427 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:12.6
      7995441 TSF:MSG:SEND,7-7-0-0,s=0,c=1,t=4,pt=7,l=5,sg=0,ft=0,st=OK:1026.2
      7995449 TSF:MSG:SEND,7-7-0-0,s=2,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:43
      7995462 TSF:MSG:SEND,7-7-0-0,s=4,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:0.4
      7995472 TSF:MSG:SEND,7-7-0-0,s=3,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=OK:1
      7995481 TSF:MSG:SEND,7-7-0-0,s=251,c=1,t=55,pt=1,l=1,sg=0,ft=0,st=OK:0
      7995488 TSF:MSG:SEND,7-7-0-0,s=252,c=1,t=55,pt=1,l=1,sg=0,ft=0,st=OK:1
      8017766 TSF:MSG:READ,25-25-0,s=0,c=1,t=24,pt=5,l=4,sg=0:96638
      8017771 TSF:MSG:REL MSG
      8017811 !TSF:MSG:SEND,25-7-0-0,s=0,c=1,t=24,pt=5,l=4,sg=0,ft=0,st=NACK:96638
      8047768 TSF:MSG:READ,25-25-0,s=0,c=1,t=24,pt=5,l=4,sg=0:96638
      8047774 TSF:MSG:REL MSG
      8047813 !TSF:MSG:SEND,25-7-0-0,s=0,c=1,t=24,pt=5,l=4,sg=0,ft=1,st=NACK:96638
      8055533 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=2,st=OK:12.7
      

      above is the DEBUG from my repeater.

      Node 25 is a water meter. Is looks like when the value is same as already sent, Gateway or controller is not accepting the value, but as soon as there is a new value is get OK.

      Anyone that seen this or can explain why this happens?

      posted in Domoticz
      flopp
      flopp
    • RE: Measure a node's NRF signal or distance value

      @flopp
      Anyone?

      posted in General Discussion
      flopp
      flopp
    • RE: Measure a node's NRF signal or distance value

      @scalz said in Measure a node's NRF signal or distance value:

      • I_POWER_LEVEL which is the internal msg for the TX radio powerlevel. To get a feedback on the radio power level set by ATC

      I couldn't find I_POWER_LEVEL here, https://www.mysensors.org/download/serial_api_20#internal

      Is this a command?

      What I want to is to get the Set Level of nRF24. This is set in the sketch but when it has been sent to Arduino, I have no idea what I set that day.
      eg. Repeater Node, I am using the example, make some changes, like PA_LEVEL, then I don't save the sketch

      posted in General Discussion
      flopp
      flopp
    • RE: Sensebender gateway local sensor

      @mfalkvidd said in Sensebender gateway local sensor:

      @deluka yes. Just use present() and send() as you would on a normal sensor node.

      So when using send() it will send the data directly into my Domoticz, which I use as Controller?

      I use Gateway Serial.

      posted in General Discussion
      flopp
      flopp
    • RE: [Solved] Repeater node causing Problems

      I have had very strange errors and I don't know what I found out. 😐
      I had a repeater with a nRF24 PA+LNA working good for about 1 year, suddenly this repeater causing that the GW got hanged, no data was received from any nodes.
      I power off the repeater down, restarted GW and everything started to work normally.
      Last week I took time to solve the problem, it was still annoying me!!!
      Reprogram the same Arduino Nano and nRF with PA+LNA, worked for 2 days, then stopped.
      Same Arduino Nano but changed to nRF24 without PA+LNA, worked 1-2 days then stopped.
      Changed to Arduino UNO and nRF with PA+LNA, worked 2 days.
      Arduino UNO and nRF24 without PA+LNA worked 2 days.

      I was so frustrated and didn't had any idea. I had been running 2.3.0 on almost all my nodes, so I tried to change GW to version 2.3.1 and Repeater to version 2.3.1(Arduino UNO with nRF24 without PA+LNA) now it has worked for at least 1 week.

      My Arduino Nano is fake and UNO is genuine.

      Maybe you can get some help from this? 🙂

      posted in Troubleshooting
      flopp
      flopp
    • RE: How to purchase mysensors SW protocol stack, instead of donation

      @hek
      Thanks

      ops, they want taxes all the time ☹

      posted in General Discussion
      flopp
      flopp
    • RE: How to purchase mysensors SW protocol stack, instead of donation

      I continue in this thread, please tell me if you want me to create a new thread.

      I am thinking of selling a complete kit with sensors using MySensors protocol. I will sell as a private person, as a hobby. So no taxes will be payed or billed.

      Is this possible to do, according to your license?

      posted in General Discussion
      flopp
      flopp
    • RE: About DS18B20 onewire.

      @pepson said in About DS18B20 onewire.:

      And you dont use library onewire.h ?

      I think it will be included in DallasTemperature.h.

      Doesn’t my sketch work for you?

      posted in Hardware
      flopp
      flopp
    • RE: About DS18B20 onewire.
      /**
       * 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
       *
       * Example sketch showing how to send in DS1820B OneWire temperature readings back to the controller
       * http://www.mysensors.org/build/temp
       */
       
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      #define MY_NODE_ID 14
      
      #include <SPI.h>
      #include <MySensors.h>
      #include <DallasTemperature.h>
      
      #define COMPARE_TEMP 0 // Send temperature only if changed? 1 = Yes 0 = No
      
      #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected 
      #define ATTACHED_DS18B20 40
      unsigned long SLEEP_TIME = 60000; // Sleep time between reads (in milliseconds)
      OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
      DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature. 
      
      byte D[ATTACHED_DS18B20][8] = {
      { 0x10, 0x04, 0xB8, 0x3F, 0x02, 0x08, 0x00, 0xBD }, //KökTbx
      { 0x10, 0xF4, 0xD7, 0x3F, 0x02, 0x08, 0x00, 0xB1 }, //UppTbx
      { 0x10, 0x92, 0x9F, 0x3E, 0x02, 0x08, 0x00, 0x98 }, //KökUt
      { 0x10, 0x4E, 0xE4, 0x3E, 0x02, 0x08, 0x00, 0x3C }, //ToaUt
      { 0x10, 0x1E, 0xE8, 0x3E, 0x02, 0x08, 0x00, 0x33 }, //EfterPump
      { 0x10, 0x09, 0xA1, 0x3E, 0x02, 0x08, 0x00, 0xF7 }, //HallTbx
      { 0x10, 0x59, 0xCB, 0x3F, 0x02, 0x08, 0x00, 0xFA }, //UppUt
      { 0x10, 0x07, 0x1B, 0x3F, 0x02, 0x08, 0x00, 0x99 }, //ToaTbx
      { 0x28, 0xFF, 0xB1, 0xAA, 0x63, 0x15, 0x03, 0xC8 }, //Kök 
      { 0x10, 0x80, 0xB6, 0x3F, 0x02, 0x08, 0x00, 0x29 }, //Panna komp
      { 0x10, 0x3C, 0x9C, 0x3E, 0x02, 0x08, 0x00, 0x99 }, //Hall ut
      { 0x10, 0x42, 0xE0, 0x3F, 0x02, 0x08, 0x00, 0xD1 }, //Tvätt
      { 0x10, 0xCE, 0xE9, 0x3E, 0x02, 0x08, 0x00, 0x3A }, //T12
      { 0x10, 0x99, 0xAC, 0x3F, 0x02, 0x08, 0x00, 0x25 }, //V mellan
      { 0x10, 0x15, 0xDB, 0x3E, 0x02, 0x08, 0x00, 0x01 }, //Hallen
      { 0x10, 0xF3, 0xD7, 0x3F, 0x02, 0x08, 0x00, 0x34 }, //Panna El
      { 0x10, 0xFB, 0xCB, 0x3F, 0x02, 0x08, 0x00, 0xC8 }, //Toa Nere
      { 0x10, 0x97, 0x23, 0x3F, 0x02, 0x08, 0x00, 0x92 }, //Varmvatten
      { 0x10, 0x0F, 0xE6, 0x3E, 0x02, 0x08, 0x00, 0xFD }, //Carport
      { 0x10, 0xF3, 0xC6, 0x3F, 0x02, 0x08, 0x00, 0x85 }, //Förrådet
      { 0x10, 0x9C, 0x3B, 0x52, 0x02, 0x08, 0x00, 0x25 }, //Mark 60
      { 0x10, 0xF2, 0x24, 0x3F, 0x02, 0x08, 0x00, 0xEB }, //Vrum V
      { 0x10, 0x6A, 0x5E, 0x52, 0x02, 0x08, 0x00, 0x26 }, //Mark 30
      { 0x10, 0x76, 0xCE, 0x3F, 0x02, 0x08, 0x00, 0xBA }, //Plattan
      { 0x10, 0x0E, 0x7B, 0x13, 0x02, 0x08, 0x00, 0x7C }, //Utetemp
      { 0x10, 0xEE, 0xEB, 0x3E, 0x02, 0x08, 0x00, 0x0F }, //Uterum
      { 0x28, 0x8C, 0x2D, 0xB4, 0x04, 0x00, 0x00, 0x9C }, //Kyl uppe
      { 0x28, 0xFF, 0xB2, 0x74, 0x63, 0x15, 0x02, 0xCC }, //Kyl mitten
      { 0x28, 0xFF, 0x08, 0x07, 0x52, 0x04, 0x00, 0xFF }, //Kyl nere
      { 0x28, 0xFF, 0xE6, 0x06, 0x52, 0x04, 0x00, 0x08 }, //Frys uppe
      { 0x28, 0xFF, 0xB4, 0x07, 0x55, 0x04, 0x00, 0xEB }, //Kyl bakom
      { 0x10, 0x1C, 0xA8, 0x3F, 0x02, 0x08, 0x00, 0x3B }, //Lucas
      { 0x10, 0x83, 0x3C, 0x3F, 0x02, 0x08, 0x00, 0x06 }, //Allrum
      { 0x10, 0xA3, 0xE8, 0x3E, 0x02, 0x08, 0x00, 0x7E }, //Theo
      { 0x10, 0x33, 0x3C, 0x3F, 0x02, 0x08, 0x00, 0x01 }, //Sovrum
      { 0x28, 0xFF, 0xFB, 0x3D, 0xC3, 0x16, 0x03, 0x58 }, //Panna luft in(varm)
      { 0x28, 0xFF, 0xD4, 0x1C, 0x00, 0x17, 0x03, 0x43 }, //Dränering
      { 0x28, 0xFF, 0x97, 0x11, 0x01, 0x15, 0x04, 0xC0 } // Poolvatten
      
      };
      
      float lastTemperature[ATTACHED_DS18B20];
      // Initialize temperature message
      MyMessage msg(0,V_TEMP);
      MyMessage heat(0,V_STATUS);
      
      void setup()  
      { 
        // Startup up the OneWire library
        sensors.begin();
        // requestTemperatures() will not block current thread
        sensors.setWaitForConversion(false);
      }
      void presentation() {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("OneWire Temp+Heating LED", "20180709");
        
        // Fetch the number of attached temperature sensors  
        //numSensors = sensors.getDeviceCount();
      
        // Present all sensors to controller
        for (int i=0; i<ATTACHED_DS18B20; i++) {   
           present(i, S_TEMP);
        }
        for (int i=ATTACHED_DS18B20; i<ATTACHED_DS18B20+5; i++) {   
           present(i, S_HEATER);
        }
      }
      
      void loop()     
      {     
        // Fetch temperatures from Dallas sensors
        sensors.requestTemperatures();
      
        // query conversion time and sleep until conversion completed
        int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
        // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
        sleep(conversionTime);
      
        // Read temperatures and send them to controller 
        for (int i=0; i<ATTACHED_DS18B20; i++) {
      
        //Serial.println(sensors.getResolution(D[i]), DEC); 
          // Fetch and round temperature to one decimal
       //   float temperature = static_cast<float>(static_cast<int>((sensors.requestTemperaturesByAddress(D[i])) * 10.)) / 10.;
            float temperature = sensors.getTempC(D[i]);
          // Only send data if temperature has changed and no error
          #if COMPARE_TEMP == 1
          if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) {
          #else
          if (temperature != -127.00 && temperature <= 85.00) {
          #endif
       
            // Send in the new temperature
            send(msg.setSensor(i).set(temperature,1));
            // Save new temperatures for next compare
            lastTemperature[i]=temperature;
          }
        }
      
         for (int i=0; i<5;i++){
          int value = analogRead(i);
          /*Serial.print("Pin");
          Serial.print(i);
          Serial.print("=");
          Serial.println(value);
          */
          int j=i+ATTACHED_DS18B20;
          if (value>150) {
            send(heat.setSensor(j).set(1));
          }
          else {
            send(heat.setSensor(j).set(0));
          }
        }
        
        sleep(SLEEP_TIME);
      }
      
      posted in Hardware
      flopp
      flopp
    • RE: About DS18B20 onewire.

      I have a sketch where I have attached 40 pcs mixed both DS18B20 and DS18S20, works perfect, except that sometimes I recevied 0 as value for some of them. I am polling every minute, so I don't care if the value is 0 for a couple of minutes, it is not that very important

      posted in Hardware
      flopp
      flopp
    • RE: About DS18B20 onewire.

      @pepson said in About DS18B20 onewire.:

      byte D[3][8] = {
      { 0x28, 0xFB, 0x8F, 0x77, 0x91, 0x15, 0x02, 0x32 },
      { 0x28, 0xFF, 0x37, 0x77, 0x91, 0x18, 0x02, 0x16 }
      };
      

      D[3] means 3 attached DS18B20, but you only have address for 2

      posted in Hardware
      flopp
      flopp
    • RE: About DS18B20 onewire.

      @pepson said in About DS18B20 onewire.:

      #define MAX_ATTACHED_DS18B20 16
      

      this should be how many DS18B20 you have attached

      posted in Hardware
      flopp
      flopp
    • RE: 💬 Water Meter Pulse Sensor

      @bjacobse said in 💬 Water Meter Pulse Sensor:

      @flopp said in 💬 Water Meter Pulse Sensor:

      TCRT5000 IR senso

      I have not had good results using TCRT5000 IR sensor, did you?

      I didn’t get it to work.
      I was so lucky that my water company change the meter to a meter with wireless m-bus.
      So I bought a box for this and now I have 100% correct readings.

      posted in Announcements
      flopp
      flopp
    • RE: 💬 MySensors Library

      Nice to see that you have 2.3.1 now 🙂
      I tried to click on the link
      Full Change Log
      But it is linked to 2.3.0

      posted in Announcements
      flopp
      flopp
    • RE: Novice requesting PCB review and advice for a window / door sensor

      U1, you have a lot of GND-area underneath the atmega328, it may be possible that a pin close to this area will touch the area and you will get a short circuit between a pin and area.

      posted in Hardware
      flopp
      flopp
    • RE: Merry Christmas and Happy New Year

      Replying to an old topic.

      Happy christmas everyone.

      Please donate to mysensors project, so this very good project gets even better.

      posted in General Discussion
      flopp
      flopp
    • RE: My 2AA battery sensor

      @palmerfarmer said in My 2AA battery sensor:

      Has anyone got a V2 version working for this?

      Do you mean running with MySensors 2.3?

      posted in My Project
      flopp
      flopp
    • RE: MySensors 2.3.0 released

      @nagelc said in MySensors 2.3.0 released:

      I recently upgraded my NRF24 serial gateway from 1.5 to 2.3.0 and did not have any issues. I upgraded my RFM69 gateway a while ago with no issues. If it is RFM 69, check the frequency because MyConfig.h will have gone back to the default (I use 915 mhx which is not default). Do you get any error messages? Maybe one of the more experienced MySensors users could help with those.

      Thank you, you put me in the right direction.
      I created a network for my friend(on 2.3)on different channel than I use, I didn’t change the channel in myconfig.h before I updated my GW

      posted in Announcements
      flopp
      flopp
    • RE: MySensors 2.3.0 released

      @flopp said in MySensors 2.3.0 released:

      I finally took my time to update my Serial GW from 2.2.0 to 2.3.0.
      Nothing came in from my nodes after I update.
      I have nodes with 2.1.1 and 2.2.0.

      Is there anything that I should change for update from 2.2.0 to 2.3.0, any settings in config?

      Went back to 2.2.0 and immediately data came in from my nodes.

      Anyone?

      posted in Announcements
      flopp
      flopp
    • RE: Can one arduino present multiple devices?

      What controller are you using?

      posted in General Discussion
      flopp
      flopp
    • RE: Can one arduino present multiple devices?

      Hi, if you upload your code then it would be easier to understand.
      Don't forget to use </> when you upload it, thanks

      posted in General Discussion
      flopp
      flopp
    • RE: BH1750 library issue with using sleep

      @Rayne
      Can you upload your code. Two days ago I built a battery powered node with BH1750 and don't have any problem.
      MySensors version?
      Running on a Arduino Nano?
      Battery powered?
      Serial/Ethernet GW?

      posted in Development
      flopp
      flopp
    • RE: MySensors 2.3.0 released

      I finally took my time to update my Serial GW from 2.2.0 to 2.3.0.
      Nothing came in from my nodes after I update.
      I have nodes with 2.1.1 and 2.2.0.

      Is there anything that I should change for update from 2.2.0 to 2.3.0, any settings in config?

      Went back to 2.2.0 and immediately data came in from my nodes.

      posted in Announcements
      flopp
      flopp
    • RE: Your best advice on buying components?

      Hi, any know how to order from outside Europe and send it to Sweden and not have to pay the extra fee?
      AliExpress doesn’t seem to have a Europe warehouse.
      Does DX.com have Europe warehouse?
      Banggood?

      posted in General Discussion
      flopp
      flopp
    • RE: MySensors suddenly stop working [solved]

      SOLVED please see first post

      posted in Domoticz
      flopp
      flopp
    • RE: MySensors suddenly stop working [solved]

      Log in DZ

      2018-08-31 10:44:26.576 Status: MySensors: Using serial port: /dev/ttyUSB0
      2018-08-31 10:44:28.068 MySensors: Gateway Ready...
      2018-08-31 10:44:28.143 MySensors: Gateway Version: 2.2.0
      2018-08-31 10:45:01.568 Status: Incoming connection from: 127.0.0.1
      2018-08-31 10:45:05.421 (MySensors USB) Temp (AppleTV_T)
      2018-08-31 10:45:05.441 (MySensors USB) Temp (PS3_T)
      2018-08-31 10:45:05.463 (MySensors USB) Temp (Stereo_T)
      2018-08-31 10:45:18.687 (MySensors USB) RFXMeter (Water)
      2018-08-31 10:45:24.314 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:45:24.317 (MySensors USB) General/Custom Sensor (ElFails)
      2018-08-31 10:45:24.320 (MySensors USB) General/Custom Sensor (ElParent)
      2018-08-31 10:45:24.322 (MySensors USB) General/Custom Sensor (ElDistance)
      2018-08-31 10:45:24.323 (MySensors USB) Usage (Usage)
      2018-08-31 10:45:24.326 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:45:24.328 (MySensors USB) General/kWh (Huset_V)
      2018-08-31 10:45:24.331 (MySensors USB) General/Custom Sensor (ElFails)
      2018-08-31 10:45:33.750 (MySensors USB) General/kWh (Huset_V)
      2018-08-31 10:45:33.759 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:45:33.778 (MySensors USB) General/kWh (Huset_V)
      2018-08-31 10:45:33.794 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:45:33.803 (MySensors USB) General/Custom Sensor (ElFails)
      2018-08-31 10:45:40.824 (MySensors USB) General/Voltage (TvättMS_V)
      2018-08-31 10:45:40.902 (MySensors USB) General/Custom Sensor (TvättSleepTime)
      2018-08-31 10:45:40.977 (MySensors USB) General/Custom Sensor (TvättFails)
      2018-08-31 10:45:43.750 (MySensors USB) General/kWh (Huset_V)
      2018-08-31 10:45:43.759 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:45:43.777 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:45:43.784 (MySensors USB) General/Custom Sensor (ElFails)
      2018-08-31 10:45:48.692 (MySensors USB) RFXMeter (Water)
      2018-08-31 10:45:53.752 (MySensors USB) General/kWh (Huset_V)
      2018-08-31 10:45:53.760 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:45:53.778 (MySensors USB) General/kWh (Huset_V)
      2018-08-31 10:45:53.796 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:45:53.805 (MySensors USB) General/Custom Sensor (ElFails)
      2018-08-31 10:45:55.493 (MySensors USB) General/Custom Sensor (BadrumUppeFails)
      2018-08-31 10:46:03.753 (MySensors USB) General/kWh (Huset_V)
      2018-08-31 10:46:03.762 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:46:03.781 (MySensors USB) General/kWh (Huset_V)
      2018-08-31 10:46:03.798 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:46:03.806 (MySensors USB) General/Custom Sensor (ElFails)
      2018-08-31 10:46:13.754 (MySensors USB) General/kWh (Huset_V)
      2018-08-31 10:46:13.762 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:46:13.781 (MySensors USB) General/kWh (Huset_V)
      2018-08-31 10:46:13.798 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:46:13.808 (MySensors USB) General/Custom Sensor (ElFails)
      2018-08-31 10:46:14.950 (MySensors USB) General/Voltage (KöketVaskenMS_V)
      2018-08-31 10:46:14.960 (MySensors USB) General/Voltage (KöketVaskenResMS_V)
      2018-08-31 10:46:14.975 (MySensors USB) General/Custom Sensor (KöketVaskenSleepTime)
      2018-08-31 10:46:14.985 (MySensors USB) General/Custom Sensor (KöketVaskenFails)
      2018-08-31 10:46:18.693 (MySensors USB) RFXMeter (Water)
      2018-08-31 10:46:23.721 (Z-Wave) General/kWh (Pool_Pump_Cirk_kWh)
      2018-08-31 10:46:23.755 (MySensors USB) General/kWh (Huset_V)
      2018-08-31 10:46:23.763 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:46:23.766 (Z-Wave) General/kWh (Pool_Lights_Deck_kWh)
      2018-08-31 10:46:23.781 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:46:23.790 (MySensors USB) General/Custom Sensor (ElFails)
      2018-08-31 10:46:24.315 (MySensors USB) General/Voltage (BadrumNereMS_V)
      2018-08-31 10:46:24.389 (MySensors USB) Temp (Temp)
      2018-08-31 10:46:24.464 (MySensors USB) Temp (BadrumNereDew)
      2018-08-31 10:46:24.537 (MySensors USB) General/Custom Sensor (BadrumNereSleepTime)
      2018-08-31 10:46:24.612 (MySensors USB) General/Custom Sensor (BadrumNereFails)
      2018-08-31 10:46:33.757 (MySensors USB) General/kWh (Huset_V)
      2018-08-31 10:46:33.766 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:46:33.783 (MySensors USB) General/kWh (Huset_V)
      2018-08-31 10:46:33.802 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:46:33.810 (MySensors USB) General/Custom Sensor (ElFails)
      2018-08-31 10:46:43.759 (MySensors USB) General/kWh (Huset_V)
      2018-08-31 10:46:43.766 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:46:43.785 (MySensors USB) General/kWh (Huset_V)
      2018-08-31 10:46:43.803 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 10:46:43.812 (MySensors USB) General/Custom Sensor (ElFails)
      2018-08-31 10:47:07.296 (Z-Wave) General/kWh (Pool_Pump_Drain_kWh)
      2018-08-31 10:47:07.367 (Z-Wave) Usage (Pool_Lights_Water_Watt)
      2018-08-31 10:47:07.369 (Z-Wave) General/kWh (Pool_Lights_Water_kWh)
      2018-08-31 10:47:07.441 (Z-Wave) General/kWh (Pool_Lights_Water_kWh)
      2018-08-31 10:47:48.293 (Z-Wave) Usage (Pool_Pump_Drain_Watt)
      2018-08-31 10:47:48.295 (Z-Wave) General/kWh (Pool_Pump_Drain_kWh)
      2018-08-31 10:47:58.293 (Z-Wave) Usage (Pool_Pump_Drain_Watt)
      2018-08-31 10:47:58.298 (Z-Wave) General/kWh (Pool_Pump_Drain_kWh)
      2018-08-31 10:48:00.688 (Z-Wave) Usage (Pool_Lights_Deck_Watt)
      2018-08-31 10:48:00.692 (Z-Wave) General/kWh (Pool_Lights_Deck_kWh)
      2018-08-31 10:48:01.688 (Z-Wave) Usage (Pool_Pump_Cirk_Watt)
      2018-08-31 10:48:01.692 (Z-Wave) General/kWh (Pool_Pump_Cirk_kWh)
      2018-08-31 10:48:03.057 (Z-Wave) General/kWh (Pool_Heat_kWh)
      2018-08-31 10:48:11.292 (Z-Wave) Usage (Pool_Pump_Drain_Watt)
      2018-08-31 10:48:11.297 (Z-Wave) General/kWh (Pool_Pump_Drain_kWh)
      2018-08-31 10:49:19.055 (Z-Wave) Usage (Pool_Heat_Watt)
      2018-08-31 10:49:19.060 (Z-Wave) General/kWh (Pool_Heat_kWh)
      2018-08-31 10:52:23.692 (Z-Wave) General/kWh (Pool_Pump_Cirk_kWh)
      2018-08-31 10:52:23.765 (Z-Wave) General/kWh (Pool_Lights_Deck_kWh)
      2018-08-31 10:53:07.294 (Z-Wave) General/kWh (Pool_Pump_Drain_kWh)
      2018-08-31 10:53:07.366 (Z-Wave) Usage (Pool_Lights_Water_Watt)
      2018-08-31 10:53:07.369 (Z-Wave) General/kWh (Pool_Lights_Water_kWh)
      2018-08-31 10:53:07.441 (Z-Wave) General/kWh (Pool_Lights_Water_kWh)
      2018-08-31 10:53:30.292 (Z-Wave) Usage (Pool_Pump_Drain_Watt)
      2018-08-31 10:53:30.296 (Z-Wave) General/kWh (Pool_Pump_Drain_kWh)
      2018-08-31 10:53:53.291 (Z-Wave) Usage (Pool_Pump_Drain_Watt)
      2018-08-31 10:53:53.296 (Z-Wave) General/kWh (Pool_Pump_Drain_kWh)
      2018-08-31 10:54:00.689 (Z-Wave) Usage (Pool_Lights_Deck_Watt)
      2018-08-31 10:54:00.692 (Z-Wave) General/kWh (Pool_Lights_Deck_kWh)
      2018-08-31 10:54:01.689 (Z-Wave) Usage (Pool_Pump_Cirk_Watt)
      2018-08-31 10:54:01.694 (Z-Wave) General/kWh (Pool_Pump_Cirk_kWh)
      2018-08-31 10:54:03.057 (Z-Wave) General/kWh (Pool_Heat_kWh)
      2018-08-31 10:54:03.292 (Z-Wave) Usage (Pool_Pump_Drain_Watt)
      2018-08-31 10:54:03.297 (Z-Wave) General/kWh (Pool_Pump_Drain_kWh)
      2018-08-31 10:55:19.055 (Z-Wave) Usage (Pool_Heat_Watt)
      2018-08-31 10:55:19.059 (Z-Wave) General/kWh (Pool_Heat_kWh)
      2018-08-31 10:58:23.692 (Z-Wave) General/kWh (Pool_Pump_Cirk_kWh)
      2018-08-31 10:58:23.767 (Z-Wave) General/kWh (Pool_Lights_Deck_kWh)
      2018-08-31 10:59:06.291 (Z-Wave) Usage (Pool_Pump_Drain_Watt)
      2018-08-31 10:59:06.294 (Z-Wave) General/kWh (Pool_Pump_Drain_kWh)
      2018-08-31 10:59:07.293 (Z-Wave) General/kWh (Pool_Pump_Drain_kWh)
      2018-08-31 10:59:07.365 (Z-Wave) Usage (Pool_Lights_Water_Watt)
      2018-08-31 10:59:07.368 (Z-Wave) General/kWh (Pool_Lights_Water_kWh)
      2018-08-31 10:59:07.441 (Z-Wave) General/kWh (Pool_Lights_Water_kWh)
      2018-08-31 10:59:16.291 (Z-Wave) Usage (Pool_Pump_Drain_Watt)
      2018-08-31 10:59:16.294 (Z-Wave) General/kWh (Pool_Pump_Drain_kWh)
      2018-08-31 10:59:29.291 (Z-Wave) Usage (Pool_Pump_Drain_Watt)
      2018-08-31 10:59:29.296 (Z-Wave) General/kWh (Pool_Pump_Drain_kWh)
      2018-08-31 11:00:00.714 (Z-Wave) Usage (Pool_Lights_Deck_Watt)
      2018-08-31 11:00:00.713 Status Starting automatic database backup procedure
      2018-08-31 11:00:01.786 (Z-Wave) General/kWh (Pool_Lights_Deck_kWh)
      2018-08-31 11:00:01.788 (Z-Wave) Usage (Pool_Pump_Cirk_Watt)
      2018-08-31 11:00:01.790 (Z-Wave) General/kWh (Pool_Pump_Cirk_kWh)
      2018-08-31 11:00:01.781 Status Ending automatic database backup procedure
      2018-08-31 11:00:01.788 Status Incoming connection from: 127.0.0.1
      2018-08-31 11:00:03.058 (Z-Wave) General/kWh (Pool_Heat_kWh)
      2018-08-31 11:01:19.056 (Z-Wave) Usage (Pool_Heat_Watt)
      2018-08-31 11:01:19.060 (Z-Wave) General/kWh (Pool_Heat_kWh)
      2018-08-31 11:01:45.807 Error: MySensors USB hardware (5) nothing received for more than 15 Minutes
      2018-08-31 11:01:46.807 Error: Restarting: MySensors USB
      2018-08-31 11:01:47.752 Status: MySensors: Serial Worker stopped
      2018-08-31 11:01:48.772 Status: MySensors: Using serial port: /dev/ttyUSB0
      2018-08-31 11:01:50.264 MySensors: Gateway Ready
      2018-08-31 11:01:50.339 MySensors: Gateway Version: 2.2.0
      2018-08-31 11:02:04.956 (MySensors USB) Usage (Usage)
      2018-08-31 11:02:04.959 (MySensors USB) Usage (Usage)
      2018-08-31 11:02:04.963 (MySensors USB) General/kWh (Huset_V)
      2018-08-31 11:02:04.968 (MySensors USB) General/kWh (Panna_V)
      2018-08-31 11:02:04.971 (MySensors USB) General/Custom Sensor (ElFails)
      2018-08-31 11:02:08.353 (MySensors USB) General/Voltage (TvättMS_V)
      2018-08-31 11:02:08.430 (MySensors USB) General/Custom Sensor (TvättSleepTime)
      2018-08-31 11:02:08.504 (MySensors USB) General/Custom Sensor (TvättFails)
      2018-08-31 11:02:11.820 Error: SMTP Mailer: Error sending Email to: <@hotmail.com>
      2018-08-31 11:02:11.820 Error: Notification failed (Email) 
      
      posted in Domoticz
      flopp
      flopp
    • RE: MySensors suddenly stop working [solved]

      I think the problem is Domoticz.
      I stopped DZ, installed Arduino IDE on Debian, then opened the Serial Monitor for my GW and it is working more than 1 minute.
      Below is Debug log and sketch for GW

      Serial output

      0;255;3;0;14;Gateway startup complete.
      0;255;0;0;18;2.2.0
      5;0;1;0;0;23.4
      5;1;1;0;0;21.9
      5;2;1;0;0;22.9
      19;1;1;0;0;24.5
      19;3;1;0;0;14.0
      19;251;1;0;55;0
      19;252;1;0;55;1
      19;253;1;0;55; 7
      19;250;1;0;55;1676
      21;2;1;0;18;3421.5156
      21;250;1;0;55;57
      21;251;1;0;55;0
      21;252;1;0;55;1
      21;1;1;0;17;261
      21;2;1;0;17;64
      21;1;1;0;24;175354206
      21;1;1;0;18;175354.2000
      21;2;1;0;25;34215158
      21;2;1;0;18;3421.5161
      21;250;1;0;55;0
      25;0;1;0;24;48198
      25;0;1;0;35;48.198
      21;1;1;0;17;287
      21;2;1;0;17;64
      21;1;1;0;24;175354207
      21;1;1;0;18;175354.2000
      21;2;1;0;25;34215160
      21;2;1;0;18;3421.5161
      21;250;1;0;55;0
      21;1;1;0;17;287
      21;2;1;0;17;64
      21;2;1;0;25;34215162
      21;2;1;0;18;3421.5161
      21;250;1;0;55;0
      21;1;1;0;17;262
      21;2;1;0;17;64
      21;1;1;0;24;175354208
      21;1;1;0;18;175354.2000
      21;2;1;0;25;34215164
      21;2;1;0;18;3421.5164
      21;250;1;0;55;0
      25;0;1;0;24;48198
      25;0;1;0;35;48.198
      21;1;1;0;17;262
      21;2;1;0;17;64
      21;1;1;0;24;175354209
      21;1;1;0;18;175354.2000
      21;2;1;0;25;34215165
      21;2;1;0;18;3421.5164
      21;250;1;0;55;0
      14;0;1;0;0;22.9
      14;1;1;0;0;23.1
      14;2;1;0;0;23.3
      14;3;1;0;0;23.4
      14;4;1;0;0;23.6
      14;5;1;0;0;23.0
      14;6;1;0;0;22.8
      14;7;1;0;0;23.0
      14;9;1;0;0;51.5
      14;10;1;0;0;23.3
      14;11;1;0;0;23.4
      14;12;1;0;0;22.8
      14;13;1;0;0;22.4
      14;14;1;0;0;21.3
      14;15;1;0;0;52.0
      14;16;1;0;0;21.3
      14;17;1;0;0;32.0
      14;18;1;0;0;16.9
      14;19;1;0;0;18.4
      14;20;1;0;0;17.4
      14;21;1;0;0;20.5
      14;22;1;0;0;17.6
      14;23;1;0;0;18.6
      14;24;1;0;0;16.3
      14;25;1;0;0;20.3
      14;26;1;0;0;6.4
      14;27;1;0;0;3.1
      14;28;1;0;0;4.1
      14;29;1;0;0;-12.8
      14;30;1;0;0;29.4
      14;31;1;0;0;20.5
      14;32;1;0;0;21.4
      14;33;1;0;0;21.4
      14;34;1;0;0;21.2
      14;35;1;0;0;22.4
      14;36;1;0;0;16.2
      14;37;1;0;0;17.9
      14;40;1;0;2;0
      14;41;1;0;2;0
      14;42;1;0;2;0
      14;43;1;0;2;0
      14;44;1;0;2;0
      21;1;1;0;17;261
      21;2;1;0;17;64
      21;1;1;0;24;175354210
      21;1;1;0;18;175354.2000
      21;2;1;0;25;34215167
      21;2;1;0;18;3421.5168
      21;250;1;0;55;0
      21;1;1;0;17;671
      21;2;1;0;17;64
      21;1;1;0;24;175354212
      21;1;1;0;18;175354.2000
      21;2;1;0;25;34215169
      21;2;1;0;18;3421.5168
      21;250;1;0;55;0
      25;0;1;0;24;48198
      25;0;1;0;35;48.198
      21;1;1;0;17;656
      21;2;1;0;17;64
      21;1;1;0;24;175354213
      21;1;1;0;18;175354.2000
      21;2;1;0;25;34215171
      21;2;1;0;18;3421.5171
      21;250;1;0;55;0
      21;1;1;0;17;601
      21;2;1;0;17;64
      21;1;1;0;24;175354214
      21;1;1;0;18;175354.2000
      21;2;1;0;25;34215173
      21;2;1;0;18;3421.5171
      21;250;1;0;55;0
      21;1;1;0;17;241
      21;2;1;0;17;64
      21;1;1;0;24;175354215
      21;1;1;0;18;175354.2000
      21;2;1;0;25;34215174
      21;2;1;0;18;3421.5176
      21;250;1;0;55;0
      25;0;1;0;24;48198
      25;0;1;0;35;48.198
      
      

      Sketch

      /**
      * 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
      * The ArduinoGateway prints data received from sensors on the serial link.
      * The gateway accepts input on seral which will be sent out on radio network.
      *
      * The GW code is designed for Arduino Nano 328p / 16MHz
      *
      * Wire connections (OPTIONAL):
      * - Inclusion button should be connected between digital pin 3 and GND
      * - RX/TX/ERR leds need to be connected between +5V (anode) and digital pin 6/5/4 with resistor 270-330R in a series
      *
      * LEDs (OPTIONAL):
      * - To use the feature, uncomment any of the MY_DEFAULT_xx_LED_PINs
      * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved
      * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
      * - ERR (red) - fast blink on error during transmission error or recieve crc error
      *
      */
      
      // 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
      
      //Buffer
      #define MY_RX_MESSAGE_BUFFER_FEATURE 
      #define MY_RF24_IRQ_PIN 2 
      
      // Set LOW transmit power level as default, if you have an amplified NRF-module and
      // power your radio separately with a good regulator you can turn up PA level.
      #define MY_RF24_PA_LEVEL RF24_PA_LOW
      
      // Enable serial gateway
      #define MY_GATEWAY_SERIAL
      
      // Enable inclusion mode
      //#define MY_INCLUSION_MODE_FEATURE
      // Enable Inclusion mode button on gateway
      //#define MY_INCLUSION_BUTTON_FEATURE
      
      // Inverses behavior of inclusion button (if using external pullup)
      //#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP
      
      // Set inclusion mode duration (in seconds)
      //#define MY_INCLUSION_MODE_DURATION 60
      // Digital pin used for inclusion mode button
      //#define MY_INCLUSION_MODE_BUTTON_PIN  3
      
      // Set blinking period
      //#define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      // Inverses the behavior of leds
      //#define MY_WITH_LEDS_BLINKING_INVERSE
      
      // Flash leds on rx/tx/err
      // Uncomment to override default HW configurations
      //#define MY_DEFAULT_ERR_LED_PIN 4  // Error led pin
      //#define MY_DEFAULT_RX_LED_PIN  6  // Receive led pin
      //#define MY_DEFAULT_TX_LED_PIN  5  // the PCB, on board LED
      
      #include <MySensors.h>
      
      void setup()
      {
        // Setup locally attached sensors
      }
      
      void presentation()
      {
        // Present locally attached sensors
      }
      
      void loop()
      {
        // Send locally attached sensor data here
      }
      
      posted in Domoticz
      flopp
      flopp
    • RE: MySensors suddenly stop working [solved]

      @tekka OK, will upload them as soon as I have them, at work at the moment

      posted in Domoticz
      flopp
      flopp
    • RE: MySensors suddenly stop working [solved]

      Thanks for your reply.
      Do you mean sketch for GW and Debug log for GW or from DZ?

      posted in Domoticz
      flopp
      flopp
    • MySensors suddenly stop working [solved]

      MySensors 2.2.0 on Arduino Nano USB GW
      Debian with Domoticz

      I have been running this setup for almost one year. About one week ago I updated Domoticz with the "Check for updates" in the menu, it updated to 4.9701(even if it says 4.9700 as stable on there webpage)
      It was still working good until yesterday afternoon.
      I came home and about 10 minutes later MySensors stopped getting data. I have tried everything, almost.
      New Nano, new RF, new usb port on pc, updated to latest Beta of Domoticz.
      If I restart GW i will get data from my nodes(~30) for about one minute, then I just stops.

      Any that can help my or tell me something to test.
      Thanks

      EDIT: my problem was a MySensor Repeater that did something strange, after a reset of this repeater everything seems to be OK again.

      posted in Domoticz
      flopp
      flopp
    • RE: does someone use pcbs.io ?

      Hi, I have used Pcbs.io three times, first and second was good shipping time, both was 3 weeks from order to arrival.
      but now the third time I ordered 27/1 2018 and today 19/3 2018 I have still not received it.
      I got an email that my Pcbs were on the way at the 7/3 2018 but USPS have still not get them from Pcbs.io.
      So do not use Pcbs.io

      posted in Hardware
      flopp
      flopp
    • RE: New 2.2.0 Signal report function

      I just now found some other maybe interested variables

      transportGetReceivingRSSI()
      transportGetSendingRSSI()
      transportGetReceivingSNR()
      transportGetSendingSNR()
      transportGetTxPowerLevel()
      transportGetTxPowerPercent()
      transportInternalToRSSI(_transportSM.uplinkQualityRSSI)

      i have not tested anyone of them, but it seems that "transportGetSendingRSSI()" will give same result as "transportGetSignalReport(SR_TX_RSSI)"
      so the message may look like this instead

      send(RSSIMsg.set(transportGetSendingRSSI()));

      posted in Hardware
      flopp
      flopp
    • RE: New 2.2.0 Signal report function

      I tried to send RSSI with nRF and it seemed to work, I could get a value that was changing if I moved away from Gateway.

      i was using this variable, transportGetSignalReport(SR_TX_RSSI)

      so to send the RSSI create a Child, I think you can pick anyone that can handle value from 0-1024 then use below message to send the value

      send(RSSIMsg.set(transportGetSignalReport(SR_TX_RSSI)));

      I am using Domoticz as Controller

      posted in Hardware
      flopp
      flopp
    • RE: Water leak sensor

      @helvetian
      Thanks.
      I am using Domoticz as Controller.
      After you first start-up of node you will get a Light device, change this device to Dimmer, then in Setup-Hardware-MySensorsSetup, select Node then select Child for SleepTime and disable Ack.

      posted in My Project
      flopp
      flopp
    • Water leak sensor

      Finally I made my water leak sensor that I have been dreaming about for a long time now 🙂
      I used those items:
      Enclosure
      2 x AA batteris incl holder
      nRF24L01+
      Home made PCB with ATmega328P-PU
      red, green LED
      si7021, temp & hum
      some capactitors and resistors
      Kitchen aluminum foil
      Copper wire

      I am measuring temperature and humidity with a Si7021, measuring battery voltage with voltage divider and internal reference, just to test which one that shows most correct.

      /**
       * 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.
       *
       *******************************
       *
       * REVISION HISTORY
       * Version 1.0 - Henrik EKblad
       * 
       */
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      #define MY_NODE_ID 27
      
      #include <SPI.h>
      #include <MySensors.h>
      #include <Wire.h>
      #include <SI7021.h>
      
      #define CHILD_SIHUM 0
      #define CHILD_SITEMP 1
      #define CHILD_BATT 2
      #define CHILD_SIDEW 3
      #define CHILD_BATTRES 4
      
      #define CHILD_WATER 10
      
      #define CHILD_FAILS 250
      #define CHILD_PARENT 251
      #define CHILD_DISTANCE 252
      #define CHILD_SLEEPTIME 253
      
      //LED
      int GREEN = 7;
      int RED = 8;
      
      //Water alarm
      int Interrupt = 1; // pin 3 on UNO/Nano
      
      //SleepTime
      float SleepTime = 30; // Sleep time between reads (in minutes)
      int OldSleepTime = -1;
      int SleepTimeLoopCount = 10;
      
      //ReadVCC
      long result;
      float BatteryVolt;
      float OldBatteryVolt;
      int BatteryVoltLoopCount = 5;
      
      //ReadVCCRes
      int sensorValue;
      float BatteryResVolt;
      int BATTERY_SENSE_PIN = A2;  // select the input pin for the battery sense point
      
      //SI7021
      SI7021 SI;
      int SILoopCount = 5;
      int SIHum;
      int OldSIHum = -1;
      float SITemp;
      float OldSITemp = -1;
      float SIDew;
      float OldSIDew = -1;
      
      //NRF
      int Fails = 0;
      int OldFails = -1;
      int FailsLoopCount = 10;
      int OldParentNode = -1;
      int ParentNodeLoopCount = 10;
      int OldDistanceNode = -1;
      int DistanceLoopCount = 10;
      
      MyMessage msgSIHum(CHILD_SIHUM, V_HUM);
      MyMessage msgSITemp(CHILD_SITEMP, V_TEMP);
      MyMessage msgSIDew(CHILD_SIDEW, V_TEMP);
      MyMessage msgBatt(CHILD_BATT, V_VOLTAGE);
      MyMessage msgBattRes(CHILD_BATTRES, V_VOLTAGE);
      
      MyMessage msgWater(CHILD_WATER, V_TRIPPED);
      
      MyMessage msgFails(CHILD_FAILS, V_VA);
      MyMessage msgParent(CHILD_PARENT, V_VA);
      MyMessage msgDistance(CHILD_DISTANCE, V_VA);
      MyMessage msgSleepTime(CHILD_SLEEPTIME, V_VA);
      
      void setup() {
      
        //Water Alarm
        pinMode(3, INPUT_PULLUP);
        attachInterrupt(Interrupt, Water, FALLING);
      
        //Battery measurement
        analogReference(INTERNAL); // use the 1.1 V internal reference
        sensorValue = analogRead(BATTERY_SENSE_PIN); // read once to activate the change of reference
      
        pinMode(GREEN, OUTPUT);
        pinMode(RED, OUTPUT);
        digitalWrite(GREEN, HIGH);
        digitalWrite(RED, HIGH);
        delay(200);
        digitalWrite(GREEN, LOW);
        digitalWrite(RED, LOW);
      
        SI.begin();
      }
      void presentation() {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Temp/Humidity/WaterLeak", "20180226");
        // Register all sensors to gateway (they will be created as child devices)
        present(CHILD_SIHUM, S_HUM, "SIHum");
        present(CHILD_SITEMP, S_TEMP, "SITemp");
        present(CHILD_SIDEW, S_TEMP, "SIDew");
        present(CHILD_BATT, S_MULTIMETER, "Volt");
        present(CHILD_BATTRES, S_MULTIMETER, "VoltRes");
      
        present(CHILD_WATER, S_WATER_LEAK, "Water Alarm");
        
        present(CHILD_FAILS, S_POWER, "Fails");
        present(CHILD_PARENT, S_POWER, "Parent");
        present(CHILD_DISTANCE, S_POWER, "Distance");  
        present(CHILD_SLEEPTIME, S_DIMMER, "SleepTime");
      }
      void loop() {
        //Voltage
        readVcc();
        sensorValue = analogRead(BATTERY_SENSE_PIN);
        BatteryResVolt  = sensorValue * 0.003363075;
        
        //SI read both temperature and humidity
        si7021_env SIdata = SI.getHumidityAndTemperature();
        
        //SI Humidity  
        SIHum = SIdata.humidityPercent;
        //Serial.print("SIHum=");
        //Serial.println(SIHum);
        if(SIHum >99)
        {
          SIHum = 99;
        }
        if(SIHum < 1)
        {
          SIHum = 0;
        }
        
        //SI Temperature
        SITemp = SIdata.celsiusHundredths / 100.0;
        SITemp = round(SITemp*10)/10.0;
        //Serial.print("SITemp=");
        //Serial.println(SITemp,1);
      
        //SI Dew
        double a = 17.271;
        double b = 237.7;
        double dewtemp = (a * SITemp) / (b + SITemp) + log(SIHum*0.01);
        SIDew = (b * dewtemp) / (a - dewtemp);
      
        //Get SleepTime from controller
        request(CHILD_SLEEPTIME, V_PERCENTAGE);
        wait(1000);
      
        //Water Alarm
        int WaterLeak = digitalRead(3);
        if (WaterLeak == 0){
          resend((msgWater.set(1)), 100);
        } 
        else{
          resend((msgWater.set(0)), 100);
        }
      
        //Send data to controller
        if ((OldBatteryVolt != BatteryVolt) | (BatteryVoltLoopCount >= 5))
        {
          send(msgBatt.set(BatteryVolt, 3));
          send(msgBattRes.set(BatteryResVolt, 3));
          OldBatteryVolt = BatteryVolt;
          BatteryVoltLoopCount = 0;
        }
          
        if ((OldSIHum != SIHum) | (OldSITemp != SITemp) | (OldSIDew != SIDew) | (SILoopCount >= 5))
        {
          resend((msgSIHum.set(SIHum)), 1);
          resend((msgSITemp.set(SITemp, 1)), 1);
          resend((msgSIDew.set(SIDew, 1)), 1);
          OldSIHum = SIHum;
          OldSITemp = SITemp;
          OldSIDew = SIDew;
          SILoopCount = 0;
        }
        
        if ((OldParentNode != _transportConfig.parentNodeId) | (ParentNodeLoopCount >= 10))
        {
          resend((msgParent.set(_transportConfig.parentNodeId)),1);
          OldParentNode = _transportConfig.parentNodeId;
          ParentNodeLoopCount = 0;
        }
          
        if ((OldDistanceNode != _transportConfig.distanceGW) | (DistanceLoopCount >= 10))
        {
          resend((msgDistance.set(_transportConfig.distanceGW)),1);
          OldDistanceNode = _transportConfig.distanceGW;
          DistanceLoopCount = 0;
        }
      
        if ((OldSleepTime != SleepTime) | (SleepTimeLoopCount >= 10))
        {
          resend((msgSleepTime.set(SleepTime,0)),10);
          OldSleepTime = SleepTime;
          SleepTimeLoopCount = 0;
        }
      
        if ((OldFails != Fails) | (FailsLoopCount >= 10))
        {
          failsend((msgFails.set(Fails)),1);
          OldFails = Fails;
          FailsLoopCount = 0;
        }
           
        BatteryVoltLoopCount++;
        SILoopCount++;
        ParentNodeLoopCount++;
        DistanceLoopCount++;
        SleepTimeLoopCount++;
        FailsLoopCount++;
      
        digitalWrite(GREEN, HIGH);
        delay(200);
        digitalWrite(GREEN, LOW);
        
        sleep(SleepTime*60000); //sleep a bit
      }
      void readVcc() {
        //Serial.println("readVcc");
        // Read 1.1V reference against AVcc
        ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
        delay(2); // Wait for Vref to settle
        ADCSRA |= _BV(ADSC); // Convert
        while (bit_is_set(ADCSRA, ADSC));
        result = ADCL;
        result |= ADCH << 8;
        result = 1126400L / result; // Back-calculate AVcc in mV
        //batteryPcnt = (result - 1900) * 0.090909;
        BatteryVolt = result / 1000.000;
        //sendBatteryLevel(batteryPcnt);
        //Serial.print("battery volt:");
        //Serial.println(batteryVolt, 3);
        //Serial.print("battery percent:");
        //Serial.println(batteryPcnt);
      }
      void resend(MyMessage & msg, int repeats) {
        int repeat = 0;
        int repeatdelay = 0;
        boolean sendOK = false;
        while ((sendOK == false) and(repeat < repeats))
        {
          if (send(msg))
          {
            sendOK = true;
          }
          else
          {
            
            digitalWrite(RED, HIGH);
            delay(200);
            digitalWrite(RED, LOW);
            Fails++;
            sendOK = false;
            Serial.print("Error ");
            Serial.println(repeat);
            repeatdelay += 250;
            repeat++;
            sleep(repeatdelay);
          }
        }
      }
      
      void failsend(MyMessage &msg, int repeats) {
        int repeat = 0;
        int repeatdelay = 0;
        boolean sendOK = false;
      
        while ((sendOK == false) and (repeat < repeats)) {
          if (send(msg))
          {
            Fails = 0;
            sendOK = true;
          }
          else
          {
            Fails++;
            sendOK = false;
            Serial.print("Error ");
            Serial.println(repeat);
            repeatdelay += 250;
            repeat++;
            sleep(repeatdelay);
          }
        }
      }
      
      void receive(const MyMessage &message) {
        if (message.sender == 0) {
          if(message.type == V_PERCENTAGE) {
            //Serial.println( "V_PERCENTAGE command received..." );
            SleepTime = atoi(message.data);
            if ((SleepTime <= 0) | (SleepTime >= 700))
            {
              SleepTime = 30;
            }
            else
            {
              SleepTime = SleepTime / 6.6;
              //Serial.println(SleepTime);
              if (SleepTime < 1)
              {
                SleepTime = 1;  
              }
            }
            //Serial.println(SleepTime);
          }
        } 
      }
      
      void Water() {
        Serial.println("Water");
        resend((msgWater.set(1)), 1000);
        digitalWrite(GREEN, HIGH);
        delay(200);
        digitalWrite(GREEN, LOW);
      }
      

      0_1519677466024_20180226_193839617_iOS.jpg
      0_1519677539241_20180226_193922845_iOS.jpg

      posted in My Project
      flopp
      flopp
    • RE: 💬 Water Meter Pulse Sensor

      @smilvert said in 💬 Water Meter Pulse Sensor:

      You don't use a green led? I tried that and it seems to work better but then I struggle with the mounting.

      I am using IR to detect movements. Green LED is flashing eveytime the IR detects movement and Red LED is power for PCB.
      I am using Digital Output from PCB to pin 2 or 3 on my UNO. I have tried both with INPUT_PULLUP and without, also tried 20K between Digital Output and GND. nothing is helping

      How do you use green LED with water meter?

      posted in Announcements
      flopp
      flopp
    • RE: 💬 Water Meter Pulse Sensor

      @flopp
      tried pin3, didn't help

      Can it be something wrong with LM393(pcb)?

      posted in Announcements
      flopp
      flopp
    • RE: 💬 Water Meter Pulse Sensor

      @flopp
      This didn't worked so well, I got a lot of errors everytime nRF was sending data, then I got one pulse.
      Anyone know how to protect the digital input to NOT fall when nRF sends?
      Wait, when I was writing this text 🙂 I just remember that nRF is using Pin 2, is that correct?
      I will try to use pin 3 instead, as interrupt pin

      posted in Announcements
      flopp
      flopp
    • RE: 💬 Water Meter Pulse Sensor

      @smilvert
      I also have same meter as the picture. Yesterday I installed my sensor
      I took a TCRT5000 IR sensor, https://www.mysensors.org/store/water
      A cap from a soda bottle, cut it so it fits above left red wheel(X0,0001) which means one lap i 1 liter
      It works but it counts little bit wrong, I have change the

      if (interval<500000L)
      

      to

      if (interval<2500000L)
      

      but anyway it counts about 3 times to much. I will check it later today

      0_1518429857989_vatten.png
      0_1518429910010_water.png

      posted in Announcements
      flopp
      flopp
    • RE: You Have I Need

      The idea was e.g. I send a question if someone in Malmö or close to Malmö have a 5v relay, because the store is closed and I really wanna do this project and can’t wait.
      Nobody wants to stop in the project 🙂

      posted in General Discussion
      flopp
      flopp
    • You Have I Need

      Last weekend I helped my brother with some MySensors nodes.
      There is no store close his house where we could buy electronic parts like resistor, diode etc.

      I wonder if there is a website where I can ask if someone do have a special part at home that I can buy.

      Maybe we can have something here at MySensors.org?

      posted in General Discussion
      flopp
      flopp
    • RE: MySensors 2.2.0 released

      @user1306
      I am using LOW and HIGH. LOW should be enough. I was testing HIGH with some nodes but I dont know if that helped.

      I also using nRF from AliE.

      I think most of MYS users are using nRF from China, i don't know how to see if it is real or fake.

      posted in Announcements
      flopp
      flopp
    • RE: MySensors 2.2.0 released

      @user1306
      Correct, if you don't define RF24_PA LEVEL in your sketch it will use default values from Config, which in your case seems to be MAX

      posted in Announcements
      flopp
      flopp
    • RE: NACK Errors w/ Arduino Uno Ethernet Gateway v2.2.0 rc2

      @gohan said in NACK Errors w/ Arduino Uno Ethernet Gateway v2.2.0 rc2:

      @dklinkman good reports are for the ones from CDEBytes store on aliexpress, I got some of those and so far a performing well

      Do you mean these?
      https://www.aliexpress.com/store/product/CDEBYTE-2PCS-Lot-E01-ML01D-Wireless-Transceiver-For-Arduino-nRF24L01-2-4GHz-Antenna-Module-For-Microcontroll/2077046_32803704874.html?spm=2114.12010615.0.0.1ed639cdAmxalE

      posted in Troubleshooting
      flopp
      flopp
    • RE: MySensors 2.2.0 released

      @zboblamont
      It is still there, but I don't think DZ has implemented MYS RF signal, yet 🙂

      posted in Announcements
      flopp
      flopp
    • RE: MySensors 2.2.0 released

      @user1306
      I couldn't find any Signal value in Domoticz
      What I did was to send that information as a seperate Child
      use variable transportGetSignalReport(SR_TX_RSSI) to get the value

      send(RSSIMsg.set(transportGetSignalReport(SR_TX_RSSI)));
      
      posted in Announcements
      flopp
      flopp
    • RE: MySensors 2.2.0 released

      Thank you very much. I donated USD 10 as a small thank you for all your work. I hope more people do the same.

      Very nice text when you start a node, I have only tried 2.2 on my GW and it looks like some of my sending errors disappeared.

      This is what you see when you start a node

      __  __       ____
      |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
      | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
      | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
      |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
             |___/                      2.2.0
      

      Why not add two | in the "o" then i will look like this

      
       __  __       ____
      |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
      | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
      | |  | | |_| |___| |  __/ | | \__ \ |_| | |  \__ \
      |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
              |___/                      2.2.0
      
      
      posted in Announcements
      flopp
      flopp
    • RE: Error Sending switch command

      I read this post yesterday and today I solved it.
      My GW was restarting as soon as I was sending a command to a MYS node with dimmer child.
      I am using nRF PA-LNA, with extra power supply, PA_HIGH. Domoticz 3.8795, MYS 2.1.1. Nano as serial GW.
      Tried PA_LOW, new nRF but that didn't help.
      Today I found the solution, I disabled DEBUG in GW and now I can't reproduce any restarts.

      posted in Domoticz
      flopp
      flopp
    • RE: Merry X-mas and Happy New 2018

      Merry Christmas and a Happy New Year and as thank you I donated some money to you.

      posted in Announcements
      flopp
      flopp
    • RE: Temperature sensor on ESP8266

      @bagou91
      Sorry for late answer.
      I don't remember but after I look at the code it seems to be that you need define what IDX your device have.

      String idx = "1"; // ***id for your sensor***
      

      So, yes, you need to create a virtual temperature and then put in the IDX in your sketch

      posted in Hardware
      flopp
      flopp
    • RE: My own library with MyS commands

      @Yveaux
      Thanks, i will have a look at it

      posted in My Project
      flopp
      flopp
    • My own library with MyS commands

      I want to make my own library. In that library I will put stuff that I use in all my sketches.
      I will still include MySensors.h, version 2.1.1
      What I want to do is to put MyMessage for 3 childs that I always use in my sketches, of course I can write it in my sketch but it looks cleaner and I want to learn more about library.
      When I use MyMessage in my new library I get an error in Arduino IDE,
      'MyMessage' was not declared in this scope
      I guess that MyMessage is not public or something like that.

      Anyone that can help in correct direction?

      posted in My Project
      flopp
      flopp
    • RE: 💬 Rain Gauge

      Last 5 days all of them are fake, always during noon(12:00) isn't that strange?
      0_1495472098137_IMG_4118.PNG

      posted in Announcements
      flopp
      flopp
    • RE: 💬 Rain Gauge

      @petewill
      I have never seen it on other nodes and I don't think I had this error when it was cold

      posted in Announcements
      flopp
      flopp
    • RE: 💬 Rain Gauge

      I am using version 1.5.?
      I have not opened the rain-box for at least 4 month and not changed the code.
      Maybe this error have been there since day one but I have not checked so often.
      But now I am checking daily because of other nodes that I added recently and then I noticed this

      posted in Announcements
      flopp
      flopp
    • RE: Please share your raingauge sketch that works with Domoticz

      @edweather
      Does the node get VAR1 from DZ?
      Does it send new value every hour or same value?

      posted in Development
      flopp
      flopp
    • RE: 💬 Rain Gauge

      @user2684
      My board is sleep and wake up every 2 hours to send battery voltage or it wake up by interrupt

      posted in Announcements
      flopp
      flopp
    • RE: 💬 Rain Gauge

      My node is batteri powered, can it have something with the battery why this happens?
      I have a second rain gauge powered by USB and that one doesn't give fake interrupt

      posted in Announcements
      flopp
      flopp
    • RE: 💬 Rain Gauge

      I have been using my tipping bucket for at least 6 month now and I also noticed that the last week I got some fake interrupt. We have had a very nice week in south Sweden so it must be something with the weather that makes the interrupt

      posted in Announcements
      flopp
      flopp
    • RE: 3.3V step up regulator voltage monitoring

      @scalz is correct, use analog input to read batteries.
      My link at top was to measure what voltage the Arduino I see getting. Sorry for leading you in wrong direction 😑

      posted in Hardware
      flopp
      flopp
    • RE: 3.3V step up regulator voltage monitoring

      @fhenryco
      If battery is below 0,8 step-up will not work and your Arduino will not work.
      If battery is 2.3 you will get 3.3 output from step-up

      posted in Hardware
      flopp
      flopp
    • RE: 3.3V step up regulator voltage monitoring

      @fhenryco
      If you measure after the step-up you will never know when it will "die".
      You need to measure before step-up to see battery level

      posted in Hardware
      flopp
      flopp
    • RE: coin-cell (CR2032) powered temperature sensor

      @tango156157
      Look you have more than one library for si7021.
      Move one library and then try again.
      If that doesn't help.

      Move back the first library and move the second one, try again and see if that helped

      posted in My Project
      flopp
      flopp
    • RE: 3.3V step up regulator voltage monitoring

      What voltage is your battery?

      This is one way to measure voltage
      https://forum.arduino.cc/index.php?topic=356752.0

      posted in Hardware
      flopp
      flopp
    • RE: fody weather station, wind sensor

      I read about watchdog now and as normal way, without extra code, it can check that our code is alive less then 8 seconds.
      I want it to send data every 60 seconds so I need to loop watchdog code a couple of times.
      I will look at this later

      posted in Hardware
      flopp
      flopp
    • RE: fody weather station, wind sensor

      @gohan said in fody weather station, wind sensor:

      Search "Arduino watchdog examples" lots of stuff comes out

      thanks 👍
      I did some search and I never heard of this function before.
      I will test it in my sketch and see if I get rid of the freezing stuff

      posted in Hardware
      flopp
      flopp
    • RE: fody weather station, wind sensor

      @gohan said in fody weather station, wind sensor:

      Try adding the watchdog function.

      That's something new for me. What is this and how do you add it?
      Anyone with a link?

      posted in Hardware
      flopp
      flopp
    • RE: fody weather station, wind sensor

      it stopped working again, this morning. This time it started to work again just after opening Serial monitoring in Arduino IDE

      posted in Hardware
      flopp
      flopp
    • RE: fody weather station, wind sensor

      suddenly it stopped sending data, after power-off-power-on it started to work again

      posted in Hardware
      flopp
      flopp
    • RE: fody weather station, wind sensor

      @gohan
      Thanks for asking 🙂
      It is working good, but I don't trust the wind speed. I have lots of "ghost" indications from the reed
      switch, I tried to remove it with code in two different ways but anyway I get some high values. I will order a wind speed meter and check against that one. I also record a slow-mo video when it spins in front of a fan(2.5m/s) and it is correct but it is difficult to test it with 10 m/s,
      0_1494056546529_chart.png

      If anyone are inreseted what's inside the receiver that was included from Fody. It look like this
      0_1494056662724_20170505_182732345_iOS.jpg

      posted in Hardware
      flopp
      flopp
    • RE: MySensors weather station

      @dbemowsk
      I am using 8 digital inputs, with pinmode(x,INPUT_PULLUP) on all of them, A0, A1 and A2 i use as digital input because I am using UNO so all the digitals was occupied with NRf and Rain, Wind speed.

      posted in Enclosures / 3D Printing
      flopp
      flopp
    • RE: MySensors weather station

      @dbemowsk
      On my(fody) wind direction they use GND instead of VCC. When light is hitting the receiver, GND is passing through and you get a shortcut. I think, in that way you don't need all the 3,3K resistors.

      About resolution, personally I wouldn't focus on that because the wind is never in the same direction more than a few second then it moves a little bit. Maybe it stays in same direction when you have strong winds?

      posted in Enclosures / 3D Printing
      flopp
      flopp
    • RE: MySensors weather station

      @dbemowsk said in MySensors weather station:

      Here is my starting design done in OpenSCAD. I have the center hole threaded part way with a US 1/4 x 20 thread as that is what I used for the bolts to go through the wind vane.

      Your drawings look good.

      posted in Enclosures / 3D Printing
      flopp
      flopp
    • RE: MySensors weather station

      @dbemowsk said in MySensors weather station:

      @flopp I am curious how you wired your electronics. I saw that as one of your original questions in your fody weather station post. so based on what you are saying, you really only use the 8 different directions, N, NE, E, SE, S, SW, W, NW, correct?

      Yes, correct. I have 8 receivers for the light.

      I want to know more about this product https://www.youtube.com/watch?v=-oQiJ50LcAc

      posted in Enclosures / 3D Printing
      flopp
      flopp
    • RE: MySensors weather station

      @gohan said in MySensors weather station:

      The tricky part will be to find the right brightness for the LED when it is crossing between 2 photo-transistor, but I think it will be easier to adjust than changing a magnetic field 🙂

      What I did for wind direction is that I "look" for the first photo-transistor that get light from the LED and use that direction. So I don't care if the light is crossing between 2 photo-transistor. I scan from first digital in until i scanned all of them.

      void readWindDirection()
      {
        //check in what direction the wind is. First sensor that have light will be the direction
        int i = 4;
        for (i; i < 9 ; i++){
          if (!digitalRead(i)){
            WD = WDarray[i-4];
            return;
          }
        }
        i = 14;
        for (i; i < 17 ; i++){
          if (!digitalRead(i)){
            WD = WDarray[i-9];
            return;
          }
        }
      }
      
      posted in Enclosures / 3D Printing
      flopp
      flopp
    • RE: fody weather station, wind sensor

      New code again 😦
      Wind speed: it compare between two interrupts if it is too quick, if more than 100000 micros it will not use it

      #include <SPI.h>
      #include <MySensor.h>  
      #include <Wire.h>
      
      #define WIND_CHILD 0
      #define TEMP_CHILD 1
      #define HUM_CHILD 2
      #define RAIN_CHILD 3
      
      MySensor gw;
      
      MyMessage WSMsg(WIND_CHILD, V_WIND);
      MyMessage WGMsg(WIND_CHILD, V_GUST);
      MyMessage WDMsg(WIND_CHILD, V_DIRECTION);
      MyMessage TempMsg(TEMP_CHILD, V_TEMP);
      MyMessage HumMsg(HUM_CHILD, V_HUM);
      MyMessage RainMsg(RAIN_CHILD, V_RAIN);
      MyMessage RainCounterMsg(RAIN_CHILD,V_VAR1);
      
      //Wind Speed
      volatile unsigned long lastPulse = 0;
      volatile unsigned long intervalSum;
      unsigned long lastInterval = 0;
      unsigned long looptime;
      float WS = 0;
      float WG = 0;
      int WScount = 0;
      
      //Wind Direction
      int WDarray[8] = {0,45,90,135,180,225,270,315};
      int WD;
      
      //Rain
      volatile float hwRainVolume = 0;   // Current rainvolume calculated in hardware.
      float bucketSize = 0.4;   // mm per tip
      boolean pcReceived = false; 
      volatile unsigned long lastSend = 0;
      
      // Temperature/Humidity
      double hum = 0;
      double temp = 0;
      
      void setup() {
        
        Wire.begin();   //start i2c
        
        gw.begin(incomingMessage, AUTO, false);
      
        // Send the sketch version information to the gateway and Controller
        gw.sendSketchInfo("WeatherMast", "170427");
      
        gw.present(WIND_CHILD, S_WIND);
        gw.present(TEMP_CHILD, S_TEMP);
        gw.present(HUM_CHILD, S_HUM);
        gw.present(RAIN_CHILD, S_RAIN);
      
        gw.request(RAIN_CHILD, V_VAR1);
        gw.wait(5000);
        //pin 2 is rain, pin 3 is wind speed
        //pin 4-8, 14-16 is wind direction
        //configure pin 2-8 as an input and enable the internal pull-up resistor
        for (int i=2 ; i < 9 ; i++) {
          pinMode(i, INPUT_PULLUP);
        }
        //configure pin 14-16(A0-A2) as an input and enable the internal pull-up resistor
        for (int i=14 ; i < 17 ; i++) {
          pinMode(i, INPUT_PULLUP);
        }
        attachInterrupt(0, Rain, FALLING);    //rain
        attachInterrupt(1, WindSpeed, FALLING);   //wind speed
      }
      
      void loop()
      {
        gw.wait(60000);
        detachInterrupt(1);
        looptime = micros();
        readTempHum();    //read temperature and humidity
        readWindDirection();    //read wind direction
        resend((WSMsg.set(WS, 1)),3);
        WS = 0;  //reset wind speed, useful if there is no wind otherwise old value will be sent to Controller
        resend((WGMsg.set(WG, 1)),3);
        WG = 0;   //reset gust
        resend((WDMsg.set(WD, 1)),3);
        resend((RainMsg.set((float)hwRainVolume,2)),3);
        resend((TempMsg.set(temp, 1)),3);
        resend((HumMsg.set(hum, 1)),3);
        lastPulse += micros() - looptime;
        attachInterrupt(1, WindSpeed, FALLING);   //wind speed
      }
      
      void readWindDirection()
      {
        //check in what direction the wind is. First sensor that have light will be the direction
        int i = 4;
        for (i; i < 9 ; i++){
          if (!digitalRead(i)){
            WD = WDarray[i-4];
            return;
          }
        }
        i = 14;
        for (i; i < 17 ; i++){
          if (!digitalRead(i)){
            WD = WDarray[i-9];
            return;
          }
        }
      }
      
      void Rain()
      { 
        unsigned long currentTime = millis();
        if (!pcReceived) {      
          gw.request(RAIN_CHILD, V_VAR1);
          Serial.println("Request rainCount");
          gw.process();
          return;
        }
        if (currentTime - lastSend > 5000) {      
        hwRainVolume = hwRainVolume + bucketSize;
        resend((RainCounterMsg.set(hwRainVolume,2)),3);
        resend((RainMsg.set((float)hwRainVolume,2)),3);
        lastSend=currentTime;
        }
      }
      
      void WindSpeed()
      {
        detachInterrupt(1);
        volatile unsigned long newPulse = micros();  
        unsigned long interval = newPulse-lastPulse;
        if (interval<16000L) { // Sometimes we get wrong interrupt. 16000L = ~30 m/s
          attachInterrupt(1, WindSpeed, FALLING);
          lastPulse = newPulse;
          return;
        }
        long a = interval-lastInterval;
        a = abs(a);
        lastInterval = interval;
        if (a > 100000) {  
          lastPulse = newPulse;
          attachInterrupt(1, WindSpeed, FALLING);
          return;
        }
        else {
          lastPulse = newPulse;
          WS = (0.4775/(interval/1000000.0));   
          if (WS > WG) {
            WG = WS;
          }
        }
        attachInterrupt(1, WindSpeed, FALLING);
      }
      
      void readTempHum()
      {
        Wire.beginTransmission(0x28);   // Begin transmission with given device on I2C bus
        Wire.requestFrom(0x28, 4);      // Request 4 bytes 
        if(Wire.available() == 4) {                   
          int b1 = Wire.read();
          int b2 = Wire.read();
          int b3 = Wire.read();
          int b4 = Wire.read();
          
          Wire.endTransmission();           // End transmission and release I2C bus
          
          // combine humidity bytes and calculate humidity
          int rawHumidity = b1 << 8 | b2;
          // compound bitwise to get 14 bit measurement first two bits
          // are status/stall bit (see intro text)
          rawHumidity =  (rawHumidity &= 0x3FFF);
          hum = 100.0 / pow(2,14) * rawHumidity;
          
          // combine temperature bytes and calculate temperature
          b4 = (b4 >> 2); // Mask away 2 least significant bits see HYT 221 doc
          int rawTemperature = b3 << 6 | b4;
          temp = 165.0 / pow(2,14) * rawTemperature - 40;
         }
      }
      
      void incomingMessage(const MyMessage &message)
      {
        if (message.type==V_VAR1) {
          hwRainVolume = message.getFloat();
          pcReceived = true;
          Serial.print("Received last pulse count from gw: ");
          Serial.println(hwRainVolume,2);   
        }
      }
      
      void resend(MyMessage &msg, int repeats)
      {
        int repeat = 1;
        int repeatdelay = 0;
        boolean sendOK = false;
      
        while ((sendOK == false) and (repeat < repeats)) {
          if (gw.send(msg)) {
            sendOK = true;
          }
          else {
            sendOK = false;
            Serial.print("Error ");
            Serial.println(repeat);
            repeatdelay += 500;
          }
          repeat++; delay(repeatdelay);
        }
      }
      

      EDIT: added

      WS = 0;
      

      in loop

      posted in Hardware
      flopp
      flopp
    • RE: fody weather station, wind sensor

      @gohan
      Ok, thanks.

      I will try it tomorrow

      posted in Hardware
      flopp
      flopp
    • RE: fody weather station, wind sensor

      @gohan said in fody weather station, wind sensor:

      Maybe you need a better heat shield, did you try some aluminum foil?

      Good idea 🙂
      Should I have the foil inside the shield or outside?
      Any pics if you done it yourself?
      I think I need some air through the shield so it can cool down.

      posted in Hardware
      flopp
      flopp
    • RE: fody weather station, wind sensor

      I have not verify all the code yet.
      Wind direction is correct.
      Temp is little bit higher then another temp that I have on shadow so maybe the radiation shield is not working 100%
      Hum: my other sensor that I have outdoor broke a few weeks ago, so nothing to compare with
      Wind Speed: I want to verify with an RPM tool. I get some extra indication from reeed switch.
      Every second indication is below 1000 micros which is 1 millisecond, which is 1000m/s
      Rain: lucky or unlucky I have not had any rain when the mast was up and running

      posted in Hardware
      flopp
      flopp
    • RE: fody weather station, wind sensor

      I am using this water proof connector for USB connection.
      https://www.aliexpress.com/item/Free-Shipping-3-Sets-All-New-4-Pin-Waterproof-Electrical-Wire-Connector-Plug-HID-Male-female/32264045957.html

      in sweden you can buy it at Biltema

      posted in Hardware
      flopp
      flopp
    • RE: fody weather station, wind sensor

      some pictures
      0_1493054883191_20170424_160412832_iOS.jpg 0_1493054891231_20170424_160402858_iOS.jpg 0_1493054901570_20170424_160025939_iOS.jpg 0_1493054908764_20170424_160020368_iOS.jpg

      posted in Hardware
      flopp
      flopp
    • RE: fody weather station, wind sensor

      @sundberg84
      Can upload some later today.
      I found that I have some problem with the NRf, so I need to open it up.
      Will upload new code later today, as well.

      posted in Hardware
      flopp
      flopp
    • RE: Sun / cloud sensor?

      If you use a sensor that measures UV and maybe some other sensors, you can't use all material between sun and the sensors.
      It must be a material that doesn't block UV

      posted in Hardware
      flopp
      flopp
    • RE: fody weather station, wind sensor

      @gohan said in fody weather station, wind sensor:

      @flopp are you still using old library version?

      Yes, this is for 1.5

      Are you going to make it a battery powered node or else?I noticed you didn't use any sleep in the code

      This is powered from a PC, not battery. I want data very often that's why it is not battery powered. I can also change the code if something is wrong.

      posted in Hardware
      flopp
      flopp
    • RE: fody weather station, wind sensor

      It was a HT-01D sensor for measuring temp/hum. It is I2C and address is 0x28.
      I found code for HYT 221 that worked fine.
      https://github.com/stylesuxx/Arduino-HYT-221-I2C

      posted in Hardware
      flopp
      flopp