Navigation

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

    Posts made by tlpeter

    • RE: question about repeater node

      yes add the line but only on non battery powered nodes.
      If battery powered this will kill battery life.
      I have a couple repeater nodes at home to extend the range.

      posted in Development
      tlpeter
      tlpeter
    • RE: Example code - DallasTemperatureSensor.ino

      In the 2.0 sketch this is mentioned:

      #define COMPARE_TEMP 1 // Send temperature only if changed? 1 = Yes 0 = No
      So 0 should keep everything working and sens info even when not changed.

      posted in Feature Requests
      tlpeter
      tlpeter
    • RE: Example code - DallasTemperatureSensor.ino

      I think you just have to comment out that part of the code (the 5 lines of code)

      posted in Feature Requests
      tlpeter
      tlpeter
    • RE: Which Arduino IDE version?

      Thanks, i would not have found that by myself 😄

      posted in Development
      tlpeter
      tlpeter
    • RE: How to include the battery measurement?

      I will buy one later 😄
      This is just to play with as i wanted to know how the battery measurement works.

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: Which Arduino IDE version?

      And how do i downgrade AVR board devs?

      posted in Development
      tlpeter
      tlpeter
    • RE: How to include the battery measurement?

      I have voltage now and a percentage at the devices.
      Hum and temp do work fine.
      I only sucked all the juice out of the battery so it is charging now by the little solar panel.
      I found out that 2,4V was really the lowest voltage that worked 😄

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: How to include the battery measurement?

      I have the voltage part working and i think also the battery percentage with it.
      I build the sketch like this. Can you have a little look?

      /**
       * 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
       *
       * This is an example that demonstrates how to report the battery level for a sensor
       * Instructions for measuring battery capacity on A0 are available here:
       * http://www.mysensors.org/build/battery
       * 
       */
      
      
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG 
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      
      #include <SPI.h>
      #include <MySensors.h>
      #include <DHT.h>
      
      #define CHILD_ID_BATT 0
      #define CHILD_ID_HUM 1
      #define CHILD_ID_TEMP 2
      
      #define DHT_DATA_PIN 3 // Set this to the pin you connected the DHT's data pin to
      int BATTERY_SENSE_PIN = A0;  // select the input pin for the battery sense point
      
      // Set this offset if the sensor has a permanent small offset to the real temperatures
      #define SENSOR_TEMP_OFFSET 0
      
      static const uint64_t UPDATE_INTERVAL = 30000;
      
      // Force sending an update of the temperature after n sensor reads, so a controller showing the
      // timestamp of the last update doesn't show something like 3 hours in the unlikely case, that
      // the value didn't change since;
      // i.e. the sensor would force sending an update every UPDATE_INTERVAL*FORCE_UPDATE_N_READS [ms]
      static const uint8_t FORCE_UPDATE_N_READS = 10;
      
      //unsigned long SLEEP_TIME = 9000;  // sleep time between reads (seconds * 1000 milliseconds)
      int oldBatteryPcnt = 0;
      
      float lastTemp;
      float lastHum;
      uint8_t nNoUpdatesTemp;
      uint8_t nNoUpdatesHum;
      boolean metric = true; 
      
      MyMessage msgBatt(CHILD_ID_BATT, V_VOLTAGE);
      MyMessage msgHum(CHILD_ID_HUM, V_HUM);
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      DHT dht;
      
      void setup()  
      {
         // use the 1.1 V internal reference
      #if defined(__AVR_ATmega2560__)
         analogReference(INTERNAL1V1);
      #else
         analogReference(INTERNAL);
      #endif
      //}
      
      {
      dht.setup(DHT_DATA_PIN); // set data pin of DHT sensor
        if (UPDATE_INTERVAL <= dht.getMinimumSamplingPeriod()) {
          Serial.println("Warning: UPDATE_INTERVAL is smaller than supported by the sensor!");
        }
        // Sleep for the time of the minimum sampling period to give the sensor time to power up
        // (otherwise, timeout errors might occure for the first reading)
        sleep(dht.getMinimumSamplingPeriod());
      }
      }
      void presentation() {
         // Send the sketch version information to the gateway and Controller
         sendSketchInfo("Battery Meter", "1.0");
      
         present(CHILD_ID_BATT, S_MULTIMETER);
         wait(20);
         present(CHILD_ID_HUM, S_HUM);
         wait(20);
         present(CHILD_ID_TEMP, S_TEMP);
         wait(20);
         metric = getConfig().isMetric;
      
      }
      void loop()
      {
         // get the battery Voltage
         int sensorValue = analogRead(BATTERY_SENSE_PIN);
         #ifdef MY_DEBUG
         Serial.println(sensorValue);
         #endif
         
         // 1M, 470K divider across battery and using internal ADC ref of 1.1V
         // Sense point is bypassed with 0.1 uF cap to reduce noise at that point
         // ((1e6+470e3)/470e3)*1.1 = Vmax = 3.44 Volts
         // 3.44/1023 = Volts per bit = 0.003363075
         
         int batteryPcnt = sensorValue / 10;
      
         #ifdef MY_DEBUG
         float batteryV  = sensorValue * 0.003363075;
         Serial.print("Battery Voltage: ");
         Serial.print(batteryV);
         Serial.println(" V");
      
         Serial.print("Battery percent: ");
         Serial.print(batteryPcnt);
         Serial.println(" %");
         #endif
      
         if (oldBatteryPcnt != batteryPcnt) {
           // Power up radio after sleep
           send(msgBatt.set(batteryV, 1));
          //sendBatteryLevel(batteryPcnt);
           oldBatteryPcnt = batteryPcnt;
         }
      
         {  
        // Force reading sensor, so it works also after sleep()
        dht.readSensor(true);
        
        // Get temperature from DHT library
        float temperature = dht.getTemperature();
        if (isnan(temperature)) {
          Serial.println("Failed reading temperature from DHT!");
        } else if (temperature != lastTemp || nNoUpdatesTemp == FORCE_UPDATE_N_READS) {
          // Only send temperature if it changed since the last measurement or if we didn't send an update for n times
          lastTemp = temperature;
          if (!metric) {
            temperature = dht.toFahrenheit(temperature);
          }
          // Reset no updates counter
          nNoUpdatesTemp = 0;
          temperature += SENSOR_TEMP_OFFSET;
          send(msgTemp.set(temperature, 1));
      
          #ifdef MY_DEBUG
          Serial.print("T: ");
          Serial.println(temperature);
          #endif
        } else {
          // Increase no update counter if the temperature stayed the same
          nNoUpdatesTemp++;
        }
      
        // Get humidity from DHT library
        float humidity = dht.getHumidity();
        if (isnan(humidity)) {
          Serial.println("Failed reading humidity from DHT");
        } else if (humidity != lastHum || nNoUpdatesHum == FORCE_UPDATE_N_READS) {
          // Only send humidity if it changed since the last measurement or if we didn't send an update for n times
          lastHum = humidity;
          // Reset no updates counter
          nNoUpdatesHum = 0;
          send(msgHum.set(humidity, 1));
          
          #ifdef MY_DEBUG
          Serial.print("H: ");
          Serial.println(humidity);
          #endif
        } else {
          // Increase no update counter if the humidity stayed the same
          nNoUpdatesHum++;
        }
         //sleep(SLEEP_TIME);
         sleep(UPDATE_INTERVAL);
         }}```
      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: How to include the battery measurement?

      I have voltage now (utility) and a percentage under devices.
      I have read somewhere that the percentage is depending on the last sensors poll so i will now try to add the DHT part in to the sketch.

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: How to include the battery measurement?

      sendBatteryLevel doesn't do anything.
      I have modified it a bit and now i have some readings.
      I will do a bit more playing to see where i will end.

      posted in Troubleshooting
      tlpeter
      tlpeter
    • How to include the battery measurement?

      I am trying to build a sensor with a DHT22 and for now on a solar panel and a battery.
      I want to see the battery level within Domoticz.
      I cannot seem to merge both the battery sketch and the DHT sketch together.
      Most of the times i get an error about a { being in a place where it should not belong.
      I think i lost it 😃 and i am going mad soon.
      Also how to send the battery level to Domoticz? i tried the battery sketch alone and nothing happens.

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: Ethernet Gateway On Arduino Mega 2056 Issues

      I have this error also with a ENC28J60 module.
      I have used the 1.6.8/9 and 11 ide but that doesn't matter.
      This was on an Nano by the way.

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: Repeater node stops sending sensor info

      Ha ha, just saw that i already ordered some LE33 converters 😄
      I forgot about those.

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: Repeater node stops sending sensor info

      I think i will invest in suck a buck converter.
      There is still plenty coming over from China so many projects to build and i rather do it right the first time.

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: Repeater node stops sending sensor info

      I agree on that but could it be the same power supply?
      In this case it is a 5V 2A phone charger which should be fine in my honest opinion.
      All i have on this node is a radio and a rainsensor like this.

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: Overloading the Arduino delay

      For sure i want it to learn too as it is frustrating thinking you are doing it right but have nothing but trouble 😄

      posted in Feature Requests
      tlpeter
      tlpeter
    • RE: Repeater node stops sending sensor info

      I think it is a power issue.
      When connected to my laptop by USB (nano 5V) i have no major issues but i see this in the beginning:
      !TSM:FPAR:FAIL
      !TSM:FAILURE
      TSM:PDT

      After using a phone charger it takes a long time before the node is seen within Domoticz.
      Right now i use a 4,7uF capacitor.
      Would replacing the capacitor with a 100uF makes sense?

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: Overloading the Arduino delay

      @TheoL , i saw that there is a workshop but unfortunally i am very busy coming week so i can't come.
      I will need some more time learning the code.
      Funny i enough i used a wait for my rain sensor (moisture sketch with analog instead of digital)
      I remove the wait and it is running much better.

      posted in Feature Requests
      tlpeter
      tlpeter
    • RE: Overloading the Arduino delay

      That would be very usefull.
      Like me many people like to work with there hands and copy code.
      I am in code a little bit but not enough to build my own code.
      When i see code than most of it i understand.

      posted in Feature Requests
      tlpeter
      tlpeter
    • RE: Repeater Node, problems

      I have two which are powered (nano) with USB and both in the same place (garage)
      They both are repeater nodes and i think they both have issues connecting to the nearest repeater node.

      posted in Domoticz
      tlpeter
      tlpeter
    • RE: Repeater Node, problems

      I seem to have the same issue. I just opened a topic about it.
      One or two nodes just stop sending and i am not sure if this is because there isn't a change in the reading or not.
      After rebooting the node it goes well for sometimes hours and sometimes just minutes.

      posted in Domoticz
      tlpeter
      tlpeter
    • RE: Repeater node stops sending sensor info

      That is quick 😄
      I will check ik out later.
      Thanks

      posted in Troubleshooting
      tlpeter
      tlpeter
    • Repeater node stops sending sensor info

      I have an issue where a node stops sending sensor info after a while.
      I do not have a log (yet) but i am wondering if a range issue would cause this.
      Which reasons could cause a node stop sending info to the gateway?

      If needed i can made a log later as i need my laptop connected to it and i cannot reach it at the moment.

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: Easy/Newbie PCB for MySensors

      I didn't use your board in this case (the weather station) but i will do in the future.
      I did connect the battery to the raw pin and it is working fine.
      Funny, a solar panel with a battery powering the pro mini with DHT22 and BMP180.
      For now i will keep it simple but later on i want a rain gauge and windmeter too.
      Rain sensor is on a different Nano as this needs to be powered all the time.
      It will control my sunscreen later on.

      posted in Hardware
      tlpeter
      tlpeter
    • RE: Conversion to mysensors 2.0 for BMP180

      I just installed my own type of weather station with a BMP180 and the 2.0 sketch works fine.
      I think you are doing something wrong 😄

      posted in Development
      tlpeter
      tlpeter
    • RE: Easy/Newbie PCB for MySensors

      Ok, very clear.
      So now i have a new question, i want to use a solar panel and a battery but this will go above the 3.7V when there is light and the battery pack is 3.7V so i must use the raw connection.
      I also want to measure the battery and i think this needs PWR 😃

      Can i do this?

      I want to build the solar powered mini weather station:

      https://forum.mysensors.org/topic/841/solar-powered-mini-weather-station

      Thanks already.

      posted in Hardware
      tlpeter
      tlpeter
    • RE: Easy/Newbie PCB for MySensors

      I do have some questions 😃

      I think i got it a bit. When i use a 3,3V mini then i do not need the 3,3V regulator and it is powered with a battery. If i use a 5V mini then i need the regulator. Is this correct?

      Do i need the booster if batteries are used?

      How about the RAW option? How does it go to 5V? i need the regulator to go to 3,3V so how do i loose the 6-12V 😃

      posted in Hardware
      tlpeter
      tlpeter
    • RE: Getting started

      You will need a gateway connected to your controller (openhab or MQTT) which can be a nano.
      You will need a sensor on a node (can be also a nano or a different arduino board.
      Each node and the gateway needs to have a radio.

      Begin reading from here:

      https://www.mysensors.org/build/

      posted in General Discussion
      tlpeter
      tlpeter
    • RE: Mysensors Ethernet GW w5100 problem

      @mrc-core said:

      @tlpeter
      Ok it's fix i cant ping the gw ip but domoticz can see the new arduino gw.

      Now at the gw i'm getting this message:
      0;255;3;0;9;TSP:MSG:READ 192-1-0 s=0,c=0,t=0,pt=0,l=0,sg=0:
      0;255;3;0;9;!TSP:MSG:PVER mismatch
      0;255;3;0;9;TSP:MSG:READ 192-1-0 s=0,c=0,t=0,pt=0,l=0,sg=0:
      0;255;3;0;9;!TSP:MSG:PVER mismatch

      I don't undestand this mismatch

      I think VER is for version and maybe (a wild guess) the P for protocol???
      Which version Domoticz are you running? try the latest beta.
      Is/are your gateway(s) upgraded too?

      posted in Domoticz
      tlpeter
      tlpeter
    • RE: Library 2.0 - No Humidity sketch

      I don't know either and i remember that there should be a zip file which you can download.
      I only cannot remember where.
      For now you can copy the code and save it.

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: Library 2.0 - No Humidity sketch

      Did you download the new examples? they are not included anymore.
      Here you can find them:

      https://github.com/mysensors/MySensorsArduinoExamples/tree/master/examples

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: Mysensors Ethernet GW w5100 problem

      In your previous example you use pin 14,15 and 16 next to 5 and 6.
      This is what the example on the site says:

      Arduino NRF24L01 Radio Ethernet module
      GND GND GND
      3.3V VCC VCC
      13 SCK SCK
      12 MISO MISO/SO
      11 MOSI MOSI/SI
      10 SS/CS
      6 CSN
      5 CE

      Use the pinout on the gateway example page.

      posted in Domoticz
      tlpeter
      tlpeter
    • RE: Library 2.0 - No Humidity sketch

      It is there and is called

      DhtTemperatureAndHumiditySensor

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: Mysensors Ethernet GW w5100 problem

      I see a lot off temp directory so your sketch is not saved in the correct library.
      Open the gateway from the my documents folder:

      C:\Users\Marco\Documents\Arduino\libraries\MySensors-master\examples\GatewayENC28J60

      That is the example i used.

      posted in Domoticz
      tlpeter
      tlpeter
    • RE: Mysensors Ethernet GW w5100 problem

      That is because UDP is enabled, if you uncomment the gateway stuff for the ENC28J60 then it compiles because UDP can be enabled now.

      So remove the comment lines and add #define MY_USE_UDP at the end like suggested.

      posted in Domoticz
      tlpeter
      tlpeter
    • RE: Mysensors Ethernet GW w5100 problem

      @mrc-core said:

      C:\Users\marco\Documents\Arduino\libraries\MySensors

      Did you put the sketch in this folder?

      posted in Domoticz
      tlpeter
      tlpeter
    • RE: Mysensors Ethernet GW w5100 problem

      Sure i can:

      /**
       * 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
       * Contribution by a-lurker and Anticimex,
       * Contribution by Norbert Truchsess <norbert.truchsess@t-online.de>
       * Contribution by Tomas Hozza <thozza@gmail.com>
       *
       *
       * DESCRIPTION
       * The EthernetGateway sends data received from sensors to the ethernet link.
       * The gateway also accepts input on ethernet interface, which is then sent out to the radio network.
       *
       * The GW code is designed for Arduino 328p / 16MHz.  ATmega168 does not have enough memory to run this program.
       *
       * LED purposes:
       * - To use the feature, uncomment WITH_LEDS_BLINKING in MyConfig.h
       * - 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
       *
       * See http://www.mysensors.org/build/ethernet_gateway for wiring instructions.
       *
       */
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG 
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      
      // When ENC28J60 is connected we have to move CE/CSN pins for NRF radio
      #define MY_RF24_CE_PIN 5
      #define MY_RF24_CS_PIN 6
      
      // Enable gateway ethernet module type 
      #define MY_GATEWAY_ENC28J60
      
      // Gateway IP address
      #define MY_IP_ADDRESS 10,0,0,25  
      
      // The port to keep open on node server mode / or port to contact in client mode
      #define MY_PORT 5003   
      
      // Controller ip address. Enables client mode (default is "server" mode). 
      // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere. 
      //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 254   
       
      // The MAC address can be anything you want but should be unique on your network.
      // Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use.
      // Note that most of the Ardunio examples use  "DEAD BEEF FEED" for the MAC address.
      #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
      
      // Flash leds on rx/tx/err
      #define MY_LEDS_BLINKING_FEATURE
      // Set blinking period
      #define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      // Enable inclusion mode
      #define MY_INCLUSION_MODE_FEATURE
      // Enable Inclusion mode button on gateway
      #define MY_INCLUSION_BUTTON_FEATURE
      // 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 
      
      #define MY_DEFAULT_ERR_LED_PIN 7  // Error led pin
      #define MY_DEFAULT_RX_LED_PIN  8  // Receive led pin
      #define MY_DEFAULT_TX_LED_PIN  9  // the PCB, on board LED
      
      #include <SPI.h>
      #include <UIPEthernet.h>
      #include <MySensors.h>
      
      void presentation()
      {
        // Send the sketch version information to the gateway and Controller
      
        sendSketchInfo("Ethernet GW", "1,0");
      }
      void setup()
      {
      }
      
      void loop() {
      }
      
      posted in Domoticz
      tlpeter
      tlpeter
    • RE: Mysensors Ethernet GW w5100 problem

      Can you still ping when it is disconnected? (IP conflict)
      Maybe power related?

      posted in Domoticz
      tlpeter
      tlpeter
    • RE: Mysensors Ethernet GW w5100 problem

      Can you ping it?

      posted in Domoticz
      tlpeter
      tlpeter
    • RE: Mysensors Ethernet GW w5100 problem

      Can you show the sketch?
      I succesfully connected a ENC28J60 gateway and connected fine.

      posted in Domoticz
      tlpeter
      tlpeter
    • RE: Skech using DHT11/LDR and SoilMoisture from itead. (Solved solution inside)

      I use V_LEVEL and S_MOISTURE for a moisture sensor.
      The percentage part is something i am going to try for sure.

      posted in Development
      tlpeter
      tlpeter
    • RE: Mysensors Ethernet GW w5100 problem

      I have had that with a serial gateway where is used a radio with external antenna.
      After switching to a normal radio the problems where gone.
      I had it connected to a RPI3 and it seemed to be a power issue as it was working fine connected to my laptop.

      posted in Domoticz
      tlpeter
      tlpeter
    • RE: Dallas Temp failure to compile

      I uninstalled that too.
      I really removed everything.
      Uninstalled arduino and removed the folders in the program files folder and the my documents folder too.

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: Dallas Temp failure to compile

      I removed everything and started from scratch and after that i copied the mysensors-master library.

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: Dallas Temp failure to compile

      I tihnk so, i used libraries that i was pointed too as they are moved.
      All other sensors i have been playing with are working fine.

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: Dallas Temp failure to compile

      Thanks, that works fine.
      How come that i have an old library? i use the 2.0.0 version
      Is this perhaps a known issue which will be fixed soon?

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: Dallas Temp failure to compile

      @Hermann-Kaiser said:

      @tlpeter
      This is my function to read all Sensors. You have to give the Sensor time to do the measuring and make the result available.
      I've commented everything out to get the min wait time. It is defined in the Datasheet of the Sensor
      alt text
      If you wait or sleep for 750ms you are save. Depending on the resultion of the sensor you can wait a bit less.

      void readDallasSensors()
      {
        // Fetch temperatures from Dallas sensors
        TempSensors.requestTemperatures();
        // query conversion time and sleep until conversion completed
        //int16_t conversionTime = TempSensors.millisToWaitForConversion(TempSensors.getResolution());
        // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
        sleep(750);
        // Read temperatures and send them to controller
        for (int i = 0; i < numTempSensors && i < MAX_ATTACHED_DS18B20; i++)
        {
          // Fetch and round temperature to one decimal
          float temperature = TempSensors.getTempCByIndex(i);
      #ifdef DEBUG
          SPrint(Temperature: );
          Serial.println(temperature, 1);
      #endif
      
          // Only send data if temperature has changed and no error
          if (abs(lastTemperature[i] - temperature) >= 0.1 && temperature != -127.00 && temperature != 85.00)
          {
            // Send in the new temperature
            send(msg.setSensor(i).set(temperature, 1));
            // Save new temperatures for next compare
            lastTemperature[i] = temperature;
          }
        }
      

      That indeed works but still the example has some kind of an error or is not good enough for beginners like me 🙂
      Thanks, this works fine.

      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: Dallas Temp failure to compile

      It does not compile an di am not the only one saying that.
      See this error:

      Arduino: 1.6.9 (Windows 10), Board: "Arduino/Genuino Uno"
      
      In file included from C:\Users\Peter\AppData\Local\Temp\arduino_modified_sketch_224748\DallasTemperatureSensor.ino:37:0:
      
      C:\Users\Peter\Documents\Arduino\libraries\DallasTemperature/DallasTemperature.h: In function 'void loop()':
      
      C:\Users\Peter\Documents\Arduino\libraries\DallasTemperature/DallasTemperature.h:252:13: error: 'int16_t DallasTemperature::millisToWaitForConversion(uint8_t)' is private
      
           int16_t millisToWaitForConversion(uint8_t);
      
                   ^
      
      DallasTemperatureSensor:81: error: within this context
      
         int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
      
                                                                                           ^
      
      exit status 1
      within this context
      
      This report would have more information with
      "Show verbose output during compilation"
      option enabled in File -> Preferences.
      
      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: Dallas Temp failure to compile

      Is there any resolution for this?
      I am facing the same problem and i do not know how to fix this.

      Edit, i found something.
      You need to comment out these lines:

      Only this way it compiles and sensors do work.
      I don't know what happens so maybe somebody with knowledge can explain this?

      //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);```
      posted in Troubleshooting
      tlpeter
      tlpeter
    • RE: KY015 - Humidity and Temperature 2.0.x

      Two days ago i got two through the mailbox and two at the postal office.

      posted in Development
      tlpeter
      tlpeter
    • RE: Easy/Newbie PCB for MySensors

      I have ordered some boards and i am looking forward to play with them.
      I tried soldering some part and a nano on a soldering board but apparently my soldering skills and patience isn't what it used to be in the past.
      @sundberg84 it looks good.

      posted in Hardware
      tlpeter
      tlpeter
    • RE: Step-by-step procedure to connect the NRF24L01+ to the GPIO pins and use the Raspberry as a Serial Gateway (MySensors 1.x)

      I also have a serial gateway next to my raspberry (3 in this case) with Domoticz on it.
      If there is an issue than at least a part is still running without breaking everything.
      I am using zwave at most and mysensors now for playing.
      I cannot break the current zwave implementation so for me a serial gateway is the best solution.
      For playing around you might just try as i imaging it could be fun to do it.

      posted in Hardware
      tlpeter
      tlpeter
    • RE: Raindrops Detection under v2

      You're welcome.
      It was for me also a struggle to get it working.

      posted in My Project
      tlpeter
      tlpeter
    • RE: MySensors 2.0 support

      Indeed the moisture/rain sensor.

      posted in Domoticz
      tlpeter
      tlpeter
    • RE: Raindrops Detection under v2

      Hi Dave,

      Funny as i had the same problem.
      I tried using the digital pin with i could not get to work so i am using the A0 port now so have more than on and off.

      This is the sketch i am using and i use moisture as output to Domoticz:

      /**
       * 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 - Felix Haverkamp
       * 
       * DESCRIPTION
       * Example sketch sending soil moisture in percentage alarm to controller 
       * 
       */
      // Enable debug prints
      #define MY_DEBUG
      
      // Enable and select radio type attached 
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      //#define MY_RS485
      
      #include <SPI.h>
      #include <MySensors.h>  
       
      #define CHILD_ID 0   // Id of the sensor child
       
      int mostureSensor = 0;   // ANALOG Pin for Soil sensor, usally A0
      
      MyMessage msg(CHILD_ID, V_LEVEL);
      int lastSoilValue = -1;
       
      void presentation()  
      { 
        
       
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Regensensor", "1.0");
        // Register all sensors to gw (they will be created as child devices)  
        present(CHILD_ID, S_MOISTURE);
      }
       
      void loop()     
      {     
       
       
        int soilValue = map(analogRead(mostureSensor), 0, 1024, 100, 0);
       
        if (soilValue != lastSoilValue) {
          Serial.println(soilValue);
          send(msg.set(soilValue));
          lastSoilValue = soilValue;
        }
      sleep(3000);
      }
      
      posted in My Project
      tlpeter
      tlpeter
    • RE: MySensors 2.0 support

      I have seen and used that one with a DHT22 and it is working well.
      I am using the rain sensor mentioned in the moisture example.
      But i will try it as there is a moisture sensor on it's way also.

      posted in Domoticz
      tlpeter
      tlpeter
    • RE: MySensors 2.0 support

      @hek said:

      @tlpeter said:

      I am a beginner and i am struggling to convert the already excisting examples which are based on 1.5

      All of the existing examples have been converted already. You'll find them here:

      https://github.com/mysensors/MySensors/tree/development/examples

      and here:

      https://github.com/mysensors/MySensorsArduinoExamples/tree/master/examples

      I do not see the moisture sketch or is it renamed?
      I now have it working with the A0 pin but i cannot get it working with the D3 pin (the other example)
      I will keep trying as i think i was a bit too far away from the gateway.
      I also read somewhere that you need a little bit bigger capacitor now for the radio?

      posted in Domoticz
      tlpeter
      tlpeter
    • RE: MySensors 2.0 support

      Be aware that you have to rewrite your sketches.
      I am a beginner and i am struggling to convert the already excisting examples which are based on 1.5

      posted in Domoticz
      tlpeter
      tlpeter
    • Trying to convert a rain sensor sketch. get a fail error

      Hi,

      I am trying to convert a rain sensor sketch but it just doens't seem to work.
      I am just trying to learn MySensors and i got a couple nodes with a DHT22 sensor working connected to Domoticz by a serial gateway.

      When i try to build a rain sensor then i see this error a lot:

      !TSM:FPAR:FAIL
      !TSM:FAILURE
      TSM:PDT

      Starting sensor (RNNNA-, 2.0.0)
      TSM:INIT
      TSM:RADIO:OK
      TSP:ASSIGNID:OK (ID=2)
      TSM:FPAR
      TSP:MSG:SEND 2-2-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSM:FPAR
      TSP:MSG:SEND 2-2-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSM:FPAR
      TSP:MSG:SEND 2-2-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSM:FPAR
      TSP:MSG:SEND 2-2-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      !TSM:FPAR:FAIL
      !TSM:FAILURE
      TSM:PDT
      TSM:INIT
      TSM:RADIO:OK
      TSP:ASSIGNID:OK (ID=2)
      TSM:FPAR
      TSP:MSG:SEND 2-2-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSM:FPAR
      TSP:MSG:SEND 2-2-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSM:FPAR
      TSP:MSG:SEND 2-2-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSM:FPAR
      TSP:MSG:SEND 2-2-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      !TSM:FPAR:FAIL
      !TSM:FAILURE
      TSM:PDT```
      
      

      Can somebody tell me what i am doing wrong?
      This is what i have as a sketch:

      // Enable debug prints
      #define MY_DEBUG
      
      // Enable and select radio type attached 
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      //#define MY_RS485
      
      
      #include <SPI.h>
      #include <MySensors.h>  
      
      #define DIGITAL_INPUT_SOIL_SENSOR 3   // Digital input did you attach your soil sensor.  
      #define INTERRUPT DIGITAL_INPUT_SOIL_SENSOR-2 // Usually the interrupt = pin -2 (on uno/nano anyway)
      #define CHILD_ID 0   // Id of the sensor child
      
      MyMessage msg(CHILD_ID, V_TRIPPED);
      int lastSoilValue = -1;
      
      void presentation()  
      {
        // Send the sketch version information to the gateway
        sendSketchInfo("RainSensor", "1.0");
      // Register all sensors to gw (they will be created as child devices)
          present(CHILD_ID, S_MOTION);
      }
      void setup()  
      { 
        // sets the soil sensor digital pin as input
        pinMode(DIGITAL_INPUT_SOIL_SENSOR, INPUT);      
      }
       
      void loop()     
      {     
        // Read digital soil value
        int soilValue = digitalRead(DIGITAL_INPUT_SOIL_SENSOR); // 1 = Not triggered, 0 = In soil with water 
        if (soilValue != lastSoilValue) {
          Serial.println(soilValue);
          send(msg.set(soilValue==0?1:0));  // Send the inverse to gw as tripped should be when no water in soil
          lastSoilValue = soilValue;
        }
        // Power down the radio and arduino until digital input changes.
        sleep(INTERRUPT,CHANGE);
      }
      
      
      posted in Troubleshooting
      tlpeter
      tlpeter