Navigation

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

    Posts made by thenounoursk

    • RE: Arduino ProMini 3.3V on 1MHz + RFM69W missing ACKs

      Thanks for the tip, I should give a try with the new driver then.

      My node actually died a week ago, battery dead. Thing is, a week before that, I checked the battery with a multimeter and it looked in real good shape. So I'm not sure what happened but I'm leaning towards something unexpected rather normal life cycle of a battery. Out of interest, what's your typical lifetime (assuming your setup is similar)?

      posted in Troubleshooting
      thenounoursk
      thenounoursk
    • RE: Arduino ProMini 3.3V on 1MHz + RFM69W missing ACKs

      @electrik no not yet. It's still on my list of things to do though.

      posted in Troubleshooting
      thenounoursk
      thenounoursk
    • RE: Arduino ProMini 3.3V on 1MHz + RFM69W missing ACKs

      @rozpruwacz I should have been more precise, I have a good multimeter already 🙂 But when I talked about how measuring how much time it takes the battery to recover after a send operation, I thought about doing it on an oscilloscope... Poor phrasing on my part, my multimeter will be enough to get an idea of how much time it takes, I will just not get the nice chart to back up my experience.

      posted in Troubleshooting
      thenounoursk
      thenounoursk
    • RE: Candle - signal Hub - A universal 433Mhz signal detector and cloner

      Hi everyone,

      I hope 6 months isn't too old to keep the discussion going on that topic. It's a great project @alowhum ! I think I'll do some more careful reading about it over the weekend, but the first question that actually popped to my mind was: would it be a good idea to combine this with an MQTT gateway?

      Typically, at home, I have an MQTT gateway (NodeMCU) that I use to interact with MySensors nodes. I also have a Sonoff RF Bridge that I typically use to interact with other RF devices (door/window detectors, soon a smoke detector). And I thought, actually, combining those two devices into one (enhancing my MQTT gateway with your project) would be brilliant? This way, only one device to read/talk to RF devices.

      Any thoughts?

      Cheers.

      posted in My Project
      thenounoursk
      thenounoursk
    • RE: Arduino ProMini 3.3V on 1MHz + RFM69W missing ACKs

      I'll post logs this weekend hopefully.

      I take your point on charging the capacitor. It looks like 1ms would be more than enough to charge it completely. I suppose the question is also, how much time does it take for the battery to recover from a send operation? I don't have the right tooling to do a nice numerical analysis on that, but maybe can do something cheeky.

      posted in Troubleshooting
      thenounoursk
      thenounoursk
    • RE: Arduino ProMini 3.3V on 1MHz + RFM69W missing ACKs

      There it is:

      /**
       * 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: Yveaux
       * 
       * DESCRIPTION
       * This sketch provides an example of how to implement a humidity/temperature
       * sensor using a Si7021 sensor.
       *  
       * For more information, please visit:
       * http://www.mysensors.org/build/humiditySi7021
       * 
       */
      
      // Enable debug prints
      //#define MY_DEBUG
      
      // Enable REPORT_BATTERY_LEVEL to measure battery level and send changes to gateway
      #define REPORT_BATTERY_LEVEL
      
      // Enable and select radio type attached 
      //#define MY_RADIO_RF24
      #define MY_RADIO_RFM69
      //#define MY_RS485
      
      #define MY_RFM69_FREQUENCY (RFM69_433MHZ)
      
      #define MY_NODE_ID 1
      #define MY_PARENT_NODE_ID 0
      #define MY_PARENT_NODE_IS_STATIC
      
      #include <MySensors.h>  
      
      #define CHILD_ID_HUM  0
      #define CHILD_ID_TEMP 1
      
      static bool metric = true;
      
      // Sleep time between sensor updates (in milliseconds)
      static const uint64_t UPDATE_INTERVAL = 180000;
      static const uint64_t COMM_INTERVAL = 60000;  // Sleep between communications to rest battery and charge capacitor
      static const uint16_t UPDATE_COUNT = 100;     // Will force update every UPDATE_COUNT cycles
      
      #include <SI7021.h>
      static SI7021 sensor;
      
      #ifdef REPORT_BATTERY_LEVEL
      #include <Vcc.h>
      static uint16_t currentCount      = 0;    // Initialize at 0
      static uint8_t oldBatteryPcnt = 200;  // Initialize to 200 to assure first time value will be sent.
      static float oldTemp      = 100;      // Initialize to 100 to ensure first time value will be reported
      static float oldHum       = 200;      // Initialize to 200 to ensure first time value will be reported
      const float VccMin        = 1.8;      // Minimum expected Vcc level, in Volts: Brownout at 1.8V    -> 0%
      const float VccMax        = 3; //2.0*1.6;  // Maximum expected Vcc level, in Volts: 2xAA fresh Alkaline -> 100%
      const float VccCorrection = 1.0;      // Measured Vcc by multimeter divided by reported Vcc
      static Vcc vcc(VccCorrection); 
      #endif
      
      void presentation()  
      { 
        // Send the sketch info to the gateway
        //sleep(COMM_INTERVAL);
        //sendSketchInfo("TemperatureAndHumidity", "1.0");
      
        // Present sensors as children to gateway
        sleep(2*COMM_INTERVAL);
        present(CHILD_ID_HUM, S_HUM,   "Humidity");
        sleep(COMM_INTERVAL);
        present(CHILD_ID_TEMP, S_TEMP, "Temperature");
        sleep(COMM_INTERVAL);
        metric = getControllerConfig().isMetric;
      }
      
      void setup()
      {
        while (not sensor.begin())
        {
          Serial.println(F("Sensor not detected!"));
          delay(5000);   
        }
        sleep(COMM_INTERVAL);
      }
      
      
      void loop()      
      {  
        // Read temperature & humidity from sensor.
        const float temperature = float( metric ? sensor.getCelsiusHundredths() : sensor.getFahrenheitHundredths() ) / 100.0;
        const float humidity    = float( sensor.getHumidityBasisPoints() ) / 100.0;
      
      #ifdef MY_DEBUG
        Serial.print(F("Temp "));
        Serial.print(temperature);
        Serial.print(metric ? 'C' : 'F');
        Serial.print(F("\tHum "));
        Serial.println(humidity);
      #endif
      
        static MyMessage msgHum( CHILD_ID_HUM,  V_HUM );
        static MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      
        // Temperature granularity will depend on temperature range
        if ((abs(temperature  - oldTemp) > 0.5) || (currentCount > UPDATE_COUNT))
        {    
          send(msgTemp.set(temperature, 2));
          oldTemp = temperature;  
          sleep(COMM_INTERVAL);
        } else if ((abs(temperature - 22.25) <= 0.75) && (abs(temperature  - oldTemp) > 0.15))
        {
          send(msgTemp.set(temperature, 2));
          oldTemp = temperature;  
          sleep(COMM_INTERVAL);
        }
        
        if ((abs(humidity - oldHum) > 5.0) || (currentCount > UPDATE_COUNT))
        {
          send(msgHum.set(humidity, 2));
          oldHum = humidity;  
          sleep(COMM_INTERVAL);
        }
      
        if (currentCount > UPDATE_COUNT)
        {
          currentCount = 0;
        }
        currentCount++;
      
      #ifdef REPORT_BATTERY_LEVEL
        sleep(COMM_INTERVAL);
        const uint8_t batteryPcnt = static_cast<uint8_t>(0.5 + vcc.Read_Perc(VccMin, VccMax));
        
      
      #ifdef MY_DEBUG
        Serial.print(F("Vbat "));
        Serial.print(vcc.Read_Volts());
        Serial.print(F("\tPerc "));
        Serial.println(batteryPcnt);
      #endif
      
        if ( abs(batteryPcnt  - oldBatteryPcnt) >= 0.035)
        {
            sendBatteryLevel(batteryPcnt);
            oldBatteryPcnt = batteryPcnt;      
        }
      #endif
      
        // Sleep until next update to save energy
        sleep(UPDATE_INTERVAL); 
      }
      

      When I have time I'll look at the gateway. However, I'm dubious this is it because when I keep everything else the same, but change frequency back to 8MHz (by changing node bootloader), I don't get duplicates anymore.

      posted in Troubleshooting
      thenounoursk
      thenounoursk
    • Arduino ProMini 3.3V on 1MHz + RFM69W missing ACKs

      Hi everyone,

      This is my first post here. First of all, I should say congratulation for the formidable work you're putting in there. I've discovered MySensors about 2 months ago and I'm loving it.

      I've recently built:

      • A MQTT gateway with a NodeMCU + RFM69W
      • A temperature node (Arduino ProMini 3.3v) + SI7021 + RFM69W. Running on a CR2032 cell.

      Initially tested the whole thing for a few days and it works like a charm. But I noticed battery level dropping slowly (well expected I suppose). I thought, maybe I can actually do something to minimize energy used. I read a bunch online and implemented the following:

      • Remove the led (well that one everyone seems to remove)
      • Remove the regulator
      • Add 100uF capacitor between GND and 3.3V on RFM69W (helps battery I've heard)
      • Add sleep instructions here and there in my code to allow the battery to rest. The code is mostly the SI7021 example found in MySensors plus a few sleeps...
      • Disable BOD (otherwise actually noticed that since adding my capacitor, my sensor would struggle to start, because of initial drain taking the battery to ~2.7V I suppose)
      • Lower CPU clock to 1MHz to allow to run when battery gets lower voltage (I read that 8MHz wouldn't be stable around 1.8V but the radio, sensor and arduino could still work at that voltage).

      Now, it still works. And if anyone has any feedback on what I just explained, they would be most welcome as I'm sure I've got more to learn.

      One thing doesn't work as expected: when running on 1MHz, most of the time, my Gateway receives duplicate transmissions of my node. When running on 8MHz (everything else the same), no duplicates. Sensor is close to GW (3m). I suspected maybe on 1MHz I need to increase the ACK timeout of sensor, so I increased it to 2seconds. I can now see duplicate messages being 2s apart on the gateway, so that didn't do the trick.

      My current solution is to not allow retries, but that is really a bad workaround... Anyone has an idea of what I could try to see what is the problem here?

      Thanks everyone.

      posted in Troubleshooting
      thenounoursk
      thenounoursk