Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
F

flopp

@flopp
About
Posts
591
Topics
54
Shares
0
Groups
0
Followers
2
Following
0

Posts

Recent Best Controversial

  • S_Heater
    F flopp

    Home Assistant 2022.12.6
    Supervisor 2022.11.2
    Operating System 9.4
    Frontend 20221213.0 - latest

    I know that S_Heater is not supported.

    Are there any plans to support it?

    I get this error:

    WARNING (MainThread) [homeassistant.components.mysensors.helpers] Child type 14 is not supported
    
    Home Assistant

  • Selling: Temp, Hum Si7021
    F flopp

    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

    Hardware

  • How To - Doorbell Automation Hack
    F flopp

    @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
    
    My Project

  • How To - Doorbell Automation Hack
    F flopp

    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?

    My Project

  • Error: Serial Port closed!... Error: End of file..
    F flopp

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

    Troubleshooting

  • Error: Serial Port closed!... Error: End of file..
    F flopp

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

    Troubleshooting

  • Shunt motor/valve
    F flopp

    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.
    https://youtu.be/dXlzkhmw8aU

    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);
        }
      }
    }
    
    My Project

  • Repeater getting NACK
    F flopp

    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

    Domoticz

  • Repeater getting NACK
    F flopp

    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.

    Domoticz

  • Repeater getting NACK
    F flopp

    @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++;
    }
    
    Domoticz

  • Measure a node's NRF signal or distance value
    F flopp

    Thanks.

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

    RF24_PA_LEVEL

    General Discussion

  • Repeater getting NACK
    F flopp
    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?

    Domoticz

  • Measure a node's NRF signal or distance value
    F flopp

    @flopp
    Anyone?

    General Discussion

  • Measure a node's NRF signal or distance value
    F flopp

    @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

    General Discussion

  • Sensebender gateway local sensor
    F flopp

    @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.

    General Discussion

  • [Solved] Repeater node causing Problems
    F flopp

    I have had very strange errors and I don't know what I found out. :neutral_face:
    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? :)

    Troubleshooting

  • How to purchase mysensors SW protocol stack, instead of donation
    F flopp

    @hek
    Thanks

    ops, they want taxes all the time :white_frowning_face:

    General Discussion

  • How to purchase mysensors SW protocol stack, instead of donation
    F flopp

    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?

    General Discussion

  • About DS18B20 onewire.
    F flopp

    @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?

    Hardware dallas one wire onewire ds18b20

  • About DS18B20 onewire.
    F flopp
    /**
     * 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);
    }
    
    Hardware dallas one wire onewire ds18b20
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular