Navigation

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

    Posts made by giangired

    • RE: How to get the bad status (red) for Temperature Node

      Thanks everyone for the answers. However what I would like to do is create a routine with Dzvents that when I have the "red" indication (as shown in the image) causes a switch to operate which cuts the voltage to a device. The value of ".lastUpdate.minutesAgo" seems not to be the right solution because it continues to be increased in any case, regardless of the temperature value and the status of the "red" or normal indication.

      posted in Domoticz
      giangired
      giangired
    • How to get the bad status (red) for Temperature Node

      Hi to all.
      I need to act in case of my temperature node is not updating the value since time. Practically when the screen shows a "red line" on the upper left side (see below picture), I need to get the bad status and provide an action. I searched on forum with no success. I tried to use ".lastUpdate.minutesAgo" but it seems not to be the right way.
      May someone help me to finde the right parameter to check?

      redrectangle.jpg

      posted in Domoticz
      giangired
      giangired
    • RE: Sometimes DomoticZ doesn't receive data from nodes

      Found the solution. I used

      asm volatile (" jmp 0 "); // reset
      

      to reboot the node each hour (or any other timing) .

      posted in Domoticz
      giangired
      giangired
    • Sometimes DomoticZ doesn't receive data from nodes

      Hi everybody. I created my MySensors home network based on DomoticZ loaded into Raspberry PI and several nodes based on Arduino Pro Mini (16, 5V), DHT22 and W5100 ethernet card. Basically the network is based on Ethernet (wired) and is used to collect temp and hum from every room in my house and through DomoticZ control the temperature room by room. Sometimes few nodes (not always the same, it happen randomly) are not receveid by DomoticZ. If I reboot the node then it starts to be gathered by DomoticZ again. Can you suggest me how to solve this issue? I read the forum to check if the node autoreboot is feasible but (if I well understood ) it seems to be not possible. May someone of you help me?

      posted in Domoticz
      giangired
      giangired
    • RE: Coronavirus (way, way, off topic)

      Hi guys from Italy. I live in one of the most interested areas by the Virus and I can say that the situation is very bad. I read some of you refer to older people as the main group touched by the virus. That's obviously true but our doctors start to say that the last days people around 50 years old are now increasing in the intensive care units. So, since you all have more time than us, please stay at home and avoid any possible contact with others because this virus is very aggressive. Take care!

      posted in General Discussion
      giangired
      giangired
    • RE: ENC28J60 and EtherCard

      Finally I've solved. I'm still using UIPEthernet sincee my problem was the use of DHT library (last rev) with UIPEhernet lib.
      I was having a restart of teh ETH port each time I was reading Temp/hum. I've changed into SimpleDHT lib and now it's working fine. I'm using a mix of W5100 and ENC28J60.

      posted in My Project
      giangired
      giangired
    • ENC28J60 and EtherCard

      Hallo. I would like to use EtherCard lib with ENC28J60: is it possible? The only example I see on Build section is created by using UIPEthernet lib. Is there any code example to create a gateway with EtherCard library? Is anyone using ENC28J60 based gateway together with EtherCard?
      I some haveing some problem with UIPEthernet since I receive ETH:FAIL and I cannot ping my gateway. The ENC28J60 module is working because if I compile an example with EtherCard I can ping it; similarly, I've created a web server and it's working.

      posted in My Project
      giangired
      giangired
    • RE: DHT11, W5100, OLED display node

      @mfalkvidd Thanks a lot as usual! Any I cannot download the libraries: can you give me some instructions to load on my Arduino tool?

      posted in My Project
      giangired
      giangired
    • DHT11, W5100, OLED display node

      Hi.
      I have a node composed by Arduino Nano, DHT11 sensor, mini W5100 ethernet shield and OLED 128x32 display.
      I'm using Adafruit GFX library to control the OLED display.
      The problem is the code size that seems to be more than 32K therefore I cannot compile it.
      I tried to squeeze the code but with no success. Any help? Suggestion?

      Here my code

      // ----------------------------------------------------------- Definitions
      #define MY_DEBUG
      
      #define MY_GATEWAY_W5100
      #define MY_IP_ADDRESS 192,168,1,71
      #define MY_PORT 5070
      
      #define CHILD_ID_HUM 0
      #define CHILD_ID_TEMP 1
      
      #define MY_MAC_ADDRESS 0x00, 0x01, 0x02, 0x03, 0x04, 0x05
      
      // Set this to the pin you connected the DHT's data pin to
      #define DHT_DATA_PIN 3
      
      // If any Permanent Small Offset to the real temperatures in °C
      #define SENSOR_TEMP_OFFSET 0
      
      // OLED SSD1306 
      #define SCREEN_WIDTH 128 // OLED display width, in pixels
      #define SCREEN_HEIGHT 32 // OLED display height, in pixels
      
      // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
      #define OLED_RESET     4 // Reset pin # (or -1 if sharing Arduino reset pin)
      
      #define COLORBLACK 0x0000 // BLACK
      
      // ----------------------------------------------------------- Libraries
      #include <Ethernet.h>
      //#include <SPI.h>
      #include <MySensors.h>
      #include <DHT.h>
      #include <Adafruit_GFX.h>
      #include <Adafruit_SSD1306.h>
      
      // ----------------------------------------------------------- Variables
      
      // Sleep time between sensor updates (in milliseconds)
      // Must be >1000ms for DHT22 and >2000ms for DHT11
      static const uint64_t UPDATE_INTERVAL = 5000;
      bool metric = true;
      
      MyMessage msgHum(CHILD_ID_HUM, V_HUM);
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      DHT dht;
      
      unsigned long startMillis;  //some global variables available anywhere in the program
      unsigned long currentMillis;
      const unsigned long period = 2000;  //the value is a number of milliseconds
      
      Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
      
      
      bool FirstTime; // to execute an action once only
      
      // ----------------------------------------------------------- Functions
      
      void presentation()  
      {
         sendSketchInfo("Temp/Humidity Soggiorno", "1.0");
         present(CHILD_ID_HUM, S_HUM);
         present(CHILD_ID_TEMP, S_TEMP);
      
         metric = getControllerConfig().isMetric;
      }
      
      
      void setup()
      {
      //---------------------------------------------------------- Serial Begin
      Serial.begin(9600);
      //---------------------------------------------------------- DHT11
        dht.setup(DHT_DATA_PIN); // set data pin of DHT sensor
        
        if (UPDATE_INTERVAL <= dht.getMinimumSamplingPeriod()) 
        {
          #ifdef MY_DEBUG
          Serial.println("Warning: UPDATE_INTERVAL is smaller than supported by the sensor!");
          #endif
        }
        
        // 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());
      
      //---------------------------------------------------------- OLED SSD1306
      // SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
        if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) // Address 0x3C for 128x32
        { 
          #ifdef MY_DEBUG
          Serial.println(F("SSD1306 allocation failed"));
          #endif
          for(;;); // Don't proceed, loop forever
        }
      
        // Show initial display buffer contents on the screen the library initializes this with an Adafruit splash screen.
        display.display();
        delay(500); // Pause for 0,5 second
      
        // Clear the buffer
        display.clearDisplay();
      
        display.setTextSize(2); // Draw 2X-scale text
        display.setTextColor(SSD1306_WHITE);
      
        display.setCursor(2, 16);
        display.println(F("Waiting...."));
        display.display();      // Show initial text
        delay(100);
      
        // Variable to make action just the first time
        FirstTime = true;
       
      //---------------------------------------------------------- Timing
        startMillis = millis();  //initial start time
      }
      
      
      void loop()      
      {  
        bool changed; // to note the change of value
        
      //---------------------------------------------------------- Verify Timing for Reading    
        currentMillis = millis();  //get the current "time" (actually the number of milliseconds since the program started)
        if (currentMillis - startMillis >= period)  //test whether the period has elapsed
        {
          startMillis = currentMillis;  
          changed = false;
        
      //---------------------------------------------------------- WakeUp Sensor
          dht.readSensor(true);
      
      //---------------------------------------------------------- Temperature    
          int temperature = dht.getTemperature();
          
          if (isnan(temperature)) 
          {
            #ifdef MY_DEBUG
            Serial.println("Failed reading temperature from DHT!");
            #endif
          } 
          else 
          {
            // apply the offset before converting to something different than Celsius degrees
            temperature += SENSOR_TEMP_OFFSET;
             if (!metric) 
             {
                temperature = dht.toFahrenheit(temperature);
             }
             send(msgTemp.set(temperature, 1));
            #ifdef MY_DEBUG
            Serial.print("T: ");
            Serial.println(temperature);
            #endif
            
            changed = true;
            CancellaQuadro();
      
            display.setCursor(64, 0);
            display.print(temperature);
          } 
      //---------------------------------------------------------- Humidity    
          int humidity = dht.getHumidity();
          
          if (isnan(humidity)) 
          {
            #ifdef MY_DEBUG
            Serial.println("Failed reading humidity from DHT");
            #endif
          } 
          else 
          {
             send(msgHum.set(humidity, 1));
            #ifdef MY_DEBUG
            Serial.print("H: ");
            Serial.println(humidity);
            #endif
      
            if (changed == false)
            {
                CancellaQuadro();
            }
            display.setCursor(64, 18);
            display.print(humidity);
          } 
          display.display();      
          delay(100);
        }
      }
      
      void CancellaQuadro(void) {
          if (FirstTime == true)
          {
            display.clearDisplay();
            display.setCursor(2, 0);
            display.print(F("Temp:"));
            display.setCursor(90, 0);
            display.print((char)247); // degree symbol
            display.setCursor(105, 0);
            display.print(F("C"));
            display.setCursor(2, 18);
            display.print(F("Hum :"));
            display.setCursor(90, 18);
            display.print(F("%"));
            display.display();
            delay(100);
            FirstTime = false;
          }else
          {
            display.fillRect(64,0, 25, 16, COLORBLACK);
            display.fillRect(64,16, 25, 32, COLORBLACK);
            display.display();
            delay(1);
          }
      }
      posted in My Project
      giangired
      giangired
    • RE: Arduino Pro Mini and Mini W5100 LAN Ethernet Shield

      @mfalkvidd Solved, it was my mistake on wiring. Thanks.

      posted in Troubleshooting
      giangired
      giangired
    • RE: Arduino Pro Mini and Mini W5100 LAN Ethernet Shield

      Thanks for clarify. So, why my raspberry pi domoticz don't see the gateway? If I try to ping the ethernet gateway i cannot reach it. Ma there any ping test to be used?

      posted in Troubleshooting
      giangired
      giangired
    • RE: Arduino Pro Mini and Mini W5100 LAN Ethernet Shield

      @mfalkvidd thanks. Removing the define for radio the output says TSP NA, why?

      posted in Troubleshooting
      giangired
      giangired
    • Arduino Pro Mini and Mini W5100 LAN Ethernet Shield

      Hallo. I would like to use a gateway based on Mini W5100 Ethernet shield with no Radio module: is it feasible?
      I have connected the devices as indicated in MySensor but I cannot reach my Controller (Domoticz over Raspberry PI).

      The output of serial debug is

      0 MCO:BGN:INIT GW,CP=RNNGA---,REL=255,VER=2.3.1
      4 TSM:INIT
      5 TSF:WUR:MS=0
      11 !TSM:INIT:TSP FAIL
      13 TSM:FAIL:CNT=1
      14 TSM:FAIL:DIS
      16 TSF:TDI:TSL
      10018 TSM:FAIL:RE-INIT
      10020 TSM:INIT
      10027 !TSM:INIT:TSP FAIL
      10029 TSM:FAIL:CNT=2
      10031 TSM:FAIL:DIS
      10033 TSF:TDI:TSL
      20036 TSM:FAIL:RE-INIT
      20038 TSM:INIT
      20044 !TSM:INIT:TSP FAIL
      20046 TSM:FAIL:CNT=3
      20048 TSM:FAIL:DIS
      20050 TSF:TDI:TSL

      Any help?

      posted in Troubleshooting
      giangired
      giangired
    • Portable Domoticz

      Hallo.
      Is it possible to make portable the Domoticz application? I have a pc where I have not the administrator rights so I'd like to install a portable version of Domoticz.

      posted in Domoticz
      giangired
      giangired
    • RE: DHT11 and Ethernet Gateway with enc28j60

      @mfalkvidd
      Now it's working fine. It was an electrical problem. I changed the power supply and now it's working.
      Now I have a new question. I use an Arduino Pro Mini Node with ethernet gateway. I have connected to the same node two relays, one switch, one PIR and one DHT11. The question is: what about sleep times? I mean, from the examples of DHT and PIR and others, often it's indicated a Sleep time. SInce the sketch has a unique Loop, how I have to manage the Sleep. Currently I have removed the sleep and I use a counter for each sensor attached to the same MySensors Node. Is this the right solution?

      posted in My Project
      giangired
      giangired
    • RE: DHT11 and Ethernet Gateway with enc28j60

      @mfalkvidd My output is identical with the exception of the row related the Eth. I see the row only when the connection with Domoticz is established. Could be a problem of power? I mean, can be a problem related the power despite the green/yellow led of the RJ45 are blinking?

      posted in My Project
      giangired
      giangired
    • RE: DHT11 and Ethernet Gateway with enc28j60

      @mfalkvidd I did the test and I obtained a weird result. After several initial test (I started with examples to check the functionality of the ENC28j60, like pinging the Google site) i can say that the wiring between Arduino Pro Mini and ENC28j60 is correct (I saw pinging on my serial monitor). When I test my sktech (that concern one DHT11, two relays and one switch) the connection with the controller (Raspberry PI 3 with Domoticz) is not assured. Time to time I see teh connection on Domoticz but very often the connection is not present. Which debug I can do? Which string I have to receive on my serial monitor to be sure that the Ethernet module is properly recognized? For your info, the power led on the ENC28j60 is lighted and the two leds (green and yellow) on RJ45 port are blinking. I tried to ping the ENC28j60 but I cannot ping it.

      posted in My Project
      giangired
      giangired
    • RE: DHT11 and Ethernet Gateway with enc28j60

      @mfalkvidd Thanks a lot. Effectively I did the same with DHT11 sketch and enc28j60 gateway sketch. The combined sketch has been successfully compiled and later on I will test it. I have a question: the temp and humidity values are sent through the Arduino serial link (correct?) by using the "send" instruction. Adding the enc28j60 gateway code, it is automatically send through the Etehernet link?

      posted in My Project
      giangired
      giangired
    • DHT11 and Ethernet Gateway with enc28j60

      Hallo.
      That's my first project with MySensor since so foar I have only tested different examples I found on internet,
      My project is to create a Temperature/Humidity sensor in each room of my house and then control the temperature of each room by using a dedicated electric valve for each radiator (interfaced with a MySensor node based on relay). As temperature/humidity sensor I have DHT11 and as gateway I have enc28j60. I'm using a Arduino Pro Mini 5v. The "brain" of the system will be a Raspberry PI 3 equipped with DomoticZ.
      First problem is how to combine the examples I have found in MySensors (DHT code and enc28j60 code) in a sketch. Can you help me or indicate where to find how to integrate two sketches (examples) in one?

      posted in My Project
      giangired
      giangired
    • RE: Ethernet Sensor

      @rejoe2 Thanks!

      posted in Hardware
      giangired
      giangired
    • Ethernet Sensor

      Hi everybody. I'm a newbie of MySensors. My question: is it possible to realize a mysensors project by using only ethernet modules (no radio modules)? I mean, I would like to use the Raspberry Pi as ethernet gateway (using the Raspberry Pi on-board ethernet port) and several sensors (door switch, temperature and humidity) connected through ethernet modules (wired).
      I had a look into the forum but I didn't find the answer.

      posted in Hardware
      giangired
      giangired