Navigation

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

    Posts made by Markus.

    • RE: Soil moisture sensor - strange readings

      now it Looks better 🙂
      reversed D2 and D6

      D2 -> Input 10K resistor-> Output 10K Input Fork and A1-> Output fork -> D6
      The values now makes sense 🙂
      However...Would be great if someone can have a look on the Sketch because Ihave removed the OTA part and not sure If it was correct on this way.

      Many thanks
      Markus

      posted in Hardware
      Markus.
      Markus.
    • RE: Soil moisture sensor - strange readings

      Well its measuring "something"

      Fork in water
      Value1=0 1.00
      Value2=730 33.95

      Fork dry
      Value1=218 27.25
      Value2=0 100.00

      posted in Hardware
      Markus.
      Markus.
    • RE: Soil moisture sensor - strange readings

      Would be great If someone can check this Sketch.Because its giving me Always the same results

      Value1=219 27.37
      Value2=0 100.00
      Result = 63.69% (6.51cb)
      VCC = 3.39 Volts
      VCC% = 32 %
      
      #define MY_DEBUG
      #define MY_SPECIAL_DEBUG
      #define MY_SIGNAL_REPORT_ENABLED
      
      // Enable and select radio type attached 
      //#define MY_RADIO_NRF24
      #define MY_RADIO_RFM69
      //#define MY_RS485
      #define MY_RFM69_FREQUENCY RFM69_868MHZ
      
      #define MY_BAUD_RATE 38400
      
      #include <MySensors.h>
      #include <SPI.h>
      #include <Vcc.h>
      #include <Streaming.h>
      #include <math.h>
      
      //#define SLEEP_TIME_15min  900000    // 15min x 60s = 900000 ms -13% = 783000                (my arduinos show a delay of 8s/min = 13%)
      #define SLEEP_TIME_15min  5000
      #define SLEEP_TIME_1h     3600000   // 1 h = 1*60*60000 = 3600000 ms -13% = 3132000 ms
      #define SLEEP_TIME_2h     7200000   // 2 h = 2*60*60000 = 7200000 ms -13% = 6264000 ms
      #define SLEEP_TIME_3h     10800000  // 3 h = 3*60*60000 = 10800000 ms -13% = 9396000 ms
      
      #define VERSION "3.0"
      #define PIN_ALIM1 2                                   // Connect to input of resistor
      #define PIN_ALIM2 6                                   // Connect to input of measuring probe
      #define PIN_LECTURA A1
      
      #define AGUA_DIR            800.0
      #define AGUA_INV            160.0
      #define AIRE_DIR            0.0
      #define AIRE_INV            1023.0
      #define TIEMPO_LECTURA      10
      #define MAX_REP_LECTURA     20
      #define MAX_REPORTING_LOOPS 4
      
      // Battery calibration (Li-ion)
      const float VccMin   = 3.0;                         // Minimum expected Vcc level, in Volts.
      const float VccMax   = 4.2;                         // Maximum expected Vcc level, in Volts.
      const float VccCorrection = 3.82/3.74;              // Measured Vcc by multimeter divided by reported Vcc
      
      #define CHILD_MOIST_ID 1
      MyMessage msgmoist(CHILD_MOIST_ID, V_LEVEL);
      Vcc vcc(VccCorrection);
      
      int count=0;
      signed int oldv1=0, oldv2=0;
      float oldresultcb=0;
      
      void setup() {
      #ifdef MY_DEBUG
        Serial.begin(38400);
      #endif
        analogReference(DEFAULT);
        pinMode(PIN_LECTURA, INPUT);
        pinMode(PIN_ALIM1, OUTPUT);
        pinMode(PIN_ALIM2, OUTPUT);
      }
      
      void presentation(){
          sendSketchInfo("Sensor de humedad", VERSION);
          present(CHILD_MOIST_ID, S_MOISTURE, "Humedad suelo");
      }
      
      void loop()
      {
        {
         signed int value1=0, value2=0, i=0;
          float result1, result2, resultp, resultcb;
      
          //Loop until readings are stable or max number of readings is reached
          do {
            oldv1=value1; oldv2=value2;
            wait(TIEMPO_LECTURA);
            digitalWrite(PIN_ALIM1, HIGH);
            digitalWrite(PIN_ALIM2, LOW);
            wait(TIEMPO_LECTURA);
            value1 = analogRead(PIN_LECTURA);
      
            digitalWrite(PIN_ALIM1, LOW);
            digitalWrite(PIN_ALIM2, HIGH);
            wait(TIEMPO_LECTURA);
            value2 = analogRead(PIN_LECTURA);;
            digitalWrite(PIN_ALIM1, LOW);
            digitalWrite(PIN_ALIM2, LOW);
          } while (((oldv1 != value1) && (oldv2 != value2)) || (i == MAX_REP_LECTURA));
      
      /*
            0-10 Saturated Soil. Occurs for a day or two after irrigation 
            10-20 Soil is adequately wet (except coarse sands which are drying out at this range) 
            20-60 Usual range to irrigate or water (most soils except heavy clay soils). 
            60-100 Usual range to irrigate heavy clay soils 
            100-200 Soil is becoming dangerously dry
          */
          result1=constrain(value1/(AGUA_DIR-AIRE_DIR)*100.0, 1, 100);
          result2=constrain(100-(value2-AGUA_INV)/(AIRE_INV-AGUA_INV)*100.0,1,100);
          resultp = (result1+result2)/2.0;
          resultcb = resultcb + constrain(square((-2.96699 + 351.395/resultp)),0,200);                           //Equation fit using stat software
          count++;
        
          //Send the data - only if moisture changed to save battery (send anyways once every 4 readings). If moisture sent, send battery level.
          if ((oldresultcb!=resultcb) || (count==MAX_REPORTING_LOOPS)) {
            send(msgmoist.set((unsigned int)resultcb));
            oldresultcb=resultcb;
            //Measure battery voltage and send level
            float v = vcc.Read_Volts();  
            int p = vcc.Read_Perc(VccMin, VccMax);
            p=constrain(p,0,100);
            sendBatteryLevel(p);
            #ifdef MY_DEBUG
              Serial << "Value1=" << value1 << " " << result1 << endl << "Value2=" << value2 << " " << result2 << endl << "Result = " << resultp << "% (" << resultcb << "cb)" << endl;
              Serial << "VCC = " << v << " Volts" << endl << "VCC% = " << p << " %" << endl;
            #endif
          }
        
          if (count==MAX_REPORTING_LOOPS) count=0;
          //sleep(SLEEP_TIME_3h, true);
          sleep(SLEEP_TIME_15min, true);
        }
      }
      

      its connected on following Schema

      D2 -> Input 10K resistor-> Output 10K Input Fork and A1-> Output fork -> D6
      I am using a Adruino pro mini 3,3V on an Easy PCB Board.

      Many thanks

      Markus

      posted in Hardware
      Markus.
      Markus.
    • RE: Soil moisture sensor - strange readings

      @manutremo
      ….I used two digital pins (4 and 7 in my case) which I enable and disable so I can polarize the fork in one direction or the opposite. Be aware that the resistor should be connected to pin in this case, and the fork to pin 7; otherwise the formula of the voltage divider needs to be modified..

      Hi Manutremo,
      The resistor must be connected to D4 in your example? and the fork "end" to D7? The sampling pint then to A0? Or a equivalent Analog Input..?

      Thanks

      Markus

      posted in Hardware
      Markus.
      Markus.
    • Mulitple Gatways and NodeID0

      Hi All,
      I have two Gateways connected to one Controller and I want to attach on each Gateway, which have different Radios, a sensor. I know always NodeID 0 is assigned to a sensor attached to the Gateways.
      Is there any chance to give a sensor attached to the Gateway another NodeID?
      Thanks

      Markus

      posted in General Discussion
      Markus.
      Markus.
    • RE: Serial Gateway Sketch with si7021

      @gohan 😉 will try it.... -> Learning leasson... 🙂

      posted in General Discussion
      Markus.
      Markus.
    • RE: Serial Gateway Sketch with si7021

      the sensor conenction was the Problem at the end. Changed SCD and SCL and now it Looks good so far. At the Moment is the Gateway not connected to a Controller. Hope the sensor will be then also send the values...

       __  __       ____
      |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
      | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
      | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
      |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
              |___/                      2.2.0-beta
      
      0;255;3;0;9;53 MCO:BGN:INIT GW,CP=RRNGA---,VER=2.2.0-beta
      0;255;3;0;9;83 TSM:INIT
      0;255;3;0;9;92 TSF:WUR:MS=0
      0;255;3;0;9;100 TSM:INIT:TSP OK
      0;255;3;0;9;108 TSM:INIT:GW MODE
      0;255;3;0;9;118 TSM:READY:ID=0,PAR=0,DIS=0
      0;255;3;0;9;129 MCO:REG:NOT NEEDED
      0;255;3;0;14;Gateway startup complete.
      0;255;0;0;18;2.2.0-beta
      0;255;3;0;11;Gateway_SI7021
      0;255;3;0;12;1.0 161017
      0;0;0;0;6;
      0;1;0;0;7;
      0;255;3;0;9;159 MCO:BGN:STP
      Serial started
      Node and 2 children presented.
      0;255;3;0;9;684 MCO:BGN:INIT OK,TSP=1
      Loop1 started
      T: 21.49
      TempDiff :121.49
      0;0;1;0;0;21.5
      T sent!
      H: 64
      HumDiff  :164.00
      0;1;1;0;1;64
      H sent!
      Before first sleep
      0;255;3;0;9;733 MCO:SLP:MS=300000,SMS=0,I1=255,M1=255,I2=255,M2=255
      0;255;3;0;9;768 !MCO:SLP:REP
      0;255;3;0;9;124672 TSF:MSG:READ,106-106-0,s=0,c=1,t=1,pt=7,l=5,sg=0:63.3
      106;0;1;0;1;63.3
      0;255;3;0;9;124702 TSF:MSG:READ,106-106-0,s=255,c=3,t=0,pt=1,l=1,sg=0:90
      106;255;3;0;0;90
      0;255;3;0;9;124735 TSF:MSG:READ,106-106-0,s=3,c=1,t=38,pt=7,l=5,sg=0:3.71
      106;3;1;0;38;3.71
      After first sleep
      Loop1 started
      T: 21.64
      TempDiff :0.15
      H: 65
      HumDiff  :0.00
      Before first sleep
      0;255;3;0;9;300797 MCO:SLP:MS=300000,SMS=0,I1=255,M1=255,I2=255,M2=255
      0;255;3;0;9;300830 !MCO:SLP:REP
      0;255;3;0;9;428443 TSF:MSG:READ,106-106-0,s=255,c=3,t=0,pt=1,l=1,sg=0:90
      106;255;3;0;0;90
      0;255;3;0;9;428476 TSF:MSG:READ,106-106-0,s=3,c=1,t=38,pt=7,l=5,sg=0:3.72
      106;3;1;0;38;3.72
      

      But how can I prevent the Situation that a defect or missing sensor on the Gateway blocks also the Gateway function ?

      Thanks

      Markus

      posted in General Discussion
      Markus.
      Markus.
    • RE: Serial Gateway Sketch with si7021

      the Code stops here

      si7021_env data = humiditySensor.getHumidityAndTemperature();
      

      Anything wrong with the sensor I guess. But how can I handle such things?

      posted in General Discussion
      Markus.
      Markus.
    • RE: Serial Gateway Sketch with si7021

      @gohan how can i do this ? 😞

      posted in General Discussion
      Markus.
      Markus.
    • RE: Serial Gateway Sketch with si7021

      tried now the Sketch... Seems that something is wrong with the sensor.

       __  __       ____
      |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
      | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
      | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
      |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
              |___/                      2.2.0-beta
      
      0;255;3;0;9;53 MCO:BGN:INIT GW,CP=RRNGA---,VER=2.2.0-beta
      0;255;3;0;9;83 TSM:INIT
      0;255;3;0;9;92 TSF:WUR:MS=0
      0;255;3;0;9;100 TSM:INIT:TSP OK
      0;255;3;0;9;108 TSM:INIT:GW MODE
      0;255;3;0;9;118 TSM:READY:ID=0,PAR=0,DIS=0
      0;255;3;0;9;129 MCO:REG:NOT NEEDED
      0;255;3;0;14;Gateway startup complete.
      0;255;0;0;18;2.2.0-beta
      0;255;3;0;11;Gateway_SI7021
      0;255;3;0;12;1.0 161017
      0;0;0;0;6;
      0;1;0;0;7;
      0;255;3;0;9;159 MCO:BGN:STP
      Serial started
      Node and 2 children presented.
      0;255;3;0;9;684 MCO:BGN:INIT OK,TSP=1
      

      Also the issue with the attached sensor blocks completly the Gateway function.Means that the Gateway didn't receive anything. Is it possible to prevent such issue? what I mean, is it possible to seperate both functions in the Sketch in that way If something is wrong with the sensor, the Gateway can still operate?
      THX
      Markus

      posted in General Discussion
      Markus.
      Markus.
    • RE: Serial Gateway Sketch with si7021

      not yet 😉 Will try it later....

      posted in General Discussion
      Markus.
      Markus.
    • RE: Serial Gateway Sketch with si7021

      can it work like this?

      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      
      // Enable and select radio type attached
      #define MY_RADIO_RFM69
      #define MY_RFM69_FREQUENCY RFM69_868MHZ
      
      #include <Wire.h>
      #include <SI7021.h>
      #include <SPI.h>
      #include <RunningAverage.h>
      
      
      #ifdef MY_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 CHILD_ID_TEMP 0
      #define CHILD_ID_HUM 1
      // #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 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 AVERAGES 2
      
      int measureCount = 0;
      float lastTemperature = -100;
      int lastHumidity = -100;
      
      RunningAverage raHum(AVERAGES);
      SI7021 humiditySensor;
      
      
      // Enable serial gateway
      #define MY_GATEWAY_SERIAL
      
      // Define a lower baud rate for Arduino's running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender)
      #if F_CPU == 8000000L
      #define MY_BAUD_RATE 38400
      #endif
      
      // Enable inclusion mode
      #define MY_INCLUSION_MODE_FEATURE
      
      // Set inclusion mode duration (in seconds)
      #define MY_INCLUSION_MODE_DURATION 60
      
      // Set blinking period
      #define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      // Inverses the behavior of leds
      //#define MY_WITH_LEDS_BLINKING_INVERSE
      
      // Flash leds on rx/tx/err
      // Uncomment to override default HW configurations
      //#define MY_DEFAULT_ERR_LED_PIN 4  // Error led pin
      //#define MY_DEFAULT_RX_LED_PIN  6  // Receive led pin
      //#define MY_DEFAULT_TX_LED_PIN  5  // the PCB, on board LED
      
      #include <MySensors.h>
      
      MyMessage msgTemp(CHILD_ID_TEMP,V_TEMP); // Initialize temperature message
      MyMessage msgHum(CHILD_ID_HUM,V_HUM);
      
      
      void setup()
      {
        DEBUG_SERIAL(38400);    // <<<<<<<<<<<<<<<<<<<<<<<<<< Note BAUD_RATE in MySensors.h
        DEBUG_PRINTLN("Serial started");
        delay(500); // Allow time for radio if power useed as reset
        DEBUG_PRINT("Node and "); DEBUG_PRINTLN("2 children presented.");
         raHum.clear();
        
      }
      
      void presentation()
      { 
        sendSketchInfo("Gateway_SI7021", "1.0 161017");
        present(CHILD_ID_TEMP, S_TEMP);   // Present sensor to controller
        present(CHILD_ID_HUM, S_HUM);
      }
      
      
      void loop()
      { 
      
        measureCount ++;
        bool forceTransmit = false;
        
        if (measureCount > FORCE_TRANSMIT_CYCLE) {
          forceTransmit = true; 
        }
        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");        
      */
       
        sleep(SLEEP_TIME);
      }
      
      /*********************************************
       * * 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;
      
        si7021_env data = humiditySensor.getHumidityAndTemperature();
        
        float temperature = data.celsiusHundredths / 100.0;
        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 = data.humidityPercent;
        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!");
        }
      
      }
      
      
      posted in General Discussion
      Markus.
      Markus.
    • RE: Serial Gateway Sketch with si7021

      the Problem is I cnnaot find any simple Mysensors Sketch to read a SI7021 😞
      Only with battery Monitoring which I don't Need...

      posted in General Discussion
      Markus.
      Markus.
    • RE: Serial Gateway Sketch with si7021

      Did a mistake with the Libary. Used now the SI7021 from MySensorsArduinoExamples-master and this seems to be okay now

      posted in General Discussion
      Markus.
      Markus.
    • RE: Serial Gateway Sketch with si7021

      Well the Problem seems to be in the first step to get a working SI7021 Sketch for MySensors 2.2.0 Beta or 2.1.1.
      I did Try to complie this one now:

      /* Sketch with Si7021 and battery monitoring.
      by m26872, 20151109 
      */
      
      #define MY_DEBUG
      #define MY_RADIO_NRF24
      #define MY_NODE_ID 5             // <<<<<<<<<<<<<<<<<<<<<<<<<<<   Enter Node_ID
      #define MY_BAUD_RATE 115200
      
      #include <MySensors.h>  
      #include <Wire.h>
      #include <SI7021.h>
      #include <SPI.h>
      #include <RunningAverage.h>
      
      //#define 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 CHILD_ID_TEMP 0
      #define CHILD_ID_HUM 1
      // #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 AVERAGES 2
      
      int batteryReportCounter = BATTERY_REPORT_CYCLE - 1;  // to make it report the first time.
      int measureCount = 0;
      float lastTemperature = -100;
      int lastHumidity = -100;
      
      RunningAverage raHum(AVERAGES);
      SI7021 humiditySensor;
      
      MyMessage msgTemp(CHILD_ID_TEMP,V_TEMP); // Initialize temperature message
      MyMessage msgHum(CHILD_ID_HUM,V_HUM);
      
      
      void presentation()  
      { 
        sendSketchInfo("EgTmpHumBat5min", "1.0 151106");
        present(CHILD_ID_TEMP, S_TEMP);   // Present sensor to controller
        present(CHILD_ID_HUM, S_HUM);
      }
      
      
      void setup() {
        DEBUG_SERIAL(115200);    // <<<<<<<<<<<<<<<<<<<<<<<<<< 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");
      */  
        delay(500); // Allow time for radio if power useed as reset
        DEBUG_PRINT("Node and "); DEBUG_PRINTLN("2 children presented.");
        
        raHum.clear();
        
      }
      
      void loop() { 
      
        measureCount ++;
        batteryReportCounter ++;
        bool forceTransmit = false;
        
        if (measureCount > FORCE_TRANSMIT_CYCLE) {
          forceTransmit = true; 
        }
        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);
      }
      
      // 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 = 1125300L / 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;
      
        si7021_env data = humiditySensor.getHumidityAndTemperature();
        
        float temperature = data.celsiusHundredths / 100.0;
        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 = data.humidityPercent;
        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!");
        }
      
      }
      

      But I get always follwoing error...

      exit status 1
      'si7021_env' has no member named 'humidityPercent'
      

      So I am a bit lost at the Moment due to my limited coding Knowledge.. 😞

      posted in General Discussion
      Markus.
      Markus.
    • Serial Gateway Sketch with si7021

      Hi All,
      I have biuld a Serial Gateway based on RFM69 and a ProMini. Its working great so far. But I want to implement in this Sketch also a Sensor si7021. I have currently no idea how i can implent the sensor part into the Gateway Sketch. Hope someone can help me there.

      Thanks

      Markus

      posted in General Discussion
      Markus.
      Markus.
    • RE: 💬 NRF2RFM69

      @gohan yes and i didn't checked the PCB Label...shit happends

      posted in OpenHardware.io
      Markus.
      Markus.
    • RE: 💬 NRF2RFM69

      @gohan the arrow goes to the Jumper close to the cap on the NRF socket.
      [link text]https://www.openhardware.io/view/4/EasyNewbie-PCB-for-MySensors(link url)
      But the other Jumper isthe right one . Well, could be also wrong interpreted frommy site, however ist now working and the range is also fine so far...

      posted in OpenHardware.io
      Markus.
      Markus.
    • RE: 💬 NRF2RFM69

      @gohan ohhhh helllll... its working.. As usual.. the Problem was infront of the Monitor... 🙂 So, two Problems. the first mistake i did was to use a HW module as Gateway. The power source was a FTDI adaptor which has only max Output current of 50mA (HW module Needs 120mA Minimum). The result was randomly reboot of the Gateway. The second and main Problem was the Jumper of the IRQ on the Easy PCB boards. I checked only the domumentation and there is the Jumper wrong descriped. So i placed the Jumper wrong. I have corrected this now on my two test boards and use a W module on the Gateway.. now its working 🙂
      Many thanks for all the Patience... 🙂

      posted in OpenHardware.io
      Markus.
      Markus.
    • RE: 💬 NRF2RFM69

      @gohan 10uF electrolyt cap direct on the radios already tierd beside the 4,7uF on the Radio socket.

      posted in OpenHardware.io
      Markus.
      Markus.
    • RE: 💬 NRF2RFM69

      I think at the end will it be a power problem. It seems that the sensor node powered with 2x AA cells can not handle the Radio on TX/RX. The same on the Gateway site which is also a Easy PBB powered fom the FTDI Connector connected to USB. The question now is how can i fix this power Problems ? Or more, how can i make sure that this is definitly not the reason.

      posted in OpenHardware.io
      Markus.
      Markus.
    • RE: 💬 NRF2RFM69

      @mfalkvidd you are right... Ist now added in the GW and node Sketch, but still the same Problem.

      posted in OpenHardware.io
      Markus.
      Markus.
    • RE: 💬 NRF2RFM69

      @alexsh1 should be, becaus ist not defined explicit in the Sketch. By Default in the MYS Lib 2.2 dev is it 868 mhz. And when i try to define the frequency in the Sketch. Like #define MY_RFM69_FREQUENCY RF69_868MHZ
      I get the error message. 'RF69_868MHZ' was not declared in this scope

      posted in OpenHardware.io
      Markus.
      Markus.
    • RE: 💬 NRF2RFM69

      @alexsh1 I use at the Moment RFm69W 868 modules not NRF. Because the RFMs are mounted on the NRF connector on an EasyPCB. I use at the Moment single wire antennas with a lenght of 8,3 cm.

      posted in OpenHardware.io
      Markus.
      Markus.
    • RE: 💬 NRF2RFM69

      @gohan 😞 any idea what else I can do/check ?

      posted in OpenHardware.io
      Markus.
      Markus.
    • RE: 💬 NRF2RFM69

      in principle there is traffic between node and Gateway..

      159631 !TSM:FPAR:NO REPLY
      159637 TSM:FPAR
      169848 TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      171868 !TSM:FPAR:NO REPLY
      171874 TSM:FPAR
      179087 TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      181106 !TSM:FPAR:FAIL
      181112 TSM:FAIL:CNT=4
      181118 TSM:FAIL:DIS
      181123 TSF:TDI:TSL
      191131 TSM:FAIL:RE-INIT
      191137 TSM:INIT
      191143 TSM:INIT:TSP OK
      191150 TSM:INIT:STATID=10
      191158 TSF:SID:OK,ID=10
      191164 TSM:FPAR
      198377 TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      200396 !TSM:FPAR:NO REPLY
      200402 TSM:FPAR
      207616 TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      209635 !TSM:FPAR:NO REPLY
      209641 TSM:FPAR
      216854 TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      218873 !TSM:FPAR:NO REPLY
      218880 TSM:FPAR
      226093 TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      228112 !TSM:FPAR:FAIL
      228118 TSM:FAIL:CNT=5
      228124 TSM:FAIL:DIS
      228128 TSF:TDI:TSL
      238135 TSM:FAIL:RE-INIT
      238141 TSM:INIT
      238147 TSM:INIT:TSP OK
      238153 TSM:INIT:STATID=10
      238161 TSF:SID:OK,ID=10
      238168 TSM:FPAR
      248385 TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      250404 !TSM:FPAR:NO REPLY
      250411 TSM:FPAR
      257624 TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      259643 !TSM:FPAR:NO REPLY
      259649 TSM:FPAR
      269731 TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      271751 !TSM:FPAR:NO REPLY
      271757 TSM:FPAR
      
      
      0;255;3;0;9;189196 TSF:PNG:SEND,TO=0
      0;255;3;0;9;189206 TSF:CKU:OK
      0;255;3;0;9;189214 TSF:MSG:GWL OK
      0;255;3;0;9;191236 !TSF:MSG:SEND,0-0-10-10,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
      0;255;3;0;9;244555 TSF:MSG:READ,10-10-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      0;255;3;0;9;244574 TSF:MSG:BC
      0;255;3;0;9;244582 TSF:MSG:FPAR REQ,ID=10
      0;255;3;0;9;244594 TSF:PNG:SEND,TO=0
      0;255;3;0;9;244604 TSF:CKU:OK
      0;255;3;0;9;244613 TSF:MSG:GWL OK
      0;255;3;0;9;257744 !TSF:MSG:SEND,0-0-10-10,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
      0;255;3;0;9;269957 TSF:MSG:READ,10-10-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      0;255;3;0;9;269977 TSF:MSG:BC
      0;255;3;0;9;269985 TSF:MSG:FPAR REQ,ID=10
      0;255;3;0;9;269996 TSF:PNG:SEND,TO=0
      0;255;3;0;9;270006 TSF:CKU:OK
      0;255;3;0;9;270014 TSF:MSG:GWL OK
      0;255;3;0;9;281585 !TSF:MSG:SEND,0-0-10-10,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
      0;255;3;0;9;289732 TSF:MSG:READ,10-10-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      0;255;3;0;9;289753 TSF:MSG:BC
      0;255;3;0;9;289761 TSF:MSG:FPAR REQ,ID=10
      0;255;3;0;9;289771 TSF:PNG:SEND,TO=0
      0;255;3;0;9;289781 TSF:CKU:OK
      0;255;3;0;9;289789 TSF:MSG:GWL OK
      0;255;3;0;9;297015 !TSF:MSG:SEND,0-0-10-10,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
      0;255;3;0;9;306757 TSF:MSG:READ,10-10-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      0;255;3;0;9;306776 TSF:MSG:BC
      0;255;3;0;9;306784 TSF:MSG:FPAR REQ,ID=10
      0;255;3;0;9;306796 TSF:PNG:SEND,TO=0
      0;255;3;0;9;306806 TSF:CKU:OK
      0;255;3;0;9;306814 TSF:MSG:GWL OK
      0;255;3;0;9;316682 !TSF:MSG:SEND,0-0-10-10,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
      0;255;3;0;9;322084 TSF:MSG:READ,10-10-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      0;255;3;0;9;322103 TSF:MSG:BC
      0;255;3;0;9;322111 TSF:MSG:FPAR REQ,ID=10
      0;255;3;0;9;322123 TSF:PNG:SEND,TO=0
      0;255;3;0;9;322131 TSF:CKU:OK
      0;255;3;0;9;322142 TSF:MSG:GWL OK
      0;255;3;0;9;333180 !TSF:MSG:SEND,0-0-10-10,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
      
      
      
      posted in OpenHardware.io
      Markus.
      Markus.
    • RE: 💬 NRF2RFM69

      @gohan Oh Sh* must check this... I've tried it yesterday on both devices the 2.2 Dev. But will Keep ypu informed...
      Don't find the jumperfor the IRQ on the Rev 9 board. can you please post a Picture. Seems that this one is definitly not closed...
      --> Edit... found it in the documentation but still the same.
      Think the next Point to check for me are the antennas... 😞

      posted in OpenHardware.io
      Markus.
      Markus.
    • RE: 💬 NRF2RFM69

      @gohan It at the Moment only a test. So I have one EasyPCB NRF board with FTDI as Gateway and another EasyPCB board with DHT22 Sensor attached as Node. On both is a 4,7uF electrolytic condensator attached Close to the NRF socket. Both boards are at the Moment with RFM69W 868. The sensor node is battey powered.

      posted in OpenHardware.io
      Markus.
      Markus.
    • RE: 💬 NRF2RFM69

      just one more question... I have on the Gateway a RFM69HW and a node with a RFM69W module. In the Gateway Sketch is the HW type enabled

      #define MY_RFM69_FREQUENCY RF69_868MHZ
      #define MY_IS_RFM69HW
      

      But there is no comunication from the node... I use Mysensors 2.1.1.
      Any idea?

      posted in OpenHardware.io
      Markus.
      Markus.
    • RE: 💬 NRF2RFM69

      @tbowmo Thanks for the Information... One stupid question about the SMA conenctor 🙂 Is it enough to connect only the Antenna Output conenction or must GND also conencted...?

      posted in OpenHardware.io
      Markus.
      Markus.
    • RE: Easy/Newbie PCB for MySensors

      @gohan Sounds good 🙂 well, I have a 10uF electrolytic there. Hope it makes not the big difference. On the boards with NRF works that fine so far.

      posted in Hardware
      Markus.
      Markus.
    • RE: 💬 NRF2RFM69

      Hi all,
      which size of cap should be used on this board and is it possible to connect a SMA Antenna ?

      Many thanks

      Markus

      posted in OpenHardware.io
      Markus.
      Markus.
    • RE: Easy/Newbie PCB for MySensors

      @gohan its eactly the adaptor board which i try to use at the Moment.
      But I am not sure If the test Sketch can work. Because the pin Definition could be different to get it working on the Easy PCB with RFM69 ?!

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

      @korttoma yes i use the pro mini 3,3V but can Ireplace the Radios simply with a modification of the Sketch ? Because hen I Flash following Sketch to the Easy pcb:

      // Sample RFM69 receiver/gateway sketch, with ACK and optional encryption, and Automatic Transmission Control
      // Passes through any wireless received messages to the serial port & responds to ACKs
      // It also looks for an onboard FLASH chip, if present
      // **********************************************************************************
      // Copyright Felix Rusu 2016, http://www.LowPowerLab.com/contact
      // **********************************************************************************
      // 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.                              
      //                                                        
      // Licence can be viewed at                               
      // http://www.gnu.org/licenses/gpl-3.0.txt
      //
      // Please maintain this license information along with authorship
      // and copyright notices in any redistribution of this code
      // **********************************************************************************
      #include <RFM69.h>         //get it here: https://www.github.com/lowpowerlab/rfm69
      #include <RFM69_ATC.h>     //get it here: https://www.github.com/lowpowerlab/rfm69
      #include <SPIFlash.h>      //get it here: https://www.github.com/lowpowerlab/spiflash
      #include <SPI.h>           //included with Arduino IDE install (www.arduino.cc)
      
      //*********************************************************************************************
      //************ IMPORTANT SETTINGS - YOU MUST CHANGE/CONFIGURE TO FIT YOUR HARDWARE *************
      //*********************************************************************************************
      #define NODEID        1    //unique for each node on same network
      #define NETWORKID     100  //the same on all nodes that talk to each other
      //Match frequency to the hardware version of the radio on your Moteino (uncomment one):
      //#define FREQUENCY     RF69_433MHZ
      #define FREQUENCY     RF69_868MHZ
      //#define FREQUENCY     RF69_915MHZ
      #define ENCRYPTKEY    "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes!
      #define IS_RFM69HW_HCW  //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
      //*********************************************************************************************
      //Auto Transmission Control - dials down transmit power to save battery
      //Usually you do not need to always transmit at max output power
      //By reducing TX power even a little you save a significant amount of battery power
      //This setting enables this gateway to work with remote nodes that have ATC enabled to
      //dial their power down to only the required level
      #define ENABLE_ATC    //comment out this line to disable AUTO TRANSMISSION CONTROL
      //*********************************************************************************************
      #define SERIAL_BAUD   115200
      
      #ifdef __AVR_ATmega1284P__
        #define LED           15 // Moteino MEGAs have LEDs on D15
        #define FLASH_SS      23 // and FLASH SS on D23
      #else
        #define LED           9 // Moteinos have LEDs on D9
        #define FLASH_SS      8 // and FLASH SS on D8
      #endif
      
      #ifdef ENABLE_ATC
        RFM69_ATC radio;
      #else
        RFM69 radio;
      #endif
      
      SPIFlash flash(FLASH_SS, 0xEF30); //EF30 for 4mbit  Windbond chip (W25X40CL)
      bool promiscuousMode = false; //set to 'true' to sniff all packets on the same network
      
      void setup() {
        Serial.begin(SERIAL_BAUD);
        delay(10);
        radio.initialize(FREQUENCY,NODEID,NETWORKID);
      #ifdef IS_RFM69HW_HCW
        radio.setHighPower(); //must include this only for RFM69HW/HCW!
      #endif
        radio.encrypt(ENCRYPTKEY);
        radio.promiscuous(promiscuousMode);
        //radio.setFrequency(919000000); //set frequency to some custom frequency
        char buff[50];
        sprintf(buff, "\nListening at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);
        Serial.println(buff);
        if (flash.initialize())
        {
          Serial.print("SPI Flash Init OK. Unique MAC = [");
          flash.readUniqueId();
          for (byte i=0;i<8;i++)
          {
            Serial.print(flash.UNIQUEID[i], HEX);
            if (i!=8) Serial.print(':');
          }
          Serial.println(']');
          
          //alternative way to read it:
          //byte* MAC = flash.readUniqueId();
          //for (byte i=0;i<8;i++)
          //{
          //  Serial.print(MAC[i], HEX);
          //  Serial.print(' ');
          //}
        }
        else
          Serial.println("SPI Flash MEM not found (is chip soldered?)...");
          
      #ifdef ENABLE_ATC
        Serial.println("RFM69_ATC Enabled (Auto Transmission Control)");
      #endif
      }
      
      byte ackCount=0;
      uint32_t packetCount = 0;
      void loop() {
        //process any serial input
        if (Serial.available() > 0)
        {
          char input = Serial.read();
          if (input == 'r') //d=dump all register values
            radio.readAllRegs();
          if (input == 'E') //E=enable encryption
            radio.encrypt(ENCRYPTKEY);
          if (input == 'e') //e=disable encryption
            radio.encrypt(null);
          if (input == 'p')
          {
            promiscuousMode = !promiscuousMode;
            radio.promiscuous(promiscuousMode);
            Serial.print("Promiscuous mode ");Serial.println(promiscuousMode ? "on" : "off");
          }
          
          if (input == 'd') //d=dump flash area
          {
            Serial.println("Flash content:");
            int counter = 0;
      
            while(counter<=256){
              Serial.print(flash.readByte(counter++), HEX);
              Serial.print('.');
            }
            while(flash.busy());
            Serial.println();
          }
          if (input == 'D')
          {
            Serial.print("Deleting Flash chip ... ");
            flash.chipErase();
            while(flash.busy());
            Serial.println("DONE");
          }
          if (input == 'i')
          {
            Serial.print("DeviceID: ");
            word jedecid = flash.readDeviceId();
            Serial.println(jedecid, HEX);
          }
          if (input == 't')
          {
            byte temperature =  radio.readTemperature(-1); // -1 = user cal factor, adjust for correct ambient
            byte fTemp = 1.8 * temperature + 32; // 9/5=1.8
            Serial.print( "Radio Temp is ");
            Serial.print(temperature);
            Serial.print("C, ");
            Serial.print(fTemp); //converting to F loses some resolution, obvious when C is on edge between 2 values (ie 26C=78F, 27C=80F)
            Serial.println('F');
          }
        }
      
        if (radio.receiveDone())
        {
          Serial.print("#[");
          Serial.print(++packetCount);
          Serial.print(']');
          Serial.print('[');Serial.print(radio.SENDERID, DEC);Serial.print("] ");
          if (promiscuousMode)
          {
            Serial.print("to [");Serial.print(radio.TARGETID, DEC);Serial.print("] ");
          }
          for (byte i = 0; i < radio.DATALEN; i++)
            Serial.print((char)radio.DATA[i]);
          Serial.print("   [RX_RSSI:");Serial.print(radio.RSSI);Serial.print("]");
          
          if (radio.ACKRequested())
          {
            byte theNodeID = radio.SENDERID;
            radio.sendACK();
            Serial.print(" - ACK sent.");
      
            // When a node requests an ACK, respond to the ACK
            // and also send a packet requesting an ACK (every 3rd one only)
            // This way both TX/RX NODE functions are tested on 1 end at the GATEWAY
            if (ackCount++%3==0)
            {
              Serial.print(" Pinging node ");
              Serial.print(theNodeID);
              Serial.print(" - ACK...");
              delay(3); //need this when sending right after reception .. ?
              if (radio.sendWithRetry(theNodeID, "ACK TEST", 8, 0))  // 0 = only 1 attempt, no retries
                Serial.print("ok!");
              else Serial.print("nothing");
            }
          }
          Serial.println();
          Blink(LED,3);
        }
      }
      
      void Blink(byte PIN, int DELAY_MS)
      {
        pinMode(PIN, OUTPUT);
        digitalWrite(PIN,HIGH);
        delay(DELAY_MS);
        digitalWrite(PIN,LOW);
      }
      
      

      I get following result:

      Listening at 868 Mhz...
      SPI Flash MEM not found (is chip soldered?)...
      RFM69_ATC Enabled (Auto Transmission Control)
      
      
      
      
      posted in Hardware
      Markus.
      Markus.
    • RE: Easy/Newbie PCB for MySensors

      Hi All,
      I have a lot of these PCBs in Rev.9 running as battery powered sensors. Also some with regulated power. They are running currentl with a NRF24L01. But i need to use on some sensors a RFM69 868 Radio. I have few breakout boards to use a RFM69 on a NRF24L01 connector. Is it possilbe just to replace the Radios on my EasyPBCs NRF to use RFM69 Radios? Think from power perspective should this be working. Well I know I have to Change also the Radio type in the Sketch. But is there anything more to do? Like cabling or specific Settings in the Sketch?

      Many Thanks
      Markus

      posted in Hardware
      Markus.
      Markus.
    • RE: RFM69 HW / W

      Hi Both,

      many thanks for the Information... Regarding the modules a last question.. 😉
      Are the RFM69CW or HCW modules in view of the communication fully compatible to W or HW Modules? I know the footprint and maybe the pinout is different.

      posted in General Discussion
      Markus.
      Markus.
    • RE: RFM69 HW / W

      Ahh great... thanks for the infromation. But beside any regulations, does it makes sense to fit a HW Version on the Gateway and use on the nodes W versions?

      posted in General Discussion
      Markus.
      Markus.
    • RFM69 HW / W

      Hi All,
      I am at the moment a bit confused about the usage of RFM69 HW or/ and W. Think too much informations spread over many many posts... 😉
      I want to rebuild my Sensors Netwirk based on RFM 868 Radios to replace the existing NRF24L01 where i have more and more problems with the coverage. I've saw in some posts different Statements about the usage for example on battery powered nodes. Some guys say its preffered to use on the gateway a RFM69 HW and on the battery powered nodes the W Version.
      So whats now correct? Because I am from Germany and heard from some guys here, that the W Version is not allowed to use due to a too powerfull Signal. Hope somebody here can give me the right direction 🙂

      Thanks

      Markus

      posted in General Discussion
      Markus.
      Markus.
    • RE: Relay with button wihtout ackn from controller

      ahh okay thanks 🙂
      And If I want to use both funtionallitys ... For example a Button Input Change the state and also the Controller itself can Change the state like the normal relay sketch?

      posted in Troubleshooting
      Markus.
      Markus.
    • Relay with button wihtout ackn from controller

      Hi All,
      I am a bit lost at the moment with the Sketch "relay with button". If i understand this code correctly, is the normal process "push the button" ->node sends Status Change to Controller and wait for ack from Controller.
      How can i get this working without to wait for the Controllers ack ?

      
      // Enable debug prints to serial monitor
      #define MY_DEBUG 
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      
      #include <MySensors.h>
      #include <SPI.h>
      #include <Bounce2.h>
      
      #define RELAY_PIN 5  // Arduino Digital I/O pin number for relay 
      #define BUTTON_PIN 6  // Arduino Digital I/O pin number for button 
      #define CHILD_ID 1   // Id of the sensor child
      #define RELAY_ON 1
      #define RELAY_OFF 0
      //#define MY_NODE_ID 98
      //#define MY_PARENT_NODE_ID 0
      //#define MY_PARENT_NODE_IS_STATIC
      //#define MY_RF24_PA_LEVEL RF24_PA_MIN
      
      Bounce debouncer = Bounce(); 
      int oldValue=0;
      bool state;
      
      MyMessage msg(CHILD_ID,V_LIGHT);
      
      void setup()  
      {  
        // Setup the button
        pinMode(BUTTON_PIN,INPUT);
        // Activate internal pull-up
        digitalWrite(BUTTON_PIN,HIGH);
      
        // After setting up the button, setup debouncer
        debouncer.attach(BUTTON_PIN);
        debouncer.interval(5);
      
        // Make sure relays are off when starting up
        digitalWrite(RELAY_PIN, RELAY_OFF);
        // Then set relay pins in output mode
        pinMode(RELAY_PIN, OUTPUT);   
      
        // Set relay to last known state (using eeprom storage) 
        state = loadState(CHILD_ID);
        digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF);
      }
      
      void presentation()  {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Relay & Button", "1.0");
      
        // Register all sensors to gw (they will be created as child devices)
        present(CHILD_ID, S_LIGHT);
      }
      
      /*
      *  Example on how to asynchronously check for new messages from gw
      */
      void loop() 
      {
        debouncer.update();
        // Get the update value
        int value = debouncer.read();
        if (value != oldValue && value==0) {
            send(msg.set(state?false:true), true); // Send new state and request ack back
        }
        oldValue = value;
      } 
      
      void receive(const MyMessage &message) {
        // We only expect one type of message from controller. But we better check anyway.
        if (message.isAck()) {
           Serial.println("This is an ack from gateway");
        }
      
        if (message.type == V_LIGHT) {
           // Change relay state
           state = message.getBool();
           digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF);
           // Store state in eeprom
           saveState(CHILD_ID, state);
      
           // Write some debug info
           Serial.print("Incoming change for sensor:");
           Serial.print(message.sensor);
           Serial.print(", New status: ");
           Serial.println(message.getBool());
         } 
      }
      

      Many Thanks

      Markus

      posted in Troubleshooting
      Markus.
      Markus.
    • RE: Temperature sensor WITH battery monitor

      Anyone here an idea how i can get the voltage send tomthe gateway? Works great so far except the send of the voltage ....:-(

      posted in Troubleshooting
      Markus.
      Markus.
    • RE: Housing/Box for ESP8266Wlan Gateway

      @mwalker very interested in the results of your testing 😊

      posted in Enclosures / 3D Printing
      Markus.
      Markus.
    • RE: Temperature sensor WITH battery monitor

      @AWI Hope you can give me an example because it seems that the requiered programming Level currently are over my Knowledge 😉

      THX
      Markus

      posted in Troubleshooting
      Markus.
      Markus.
    • RE: Temperature sensor WITH battery monitor

      Its working so far.:-) But the battery voltage is only available as serial print. How must i change the file to get also the voltage send to the gateway? Simply by adding the send command before the sleep?

      Thx

      M.

      posted in Troubleshooting
      Markus.
      Markus.
    • RE: Temperature sensor WITH battery monitor

      Hi
      I know this is an old post but I try to convert this Sketch to use it with Version 2.1.and I am not sure If this can be work because I am tottaly new in Arduino and Mysenseors

      // Enable debug prints to serial monitor
      //#define MY_DEBUG 
      
      // Enable and select radio type attached
       #define MY_RADIO_NRF24
       
      // Example sketch showing how to send in OneWire temperature readings
       #include <MySensors.h>
       #include <SPI.h>
       #include <DallasTemperature.h>
       #include <OneWire.h>
      
       #define COMPARE_TEMP 0 // Send temperature only if changed? 1 = Yes 0 = No
       #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected
       #define MAX_ATTACHED_DS18B20 16
       unsigned long SLEEP_TIME = 300000; // Sleep time between reads (in milliseconds)
       OneWire oneWire(ONE_WIRE_BUS);
       DallasTemperature sensors(&oneWire);
       //MySensors gw;
       float lastTemperature[MAX_ATTACHED_DS18B20];
       int numSensors=0;
       boolean receivedConfig = false;
       boolean metric = true;
       // Initialize temperature message
       MyMessage msg(0,V_TEMP);
      
      int BATTERY_SENSE_PIN = A0; // select the input pin for the battery sense point
       int oldBatteryPcnt = 0;
      
      void setup()
       {
       // Startup OneWire
       sensors.begin();
      
      // Send the sketch version information to the gateway and Controller
       sendSketchInfo("Temperature Sensor", "1.0");
      
      // Fetch the number of attached temperature sensors
       numSensors = sensors.getDeviceCount();
      
      // Present all sensors to controller
       for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
       present(i, S_TEMP);
       }
      
      // use the 1.1 V internal reference
       analogReference(INTERNAL);
       }
      
      void loop()
       {
       
      // Fetch temperatures from Dallas sensors
       sensors.requestTemperatures();
      
      // Read temperatures and send them to controller
       for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; 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.;
      
      // Only send data if temperature has changed and no error
      if (lastTemperature[i] != temperature && temperature != -127.00) {
      
        // Send in the new temperature
        send(msg.setSensor(i).set(temperature,1));
        lastTemperature[i]=temperature;
      }
      }
      
      // get the battery Voltage
       int sensorValue = analogRead(BATTERY_SENSE_PIN);
       Serial.println(sensorValue);
       // 1M, 470K divider across battery and using internal ADC ref of 1.1V
       // Sense point is bypassed with 0.1 uF cap to reduce noise at that point
       // ((1e6+470e3)/470e3)*1.1 = Vmax = 3.44 Volts
       // 3.44/1023 = Volts per bit = 0.003363075
       float batteryV = sensorValue * 0.004106;
       int batteryPcnt = sensorValue / 10;
       Serial.print("Battery Voltage: ");
       Serial.print(batteryV);
       Serial.println(" V");
       Serial.print("Battery percent: ");
       Serial.print(batteryPcnt);
       Serial.println(" %");
       if (oldBatteryPcnt != batteryPcnt) {
       // Power up radio after sleep
       sendBatteryLevel(batteryPcnt);
       oldBatteryPcnt = batteryPcnt;
       }
      
      sleep(SLEEP_TIME);
       }
      

      Would be great If someone confirm Ifthis is correct so far...

      Many thanks

      Markus

      posted in Troubleshooting
      Markus.
      Markus.
    • RE: Battery based atmega328p sensor (no SMD)

      @AWI So I will Keep my batterys above 2.7 Volts ..:-)
      So in Summary... Hope its now correct

      1. Shorting the 3V3 Connections (right site of the Picture)
      2. plus from Battery to VBAT
      3. minus to any GND

      Any many many thanks for your Patience !!!!

      posted in Hardware
      Markus.
      Markus.
    • RE: Battery based atmega328p sensor (no SMD)

      yes thats the idea to operate themwith 2xAA cells.... 😉 So it means that I can use each GND conenction for Minus and each 3V3 connction for plus....
      Ohhh hell.. 🙂 And what exactly do you mean with "burning the fuses for operating at low voltages" ?? Thought I can simple connect my Minus from the Battery to a Connection on the board and also the Plus to get it working with Batterys...:-(
      What I also not understand is .."If powered by two AA or AAA batteries, the circuits VCC and 3V3 should be connected. This is done by shorting jumper "J1"." ...
      Hope I will understand all this in the next 100 years .. 🙂

      posted in Hardware
      Markus.
      Markus.
    • RE: Battery based atmega328p sensor (no SMD)

      @AWI many thanks thats now clear for me. Sorry for all this questions but I've started to learn.... 😞
      I can see on the board some 3,3 V Connections beside VCC and VBAT. Where is now the correct place to connect the Battery as power supply ?

      Thanks

      Markus

      posted in Hardware
      Markus.
      Markus.
    • RE: Battery based atmega328p sensor (no SMD)

      And how should i connect correctly the battery for the power supply? A complete cabeling diagramm would be great... 🙂

      posted in Hardware
      Markus.
      Markus.
    • RE: Battery based atmega328p sensor (no SMD)

      Sorry i mean this one here

      https://www.openhardware.io/view/5/Battery-based-atmega328p-sensor-no-SMD
      And how must i connect the ftdi usb adapter to flash this board...

      Thx

      M

      posted in Hardware
      Markus.
      Markus.
    • Battery based atmega328p sensor (no SMD)

      Hi all,

      Well, iam starting to learn to use pcbs. I have now two of above mentioned sensor boards. But im anot sure how i connect the batterrys for the power supply or the Ftdi usb adapter for programming. Is there a kind of cabling diagramm available where i can see how and where which connection must be done?

      Many thanks

      Markus

      posted in Hardware
      Markus.
      Markus.
    • RE: Housing/Box for ESP8266Wlan Gateway

      Hi again,

      Wherencan i find more information on how i can modify the pcb to connect an external Antenna ?

      Many thanks

      Markus

      posted in Enclosures / 3D Printing
      Markus.
      Markus.
    • RE: Housing/Box for ESP8266Wlan Gateway

      Hi @mfalkvidd, Finally I want to create a new Mysensors Network with a new Gateway. As already mentioned I have now a new Gateway which is already connected to my Server. But I have my doubts about the wifi coverage.

      posted in Enclosures / 3D Printing
      Markus.
      Markus.
    • RE: German users

      ja ich... 🙂
      Aber noch ganz frisch auf dem Gebiet..

      posted in General Discussion
      Markus.
      Markus.
    • Housing/Box for ESP8266Wlan Gateway

      Hi All,
      I am totally new in Mysensors with really less Knowledge about Hardware and programming. However.. I have started to order the above mentioned Gateway and was able to get it working. But now two Questions.. 😉

      1. Is there anywhere a Box or housing available for this device
      2. What must be done to get another WIfi Module installed with external antenna?

      THX

      Markus

      posted in Enclosures / 3D Printing
      Markus.
      Markus.