Navigation

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

    Posts made by Adam Gliński

    • RE: Problem implements MySensors lib

      close topic

      posted in Troubleshooting
      Adam Gliński
      Adam Gliński
    • Problem implements MySensors lib

      Hi
      I have trable to implement the mysensors lib i try programing DHT 22 on my mini but i cant
      default 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.
       *
       *******************************
       *
       * REVISION HISTORY
       * Version 1.0 - Henrik EKblad
       * 
       * DESCRIPTION
       * This sketch provides an example how to implement a humidity/temperature
       * sensor using DHT11/DHT-22 
       * http://www.mysensors.org/build/humidity
       */
       
      #include <SPI.h>
      #include <MySensor.h>  
      #include <DHT.h>  
      
      #define CHILD_ID_HUM 0
      #define CHILD_ID_TEMP 1
      #define HUMIDITY_SENSOR_DIGITAL_PIN 3
      unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
      
      MySensor gw;
      DHT dht;
      float lastTemp;
      float lastHum;
      boolean metric = true; 
      MyMessage msgHum(CHILD_ID_HUM, V_HUM);
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      
      
      void setup()  
      { 
        gw.begin();
        dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); 
      
        // Send the Sketch Version Information to the Gateway
        gw.sendSketchInfo("Humidity", "1.0");
      
        // Register all sensors to gw (they will be created as child devices)
        gw.present(CHILD_ID_HUM, S_HUM);
        gw.present(CHILD_ID_TEMP, S_TEMP);
        
        metric = gw.getConfig().isMetric;
      }
      
      void loop()      
      {  
        delay(dht.getMinimumSamplingPeriod());
      
        float temperature = dht.getTemperature();
        if (isnan(temperature)) {
            Serial.println("Failed reading temperature from DHT");
        } else if (temperature != lastTemp) {
          lastTemp = temperature;
          if (!metric) {
            temperature = dht.toFahrenheit(temperature);
          }
          gw.send(msgTemp.set(temperature, 1));
          Serial.print("T: ");
          Serial.println(temperature);
        }
        
        float humidity = dht.getHumidity();
        if (isnan(humidity)) {
            Serial.println("Failed reading humidity from DHT");
        } else if (humidity != lastHum) {
            lastHum = humidity;
            gw.send(msgHum.set(humidity, 1));
            Serial.print("H: ");
            Serial.println(humidity);
        }
      
        gw.sleep(SLEEP_TIME); //sleep a bit
      }
      
      
      But  i have problem to compilate
      
      
      
      
      
      HumiditySensor:39: error: 'MySensor' does not name a type
      HumiditySensor:44: error: 'MyMessage' does not name a type
      HumiditySensor:45: error: 'MyMessage' does not name a type
      HumiditySensor.ino: In function 'void setup()':
      HumiditySensor:50: error: 'gw' was not declared in this scope
      HumiditySensor:57: error: 'S_HUM' was not declared in this scope
      HumiditySensor:58: error: 'S_TEMP' was not declared in this scope
      HumiditySensor.ino: In function 'void loop()':
      HumiditySensor:75: error: 'gw' was not declared in this scope
      HumiditySensor:75: error: 'msgTemp' was not declared in this scope
      HumiditySensor:85: error: 'gw' was not declared in this scope
      HumiditySensor:85: error: 'msgHum' was not declared in this scope
      HumiditySensor:90: error: 'gw' was not declared in this scope
      

      what i do wrong i add my sensors on MyDocuments/Arduino/libraries

      posted in Troubleshooting
      Adam Gliński
      Adam Gliński
    • RE: Arduino + Raspbbery + Domoticz = Wired system

      ok but is no problem to connect wired sensors on gateway? did i need to cheange somethink on code?

      posted in Domoticz
      Adam Gliński
      Adam Gliński
    • RE: Arduino + Raspbbery + Domoticz = Wired system

      im sorry 🙂 for my google translator english

      I have question can i mix wired connectrion sensors with wireless connectrion sensors to gateway

      posted in Domoticz
      Adam Gliński
      Adam Gliński
    • Arduino + Raspbbery + Domoticz = Wired system

      Hi

      Im new here i have question about all system domoticz + arduino.

      I want make this system on my home
      but everything is done by wireless communication from here my question whether it is possible to combine domoticza with Arduino and rasppberry sleeps in a way wired and wireless ? the point is the part of Sensors will be connected directly to the gate

      posted in Domoticz
      Adam Gliński
      Adam Gliński