Navigation

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

    Posts made by karl261

    • RE: Node / sketch with Dallas and Relay starts behaving weird after one day

      How would you do this?Like this? I tried to move it to the setup function.
      This is also a version I found using non blocking (millis()) code.

      // if you uncomment this, you can get test and debug updates about everything the sensor is doing by using the serial monitor tool.
      //#define MY_DEBUG
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24                            // A 2.4Ghz transmitter and receiver, often used with MySensors.
      // #define MY_RF24_PA_LEVEL RF24_PA_MIN           // This sets a low-power mode for the radio. Useful if you use the verison with the bigger antenna, but don't want to power that from a separate power source. It can also fix problems with fake Chinese versions of the radio.
      // #define MY_RADIO_RFM69                         // 433Mhz transmitter and reveiver.
      
      // Choose if you want this sensor to also be a repeater.
      // #define MY_REPEATER_FEATURE                    // Just remove the two slashes at the beginning of this line to also enable this sensor to act as a repeater for other sensors. If this node is on battery power, you probably shouldn't enable this.
      
      // Are you using this sensor on battery power?
      // #define BATTERY_POWERED                        // Just remove the two slashes at the beginning of this line if your node is battery powered. It will then go into deep sleep as much as possible. While it's sleeping it can't work as a repeater!
      
      //#define MY_RF24_PA_LEVEL RF24_PA_LOW
      #define MY_PARENT_NODE_ID 99
      #define MY_PARENT_NODE_IS_STATIC
      #define MY_NODE_ID 8
      #define MY_BAUD_RATE 9600
      
      // LIBRARIES (in the Arduino IDE go to Sketch -> Include Library -> Manage Libraries to add these if you don't have them installed yet.)
      #include <SPI.h>
      #include <MySensors.h>
      #include <DallasTemperature.h>
      #include <OneWire.h>
      
      #define RELAY_1  4  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
      #define NUMBER_OF_RELAYS 1 // Total number of attached relays
      #define RELAY_ON 1  // GPIO value to write to turn on attached relay
      #define RELAY_OFF 0 // GPIO value to write to turn off attached relay
      
      //Added this nteger to avoid stupid collect2.exe: error: ld returned 5 exit status.
      //It seems adding one or removing one (or plenty) solves the error.
      //int stupidinteger=0;
      //int stupidintegertwo=0;
      //int stupidintegerthree=0;
      
      // VARIABLES YOU CAN CHANGE
      #define COMPARE_TEMP 1                            // Send temperature only if changed? 1 = Yes 0 = No. Can save battery.
      #define ONE_WIRE_BUS 7                            // Digital pin where Dallas sensor(s) is/are connected.
      #define maxAttachedDS18B20 16                     // Maximum amount of teperature sensors you can connect to this arduino (16).
      const long measurementInterval = 10000;        // Time to wait between reads (in milliseconds).
      float tempThreshold = 0.1;                        // How big a temperature difference has to be before an update is sent. Makes the sensor less precise, but also less jittery, and can save battery.
      
      
      //VARIABLES YOU PROBABLY SHOULDN'T CHANGE
      #define TEMP_CHILD_ID 0                           // for MySensors. Within this node each sensortype should have its own ID number.
      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.
      float lastTemperature[maxAttachedDS18B20];        // creates an array to hold the previous temperature measurements for each possible sensor.
      int numSensors = 0;                               // variable to contain the number of found attached sensors.
      unsigned long measurementSleepTime = 0;           // variable to store the calculated Sleep time if the node is battery powered.
      bool metric = true;                               // Variable that stores if the sensor will output the temperature in Fahrenheit of Celsius. The gateway sends this preference to the node.
      bool receivedConfig = false;                      // This is not used in the code, but perhaps MySensors requires this?
      
      
      // Mysensors settings
      MyMessage msg(TEMP_CHILD_ID,V_TEMP);              // Sets up the message format that we'l be sending to the MySensors gateway later. The first part is the ID of the specific sensor module on this node. The second part tells the gateway what kind of data to expect.
      
      
      void before()
      {
         sensors.begin();                               // Startup up the OneWire library. It allows multiple sensors to talk over one wire (one pin).
      
      for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
          // Then set relay pins in output mode
          pinMode(pin, OUTPUT);
          // Set relay to last known state (using eeprom storage)
          digitalWrite(pin, loadState(sensor)?RELAY_ON:RELAY_OFF);
       
      }
      }
      
      
      void setup()
      {
        metric = getControllerConfig().isMetric;
         for(int i=0; i<maxAttachedDS18B20; i++) 
         {
            lastTemperature[i] = 0;  //Pre-filling array with 0's.
         }
         sensors.setWaitForConversion(false); // requestTemperatures() will not block current thread
      
      #ifdef BATTERY_POWERED // If the node is batter ypowered, we'll let Sleep take over the scheduling.
         measurementSleepTime = measurementInterval;
         measurementInterval = 0; // When the Arduino is asleep, millis doesn't increment anymore (time stops as it were). To fix this, we'll set the measurement interval time to 1, so that when the arduino wakes up it will immediately try to measure again.
      #endif
      
         //Serial.begin(115200); // for serial debugging.
         //Serial.println("Hello world, I am a sensor node.");
      }
      
      
      void presentation()
      {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Maischen relay and Dallas non blocking", "1.0");
      
        for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
          // Register all sensors to gw (they will be created as child devices)
          present(sensor, S_BINARY);
        }
      
         numSensors = sensors.getDeviceCount();          // Fetch the number of attached temperature sensors
         for (int i=0; i<numSensors && i<maxAttachedDS18B20; i++) {
            present(i, S_TEMP);     
         }
      }
      
      
      
      void loop()
      {
      
         // You should not change these variables:
         static boolean dallasIsMeasuring = true;                        // Used to indicate when the time is right for a new measurement to be made.
         static boolean dallasIsCalculating = false;                     // Used to bridge the time that is needed to calculate the temperature values by the Dallas library.
         unsigned long currentMillis = 0;                          // The millisecond clock in the main loop.
         static unsigned long previousMeasurementMillis = 0;       // Used to remember the time of the last temperature measurement.
         static int16_t conversionTime = 0;                        // Used to store the time needed to calculate the temperature from measurements.
      
         currentMillis = millis(); // The time since the sensor started, counted in milliseconds. This script tries to avoid using the Sleep function, so that it could at the same time be a MySensors repeater.
      
         // Let's measure the temperature
         if(dallasIsMeasuring == true && currentMillis - previousMeasurementMillis >= measurementInterval) { // If we're not calculating, and enough time has passed, we'll start again.
            dallasIsMeasuring = false; // We're measuring, so let's take it off our to-do list.
            //Serial.println("Starting new measurement(s)");
            previousMeasurementMillis = currentMillis; // Mark the time of the initialiation of this measurement.
      
            // Fetch temperatures from Dallas sensors
            sensors.requestTemperatures();
      
            // query conversion time. Apparently it takes a while to calculate.
            //conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
            conversionTime = millisToWaitForConversion(sensors.getResolution()); // This is a modified version of the line above, to deal with the problem in the current Dallas library.
            dallasIsCalculating = true; //Next step is to re-calculate the temperature again.
         }
      
      
         // Next, let's calculate and send the temperature
         if(dallasIsCalculating == true && currentMillis - conversionTime > previousMeasurementMillis) {
            dallasIsCalculating = false; // We're doing this now, so check calculating off the to-do list too.
            for (int i=0; i<numSensors && i<maxAttachedDS18B20; i++){  // Loop through all the attached temperature sensors.   
              //float temperature = getControllerConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i); // Fetch the temperature form the current sensor
              float temperature = static_cast<float>(static_cast<int>((metric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
               //Serial.print("Sensor #");
               //Serial.print(i);
               //Serial.print(" says it is ");
               //Serial.print(temperature);
               //Serial.println(" degrees");
               if(temperature != -127.00 && temperature != 85.00) { // Avoids working with measurement errors.
                  if (COMPARE_TEMP == 1 && abs(temperature - lastTemperature[i]) < tempThreshold) { // is the temperature difference bigger than the threshold?
                     //Serial.print(temperature - lastTemperature[i]);
                     //Serial.print("- difference too small, so not sending the new measurement to the gateway.\n");
                  } else {
                     //Serial.print(temperature - lastTemperature[i]);
                     //Serial.print("Sending the new temperature to the gateway.\n");
                     send(msg.setSensor(i).set(temperature,1));
                     lastTemperature[i] = temperature; // Save new temperatures to be able to compare in the next round.
                  }
               }
            }
      
            // Both tasks are done. Time to wait until we should measure again.
            //Serial.print("zzzzZZZZzzzzZZZZzzzz\n");
      
      #ifdef BATTERY_POWERED
            unsigned long quicktimecheck = millis(); // check how much time has passed during the measurement (can be up to 750 milliseconds), and then calculate from that how long to sleep until the next intended measuring time.
            unsigned long sleeptime = measurementSleepTime - (quicktimecheck - previousMeasurementMillis); //How much time has passed already during the calculating? Subtract that from the intended interval time.
            sleep (sleeptime);
      #endif
      
            dallasIsMeasuring = true;
         }
      }
      
      
      // This function helps to avoid a problem with the latest Dallas temperature library.
      int16_t millisToWaitForConversion(uint8_t bitResolution)
      {
         switch (bitResolution) 
         {
           case 9:
              return 94;
           case 10:
              return 188;
           case 11:
              return 375;
           default:
              return 750;
         }
      }
      
      
      void receive(const MyMessage &message)
      {
        // We only expect one type of message from controller. But we better check anyway.
        if (message.type==V_STATUS) {
          // Change relay state
          digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF);
          // Store state in eeprom
          saveState(message.sensor, message.getBool());
          // Write some debug info
          //Serial.print("Incoming change for sensor:");
          //Serial.print(message.sensor);
          //Serial.print(", New status: ");
          //Serial.println(message.getBool());
        }
      }
      
      posted in Troubleshooting
      karl261
      karl261
    • RE: Node / sketch with Dallas and Relay starts behaving weird after one day

      Yes, the 10 seconds is, because I am using it to control the heating of a mash (beer). So I want the temperature (if it changed) to be sent very often.

      The line with getControllerConfig() I have from the mysensors temperature sensor sketch example.

      Actually my initial post has an error, maybe I can correct. Yes, the temperature should be checked every 10 seconds. But when the sensor failed it kept sending the same temperature every 6 or 7 minutes in the same interval. So not as specified by the sketch.

      posted in Troubleshooting
      karl261
      karl261
    • Node / sketch with Dallas and Relay starts behaving weird after one day

      Hi,

      I am having trouble with a node. It is a combined Dallas temperature sensor with a relay.

      Everything works fine, but after about a day the node starts to behave weird. Sketch attached.

      Once it kept on sending the temperature, but did not react to requests to switch the relay anymore.
      A power cycle did not help, maybe some capacitors were not fully empty, another power cycle and everything was back to normal.
      Another time the same thing happened: The node kept sending the temperatures, but no reaction on the relay.
      Another time it failed like this: It kept sending the same temperature over and over again, the true temperature was definitely different (so it was not reading the temperature from the Dallas). It just sent the same temperature, in some strange regular interval, every 7 minutes or so. No matter that the sketch only sends the temperature if it is different from the previous one. Also no reaction on the relay.

      I do not know what happens, the node somehow works and operates and sends temperatures, but somehow gets confused. The issue is reproducible it seems, I just need to let it run for 24 hours or more.

      Any ideas? Anything wrong in the sketch? Maybe some variable or number that is overflowing? Or the time or the Atmega (millis)?

      It is a self built node with an Atmega328p running at 8 MHz with the internal clock. I have built other nodes like this some with 1 MHz that read the temperature around the house, all working fine. But totally different sketches.

      Thanks very much in advance for any ideas!

      // if you uncomment this, you can get test and debug updates about everything the sensor is doing by using the serial monitor tool.
      //#define MY_DEBUG
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24                            // A 2.4Ghz transmitter and receiver, often used with MySensors.
      // #define MY_RF24_PA_LEVEL RF24_PA_MIN           // This sets a low-power mode for the radio. Useful if you use the verison with the bigger antenna, but don't want to power that from a separate power source. It can also fix problems with fake Chinese versions of the radio.
      // #define MY_RADIO_RFM69                         // 433Mhz transmitter and reveiver.
      
      // Choose if you want this sensor to also be a repeater.
      // #define MY_REPEATER_FEATURE                    // Just remove the two slashes at the beginning of this line to also enable this sensor to act as a repeater for other sensors. If this node is on battery power, you probably shouldn't enable this.
      
      // Are you using this sensor on battery power?
      // #define BATTERY_POWERED                        // Just remove the two slashes at the beginning of this line if your node is battery powered. It will then go into deep sleep as much as possible. While it's sleeping it can't work as a repeater!
      
      //#define MY_RF24_PA_LEVEL RF24_PA_LOW
      #define MY_PARENT_NODE_ID 99
      #define MY_PARENT_NODE_IS_STATIC
      #define MY_NODE_ID 8
      #define MY_BAUD_RATE 9600
      
      // LIBRARIES (in the Arduino IDE go to Sketch -> Include Library -> Manage Libraries to add these if you don't have them installed yet.)
      #include <SPI.h>
      #include <MySensors.h>
      #include <DallasTemperature.h>
      #include <OneWire.h>
      
      #define RELAY_1  4  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
      #define NUMBER_OF_RELAYS 1 // Total number of attached relays
      #define RELAY_ON 1  // GPIO value to write to turn on attached relay
      #define RELAY_OFF 0 // GPIO value to write to turn off attached relay
      
      //Added this nteger to avoid stupid collect2.exe: error: ld returned 5 exit status.
      //It seems adding one or removing one (or plenty) solves the error.
      //int stupidinteger=0;
      //int stupidintegertwo=0;
      //int stupidintegerthree=0;
      
      // VARIABLES YOU CAN CHANGE
      #define COMPARE_TEMP 1                            // Send temperature only if changed? 1 = Yes 0 = No. Can save battery.
      #define ONE_WIRE_BUS 7                            // Digital pin where Dallas sensor(s) is/are connected.
      #define maxAttachedDS18B20 16                     // Maximum amount of teperature sensors you can connect to this arduino (16).
      unsigned long measurementInterval = 9250;        // Time to wait between reads (in milliseconds).
      //float tempThreshold = 0.1;                        // How big a temperature difference has to be before an update is sent. Makes the sensor less precise, but also less jittery, and can save battery.
      
      
      //VARIABLES YOU PROBABLY SHOULDN'T CHANGE
      #define TEMP_CHILD_ID 0                           // for MySensors. Within this node each sensortype should have its own ID number.
      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.
      float lastTemperature[maxAttachedDS18B20];        // creates an array to hold the previous temperature measurements for each possible sensor.
      int numSensors = 0;                               // variable to contain the number of found attached sensors.
      unsigned long measurementSleepTime = 0;           // variable to store the calculated Sleep time if the node is battery powered.
      bool metric = true;                               // Variable that stores if the sensor will output the temperature in Fahrenheit of Celsius. The gateway sends this preference to the node.
      bool receivedConfig = false;                      // This is not used in the code, but perhaps MySensors requires this?
      
      
      // Mysensors settings
      MyMessage msg(TEMP_CHILD_ID,V_TEMP);              // Sets up the message format that we'l be sending to the MySensors gateway later. The first part is the ID of the specific sensor module on this node. The second part tells the gateway what kind of data to expect.
      
      
      void before()
      {
         sensors.begin();                               // Startup up the OneWire library. It allows multiple sensors to talk over one wire (one pin).
      
      for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
          // Then set relay pins in output mode
          pinMode(pin, OUTPUT);
          // Set relay to last known state (using eeprom storage)
          digitalWrite(pin, loadState(sensor)?RELAY_ON:RELAY_OFF);
       
      }
      }
      
      
      void setup()
      {
         for(int i=0; i<maxAttachedDS18B20; i++) 
         {
            lastTemperature[i] = 0;  //Pre-filling array with 0's.
         }
         sensors.setWaitForConversion(false); // requestTemperatures() will not block current thread
      
      #ifdef BATTERY_POWERED // If the node is batter ypowered, we'll let Sleep take over the scheduling.
         measurementSleepTime = measurementInterval;
         measurementInterval = 0; // When the Arduino is asleep, millis doesn't increment anymore (time stops as it were). To fix this, we'll set the measurement interval time to 1, so that when the arduino wakes up it will immediately try to measure again.
      #endif
      
         //Serial.begin(115200); // for serial debugging.
         //Serial.println("Hello world, I am a sensor node.");
      }
      
      
      void presentation()
      {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Maischen relay and Dallas", "1.0");
      
        for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
          // Register all sensors to gw (they will be created as child devices)
          present(sensor, S_BINARY);
        }
      
         numSensors = sensors.getDeviceCount();          // Fetch the number of attached temperature sensors
         for (int i=0; i<numSensors && i<maxAttachedDS18B20; i++) {
            present(i, S_TEMP);     
         }
      }
      
      
      
      void loop()
      {     
        // Fetch temperatures from Dallas sensors
        sensors.requestTemperatures();
      
        // query conversion time and sleep until conversion completed
        int16_t conversionTime = millisToWaitForConversion(sensors.getResolution());
        // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
      //    Serial.print("Library");
      //    Serial.print(" says its conversion time is ");
      //    Serial.print(conversionTime);
      //    Serial.println(" ms");
        wait(conversionTime);
      
        // Read temperatures and send them to controller 
        for (int i=0; i<numSensors && i<maxAttachedDS18B20; i++) {
       
          // Fetch and round temperature to one decimal
          float temperature = static_cast<float>(static_cast<int>((getControllerConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
      //    Serial.print("Sensor #");
      //    Serial.print(i);
      //    Serial.print(" says it is ");
      //    Serial.print(temperature);
      //    Serial.println(" degrees");
       
          // 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
       
            Serial.print(temperature - lastTemperature[i]);
            Serial.print("Sending the new temperature to the gateway.\n");
            // Send in the new temperature
            send(msg.setSensor(i).set(temperature,1));
            // Save new temperatures for next compare
            lastTemperature[i]=temperature;
          }
      //  else {
      //  Serial.print(temperature - lastTemperature[i]);
      //  Serial.print("- difference too small, so not sending the new measurement to the gateway.\n");
      //  }
        }
        wait(measurementInterval);
      }
      
      
      // This function helps to avoid a problem with the latest Dallas temperature library.
      int16_t millisToWaitForConversion(uint8_t bitResolution)
      {
         switch (bitResolution) 
         {
           case 9:
              return 94;
           case 10:
              return 188;
           case 11:
              return 375;
           default:
              return 750;
         }
      }
      
      
      void receive(const MyMessage &message)
      {
        // We only expect one type of message from controller. But we better check anyway.
        if (message.type==V_STATUS) {
          // Change relay state
          digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF);
          // Store state in eeprom
          saveState(message.sensor, message.getBool());
          // Write some debug info
          //Serial.print("Incoming change for sensor:");
          //Serial.print(message.sensor);
          //Serial.print(", New status: ");
          //Serial.println(message.getBool());
        }
      }
      
      
      
      posted in Troubleshooting
      karl261
      karl261
    • RE: BME280 How to use it outdoors

      Hi, no, I live rather far from the sea. I don't know what is killing the outdoor sensor. The same in the greenhouse survives much weirder temperatures and humidities.

      posted in Hardware
      karl261
      karl261
    • RE: BME280 How to use it outdoors

      Interesting idea, the ptfe tape. I will try it with the next sensor!

      So, only the outdoor sensors fail. It is now more than one that failed.

      I have one in the living room -- perfect.

      And, very strange: I have one in the green house. Huge T differences, sometimes very hot, and often 100% humidity. Actually conditions should be worse for this sensor compared to the outdoor sensor. But: it is just fine.

      Weird.

      posted in Hardware
      karl261
      karl261
    • RE: BME280 How to use it outdoors

      Now after 2-3 month more outside the sensor seems to be finally dead. No reaction anymore. Also the 2nd one in the greenhouse does not reply anymore. I'll have to check. The one in the living room is fine.

      It seems that at least the ones I bought are not really lasting long outdoors.

      posted in Hardware
      karl261
      karl261
    • RE: BME280 How to use it outdoors

      So, this story also continues. After having these problems, I brought the sensor into the house and left it running for the past several weeks in the living room. Actually it is working fine. No more problems.

      Now, for Christmas, I have brought it back outside to the birdhouse. And it is still working fine, even at -10 °C. Let's see how long it will last this time.

      What I also noticed is that now I have a second of these in the greenhouse where the humidity is definitely from time to time 100%. At 4°C. But both outdoor sensors somehow never reach 100%, but stop somewhere between 85-90%. It seems they are not made to detect 100% humidity.

      posted in Hardware
      karl261
      karl261
    • RE: Raspberry uninteruptable power suppy

      My UPS is working fine now for the past several months. My current setup is like this:

      AC -- Power suppply power bank -- power bank -- supercaps -- voltage regulator 5V -- raspi.

      The supercaps are needd because when the powerbank switches there is a short power interruption. The supercaps are buffering this.

      The 5V voltage regulator is needed, because when the power bank is charging and discharging at the same time its output voltage drops to 4.6 V or so. The voltage regulator keeps this at 5 V at all times.

      posted in Hardware
      karl261
      karl261
    • RE: Raspberry uninteruptable power suppy

      @AWI Ok, so the bosst converter has arrived. Now I have a stupid question: Should I add the boost converter before of after the caps? Somehow I cannot figure out the advantages / disadvantages of one or the other method.

      The problem with my power bank is, that the voltage drops to 4.5 V when the power bank is charging. When I disconnect the power bank from its supply, the voltage is 5 V as expected.

      posted in Hardware
      karl261
      karl261
    • RE: BME280 How to use it outdoors

      @r-nox Hm, it is reading every 15 seconds at the moment. Do you think this is too much?

      The current sensor is not completely broken, it seems. Sometimes it is showing "normal" values. I brought it into the house to test it, and in the house it seems to show normal values. I will know more tomorrow morning.

      According to its specs it is supposed to be good for weather monitoring. But then, it seems it does not like "weather" too much.

      I also found it strange that in the past 30 days the maximum humidity it read was 87 %. And for sure there were plenty of nights here with 100 %. But ok, I could live with that. But it has started to show far too low values for humidity, down to 0 %. I'll leave it in the house for 1-2 days and then see how it behaves outside.

      posted in Hardware
      karl261
      karl261
    • RE: BME280 How to use it outdoors

      @r-nox You mean too many readings per time unit?

      posted in Hardware
      karl261
      karl261
    • RE: BME280 How to use it outdoors

      @r-nox Somehow, doesn't it? A bit too short for my taste. It should not see any rain, I wonder what is killing it. Or, how I can protect it even better.

      @Nca78 I had a SI7021 with protective foil before, but it was not very accurate. Actually it was quite far off, that's why I started to look for something more accurate.

      When I look around online there seems to be some connection/confusion with the SI7021 and SHT21. But I did not really understand it. Does anybody know more about it?

      EDIT: Hm, seems to be two different sensors, but the board is always the same. So I would need to check to really get a SHT21 and with a protective cover...

      EDIT2: I do not seem to find any SHT21 with protective cover...

      posted in Hardware
      karl261
      karl261
    • RE: BME280 How to use it outdoors

      It does not look that it was much longer time. But instead like the sensor before, the current one is now showing values between 0-22% humidity. T seems to be fine. That is SO disappointing. It seems that these things are not suitable for outdoor use. Lasted only a month...

      Buuuuh.

      posted in Hardware
      karl261
      karl261
    • RE: nRf24L01+ connection quality meter

      @Mark-Swift Where do you see the failures? Do you have a log output?
      The code is for mysensors 2.0.0. Did you adapt all the network specific #define in the beginning of the sketch to your network? In my example there is a static parent set and the static parent has the ID 99. If that does not exist, there will be failures.

      posted in My Project
      karl261
      karl261
    • RE: nRf24L01+ connection quality meter

      For those who need and don't have a display like me, here is my sketch version for output to the serial console. So what I do is, I run around with a laptop connected to the node and watch the serial console, or, I just move around with a tablet and the node. The tablet is connected to my raspi and I watch the output of my gw on the pi using picocom. Picocom handles very well the missing line feeds in the output. The gw output is also very informative, there are no statistics, but still I see when stuff fails...

      Thanks for the cool sketch @AWI!

      /*
       PROJECT: MySensors / Quality of radio transmission 
       PROGRAMMER: AWI (MySensors libraries)
       DATE: 20160529/ last update: 20160530
       FILE: AWI_Send.ino
       LICENSE: Public domain
      
       Hardware: ATMega328p board w/ NRF24l01
          and MySensors 2.0
          
      Special:
          
          
      Summary:
          Sends a radio message with counter each  x time to determine fault ratio with receiver
      Remarks:
          Fixed node-id & communication channel to other fixed node
          
      Change log:
      20160530 - added moving average on fail/ miss count, update to 2.0
      */
      
      
      //****  MySensors *****
      // Enable debug prints to serial monitor
      #define MY_DEBUG 
      #define MY_RADIO_NRF24                                  // Enable and select radio type attached
      //#define MY_RF24_CHANNEL 80                                // radio channel, default = 76
      // MIN, LOW, HIGH, MAX
      #define MY_RF24_PA_LEVEL RF24_PA_LOW
      
      #define MY_NODE_ID 250
      #define NODE_TXT "Q 250"                                // Text to add to sensor name
      
      #define MY_PARENT_NODE_ID 99                          // fixed parent to controller when 0 (else comment out = AUTO)
      #define MY_PARENT_NODE_IS_STATIC
      #define MY_BAUD_RATE 9600
      
      
      // #define MY_RF24_CE_PIN 7                             // Ceech board, 3.3v (7,8)  (pin default 9,10)
      // #define MY_RF24_CS_PIN 8
      #define DESTINATION_NODE 0                              // receiving fixed node id (default 0 = gateway)
      
      #include <SPI.h>
      #include <MySensors.h>  
      
      
      // helpers
      #define LOCAL_DEBUG
      
      #ifdef LOCAL_DEBUG
      #define Sprint(a) (Serial.print(a))                     // macro as substitute for print, enable if no print wanted
      #define Sprintln(a) (Serial.println(a))                 // macro as substitute for println
      #else
      #define Sprint(a)                                       // enable if no print wanted -or- 
      #define Sprintln(a)                                     // enable if no print wanted
      #endif
      
      
      // MySensors sensor
      #define counterChild 0
      
      // send constants and variables
      int messageCounter = 0 ; 
      const int messageCounterMax = 100 ;                     // maximum message counter value 
      const unsigned counterUpdateDelay = 500 ;               // send every x ms and sleep in between
      
      // receive constants and variables
      boolean failStore[messageCounterMax] ;                  // moving average stores & pointers
      int failStorePointer = 0 ;
      boolean missedStore[messageCounterMax] ;
      int missedStorePointer = 0 ;
      int newMessage = 0 ;
      int lastMessage = -1 ;
      int missedMessageCounter = 0 ;                          // total number of messages in range (messageCounterMax)
      int failMessageCounter = 0 ;                            // total number of messages in range (messageCounterMax)
      uint8_t parent = 0 ;                                    // parent node-id 
      
      
      // standard messages
      MyMessage counterMsg(counterChild, V_PERCENTAGE);       // Send value
      
      
      void setup() {
      
          for(int i= 0 ; i <  messageCounterMax ; i++){       // init stores for moving averages
              failStore[i] = true ;
              missedStore[i] = true ;
          }
          missedStorePointer = failStorePointer = 0 ;
          delay(1000);
      }
      
      void presentation(){
      // MySensors
          present(counterChild, S_DIMMER, "Quality counter " NODE_TXT) ;  // counter uses percentage from dimmer value
      }
      
      
      void loop() {
          // Sprint("count:") ; Sprintln(messageCounter) ;
          Sprint("Parent: "); Sprint(parent); Sprint("       Fail "); Sprint(failMessageCounter); Sprint("   "); Sprint(getCount(failStore, messageCounterMax)); Sprintln("%");
          Sprint("Destination: "); Sprint(DESTINATION_NODE); Sprint("  Miss "); Sprint(missedMessageCounter); Sprint("   "); Sprint(getCount(missedStore, messageCounterMax)); Sprintln("%");
      
      
          missedStore[failStorePointer] = false  ;            // set slot to false (ack message needs to set) ; 
          boolean succes = failStore[failStorePointer] = send(counterMsg.setDestination(DESTINATION_NODE).set(failStorePointer), true);  // send to destination with ack
          if (!succes){
              failMessageCounter++ ; 
              Sprint("Fail on message: ") ; Sprint(failStorePointer) ;
              Sprint(" # ") ; Sprintln(failMessageCounter);
          }
          failStorePointer++ ;
          if(failStorePointer >= messageCounterMax){
              failStorePointer =  0   ;                       // wrap counter
          }
          parent = getParentNodeId();                         // get the parent node (0 = gateway)
          wait(counterUpdateDelay) ;                          // wait for things to settle and ack's to arrive
      }
      
      void receive(const MyMessage &message) {                // Expect few types of messages from controller
          newMessage = message.getInt();                      // get received value
          switch (message.type){
              case V_PERCENTAGE:
                  missedStore[newMessage] = true ;            // set corresponding flag to received.
                  if (newMessage > lastMessage){              // number of messages missed from lastMessage (kind of, faulty at wrap)
                      Sprint("Missed messages: ") ; Sprintln( newMessage - lastMessage - 1) ;
                      missedMessageCounter += newMessage - lastMessage - 1 ;
                  }
                  lastMessage = newMessage ;
                  break ;
              default: break ;
          }
      }
      
      
      // calculate number of false values in array 
      // takes a lot of time, but who cares...
      int getCount(boolean countArray[], int size){
          int falseCount = 0 ;
          for (int i = 0 ; i < size ; i++){
              falseCount += countArray[i]?0:1 ;
          }
          return falseCount ;
      }
      
      posted in My Project
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      This sketch works a little bit better... Hm, it sometimes is not reading a key, but it seems to be the loose cable connections?!

      #include <Wire.h>
      #include <Keypad_I2C.h>
      #include <Keypad.h>
      #define I2CADDR 0x38
      
      #define MY_DEBUG
      #define MY_RADIO_NRF24
      #define MY_NODE_ID 8
      
      
      #include <MySensors.h>
      #include <SPI.h>
      
      word temp_pin_state;
      
      unsigned long time;
      
      
      unsigned long SLEEP_TIME = 0; // Sleep time between reports (in milliseconds)
      #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
      #define CHILD_ID 1   // Id of the sensor child
      
      const byte ROWS = 4; //four rows
      const byte COLS = 4; //three columns
      char keys[ROWS][COLS] = {
        {'1','2','3','A'},
        {'4','5','6','B'},
        {'7','8','9','C'},
        {'*','0','#','D'}
      };
      
      // Digitran keypad, bit numbers of PCF8574 i/o port
      byte rowPins[ROWS] = {0, 1, 2, 3}; //connect to the row pinouts of the keypad
      byte colPins[COLS] = {4, 5, 6, 7}; //connect to the column pinouts of the keypad
      
      Keypad_I2C kpd( makeKeymap(keys), rowPins, colPins, ROWS, COLS, I2CADDR, PCF8574 );
      
      void setup(){
          Wire.begin( );
          kpd.begin( makeKeymap(keys) );
      //    Serial.begin(9600);
          Serial.println( "start" );
          pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
          kpd.port_write( 0xff );
          temp_pin_state = kpd.pinState_set( );
      }
      
      void loop(){
      
          Serial.println("Waking up");
      
          kpd.port_write( temp_pin_state );
      //    wait(100);
      
          time = millis();
          while ((millis() - time) < 250) {
            char key = kpd.getKey();
          
            if (key){
              Serial.println(key);
            }
          }
          
      
          Serial.println("Good Night");
          temp_pin_state = kpd.pinState_set( );
          kpd.port_write( 0xf0 );
          wait(50);
          sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), FALLING, SLEEP_TIME);
      }
      
      Starting sensor (RNNNA-, 2.0.0)
      TSM:INIT
      TSM:RADIO:OK
      TSP:ASSIGNID:OK (ID=8)
      TSM:FPAR
      TSP:MSG:SEND 8-8-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSM:FPAR
      TSP:MSG:SEND 8-8-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSP:MSG:READ 0-0-8 s=255,c=3,t=8,pt=1,l=1,sg=0:0
      TSP:MSG:FPAR RES (ID=0, dist=0)
      TSP:MSG:PAR OK (ID=0, dist=1)
      TSP:MSG:READ 99-99-8 s=255,c=3,t=8,pt=1,l=1,sg=0:1
      TSP:MSG:FPAR RES (ID=99, dist=1)
      TSM:FPAR:OK
      TSM:ID
      TSM:CHKID:OK (ID=8)
      TSM:UPL
      TSP:PING:SEND (dest=0)
      TSP:MSG:SEND 8-8-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1
      TSP:MSG:READ 0-0-8 s=255,c=3,t=25,pt=1,l=1,sg=0:1
      TSP:MSG:PONG RECV (hops=1)
      TSP:CHKUPL:OK
      TSM:UPL:OK
      TSM:READY
      start
      TSP:MSG:SEND 8-8-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100
      !TSP:MSG:SEND 8-8-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=fail:2.0.0
      TSP:MSG:SEND 8-8-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=1,st=ok:0
      TSP:MSG:READ 0-0-8 s=255,c=3,t=6,pt=0,l=1,sg=0:M
      Request registration...
      TSP:MSG:SEND 8-8-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2
      TSP:MSG:READ 0-0-8 s=255,c=3,t=27,pt=1,l=1,sg=0:1
      Node registration=1
      Init complete, id=8, parent=0, distance=1, registration=1
      Waking up
      Good Night
      Waking up
      1
      Good Night
      Waking up
      2
      Good Night
      Waking up
      3
      Good Night
      Waking up
      A
      Good Night
      Waking up
      4
      Good Night
      Waking up
      5
      Good Night
      Waking up
      Good Night
      Waking up
      B
      Good Night
      Waking up
      7
      Good Night
      Waking up
      Good Night
      Waking up
      9
      Good Night
      Waking up
      C
      Good Night
      Waking up
      *
      Good Night
      Waking up
      0
      Good Night
      Waking up
      #
      Good Night
      Waking up
      D
      Good Night
      
      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI Ok, I got it working somehow, now with the original Keypad_I2C library, because it had the functions ready to write to the pins... But it needs some more tine tuning. And it does not work all the time, sometimes I need to reset the PCF, by disconnecting it from power and then restart the Arduino.

      In the log below the first try does not work, the second try after reset it works.

      And after the log the sketch. It sure needs some improvement.

      Starting sensor (RNNNA-, 2.0.0)
      TSM:INIT
      TSM:RADIO:OK
      TSP:ASSIGNID:OK (ID=8)
      TSM:FPAR
      TSP:MSG:SEND 8-8-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSP:MSG:READ 0-0-8 s=255,c=3,t=8,pt=1,l=1,sg=0:0
      TSP:MSG:FPAR RES (ID=0, dist=0)
      TSP:MSG:PAR OK (ID=0, dist=1)
      TSP:MSG:READ 99-99-8 s=255,c=3,t=8,pt=1,l=1,sg=0:1
      TSP:MSG:FPAR RES (ID=99, dist=1)
      TSM:FPAR:OK
      TSM:ID
      TSM:CHKID:OK (ID=8)
      TSM:UPL
      TSP:PING:SEND (dest=0)
      TSP:MSG:SEND 8-8-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1
      TSP:MSG:READ 0-0-8 s=255,c=3,t=25,pt=1,l=1,sg=0:1
      TSP:MSG:PONG RECV (hops=1)
      TSP:CHKUPL:OK
      TSM:UPL:OK
      TSM:READY
      start
      TSP:MSG:SEND 8-8-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100
      !TSP:MSG:SEND 8-8-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=fail:2.0.0
      TSP:MSG:SEND 8-8-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=1,st=ok:0
      TSP:MSG:READ 0-0-8 s=255,c=3,t=6,pt=0,l=1,sg=0:M
      Request registration...
      TSP:MSG:SEND 8-8-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2
      TSP:MSG:READ 0-0-8 s=255,c=3,t=27,pt=1,l=1,sg=0:1
      Node registration=1
      Init complete, id=8, parent=0, distance=1, registration=1
      Waking up
      1
      Good Night
      Waking up
      Good Night
      Waking up
      Good Night
      Waking up
      Good Night
      Waking up
      Good Night
      Waking up
      Good Night
      Waking up
      Starting sensor (RNNNA-, 2.0.0)
      TSM:INIT
      TSM:RADIO:OK
      TSP:ASSIGNID:OK (ID=8)
      TSM:FPAR
      TSP:MSG:SEND 8-8-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSP:MSG:READ 0-0-8 s=255,c=3,t=8,pt=1,l=1,sg=0:0
      TSP:MSG:FPAR RES (ID=0, dist=0)
      TSP:MSG:PAR OK (ID=0, dist=1)
      TSP:MSG:READ 99-99-8 s=255,c=3,t=8,pt=1,l=1,sg=0:1
      TSP:MSG:FPAR RES (ID=99, dist=1)
      TSM:FPAR:OK
      TSM:ID
      TSM:CHKID:OK (ID=8)
      TSM:UPL
      TSP:PING:SEND (dest=0)
      TSP:MSG:SEND 8-8-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1
      TSP:MSG:READ 0-0-8 s=255,c=3,t=25,pt=1,l=1,sg=0:1
      TSP:MSG:PONG RECV (hops=1)
      TSP:CHKUPL:OK
      TSM:UPL:OK
      TSM:READY
      start
      TSP:MSG:SEND 8-8-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100
      !TSP:MSG:SEND 8-8-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=fail:2.0.0
      TSP:MSG:SEND 8-8-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=1,st=ok:0
      TSP:MSG:READ 0-0-8 s=255,c=3,t=6,pt=0,l=1,sg=0:M
      Request registration...
      TSP:MSG:SEND 8-8-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2
      TSP:MSG:READ 0-0-8 s=255,c=3,t=27,pt=1,l=1,sg=0:1
      Node registration=1
      Init complete, id=8, parent=0, distance=1, registration=1
      Waking up
      Good Night
      Waking up
      1
      Good Night
      Waking up
      2
      Good Night
      Waking up
      3
      Good Night
      Waking up
      A
      Good Night
      Waking up
      4
      Good Night
      Waking up
      5
      Good Night
      Waking up
      6
      Good Night
      Waking up
      B
      Good Night
      Waking up
      7
      Good Night
      Waking up
      8
      Good Night
      Waking up
      9
      Good Night
      Waking up
      C
      Good Night
      Waking up
      *
      Good Night
      Waking up
      0
      Good Night
      Waking up
      #
      Good Night
      Waking up
      D
      Good Night
      
      #include <Wire.h>
      #include <Keypad_I2C.h>
      #include <Keypad.h>
      #define I2CADDR 0x38
      
      #define MY_DEBUG
      #define MY_RADIO_NRF24
      #define MY_NODE_ID 8
      
      
      #include <MySensors.h>
      #include <SPI.h>
      
      word temp_pin_state;
      
      unsigned long time;
      
      
      unsigned long SLEEP_TIME = 0; // Sleep time between reports (in milliseconds)
      #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
      #define CHILD_ID 1   // Id of the sensor child
      
      const byte ROWS = 4; //four rows
      const byte COLS = 4; //three columns
      char keys[ROWS][COLS] = {
        {'1','2','3','A'},
        {'4','5','6','B'},
        {'7','8','9','C'},
        {'*','0','#','D'}
      };
      
      // Digitran keypad, bit numbers of PCF8574 i/o port
      byte rowPins[ROWS] = {0, 1, 2, 3}; //connect to the row pinouts of the keypad
      byte colPins[COLS] = {4, 5, 6, 7}; //connect to the column pinouts of the keypad
      
      Keypad_I2C kpd( makeKeymap(keys), rowPins, colPins, ROWS, COLS, I2CADDR, PCF8574 );
      
      void setup(){
          Wire.begin( );
          kpd.begin( makeKeymap(keys) );
      //    Serial.begin(9600);
          Serial.println( "start" );
          pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
          temp_pin_state = kpd.pinState_set( );
      }
      
      void loop(){
      
          Serial.println("Waking up");
      
          kpd.port_write( temp_pin_state );
          wait(100);
      
          time = millis();
          while ((millis() - time) < 500) {
            char key = kpd.getKey();
          
            if (key){
              Serial.println(key);
            }
          }
          
      
          Serial.println("Good Night");
          temp_pin_state = kpd.pinState_set( );
          kpd.port_write( 0xf0 );
          wait(100);
          sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), FALLING, SLEEP_TIME);
      }
      
      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI I am trapped between "collect2.exe: error: ld returned 5 exit status" errors and non working sketches. This is the world of pain. I am tempted to give up. It just does not make sense. I like things that do make sense...

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      Ok, the keypad works. All keys. Now I have to check the interrupt.

      The interrupt is not working any more. At least I don't see it on the Voltmeter. The interrupt pin remains high all the time.

      I think this is because to get the key pressed, the library is scanning through the pins and writes different high low states to the ports of the pcf. This kills again the interrupt functionality.

      Yes, if I take out the loop function char key = kpd.get_key(); then the interrupt works again, because the library only writes 0xf0 and then it works. When the library is scanning, it does not work anymore.

      maybe it is possible to write 0xf0 before going to sleep... Then it won't scan, just wait for the interrupt?

      With the knew knowledge of 0xf0 writing I could also test the keypad_I2C library.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI This makes no sense at all! I did what you did, and it compiled. Then I reverted the steps, to my original setup, and it compiles too. WHY? I would be SO HAPPY if somebody could explain.

      So the sketch works, but not all keys...

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI yes, I checked Google too, but there is now real solution. I can go back to 1.6.5r5 maybe this works.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      current code

      sketch

      #include <Wire.h>
      #include <i2ckeypad.h>
      
      #define ROWS 4
      #define COLS 4
      
      // With A0, A1 and A2 of PCF8574 to ground I2C address is 0x20
      #define PCF8574_ADDR 0x38
      #define PCF8574_PIN_CONFIG 0xf0
      
      
      i2ckeypad kpd = i2ckeypad(PCF8574_ADDR, ROWS, COLS, PCF8574_PIN_CONFIG);
      
      void setup()
      {
        Serial.begin(9600);
      
        Wire.begin();
      
        kpd.init();
         
      
        Serial.print("Testing keypad/PCF8574 I2C port expander arduino lib\n\n");
      
      //  pcf8574_write(pcf8574_i2c_addr, 0xf0);
      
      }
      
      void loop()
      {
        char key = kpd.get_key();
      
        if(key != '\0') {
              Serial.print(key);
        }
      }
      

      .cpp

      /*
       *  i2ckeypad.cpp v0.1 - keypad/I2C expander interface for Arduino
       *
       *  Copyright (c) 2009 Angel Sancho <angelitodeb@gmail.com>
       *  All rights reserved.
       *
       *  Original source from keypad v0.3 of Mark Stanley <mstanley@technologist.com>
       *  (http://www.arduino.cc/playground/Main/KeypadTutorial)
       *
       *
       *  LICENSE
       *  -------
       *  This program is free software: you can redistribute it and/or modify
       *  it under the terms of the GNU General Public License as published by
       *  the Free Software Foundation, either version 3 of the License, or
       *  (at your option) any later version.
       *  
       *  This program is distributed in the hope that it will be useful,
       *  but WITHOUT ANY WARRANTY; without even the implied warranty of
       *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       *  GNU General Public License for more details.
       *  
       *  You should have received a copy of the GNU General Public License
       *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
       *
       *
       *  EXPLANATION
       *  -----------
       *  This library is designed for use with PCF8574, but can possibly be
       *  adapted to other I2C port expanders
       *
       *  Wiring diagrams for PCF8574 and 4x3 keypad can be found under
       *  examples directory. Library runs correctly without cols pull-up
       *  resistors but it's better to use it
       *
       *  You can change pin connections between PCF8574 and keypad under
       *  PIN MAPPING section below
       *
       *  IMPORTANT! You have to call Wire.begin() before init() in your code
       *
       *  ... and sorry for my poor english!
       */
      
      #include "i2ckeypad.h"
      #include <Wire.h>
      
      //extern "C" {
      //  #include "WConstants.h"
      //}
      
      
      /*
       *  PIN MAPPING
       *
       *  Here you can change your wire mapping between your keypad and PCF8574
       *  Default mapping is for sparkfun 4x3 keypad
       */
      
      #define COL0  2  // P2 of PCF8574, col0 is usually pin 3 of 4x3 keypads
      #define COL1  0  // P0 of PCF8574, col1 is usually pin 1 of 4x3 keypads
      #define COL2  4  // P4 of PCF8574, col2 is usually pin 5 of 4x3 keypads
      #define COL3  7  // sorry, don't have a 4x4 keypad to try it
      #define ROW0  1  // P1 of PCF8574, row0 is usually pin 2 of 4x3 keypads
      #define ROW1  6  // P6 of PCF8574, row1 is usually pin 7 of 4x3 keypads
      #define ROW2  5  // P5 of PCF8574, row2 is usually pin 6 of 4x3 keypads
      #define ROW3  3  // P3 of PCF8574, row3 is usually pin 4 of 4x3 keypads
      
      
      /*
       *  KEYPAD KEY MAPPING
       *
       *  Default key mapping for 4x4 keypads, you can change it here if you have or
       *  like different keys
       */
      
      const char keymap[4][5] =
      {
        "123A",
        "456B",
        "789C",
        "*0#D"
      };
      
      
      /*
       *  VAR AND CONSTANTS DEFINITION. Don't change nothing here
       *
       */
      
      // Default row and col pin counts
      int num_rows = 4;
      int num_cols = 3;
      
      // PCF8574 i2c address
      int pcf8574_i2c_addr;
      
      // PCF8574 i2c pin configuration (high low)
      int pcf8574_i2c_pin_cfg;
      
      // Current search row
      static int row_select;
      
      // Current data set in PCF8574
      static int current_data;
      
      // Hex byte statement for each port of PCF8574
      const int hex_data[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
      
      // Hex data for each row of keypad in PCF8574
      const int pcf8574_row_data[4] = 
      {
        hex_data[ROW1] | hex_data[ROW2] | hex_data[ROW3] |
        hex_data[COL0] | hex_data[COL1] | hex_data[COL2] | hex_data[COL3],
        hex_data[ROW0] | hex_data[ROW2] | hex_data[ROW3] |
        hex_data[COL0] | hex_data[COL1] | hex_data[COL2] | hex_data[COL3],
        hex_data[ROW0] | hex_data[ROW1] | hex_data[ROW3] |
        hex_data[COL0] | hex_data[COL1] | hex_data[COL2] | hex_data[COL3],
        hex_data[ROW0] | hex_data[ROW1] | hex_data[ROW2] |
        hex_data[COL0] | hex_data[COL1] | hex_data[COL2] | hex_data[COL3],
      };
      
      // Hex data for each col of keypad in PCF8574
      int col[4] = {hex_data[COL0], hex_data[COL1], hex_data[COL2], hex_data[COL3]};
      
      
      /*
       *  CONSTRUCTORS
       */
      
      i2ckeypad::i2ckeypad(int addr)
      {
        pcf8574_i2c_addr = addr;
      }
      
      i2ckeypad::i2ckeypad(int addr, int r, int c, int pinc)
      {
        pcf8574_i2c_addr = addr;
        num_rows = r;
        num_cols = c;
        pcf8574_i2c_pin_cfg = pinc;
      }
      
      
      /*
       *  PUBLIC METHODS
       */
      
      void i2ckeypad::init()
      {
        // All PCF8574 ports high
        pcf8574_write(pcf8574_i2c_addr, pcf8574_i2c_pin_cfg);
      
        // Start with the first row
        row_select = 0;
      }
      
      char i2ckeypad::get_key()
      {
        static int temp_key;
      
        int tmp_data;
        int r;
      
        int key = '\0';
      
        // Search row low
        pcf8574_write(pcf8574_i2c_addr, pcf8574_row_data[row_select]);
      
        for(r=0;r<num_cols;r++) {
          // Read pcf8574 port data
          tmp_data = pcf8574_byte_read(pcf8574_i2c_addr);
      
          // XOR to compare obtained data and current data and know
          // if some column are low
          tmp_data ^= current_data;
      
          // Key pressed!
          if(col[r] == tmp_data) {
            temp_key = keymap[row_select][r];
            return '\0';
          }
        }
      
        // Key was pressed and then released
        if((key == '\0') && (temp_key != '\0'))    
        {
          key = temp_key;
          temp_key = '\0';
          return key;
        }
      
        // All PCF8574 ports high again
        pcf8574_write(pcf8574_i2c_addr, pcf8574_i2c_pin_cfg);
      
        // Next row
        row_select++;
        if(row_select == num_rows) {
          row_select = 0;
        }
      
        return key;
      }
      
      /*
       *  PRIVATE METHODS
       */
      
      void i2ckeypad::pcf8574_write(int addr, int data)
      {
        current_data = data;
      
        Wire.beginTransmission(addr);
        Wire.write(data);
        Wire.endTransmission();
      }
      
      int i2ckeypad::pcf8574_byte_read(int addr)
      {
        Wire.requestFrom(addr, 1);
      
        return Wire.read();
      }
      

      .h

      #ifndef i2ckeypad_h
      #define i2ckeypad_h
      
      #include <inttypes.h>
      
      #if ARDUINO >= 100
      #include "Arduino.h"
      #else
      #include "WProgram.h"
      #endif
      
      
      class i2ckeypad {
      public:
        i2ckeypad(int);
        i2ckeypad(int, int, int, int);
        char get_key();
        void init();
        
      private:
        void pcf8574_write(int, int);
        int pcf8574_byte_read(int);
      };
      
      #endif
      
      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI It does not compile... I get this stupid error again:

      collect2.exe: error: ld returned 5 exit status

      But I don't know what to do with it.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI Ok, so far so good. If I connect 4 high wires to rows and 4 low wires to columns (or vice versa, no idea) then the interrupt pin indeed changes to 0. If I connect the interrupt pin of the IC to D3of the Arduino and then both through a pull up of 10 kOhm to Vcc, the interrupt is at 3.3 V. If I press a key it goes down to 0.040 V. That should be enough to read it as low.

      That sounds good, doesn't it? The question is, whether the key library still works...

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI yeah, I kind of thought the same. I'll try to have rows high and colls low and see if the interrupt pin finally triggers. I should have some pull up on the interrupt pin. Then I'll need to see if I need any pull up or down on the other lines..,

      Hope I'll get something done this weekend.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI Finally:

      Yes, it works as expected. 4 pins are 0 V and 4 pins are 3.3 V. The chip is using 2.5 uA.

      I had to change a little bit the library, it did not compile and was slightly outdated, also the function we wanted to use was private, but I just did the changes in the library.

      I also needed to update to the latest arduino from 1.6.5 to 1.6.12, because i got an error: collect2.exe: error: ld returned 5 exit status. Now it works.

      Where do we go from here?

      posted in Troubleshooting
      karl261
      karl261
    • RE: Remote debug messages with V_TEXT

      @AWI This sounds extremely cool. I will try it asap! Thanks for sharing!

      posted in Development
      karl261
      karl261
    • RE: Sensor node not working without #define MyDebug

      @ayo Hmmm I experienced this also Once with the default repeater node sketch. The radio failed completely when commenting out the my_debug.
      However, it went away somehow, so I cannot debug it. It went away after several reuploads of the sketch. So maybe there was just something wrong during programming in my case...

      posted in Troubleshooting
      karl261
      karl261
    • RE: Node's becoming unreachable

      @AWI ok, I guess you are right. I will do some more tests with grounded foil.

      Actually I have some really nice and thick Al metal. I could use it to build some better permanent shielding of the module.

      Actually I would like to give my repeater a metal enclosure. But it is built in a way that inside its case the 220 V are converted to 5 V. So I prefer the plastic case. I am too afraid that by some stupid failure there are 220 V on the case and somebody touching it. Hm, so maybe I should rebuilt the repeater with an external 5 V supply and a metal case.

      I am totally sick of these NRFs that all perform differently. 😉

      posted in Troubleshooting
      karl261
      karl261
    • RE: Node's becoming unreachable

      @Sander-Stolk said:

      This is the one to test: http://www.icstation.com/22dbm-100mw-nrf24l01ppalna-wireless-transmission-module-p-4677.html

      Looking at the module I see that the shield is NOT touching the ground of the antenna. Is that correct? Or is it connected all together on the back side of the module?

      This is also what I thought to see in my own experiments, that it was better when the Al foil was not touching the gnd of the antenna.

      Still my shielding is imperfect. It does not work at MAX setting.

      Looking at the proposed module I see that really everything is covered by the shield. I will try to enlarge my foil wrapping, but not touching the gnd.

      Hmmmm, guess I will have to do more tests. There are various opinions here about toching the ground with the foil or not.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI Yes, I will work with the test sketch on the weekend. It is clear to me now how to set pins of the PCF8574 to HIGH or LOW, and from there we can see.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Node's becoming unreachable

      @tbowmo No, it does not seem to be the humidity. Now in the evening that the temperature drops and the humidity rises I have quite regular readings.

      Anyway, it's strange. Nobody is at home -- Conditions did not change. It did not work last night and during today (readings once very two hours more or less), but since the late afternoon I get readings every 10 minutes (as it is supposed to be). So: What is better now then it was last night and evening and during today? The moon phase???

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI I found this library:

      https://github.com/skywodd/pcf8574_arduino_library

      There is a lot of talk about interrupt functionality and it seems to be somehow implemented. But I don't fully understand how it works. Maybe you can make something out of it?

      Oh, and maybe in even more detail with some examples, I have not read it yet:

      https://github.com/RalphBacon/PCF8574-Pin-Extender-I2C

      ...but it looks like a software interrupt rather than a hardware interrupt??? I am confused.

      ... at least for the last example: It does not need any library. It's all quite clear in one sketch.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Node's becoming unreachable

      @tbowmo I will observe. Today it is dry and there are still dropouts. But then for 20 m? with a +PA+LNA? I would expect this thing to go 100 m... Maybe a bad soldering point that is affected by humidity?

      posted in Troubleshooting
      karl261
      karl261
    • RE: Node's becoming unreachable

      @Sander-Stolk I have exactly the same problem with my bird house node. It is about 20 m away from the repeater. Both are 1000 m radios and aluminium shielded. The repeater uses LOW setting. The birdhouse node used MIN for 3 weeks and worked fine, then the dropouts appeared, sometimes for a whole day there is no message coming through. The repeater is working fine, I tested it with @AWI's quality meter sketch. The birdhouse node is 10 times checked, it is ome of the "My Slim AA ..." nodes, very simple setup. I recently changed the radio setting to LOW, but same results, it works for a few hours then dropouts start.

      Unfortunately I cannot advise you, just tell you that I have similar problems. I have no idea what to do, I discussed in detail with @Oitzu but I am still having dropouts.

      I will need to do further testing if the repeater can reach the node, what is sure is that the node cannot reach the repeater.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI Thanks. I am in the train now and I am spending my time to try to understand how things work. I also made some progress in my brain. My idea is similar, but you already have a sketch ready. 🙂 I will try it out, I guess on Saturday. Until then I will try to deepen my knowledge of the libraries.

      It is also possible with the "original" library, but you are right: the "new" library is much clearer.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI I think this Library sounds very promising. What do you think? At least it talks about high and low.

      http://playground.arduino.cc/Main/I2CPortExpanderAndKeypads

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      Or I go back to my three proposed solutions. For example solution 3) works fine. I tested it.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI Yeah, I guess just getting another keypad would be the easiest solution. Pitty though. I like my keypad and the fact that it is self-adhesive on the outside of the case.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI Yes, basically, 4 inputs should be set to high in the library, and 4 inputs to low. Rows and columns. I had a look at the library examples yesterday, but so far it is beyond my programming skills. As far as I understand from all the docs this is theoretically possible.

      Then, if done so, the pcf should detect a change in the low/high of the input pins and also detect what key was pressed. Or better the library interprets the received data by i2c correctly.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI I think the problem is with the keypad. Because it is not really putting a signal to its pins. The only thing it does is short circuiting them when a key is pressed... No change in high or low.

      I tried for example to pull row 1 to high and column 1 to low. Then the interrupt fires ( I think) but there is no key press detected any more. But I am not sure if the interrupt fires correctly.

      I tested some variations last night, but nothing works. It's all still set up on the breadboard, so if you have some suggestions I am happy to try.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      No progress....

      Maybe this library is better to understand the pcf...

      https://github.com/RobTillaart/Arduino/tree/master/libraries/PCF8574

      Also here are some explanations (in German) and some code examples (in English)...

      http://www.mikrocontroller.net/articles/Port-Expander_PCF8574

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI I don't recall that columns and rows have a different level. Of what I measured yesterday was that all 8 pins of the keyboard were at 3.3 V. So the only thing that happens is that there will be a connection made between column and row when a key is pressed. It seems that nothing is pulled up or down. 😕

      So you think the ic can do it? Then we have to re-program the library... 😞

      http://www.ti.com/lit/ds/symlink/pcf8574.pdf
      On page 15 is a wiring example. Maybe we can learn something from this. Some pull up missing?

      EDIT: No, still can"t get it to work. Buh.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI Thanks for the flowers. 😉 Your help is much appreciated!

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @mfalkvidd Cool stuff, thanks!

      @AWI Here you go. What a chaos... Sorry. 🙂 I thought of a setup like this. But the interrupt pin of the pcf is not doing anything. Maybe I need another chip?

      The resistor is 10kOhm.

      NRF is also connected. And working.

      The sketch is not ready, but the keyboard works on the serial line.

      0_1474716234250_Untitled Sketch_Steckplatine.jpg

      #include <Wire.h>
      #include <Keypad_I2C.h>
      #include <Keypad.h>
      #define I2CADDR 0x38
      
      #define MY_DEBUG
      #define MY_RADIO_NRF24
      #define MY_NODE_ID 8
      
      
      #include <MySensors.h>
      #include <SPI.h>
      
      
      unsigned long SLEEP_TIME = 0; // Sleep time between reports (in milliseconds)
      #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
      #define CHILD_ID 1   // Id of the sensor child
      
      const byte ROWS = 4; //four rows
      const byte COLS = 4; //three columns
      char keys[ROWS][COLS] = {
        {'1','2','3','A'},
        {'4','5','6','B'},
        {'7','8','9','C'},
        {'*','0','#','D'}
      };
      
      // Digitran keypad, bit numbers of PCF8574 i/o port
      byte rowPins[ROWS] = {0, 1, 2, 3}; //connect to the row pinouts of the keypad
      byte colPins[COLS] = {4, 5, 6, 7}; //connect to the column pinouts of the keypad
      
      Keypad_I2C kpd( makeKeymap(keys), rowPins, colPins, ROWS, COLS, I2CADDR, PCF8574 );
      
      void setup(){
          Wire.begin( );
          kpd.begin( makeKeymap(keys) );
      //    Serial.begin(9600);
          Serial.println( "start" );
          pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
      }
      
      void loop(){
      
          Serial.println("Waking up");
      
          char key = kpd.getKey();
          
          if (key){
          Serial.println(key);
          }
      
          Serial.println("Good Night");
          delay(100);
          sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), FALLING, SLEEP_TIME);
      }
      
      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI Thanks for trying to help! Just a quick question first: Do I draw the circuit by hand or is there a good cheap (free) way to do it on the PC? Or tablet?

      I think it is how the pcf8574 is designed. I detect no change on the interrupt pin. But yes, maybe my wiring is not good.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      Few crazy solutions:

      1. I put in an on / off switch. So before I type, I switch the whole thing on, wait until it registers with the gw, and then here we go. And then off. No need to sleep and wait for interrupts.

      2. I can install a button device. So, the thing is sleeping, I press the button, the thing wakes up for 30 secs, that gives me time to type and send, and back it goes to sleep.

      3. I have a 4x4 keypad. So, I don't need the ABCD. I could connect the ABCD in a way, that it acts like button device, so I can trigger the interrupt with ABCD, then type my number, and then it goes back to sleep.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      Ok, in the end I am stuck. So, I got the keypad working, no problem. But I cannot get it to trigger an interrupt. The PCF8574 has an interrupt pin, but it seems this does not work with this keypad. Or at least I could not figure out how to. So, my keypad speaks I2C now, but still has no interrupt capabilites.

      Can anyone advise?

      If not I will need to build the circuit from @AWI. Btw, in that circuit, Are ALL resistors 10 MOhm?

      Or are R1-4 1 MOhm?

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      Wow, this is so cool, the pcf8574 port expander works out of the box. If now even the interrupt works...

      posted in Troubleshooting
      karl261
      karl261
    • RE: Raspberry uninteruptable power suppy

      I found this on the net:

      http://www.hackerspace-ffm.de/wiki/index.php?title=Raspi_EDLC_UPS

      I added the 100R resistors. And I guess I will try with a step up module behind. Which one do you think is better? Of the two?

      posted in Hardware
      karl261
      karl261
    • RE: Raspberry uninteruptable power suppy

      @mfalkvidd No no, those are 10 F caps 2.3 V each. If you connect them in series you get a 3.33 F and 6.9 V Supercap.

      posted in Hardware
      karl261
      karl261
    • RE: Raspberry uninteruptable power suppy

      @mfalkvidd You mean take away one cap? That's not possible, because then the 5V is too much. Two caps would be only 4.6 V in total and giving them 5 V will kill them.

      posted in Hardware
      karl261
      karl261
    • RE: Raspberry uninteruptable power suppy

      @AWI No, I don't have an oscilloscope. Would be nice though. Searching the net it seems that other people who tried also see low voltages. I think these caps are responsible. If each cap has a voltage drop of 0.8 V then I easily get down to 4.77 V...

      posted in Hardware
      karl261
      karl261
    • RE: Raspberry uninteruptable power suppy

      @AWI I just tested it: The power bank is fine. The supercaps cause the voltage decrease. But how? I don't understand enough of caps...

      posted in Hardware
      karl261
      karl261
    • RE: Raspberry uninteruptable power suppy

      @mfalkvidd ah, cool, thanks. I see. Have to figure out the right link...

      posted in Hardware
      karl261
      karl261
    • RE: Raspberry uninteruptable power suppy

      @AWI Thanks! I'll Check.

      What about this module:

      http://pages.ebay.com/link/?nav=item.view&alt=web&id=232075363633&globalID=EBAY-DE

      How did you get the Ali express image in there?

      posted in Hardware
      karl261
      karl261
    • Raspberry uninteruptable power suppy

      So, I built myself a nice little UPS for my raspberry pi, because it is supposed to still work without power and send some SMS if a battery sensor sends a certain signal via an attached UMTS stick.

      Simplest design: A 5 V power bank with 2 A that can charge and discharge at the same time, and after that I have 3 supercaps summing up to 6.9 V and 3.33 F.

      However, I realize that the power arriving and the raspberry is only 4.77 V, which sounds too little to me.

      Questions:

      1. Why is that? Why is it not 5 V?
      2. How can I improve the UPS? I have a stepup module here, 1-5 V -> 5V. Maybe I should use that? Just behind the supercaps? Or would anything else be better?

      Any suggestions?

      Edit: I just checked: The step up module has only 500 mA. That is not enough. How do I get my 5 V back?

      posted in Hardware
      karl261
      karl261
    • RE: BME280 How to use it outdoors

      Ok, I changed the BME280. Now it is better.

      I like this sensor, I have right now 3 of them running next to each other:

      T    20.8        21.2       21.1
      H    60%         60%        60%
      P    1015.3      1015.0     1014.9
      

      Isn't that great? Now let's see how long the outdoor sensor lasts. I don't know what else to improve...

      posted in Hardware
      karl261
      karl261
    • RE: BME280 How to use it outdoors

      Well, I guess then I will change the BME280 to a new one and see how it goes. Let's see how long it lasts. If it is made for weather monitoring, it should withstand normal weather conditions if not exposed to rain???

      posted in Hardware
      karl261
      karl261
    • RE: BME280 How to use it outdoors

      By the way: This is the sketch I use. It is made for a 1 MHz Atmega328p. If anyone has some code suggestions... 🙂

      I use a board that looks like this:

      0_1474539330333_Clipboard01.jpg

      /* Sketch with Si7021 and battery monitoring.
      by m26872, 20151109 
      modified for BME280 by karl261 using Sparkfun library
      */
      
      // Enable and select radio type attached
      // MIN, LOW, HIGH, MAX
      #define MY_RADIO_NRF24
      #define MY_RF24_PA_LEVEL RF24_PA_LOW
      #define MY_PARENT_NODE_ID 99
      #define MY_PARENT_NODE_IS_STATIC
      #define MY_NODE_ID 6
      //#define MY_DEBUG
      
      #define MY_BAUD_RATE 9600
      
      
      #include <MySensors.h>  
      #include <Wire.h>  //This library allows you to communicate with I2C / TWI devices. 
      #include <SPI.h>
      #include <RunningAverage.h>
      
      #include <SparkFunBME280.h>
      
      
      
      //#define DEBUG   // local debug
      
      #ifdef DEBUG
      #define DEBUG_SERIAL(x) Serial.begin(x)
      #define DEBUG_PRINT(x) Serial.print(x)
      #define DEBUG_PRINTLN(x) Serial.println(x)
      #else
      #define DEBUG_SERIAL(x)
      #define DEBUG_PRINT(x) 
      #define DEBUG_PRINTLN(x) 
      #endif
      
      // #define NODE_ID 132             // <<<<<<<<<<<<<<<<<<<<<<<<<<<   Enter Node_ID
      #define CHILD_ID_HUM 0
      #define CHILD_ID_TEMP 1
      #define CHILD_ID_PRES 2
      #define SLEEP_TIME 15000 // 15s for DEBUG
      //#define SLEEP_TIME 300000   // 5 min
      #define FORCE_TRANSMIT_CYCLE 36  // 5min*12=1/hour, 5min*36=1/3hour 
      #define BATTERY_REPORT_CYCLE 2880   // Once per 5min   =>   12*24*7 = 2016 (one report/week)
      #define VMIN 1900
      #define VMAX 3300
      #define HUMI_TRANSMIT_THRESHOLD 3.0  // THRESHOLD tells how much the value should have changed since last time it was transmitted.
      #define TEMP_TRANSMIT_THRESHOLD 0.5
      #define PRES_TRANSMIT_THRESHOLD 1.0
      #define AVERAGES 2
      
      int batteryReportCounter = BATTERY_REPORT_CYCLE - 1;  // to make it report the first time.
      int measureCount = 0;
      float lastTemperature = -100;
      float lastPressure = -100;
      int lastHumidity = -100;
      
      RunningAverage raHum(AVERAGES);
      //SI7021 humiditySensor;
      BME280 mySensor;
      
      
      // MyMessage to controler
      MyMessage msgTemp(CHILD_ID_TEMP,V_TEMP); // Initialize temperature message
      MyMessage msgHum(CHILD_ID_HUM,V_HUM);
      MyMessage msgPres(CHILD_ID_PRES,V_PRESSURE);
      
      void presentation()
      {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("OUTSIDE P&T&H", "1.2");
        present(CHILD_ID_TEMP, S_TEMP);
        present(CHILD_ID_PRES, S_BARO);
        present(CHILD_ID_HUM, S_HUM);  
        DEBUG_PRINT("Node and "); DEBUG_PRINTLN("3 children presented.");
      }
      
      void setup() {
        DEBUG_SERIAL(9600);    // <<<<<<<<<<<<<<<<<<<<<<<<<< Note BAUD_RATE in MySensors.h
        DEBUG_PRINTLN("Serial started");
        
        DEBUG_PRINT("Voltage: ");
        DEBUG_PRINT(readVcc()); 
        DEBUG_PRINTLN(" mV");
      /*
        delay(500);
        DEBUG_PRINT("Internal temp: ");
        DEBUG_PRINT(GetInternalTemp()); // Probably not calibrated. Just to print something.
        DEBUG_PRINTLN(" *C");
      */  
      
        mySensor.settings.commInterface = I2C_MODE;
        mySensor.settings.I2CAddress = 0x77;
      
        //runMode can be:
        //  0, Sleep mode
        //  1 or 2, Forced mode
        //  3, Normal mode
        mySensor.settings.runMode = 1;
        mySensor.settings.filter = 0;
        mySensor.settings.tempOverSample = 1;
        mySensor.settings.pressOverSample = 1;
        mySensor.settings.humidOverSample = 1;
        
        delay(500); // Allow time for radio if power used as reset
      
        if (!mySensor.begin())
         {
          Serial.println("BME init failed!");
          while (1);
         }
        else Serial.println("BME init success!");
        
        raHum.clear();
        
      }
      
      void loop() { 
      
        measureCount ++;
        batteryReportCounter ++;
        bool forceTransmit = false;
        
        if (measureCount > FORCE_TRANSMIT_CYCLE) {
          forceTransmit = true; 
        }
        mySensor.begin();
        sendTempHumidityMeasurements(forceTransmit);
      /*
        // Read and print internal temp
        float temperature0 = static_cast<float>(static_cast<int>((GetInternalTemp()+0.5) * 10.)) / 10.;
        DEBUG_PRINT("Internal Temp: "); DEBUG_PRINT(temperature0); DEBUG_PRINTLN(" *C");        
      */
        // Check battery
        if (batteryReportCounter >= BATTERY_REPORT_CYCLE) {
          long batteryVolt = readVcc();
          DEBUG_PRINT("Battery voltage: "); DEBUG_PRINT(batteryVolt); DEBUG_PRINTLN(" mV");
          uint8_t batteryPcnt = constrain(map(batteryVolt,VMIN,VMAX,0,100),0,255);   
          DEBUG_PRINT("Battery percent: "); DEBUG_PRINT(batteryPcnt); DEBUG_PRINTLN(" %");
          sendBatteryLevel(batteryPcnt);
          batteryReportCounter = 0;
        }
        
        sleep(SLEEP_TIME);
      //if(isTransportOK()){
      //    sleep(SLEEP_TIME);  // transport is OK, node can sleep
      //  } 
      //  else {
      //    wait(5000); // transport is not operational, allow the transport layer to fix this
      //  }
      }
      
      // function for reading Vcc by reading 1.1V reference against AVcc. Based from http://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage/
      // To calibrate reading replace 1125300L with scale_constant = internal1.1Ref * 1023 * 1000, where internal1.1Ref = 1.1 * Vcc1 (per voltmeter) / Vcc2 (per readVcc() function) 
      long readVcc() {
        // set the reference to Vcc and the measurement to the internal 1.1V reference
        ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
        delay(2); // Wait for Vref to settle
        ADCSRA |= _BV(ADSC); // Start conversion
        while (bit_is_set(ADCSRA,ADSC)); // measuring
        uint8_t low  = ADCL; // must read ADCL first - it then locks ADCH  
        uint8_t high = ADCH; // unlocks both
        long result = (high<<8) | low;
        result = 1178053L / result; // Calculate Vcc (in mV); 1125300 = 1.1*1023*1000
        //Node 6 = 1178053L
        return result; // Vcc in millivolts
      }
      // function for reading internal temp. From http://playground.arduino.cc/Main/InternalTemperatureSensor 
      double GetInternalTemp(void) {  // (Both double and float are 4 byte in most arduino implementation)
        unsigned int wADC;
        double t;
        // The internal temperature has to be used with the internal reference of 1.1V. Channel 8 can not be selected with the analogRead function yet.
        ADMUX = (_BV(REFS1) | _BV(REFS0) | _BV(MUX3));   // Set the internal reference and mux.
        ADCSRA |= _BV(ADEN);  // enable the ADC
        delay(20);            // wait for voltages to become stable.
        ADCSRA |= _BV(ADSC);  // Start the ADC
        while (bit_is_set(ADCSRA,ADSC));   // Detect end-of-conversion
        wADC = ADCW;   // Reading register "ADCW" takes care of how to read ADCL and ADCH.
        t = (wADC - 88.0 ) / 1.0;   // The default offset is 324.31.
        return (t);   // The returned temperature in degrees Celcius.
      }
      
      /*********************************************
       * * Sends temperature and humidity from Si7021 sensor
       * Parameters
       * - force : Forces transmission of a value (even if it's the same as previous measurement)
       *********************************************/
      void sendTempHumidityMeasurements(bool force) {
        bool tx = force;
      
        float temperature = mySensor.readTempC();
        DEBUG_PRINT("T: ");DEBUG_PRINTLN(temperature);
        float diffTemp = abs(lastTemperature - temperature);
        DEBUG_PRINT(F("TempDiff :"));DEBUG_PRINTLN(diffTemp);
        if (diffTemp > TEMP_TRANSMIT_THRESHOLD || tx) {
          send(msgTemp.set(temperature,1));
          lastTemperature = temperature;
          measureCount = 0;
          DEBUG_PRINTLN("T sent!");
        }
        
        int humidity = mySensor.readFloatHumidity();
        DEBUG_PRINT("H: ");DEBUG_PRINTLN(humidity);
        raHum.addValue(humidity);
        humidity = raHum.getAverage();  // MA sample imply reasonable fast sample frequency
        float diffHum = abs(lastHumidity - humidity);  
        DEBUG_PRINT(F("HumDiff  :"));DEBUG_PRINTLN(diffHum); 
        if (diffHum > HUMI_TRANSMIT_THRESHOLD || tx) {
          send(msgHum.set(humidity));
          lastHumidity = humidity;
          measureCount = 0;
          DEBUG_PRINTLN("H sent!");
        }
      
        float pressure = mySensor.readFloatPressure()/100.0;
        DEBUG_PRINT("P: ");DEBUG_PRINTLN(pressure);
        float diffPress = abs(lastPressure - pressure);
        DEBUG_PRINT(F("PressDiff :"));DEBUG_PRINTLN(diffPress);
        if (diffPress > PRES_TRANSMIT_THRESHOLD || tx) {
          send(msgPres.set(pressure,1));
          lastPressure = pressure;
          measureCount = 0;
          DEBUG_PRINTLN("P sent!");
        }
      
      }
      
      posted in Hardware
      karl261
      karl261
    • RE: Battery powered smoke sensor

      @bjacobse Thanks for the advice. Indeed, looking at the API sometimes helps. 🙂 But a sketch example is even better.

      So, in case of the Ei Electronics 650C it is like this:
      It has two pins for connecting wires. I found that terrific -- very simple. 🙂 So, when there is no Alarm going on, there is 0 V on these two pins. If there is an alarm triggered, there are 5.6 V on the two pins. Sounds ideal. I figure, that I have to put also 5.6 V on these two pins to trigger the alarm from external.

      But, where do I go from here? I usually use 3.3 V Arduinos. How can I wire this? Does a digital pin of a 3.3 V Arduino take 5.6 V? Or do I need a voltage divider?

      Then, I guess I have to connect the + pin to let's say digital pin 3. Because digital pin 2 is used by the radio -- in case we are using interrupts in the future. And the - pin I connect to gnd. Is that right?

      Then, I can use the reed switch sketch and try the interrupt thing from the API. Right?

      I guess, when I set the 3.3 V Arduino D3 pin to high it will have 3.3 V, right? So I need to figure out if the Ei650C also triggers at 3.3 V. And if so, I would need to check that it is not drawing too much power from the pin. If it does not trigger, what to do? Sounds like using a 5 V Arduino.

      How lonng would two AA batteries last if the Arduino was sleeping and the Radio was awake? With 2.0.1 radio interrupt will arrive and power can be saved.

      Are the above assumptions correct? Nobody with a ready fire alarm sketch?

      Edit: I love this fire alarm. It triggers at 3 V. Perfect. Can't believe it. The good thin about this model that is has one of these 10 year lithium batteries. I like that too.

      posted in General Discussion
      karl261
      karl261
    • RE: nRf24L01+ connection quality meter

      @AWI Strange, with the latest sketch I get

      nrf-quality-meter.ino:88:34: error: invalid conversion from 'int' to 't_backlighPol' [-fpermissive]
      In file included from nrf-quality-meter.ino:45:0:
      C:\Dokumente und Einstellungen\Philipp\Eigene Dateien\Arduino\libraries\LiquidCrystal/LiquidCrystal_I2C.h:53:4: error: initializing argument 3 of 'LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, t_backlighPol)' [-fpermissive]
      LiquidCrystal_I2C (uint8_t lcd_Addr, uint8_t backlighPin, t_backlighPol pol);
      ^
      invalid conversion from 'int' to 't_backlighPol' [-fpermissive]

      compiling...

      It works using the other line...

      // ***** LCD
      //LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address
      LiquidCrystal_I2C lcd(0x27, 16, 2);  // Set the LCD I2C address
      
      posted in My Project
      karl261
      karl261
    • RE: BME280 How to use it outdoors

      Why are all my photos upside down? That's weird. They display right on the tablet, but on the PC in FireFox they are upside down...

      posted in Hardware
      karl261
      karl261
    • RE: BME280 How to use it outdoors

      @r-nox ok, thanks. It is exactly what I was talking about. Insect protection! 😃

      posted in Hardware
      karl261
      karl261
    • RE: BME280 How to use it outdoors

      @r-nox ok, thanks. I try to google it. Somehow I can't picture the material.

      @AWI Maybe it has to do with the box. Hm. Because I had another node out there, same sensor, and it was just hanging in the bird house protected against rain. And it still works fine. Still, there was no sign of any moisture in the box...

      posted in Hardware
      karl261
      karl261
    • RE: BME280 How to use it outdoors

      @r-nox window screen? What is that? Do you have a link?

      Ah, now I know: these anti insect meshes, one puts in front of the window... They should be good...

      Now the box is full of 2 mm holes...

      0_1474479958895_image.jpg

      posted in Hardware
      karl261
      karl261
    • RE: BME280 How to use it outdoors

      0_1474479329532_image.jpg

      posted in Hardware
      karl261
      karl261
    • RE: BME280 How to use it outdoors

      @AWI No, it's standing on a table on the photo...

      Hm.... I did not find any moisture in the box. So you think I need plenty of more holes? Hm, the sensor was directly behind the hole. On the picture one cannot see the sensor.

      Rain normally cannot reach the box. But ok, I could think of something more special.

      The housing on your photo, where can you buy it?

      Another thing: if I protect the holes against insects, what would I use? Because I don't want to measure wet tissue or so. So it would be some synthetics. Or a fine mesh of something. But in this moment I have no idea...

      Thanks for the advice!

      posted in Hardware
      karl261
      karl261
    • BME280 How to use it outdoors

      I've been playing around with the bme280 for a while. I like this sensor, it seems to be very accurate and it is easy to install.

      Now, one of them is running outdoors. It is in a plastic box, I made a little hole of 4 mm diameter in the box and placed the sensor behind the hole. I thought like this it is well protected. The sensor points north and it sits in an open bird house 2 m above ground. No rain should be able to reach the box and sensor.

      However, recently I brought it into the house and noticed that the humidity is off by 15 %. Too high compared to all other bme280 and other sensors I have.

      Could it have been damaged sitting outside?

      I tried to recondition the sensor like written in the specs, but the humidity value is still too high.

      That is bad news, because I cannot put a new bme280 every 3 weeks... That gets too expensive.

      So, what to do? The Bosch specs clearly say it's ideal for outdoor weather monitoring. That is great, but how do I prevent this thing from showing wrong values?.

      Or maybe it is just bad luck?

      What do you suggest?!

      0_1474473788932_image.jpg

      posted in Hardware
      karl261
      karl261
    • RE: Battery powered smoke sensor

      @HenryWhite I am trying to implement something similar. Could you post your sketch for this? That would help me. Thanks!

      I use an Ei650C that has the two pins ready for the wire connection, but I am not sure how to program the arduino so that it is sleeping and only wakes up on interrupt.

      posted in General Discussion
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      @karl261 said:

      @tekka But now I found something: the repeater sketch does not work, if MY_DEBUG is commented out. I tried several times forth and back. On the gw I get the output below.

      I checked and re-programmed the repeater. It seems that it has gone away. I can use my repeater without MY_DEBUG. I don't know what caused this, but the repeater is working now.

      posted in Troubleshooting
      karl261
      karl261
    • RE: My New IrrigationController

      @marekd Thanks for the detailed reply. What the monster capacitor for in gen 3?

      I plan to build my keypad with one pro mini and the PCF8574. Like your gen 1 & 3. How did / are you planning to wire the PCF8574? It seems rather straight forward according to this:

      https://www.hackster.io/venkatesh_rao/i2c-keypad-73a012

      Is this the wiring you are using? Or is it different?

      Since I am building a battery keypad, I was also planning to use the interrupt line of the PCF8574.

      posted in My Project
      karl261
      karl261
    • RE: My New IrrigationController

      @marekd Great controller! For the keypad: I see from the code that you use the I2C code. How did you connect your keypad? Did you use a I2C extension chip? And, which keypad_i2c library do you use? I found multiple on the net.

      Thanks!

      posted in My Project
      karl261
      karl261
    • RE: NRF24L01+PA+LNA power consumption

      @hek Ah yes, that's right. The radio needs to be on. I forgot about that. We need an over the air interrupt... 😉

      posted in Troubleshooting
      karl261
      karl261
    • RE: Battery sensor and re-connecting to gateway

      @tekka Yeah, that's what I actually use. Since I normally don't move my sensors and repeaters, having the parent node static sounds like a good thing to do.

      I look forward to the 2.0.1 release. There seem to be a lot of cool new things inside.

      @tekka, @oitzu, Still, this nrf is driving me nuts. My sensor in the garden has worked just fine for three weeks, and nothing has changed. Now it makes problems. It is still running, because once per day one Temp reading or similar is getting through. Battery is just the same as before.

      Do you have any idea why it could have stopped working? I don't see any reason why the repeater should stop receiving the values. The repeater works fine, it relays all other nodes. And the geometry between repeater and garden sensor has not changed.

      The weather has changed. The T is about 7 degrees less outside...

      posted in Troubleshooting
      karl261
      karl261
    • RE: Battery sensor and re-connecting to gateway

      @tekka The only problem with this extra code is, that in case the node loses its connection, it will drain the battery quite quickly...

      posted in Troubleshooting
      karl261
      karl261
    • RE: NRF24L01+PA+LNA power consumption

      @Yveaux So, basically this means that in the future we can have the arduino sleeping and when a message comes in it wakes up from the interrupt? Sounds like repeaters could run on battery then. If there is not too much traffic.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      But in the end, I prefer the keypad I have. It looks nice.

      Maybe this is the simplest solution? It turns the keypad into i2c:
      https://www.hackster.io/venkatesh_rao/i2c-keypad-73a012

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @Nca78 yes, you are absolutely right. Maybe that is what I'll do. Sound much easier. Thanks for the link, I check it out!

      posted in Troubleshooting
      karl261
      karl261
    • RE: Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

      @AWI I have such a keypad 4x4 and I would like to use it with the famous my slim aa battery node. I think I understand your drawing. What I don't understand is what diodes do I need to use? I mean what type?

      Also, if I was to include a green and red diode, or a bi-colour diode, what specifications would they need to have? Any links to the usual "shops"?

      Thanks!

      posted in Troubleshooting
      karl261
      karl261
    • RE: nRF24L01+PA+LNA

      @Oitzu Ok, so, if I understand correctly, then, if I set the nrf to max, and it will ignore the flag, it will be at high, correct?

      Another question: I have a battery sensor with a +pa+lna because I installed a little weather station in a bird house... Concerning battery life, would you run it at min or low?

      posted in General Discussion
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      Total madness: I uploaded the same sketch again, and now it is using 99.

      Questions:

      1. Can I see in the log whether it "found" the parent or if it is using the parent I put into the sketch?
      2. Is it possible to avoid this transport failure counter? Like, when I put
        #define MY_PARENT_NODE_ID 99
        #define MY_PARENT_NODE_IS_STATIC
        into my sketch I just want the node to send, whether it reaches the parent or not. Is that possible?
      posted in Troubleshooting
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      @tekka I will try this a bit later, thanks.
      Right now I am going crazy, the node is again not using the defined parent. Did I overlook something in the sketch?

      Starting sensor (RNNNA-, 2.0.0)
      TSM:INIT
      TSM:RADIO:OK
      TSP:ASSIGNID:OK (ID=4)
      TSM:FPAR
      TSP:MSG:SEND 4-4-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSP:MSG:READ 0-0-4 s=255,c=3,t=8,pt=1,l=1,sg=0:0
      TSP:MSG:FPAR RES (ID=0, dist=0)
      TSP:MSG:PAR OK (ID=0, dist=1)
      TSM:FPAR:OK
      TSM:ID
      TSM:CHKID:OK (ID=4)
      TSM:UPL
      TSP:PING:SEND (dest=0)
      TSP:MSG:SEND 4-4-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1
      TSP:MSG:READ 0-0-4 s=255,c=3,t=25,pt=1,l=1,sg=0:1
      TSP:MSG:PONG RECV (hops=1)
      TSP:CHKUPL:OK
      TSM:UPL:OK
      TSM:READY
      BME init success!
      TSP:MSG:SEND 4-4-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100
      TSP:MSG:SEND 4-4-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=ok:2.0.0
      TSP:MSG:SEND 4-4-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=ok:0
      TSP:MSG:READ 0-0-4 s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      TSP:MSG:SEND 4-4-0-0 s=255,c=3,t=11,pt=0,l=13,sg=0,ft=0,st=ok:OUTSIDE P&T&H
      TSP:MSG:SEND 4-4-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=ok:1.2
      TSP:MSG:SEND 4-4-0-0 s=1,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=ok:
      TSP:MSG:SEND 4-4-0-0 s=2,c=0,t=8,pt=0,l=0,sg=0,ft=0,st=ok:
      TSP:MSG:SEND 4-4-0-0 s=0,c=0,t=7,pt=0,l=0,sg=0,ft=0,st=ok:
      Request registration...
      TSP:MSG:SEND 4-4-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2
      TSP:MSG:READ 0-0-4 s=255,c=3,t=27,pt=1,l=1,sg=0:1
      Node registration=1
      Init complete, id=4, parent=0, distance=1, registration=1
      TSP:MSG:SEND 4-4-0-0 s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:24.7
      TSP:MSG:SEND 4-4-0-0 s=0,c=1,t=1,pt=2,l=2,sg=0,ft=0,st=ok:57
      TSP:MSG:SEND 4-4-0-0 s=2,c=1,t=4,pt=7,l=5,sg=0,ft=0,st=ok:1012.9
      TSP:MSG:SEND 4-4-0-0 s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=ok:115
      
      /* Sketch with Si7021 and battery monitoring.
      by m26872, 20151109 
      */
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      #define MY_PARENT_NODE_ID 99
      #define MY_PARENT_NODE_IS_STATIC
      #define MY_NODE_ID 4
      #define MY_DEBUG
      
      #define MY_BAUD_RATE 9600
      
      
      #include <MySensors.h>  
      #include <Wire.h>  //This library allows you to communicate with I2C / TWI devices. 
      #include <SPI.h>
      #include <RunningAverage.h>
      
      #include <SparkFunBME280.h>
      
      
      
      //#define DEBUG   // local debug
      
      #ifdef DEBUG
      #define DEBUG_SERIAL(x) Serial.begin(x)
      #define DEBUG_PRINT(x) Serial.print(x)
      #define DEBUG_PRINTLN(x) Serial.println(x)
      #else
      #define DEBUG_SERIAL(x)
      #define DEBUG_PRINT(x) 
      #define DEBUG_PRINTLN(x) 
      #endif
      
      // #define NODE_ID 132             // <<<<<<<<<<<<<<<<<<<<<<<<<<<   Enter Node_ID
      #define CHILD_ID_HUM 0
      #define CHILD_ID_TEMP 1
      #define CHILD_ID_PRES 2
       #define SLEEP_TIME 15000 // 15s for DEBUG
      //#define SLEEP_TIME 300000   // 5 min
      #define FORCE_TRANSMIT_CYCLE 36  // 5min*12=1/hour, 5min*36=1/3hour 
      #define BATTERY_REPORT_CYCLE 2880   // Once per 5min   =>   12*24*7 = 2016 (one report/week)
      #define VMIN 1900
      #define VMAX 3300
      #define HUMI_TRANSMIT_THRESHOLD 3.0  // THRESHOLD tells how much the value should have changed since last time it was transmitted.
      #define TEMP_TRANSMIT_THRESHOLD 0.5
      #define PRES_TRANSMIT_THRESHOLD 1.0
      #define AVERAGES 2
      
      int batteryReportCounter = BATTERY_REPORT_CYCLE - 1;  // to make it report the first time.
      int measureCount = 0;
      float lastTemperature = -100;
      float lastPressure = -100;
      int lastHumidity = -100;
      
      RunningAverage raHum(AVERAGES);
      //SI7021 humiditySensor;
      BME280 mySensor;
      
      
      // MyMessage to controler
      MyMessage msgTemp(CHILD_ID_TEMP,V_TEMP); // Initialize temperature message
      MyMessage msgHum(CHILD_ID_HUM,V_HUM);
      MyMessage msgPres(CHILD_ID_PRES,V_PRESSURE);
      
      void presentation()
      {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("OUTSIDE P&T&H", "1.2");
        present(CHILD_ID_TEMP, S_TEMP);
        present(CHILD_ID_PRES, S_BARO);
        present(CHILD_ID_HUM, S_HUM);  
        DEBUG_PRINT("Node and "); DEBUG_PRINTLN("3 children presented.");
      }
      
      void setup() {
        DEBUG_SERIAL(9600);    // <<<<<<<<<<<<<<<<<<<<<<<<<< Note BAUD_RATE in MySensors.h
        DEBUG_PRINTLN("Serial started");
        
        DEBUG_PRINT("Voltage: ");
        DEBUG_PRINT(readVcc()); 
        DEBUG_PRINTLN(" mV");
      /*
        delay(500);
        DEBUG_PRINT("Internal temp: ");
        DEBUG_PRINT(GetInternalTemp()); // Probably not calibrated. Just to print something.
        DEBUG_PRINTLN(" *C");
      */  
      
        mySensor.settings.commInterface = I2C_MODE;
        mySensor.settings.I2CAddress = 0x77;
      
        //runMode can be:
        //  0, Sleep mode
        //  1 or 2, Forced mode
        //  3, Normal mode
        mySensor.settings.runMode = 1;
        mySensor.settings.filter = 0;
        mySensor.settings.tempOverSample = 1;
        mySensor.settings.pressOverSample = 1;
        mySensor.settings.humidOverSample = 1;
        
        delay(500); // Allow time for radio if power used as reset
      
        if (!mySensor.begin())
         {
          Serial.println("BME init failed!");
          while (1);
         }
        else Serial.println("BME init success!");
        
        raHum.clear();
        
      }
      
      void loop() { 
      
        measureCount ++;
        batteryReportCounter ++;
        bool forceTransmit = false;
        
        if (measureCount > FORCE_TRANSMIT_CYCLE) {
          forceTransmit = true; 
        }
        mySensor.begin();
        sendTempHumidityMeasurements(forceTransmit);
      /*
        // Read and print internal temp
        float temperature0 = static_cast<float>(static_cast<int>((GetInternalTemp()+0.5) * 10.)) / 10.;
        DEBUG_PRINT("Internal Temp: "); DEBUG_PRINT(temperature0); DEBUG_PRINTLN(" *C");        
      */
        // Check battery
        if (batteryReportCounter >= BATTERY_REPORT_CYCLE) {
          long batteryVolt = readVcc();
          DEBUG_PRINT("Battery voltage: "); DEBUG_PRINT(batteryVolt); DEBUG_PRINTLN(" mV");
          uint8_t batteryPcnt = constrain(map(batteryVolt,VMIN,VMAX,0,100),0,255);   
          DEBUG_PRINT("Battery percent: "); DEBUG_PRINT(batteryPcnt); DEBUG_PRINTLN(" %");
          sendBatteryLevel(batteryPcnt);
          batteryReportCounter = 0;
        }
        
        sleep(SLEEP_TIME);
      //if(isTransportOK()){
      //    sleep(SLEEP_TIME);  // transport is OK, node can sleep
      //  } 
      //  else {
      //    wait(5000); // transport is not operational, allow the transport layer to fix this
      //  }
      }
      
      // function for reading Vcc by reading 1.1V reference against AVcc. Based from http://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage/
      // To calibrate reading replace 1125300L with scale_constant = internal1.1Ref * 1023 * 1000, where internal1.1Ref = 1.1 * Vcc1 (per voltmeter) / Vcc2 (per readVcc() function) 
      long readVcc() {
        // set the reference to Vcc and the measurement to the internal 1.1V reference
        ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
        delay(2); // Wait for Vref to settle
        ADCSRA |= _BV(ADSC); // Start conversion
        while (bit_is_set(ADCSRA,ADSC)); // measuring
        uint8_t low  = ADCL; // must read ADCL first - it then locks ADCH  
        uint8_t high = ADCH; // unlocks both
        long result = (high<<8) | low;
        result = 1134738L / result; // Calculate Vcc (in mV); 1125300 = 1.1*1023*1000
        return result; // Vcc in millivolts
      }
      // function for reading internal temp. From http://playground.arduino.cc/Main/InternalTemperatureSensor 
      double GetInternalTemp(void) {  // (Both double and float are 4 byte in most arduino implementation)
        unsigned int wADC;
        double t;
        // The internal temperature has to be used with the internal reference of 1.1V. Channel 8 can not be selected with the analogRead function yet.
        ADMUX = (_BV(REFS1) | _BV(REFS0) | _BV(MUX3));   // Set the internal reference and mux.
        ADCSRA |= _BV(ADEN);  // enable the ADC
        delay(20);            // wait for voltages to become stable.
        ADCSRA |= _BV(ADSC);  // Start the ADC
        while (bit_is_set(ADCSRA,ADSC));   // Detect end-of-conversion
        wADC = ADCW;   // Reading register "ADCW" takes care of how to read ADCL and ADCH.
        t = (wADC - 88.0 ) / 1.0;   // The default offset is 324.31.
        return (t);   // The returned temperature in degrees Celcius.
      }
      
      /*********************************************
       * * Sends temperature and humidity from Si7021 sensor
       * Parameters
       * - force : Forces transmission of a value (even if it's the same as previous measurement)
       *********************************************/
      void sendTempHumidityMeasurements(bool force) {
        bool tx = force;
      
        float temperature = mySensor.readTempC();
        DEBUG_PRINT("T: ");DEBUG_PRINTLN(temperature);
        float diffTemp = abs(lastTemperature - temperature);
        DEBUG_PRINT(F("TempDiff :"));DEBUG_PRINTLN(diffTemp);
        if (diffTemp > TEMP_TRANSMIT_THRESHOLD || tx) {
          send(msgTemp.set(temperature,1));
          lastTemperature = temperature;
          measureCount = 0;
          DEBUG_PRINTLN("T sent!");
        }
        
        int humidity = mySensor.readFloatHumidity();
        DEBUG_PRINT("H: ");DEBUG_PRINTLN(humidity);
        raHum.addValue(humidity);
        humidity = raHum.getAverage();  // MA sample imply reasonable fast sample frequency
        float diffHum = abs(lastHumidity - humidity);  
        DEBUG_PRINT(F("HumDiff  :"));DEBUG_PRINTLN(diffHum); 
        if (diffHum > HUMI_TRANSMIT_THRESHOLD || tx) {
          send(msgHum.set(humidity));
          lastHumidity = humidity;
          measureCount = 0;
          DEBUG_PRINTLN("H sent!");
        }
      
        float pressure = mySensor.readFloatPressure()/100.0;
        DEBUG_PRINT("P: ");DEBUG_PRINTLN(pressure);
        float diffPress = abs(lastPressure - pressure);
        DEBUG_PRINT(F("PressDiff :"));DEBUG_PRINTLN(diffPress);
        if (diffPress > PRES_TRANSMIT_THRESHOLD || tx) {
          send(msgPres.set(pressure,1));
          lastPressure = pressure;
          measureCount = 0;
          DEBUG_PRINTLN("P sent!");
        }
      
      }
      
      posted in Troubleshooting
      karl261
      karl261
    • RE: NRF24L01+PA+LNA power consumption

      @GertSanders Did you find an answer to this? With 2.0.0 would it be better to use IRQ now? Just connecting the pin and adding the IRQ line?

      posted in Troubleshooting
      karl261
      karl261
    • RE: nRF24L01+PA+LNA

      @Oitzu Is that so? How could I find out if my nrf accepts the max setting? Maybe it is not using it at all. What is the default then? I also saw that @GertSanders was recommending to use the "high" setting as maximum. Maybe that is why?

      posted in General Discussion
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      @tekka But now I found something: the repeater sketch does not work, if MY_DEBUG is commented out. I tried several times forth and back. On the gw I get the output below.

      0;255;3;0;9;TSP:MSG:READ 99-99-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
      0;255;3;0;9;TSP:MSG:BC
      0;255;3;0;9;TSP:MSG:FPAR REQ (sender=99)
      0;255;3;0;9;TSP:CHKUPL:OK
      0;255;3;0;9;TSP:MSG:GWL OK
      0;255;3;0;9;!TSP:MSG:SEND 0-0-99-99 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=fail:0
      0;255;3;0;9;TSP:MSG:READ 99-99-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
      0;255;3;0;9;TSP:MSG:BC
      0;255;3;0;9;TSP:MSG:FPAR REQ (sender=99)
      0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
      0;255;3;0;9;TSP:MSG:GWL OK
      0;255;3;0;9;!TSP:MSG:SEND 0-0-99-99 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=fail:0
      
      posted in Troubleshooting
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      @tekka yes, these fails come and go, I see them all the time, but not at the same place necessarily. The logs posted above show plenty of them.

      I don't understand this radio trouble.,the distances between the nodes are not long. The radios are all connected using all tricks, the relay is a nrf24+pa+lna which is located in a good location... Maybe all radios are crap? There is only one wifi network and it is not very busy... It's my own. Maybe I should change the channel? 110 or so sounds good. I am using default now. Power is set to max for all nodes, the nrf24+pa+lna is shielded from itself, I put small antenna extensions on the normal ones after @petewill, they all have nice caps, gw and repeater have excellent power sources, ...

      I found a script how to test nrf radios... Maybe I should try that?

      If I was going to buy new radios, just to try, which ones are the best???

      Edit: Hm, I think if I use antennas, it really helps if they all point into the same direction. Like all horizontal or all vertical. Which would make sens, wouldn't it?

      posted in Troubleshooting
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      @tekka No, it seems to work as expected. Any idea why I am getting this "fail" line?

      23.08.2016 00:30:33	RX	0;255;3;0;9;TSP:MSG:READ 30-30-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
      23.08.2016 00:30:33	RX	0;255;3;0;9;TSP:MSG:BC
      23.08.2016 00:30:33	RX	0;255;3;0;9;TSP:MSG:FPAR REQ (sender=30)
      23.08.2016 00:30:33	RX	0;255;3;0;9;TSP:CHKUPL:OK
      23.08.2016 00:30:33	RX	0;255;3;0;9;TSP:MSG:GWL OK
      23.08.2016 00:30:34	RX	0;255;3;0;9;TSP:MSG:SEND 0-0-30-30 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=ok:0
      23.08.2016 00:30:34	RX	0;255;3;0;9;TSP:MSG:READ 99-99-0 s=255,c=3,t=24,pt=1,l=1,sg=0:1
      23.08.2016 00:30:34	RX	0;255;3;0;9;TSP:MSG:PINGED (ID=99, hops=1)
      23.08.2016 00:30:34	RX	0;255;3;0;9;TSP:MSG:SEND 0-0-99-99 s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=ok:1
      23.08.2016 00:30:34	RX	0;255;3;0;9;TSP:MSG:READ 30-99-0 s=255,c=3,t=24,pt=1,l=1,sg=0:2
      23.08.2016 00:30:34	RX	0;255;3;0;9;TSP:MSG:PINGED (ID=30, hops=2)
      23.08.2016 00:30:34	RX	0;255;3;0;9;TSP:MSG:SEND 0-0-99-30 s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=ok:1
      23.08.2016 00:30:35	RX	0;255;3;0;9;TSP:MSG:READ 30-99-0 s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      23.08.2016 00:30:35	RX	0;255;3;0;9;!TSP:MSG:SEND 0-0-99-30 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=fail:0100
      23.08.2016 00:30:35	RX	0;255;3;0;9;TSP:MSG:READ 30-99-0 s=255,c=3,t=6,pt=1,l=1,sg=0:99
      23.08.2016 00:30:35	RX	30;255;3;0;6;99
      23.08.2016 00:30:35	TX	30;255;3;0;6;M
      23.08.2016 00:30:35	RX	0;255;3;0;9;TSP:MSG:SEND 0-0-99-30 s=255,c=3,t=6,pt=0,l=1,sg=0,ft=0,st=ok:M
      23.08.2016 00:30:35	RX	0;255;3;0;9;TSP:MSG:READ 30-99-0 s=255,c=3,t=12,pt=0,l=10,sg=0:1.0 151106
      23.08.2016 00:30:35	RX	30;255;3;0;12;1.0 151106
      23.08.2016 00:30:35	RX	0;255;3;0;9;TSP:MSG:READ 30-99-0 s=1,c=0,t=7,pt=0,l=0,sg=0:
      23.08.2016 00:30:35	RX	30;1;0;0;7;
      23.08.2016 00:30:35	DEBUG	Update child id=1, type=S_HUM
      23.08.2016 00:30:35	RX	0;255;3;0;9;TSP:MSG:READ 30-99-0 s=255,c=3,t=26,pt=1,l=1,sg=0:2
      23.08.2016 00:30:35	RX	0;255;3;0;9;TSP:MSG:SEND 0-0-99-30 s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=ok:1
      23.08.2016 00:30:35	RX	0;255;3;0;9;TSP:MSG:READ 30-99-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.3
      23.08.2016 00:30:35	RX	30;0;1;0;0;24.3
      23.08.2016 00:30:35	RX	0;255;3;0;9;TSP:MSG:READ 30-99-0 s=1,c=1,t=1,pt=2,l=2,sg=0:73
      23.08.2016 00:30:35	RX	30;1;1;0;1;73
      23.08.2016 00:30:35	RX	0;255;3;0;9;TSP:MSG:READ 30-99-0 s=255,c=3,t=0,pt=1,l=1,sg=0:91
      23.08.2016 00:30:35	RX	30;255;3;0;0;91
      
      posted in Troubleshooting
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      @tekka Yes, @1 MHz.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      @tekka Well, yes, I added the two lines you suggested, re-compiled, and then it was not using the 99. And also some posts above, I had these weird messages transmitted 6-7 times, see logs. This happend while MY_DEBUG was commented out.

      Hm, I can re-upload the sketch and see if this is reproducible.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      @tekka Now it seems to work.

      But I recompiled, because I had MY_DEBUG commented out. Somehow there is something wrong with debug...

      Starting sensor (RNNNA-, 2.0.0)
      TSM:INIT
      TSM:RADIO:OK
      TSP:ASSIGNID:OK (ID=30)
      TSM:FPAR
      TSP:MSG:SEND 30-30-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSP:MSG:READ 3-3-30 s=255,c=3,t=8,pt=1,l=1,sg=0:1
      TSP:MSG:FPAR RES (ID=3, dist=1)
      TSP:MSG:PAR OK (ID=3, dist=2)
      TSP:MSG:READ 99-99-30 s=255,c=3,t=8,pt=1,l=1,sg=0:1
      TSP:MSG:FPAR RES (ID=99, dist=1)
      TSP:MSG:FPAR (PPAR FOUND)
      TSP:MSG:PAR OK (ID=99, dist=2)
      TSM:FPAR:OK
      TSM:ID
      TSM:CHKID:OK (ID=30)
      TSM:UPL
      TSP:PING:SEND (dest=0)
      TSP:MSG:SEND 30-30-99-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1
      TSP:MSG:READ 0-0-30 s=255,c=3,t=8,pt=1,l=1,sg=0:0
      TSP:MSG:FPAR RES (ID=0, dist=0)
      TSP:MSG:READ 0-99-30 s=255,c=3,t=25,pt=1,l=1,sg=0:2
      TSP:MSG:PONG RECV (hops=2)
      TSP:CHKUPL:OK
      TSM:UPL:OK
      TSM:READY
      Serial started
      Voltage: 3289 mV
      TSP:MSG:SEND 30-30-99-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100
      TSP:MSG:SEND 30-30-99-0 s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=ok:2.0.0
      TSP:MSG:SEND 30-30-99-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=ok:99
      TSP:MSG:READ 0-99-30 s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      TSP:MSG:SEND 30-30-99-0 s=255,c=3,t=11,pt=0,l=15,sg=0,ft=0,st=ok:EgTmpHumBat5min
      TSP:MSG:SEND 30-30-99-0 s=255,c=3,t=12,pt=0,l=10,sg=0,ft=0,st=ok:1.0 151106
      TSP:MSG:SEND 30-30-99-0 s=0,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=ok:
      TSP:MSG:SEND 30-30-99-0 s=1,c=0,t=7,pt=0,l=0,sg=0,ft=0,st=ok:
      Node and 2 children presented.
      Request registration...
      TSP:MSG:SEND 30-30-99-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2
      TSP:MSG:READ 0-99-30 s=255,c=3,t=27,pt=1,l=1,sg=0:1
      Node registration=1
      Init complete, id=30, parent=99, distance=2, registration=1
      T: 21.59
      TempDiff :121.59
      TSP:MSG:SEND 30-30-99-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:21.6
      T sent!
      H: 81
      HumDiff  :181.00
      TSP:MSG:SEND 30-30-99-0 s=1,c=1,t=1,pt=2,l=2,sg=0,ft=0,st=ok:81
      H sent!
      Battery voltage: 3279 mV
      Battery percent: 98 %
      TSP:MSG:SEND 30-30-99-0 s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=ok:98
      T: 21.61
      TempDiff :0.02
      H: 81
      HumDiff  :0.00
      
      posted in Troubleshooting
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      @tekka Node 30 does still not care about the two lines. It is sending direct.
      It also does not send back any routing table. Maybe because it is sleeping most of the time?

      posted in Troubleshooting
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      @tekka I can add it to node 30 right now. It is also supposed to be relayed. In fact this is why I did start this thread in the first place, I had no luck with these two lines. Will try again.

      Oooohhh, there is a mistake further up: I am talking about node 30, and wrote node 3. That is incorrect. Let's see if I can edit. That is why you were asking about the 1.5...

      posted in Troubleshooting
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      @tekka Yes, with "all" I meant those being involved in the repeater stuff.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      @tekka Which log exactly? Node 3 is Mysensors 1.5... It is sitting somewhere hidden...

      posted in Troubleshooting
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      @tekka Still weird:
      99 says 0203 so 02 is going via 03?? Why?
      0 says 0263 so 02 is going via 99?

      247	22.08.2016 22:15:24	TX	99 - Repeater Node	N/A	C_INTERNAL	NO	I_DEBUG	R
      250	22.08.2016 22:15:24	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0000
      252	22.08.2016 22:15:24	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0203
      254	22.08.2016 22:15:24	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0404
      255	22.08.2016 22:15:50	TX	0 - Gateway	N/A	C_INTERNAL	NO	I_DEBUG	R
      257	22.08.2016 22:15:50	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	0263
      259	22.08.2016 22:15:50	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	6363
      
      posted in Troubleshooting
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      @tekka I received ok twice back. Now the nano (GW) is blinking like crazy. And so is the pro mini (repeater). I do a power cycle?

      posted in Troubleshooting
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      Here we go:

      10	22.08.2016 21:49:41	TX	0 - Gateway	N/A	C_INTERNAL	NO	I_DEBUG	R
      12	22.08.2016 21:49:41	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	0202
      14	22.08.2016 21:49:41	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	0303
      16	22.08.2016 21:49:41	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	0463
      18	22.08.2016 21:49:41	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	1E1E
      20	22.08.2016 21:49:42	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	1F1F
      22	22.08.2016 21:49:42	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	6363
      24	22.08.2016 21:49:42	RX	0 - Gateway	INTERNAL	C_INTERNAL	NO	I_DEBUG	8B03
      25	22.08.2016 21:50:06	TX	99 - Repeater Node	N/A	C_INTERNAL	NO	I_DEBUG	R
      28	22.08.2016 21:50:06	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0000
      30	22.08.2016 21:50:06	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0303
      32	22.08.2016 21:50:07	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	0404
      34	22.08.2016 21:50:07	RX	99 - Repeater Node	INTERNAL	C_INTERNAL	NO	I_DEBUG	1E1E
      37	22.08.2016 21:50:23	RX	2	1	C_SET	NO	V_TEMP	20.8
      39	22.08.2016 21:50:23	RX	2	0	C_SET	NO	V_HUM	76.1
      
      posted in Troubleshooting
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      @tekka So you mean I connect to my serial gateway and then issue the commands? Yes, let's see.

      posted in Troubleshooting
      karl261
      karl261
    • RE: Node is not using repeater to talk to gateway

      @tekka 1.0.0beta built 3314

      posted in Troubleshooting
      karl261
      karl261