Navigation

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

    Posts made by Mr_sensor

    • RE: 💬 Easy/Newbie PCB for MySensors

      I'm not sure if this is the right place to ask. But it seems right to me 🙂
      Hi I have e few of the Easy/Newbie-pcb working for some time with good effort. One of them even in a shed at 20 - 25 meters in the garden which is fairly good isolated. Sending Temp/Hum/battery level. And the Gateway is in the house on the first floor behind a door in a wardrobe.

      Now I have a second shed which is behind the fist shed. Also very good isolated. The pcb I have in there is not reaching the gateway (it did before until the battery was empty).
      Can I have the pcb in the first shed also working as an extender, so the second pcb will be able to send out topics to the gateway as well? What to add to my code to achieve that?

      posted in OpenHardware.io
      Mr_sensor
      Mr_sensor
    • RE: What is loaded / running on the arduino?

      @mfalkvidd said in What is loaded / running on the arduino?:

      @mr_sensor you are correct that it is not possible to get the sketch from the Arduino.

      But all MySensors sketches have something like this:

      sendSketchInfo("TemperatureAndHumidity", "1.1");
      

      which identifies which type of sketch and the version of that sketch, every time the sensor is restarted. If you store your sketches in some version control system (git is most popular), keeping track of them becomes quite easy.

      See also https://forum.mysensors.org/topic/2203/method-to-reveal-sketch-inside-node-or-g-w for an earlier discussion on a similar topic.

      @mfalkvidd thanks for the reply. The sendSketchInfo is indeed helpfull will also read the link.

      posted in General Discussion
      Mr_sensor
      Mr_sensor
    • What is loaded / running on the arduino?

      Just a question that is on my mind for some time now. When a sketch is loaded on a arduino (in my case a pro mini) how to see / find out what is on that board? Or is that even not possible?
      After some time running a node and building others in the mean time it is not always clear what is on the particular node. Dis I miss something basic here? Or is it just not possible getting the (sketch) info from the arduino?
      How are you dealing with it. Having a sketch named/ numbered for every node? Just wondering what is the best practise.

      posted in General Discussion
      Mr_sensor
      Mr_sensor
    • RE: Temperature sensor sketch only sending battery info to mqtt

      @gohan

      Well the NACKS are gone 🙂 by setting the RF_24_PA_HIGH but still I do not get any temperature after the first one while starting up:

      16 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.2.0
      26 TSM:INIT
      28 TSF:WUR:MS=0
      34 TSM:INIT:TSP OK
      36 TSM:INIT:STATID=4
      38 TSF:SID:OK,ID=4
      40 TSM:FPAR
      43 TSM:FPAR:STATP=0
      45 TSM:ID
      47 TSM:ID:OK
      47 TSM:UPL
      1730 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=NACK:1
      3739 TSM:UPL
      5421 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=1,st=NACK:1
      7430 TSM:UPL
      7452 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=2,st=OK:1
      7460 TSF:MSG:READ,0-0-4,s=255,c=3,t=25,pt=1,l=1,sg=0:1
      7467 TSF:MSG:PONG RECV,HP=1
      7471 TSM:UPL:OK
      7473 TSM:READY:ID=4,PAR=0,DIS=1
      7491 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
      7499 TSF:MSG:READ,0-0-4,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      7512 TSF:MSG:SEND,4-4-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.2.0
      7530 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
      9545 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=11,pt=0,l=18,sg=0,ft=0,st=OK:Temperature Sensor
      9586 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.1
      9801 TSF:MSG:SEND,4-4-0-0,s=1,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
      9840 TSF:MSG:SEND,4-4-0-0,s=2,c=0,t=30,pt=0,l=0,sg=0,ft=0,st=OK:
      9848 MCO:REG:REQ
      9861 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      9869 TSF:MSG:READ,0-0-4,s=255,c=3,t=27,pt=1,l=1,sg=0:1
      9875 MCO:PIM:NODE REG=1
      9877 MCO:BGN:STP
      9926 MCO:BGN:INIT OK,TSP=1
      911
      Child ID 2Battery Voltage: 3.06 V
      Battery Percent: 91 %
      10438 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:91
      10446 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
      10452 TSF:TDI:TSL
      10455 MCO:SLP:WUP=-1
      10457 TSF:TRI:TSB
      831
      Child ID 2Battery Voltage: 2.79 V
      Battery Percent: 83 %
      10967 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:83
      10975 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
      10981 TSF:TDI:TSL
      10983 MCO:SLP:WUP=-1
      10985 TSF:TRI:TSB
      830
      Child ID 2Battery Voltage: 2.79 V
      Battery Percent: 83 %
      11493 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
      11501 TSF:TDI:TSL
      11503 MCO:SLP:WUP=-1
      11505 TSF:TRI:TSB
      833
      Child ID 2Battery Voltage: 2.80 V
      Battery Percent: 83 %
      12013 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
      12021 TSF:TDI:TSL
      12023 MCO:SLP:WUP=-1
      12025 TSF:TRI:TSB
      830
      Child ID 2Battery Voltage: 2.79 V
      Battery Percent: 83 %
      12533 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
      12541 TSF:TDI:TSL```
      posted in Hardware
      Mr_sensor
      Mr_sensor
    • Temperature sensor sketch only sending battery info to mqtt

      I have a newbie-pcb board with a Dallas temperature sensor attached. I mixed some sketches together to make it work.
      When starting the sensor the first time I can see all the actions performed. Reading temperature and battery percentage. But than after sleeping it is only reading and sending battery percentage (no voltage)? No temperature action is visible any-more. So, there must be a fault in my sketch which makes it read the temperature part only once? Any advice on this? Thanks.

      [code]
      
      /**
       * The MySensors Arduino library handles the wireless radio link and protocol
       * between your home built sensors/actuators and HA controller of choice.
       * The sensors forms a self healing radio network with optional repeaters. Each
       * repeater and gateway builds a routing tables in EEPROM which keeps track of the
       * network topology allowing messages to be routed to nodes.
       *
       * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
       * Copyright (C) 2013-2015 Sensnology AB
       * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
       *
       * Documentation: http://www.mysensors.org
       * Support Forum: http://forum.mysensors.org
       *
       * This program is free software; you can redistribute it and/or
       * modify it under the terms of the GNU General Public License
       * version 2 as published by the Free Software Foundation.
       *
       *******************************
       *
       * REVISION HISTORY
       * Version 1.0: Henrik EKblad
       * Version 1.1 - 2016-07-20: Converted to MySensors v2.0 and added various improvements - Torben Woltjen (mozzbozz)
       * 
       * DESCRIPTION
       * This sketch provides an example of how to implement a humidity/temperature
       * 
       * Dallas temperature sensor DS18B20
       *  
       * For more information, please visit:
       * http://www.mysensors.org/build/humidity
       * 
       HTU21D Humidity Sensor
       Hardware Connections (Breakoutboard to Arduino):
       -VCC = 3.3V
       -GND = GND
       -data  = D3 met pcb 470 uf resistor
       */
      
       
      #define MY_NODE_ID 4
      #define MY_PARENT_NODE_ID 0
      #define MY_PARENT_NODE_IS_STATIC
      
      // Enable debug prints
      #define MY_DEBUG
      
      // Enable and select radio type attached 
      #define MY_RADIO_NRF24
      //#define MY_RF24_PA_LEVEL RF24_PA_HIGH
      //#define MY_RADIO_RFM69
      //#define MY_RS485
       
      #include <MySensors.h> 
      //#include <Wire.h>
      #include <SPI.h>
      #include <OneWire.h>
      #include <DallasTemperature.h>
      
      
      // Force sending an update of the temperature after n sensor reads, so a controller showing the
      // timestamp of the last update doesn't show something like 3 hours in the unlikely case, that
      // the value didn't change since;
      // i.e. the sensor would force sending an update every 
      //UPDATE_INTERVAL*FORCE_UPDATE_N_READS [ms]
      //static const uint8_t FORCE_UPDATE_N_READS = 10;
      
      #define COMPARE_TEMP 0 // Send temperature only if changed? 1 = Yes 0 = No
      // arrays to hold device address
      DeviceAddress insideThermometer;
      
      #define ONE_WIRE_BUS 3 // Pin where dallas sensor is connected 
      #define MAX_ATTACHED_DS18B20 1
      unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
      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[MAX_ATTACHED_DS18B20];
      int numSensors=0;
      bool receivedConfig = true;
      bool metric = true;
      
      #define CHILD_ID_TEMP 1
      #define CHILD_ID_BATTERY 2
      #define CHILD_ID_VOLT 3
      //#define CHILD_ID_PRCNT 3
      
      float lastTemp;
      //float lastHum;
      
      uint8_t nNoUpdatesTemp;
      //uint8_t nNoUpdatesHum;
      //boolean metric = true;
      
      
      
      
      
      void presentation()  
      { 
       // Send the Sketch Version Information to the Gateway                                                                                                                     
        sendSketchInfo("Temperature Sensor", "1.1");      
         
       // Register all sensors to gw (they will be created as child devices)                                                                                                     
      //  present(CHILD_ID_HUM, S_HUM);                                                                                                                                          
        present(CHILD_ID_TEMP, S_TEMP);
         present(CHILD_ID_BATTERY, S_MULTIMETER);                                                                                                                                         
        metric = getControllerConfig().isMetric;
      
      // 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);
        }
         
      }
      
      int BATTERY_SENSE_PIN = A0;  // select the input pin for the battery sense point
                                                                                                                                                        
      //unsigned long SLEEP_TIME = 60000; // Sleep time between reads (in milliseconds)  60000                                                                                           
      static int oldBatteryPcnt = 0;                                                                                                                                                                        
                                                                                                                                                                     
                                                                                                                                                                              
      //Create an instance of the object                                                                                                                                          
      
        MyMessage msg(0,V_TEMP);                                                                                                                                                                                                                                                                                                                           
      //MyMessage msgHum(CHILD_ID_HUM, V_HUM);                                                                                                                                      
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);                                                                                                                                   
      MyMessage msgBattery(CHILD_ID_BATTERY, V_VOLTAGE);
      //MyMessage msgBattery(CHILD_ID_BATTERY, V_PRC);
      
      
      void setup() {
          // Startup up the OneWire library
        sensors.begin();
      
           // use the 1.1 V internal reference
      #if defined(__AVR_ATmega2560__)
          analogReference(INTERNAL1V1);
      #else
          analogReference(INTERNAL);
      #endif
      
      // requestTemperatures() will not block current thread
        sensors.setWaitForConversion(false);
      
      } 
                                                                                                                                                                                                                                                                                                                                                       
      void loop()                                                                                                                                                                 
      {                                                                                                                                                                           
      
      
      // Fetch temperatures from Dallas sensors
        sensors.requestTemperatures();
      
        // query conversion time and sleep until conversion completed
        int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
        // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
        sleep(conversionTime);
      
        // 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 COMPARE_TEMP == 1
          if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) {
          #else
          if (temperature != -127.00 && temperature != 85.00) {
          #endif
      
            // Send in the new temperature
            send(msg.setSensor(i).set(temperature,1));
            // Save new temperatures for next compare
            lastTemperature[i]=temperature;
          }
        }
      
      
      // some delay here
        //delay(500);
      
         // get the battery Voltage
           
          int sensorValue = analogRead(BATTERY_SENSE_PIN);
          delay(500);
      #ifdef MY_DEBUG
          Serial.println(sensorValue);
      #endif
      
          // 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
          int batteryPcnt = sensorValue / 10;
      
      #ifdef MY_DEBUG
          float batteryV  = sensorValue * 0.003363075;
          Serial.print("Child ID ");
          Serial.print(CHILD_ID_BATTERY);
          Serial.print("Battery Voltage: ");
          Serial.print(batteryV);
          Serial.println(" V");
      
          Serial.print("Battery Percent: ");
          Serial.print(batteryPcnt);
          Serial.println(" %");
      #endif
      
          if (oldBatteryPcnt != batteryPcnt) {
              // Power up radio after sleep
                    
              sendBatteryLevel(batteryPcnt);
              oldBatteryPcnt = batteryPcnt;
          } 
                                                                                                                                                                            
        sleep(SLEEP_TIME); //sleep a bit  
                                                                                                                                             
      }
      [/code]```
      
      
      This is in the serial monitor:
      
      [code]```
      16 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.2.0
      26 TSM:INIT
      28 TSF:WUR:MS=0
      34 TSM:INIT:TSP OK
      36 TSM:INIT:STATID=4
      38 TSF:SID:OK,ID=4
      40 TSM:FPAR
      43 TSM:FPAR:STATP=0
      45 TSM:ID
      47 TSM:ID:OK
      47 TSM:UPL
      1730 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=NACK:1
      3739 TSM:UPL
      5421 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=1,st=NACK:1
      7430 TSM:UPL
      7477 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=2,st=OK:1
      7497 TSF:MSG:READ,0-0-4,s=255,c=3,t=25,pt=1,l=1,sg=0:1
      7503 TSF:MSG:PONG RECV,HP=1
      7507 TSM:UPL:OK
      7510 TSM:READY:ID=4,PAR=0,DIS=1
      7518 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
      7526 TSF:MSG:READ,0-0-4,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      7536 TSF:MSG:SEND,4-4-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.2.0
      7557 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
      11247 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=11,pt=0,l=18,sg=0,ft=0,st=NACK:Temperature Sensor
      12939 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=1,st=NACK:1.1
      14628 !TSF:MSG:SEND,4-4-0-0,s=1,c=0,t=6,pt=0,l=0,sg=0,ft=2,st=NACK:
      16318 !TSF:MSG:SEND,4-4-0-0,s=2,c=0,t=30,pt=0,l=0,sg=0,ft=3,st=NACK:
      16324 MCO:REG:REQ
      18010 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=4,st=NACK:2
      21698 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=5,st=NACK:2
      21706 !TSM:READY:UPL FAIL,STATP
      25389 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=NACK:2
      29079 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=1,st=NACK:2
      31088 MCO:BGN:STP
      31137 MCO:BGN:INIT OK,TSP=1
      31141 MCO:SLP:MS=94,SMS=0,I1=255,M1=255,I2=255,M2=255
      31148 TSF:TDI:TSL
      31150 MCO:SLP:WUP=-1
      31154 TSF:TRI:TSB
      903
      Child ID 2Battery Voltage: 3.04 V
      Battery Percent: 90 %
      31657 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=2,st=NACK:90
      31668 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
      31674 TSF:TDI:TSL
      31676 MCO:SLP:WUP=-1
      31678 TSF:TRI:TSB
      31682 MCO:SLP:MS=94,SMS=0,I1=255,M1=255,I2=255,M2=255
      31688 TSF:TDI:TSL
      31690 MCO:SLP:WUP=-1
      31692 TSF:TRI:TSB
      831
      Child ID 2Battery Voltage: 2.79 V
      Battery Percent: 83 %
      32202 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=3,st=OK:83
      32208 MCO:SLP:MS=30000,SMS=0,I1=255,M1=255,I2=255,M2=255
      32217 TSF:TDI:TSL```
      posted in Hardware
      Mr_sensor
      Mr_sensor
    • RE: 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors

      @gohan said in 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors:

      but this is RFM69 radio pcb not NRF24
      I know but I am using the nrf24 pcb.

      Do I need to add something like this when using the AP version?

      #define MY_RADIO_NRF24

      #define MY_RF24_PA_LEVEL RF24_PA_HIGH

      Or just #define MY_RADIO_NRF24

      posted in OpenHardware.io
      Mr_sensor
      Mr_sensor
    • RE: 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors

      @gohan Ok, what do you mean by "define HW" in code" ? This in my code:
      #define MY_RADIO_NRF24

      posted in OpenHardware.io
      Mr_sensor
      Mr_sensor
    • RE: 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors

      @mr_sensor said in 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors:

      @sundberg84 @gohan Ok thanks for the input I will order some of the extended ones 🙂 and see if thing s will improve.

      The parts mentioned above arrived. I thought just swapping the radio's and see if there is any improvement. But it seems my devices are not happy with there new radio 🙂 ? So are these new devices coming with the same pin-out and are they using the same library as the non amplified radio"s ? Or do I need to alter my sketches or wiring for it to work?

      posted in OpenHardware.io
      Mr_sensor
      Mr_sensor
    • RE: 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors

      @sundberg84 @gohan Ok thanks for the input I will order some of the extended ones 🙂 and see if thing s will improve.

      posted in OpenHardware.io
      Mr_sensor
      Mr_sensor
    • RE: 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors

      @gohan said in 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors:

      I would get better quality nrf24 modules and using a PA LNA one on the gateway may also help. Sure the rfm69 at 433MHz can have a better wall penetration, but I think you can do with better radios. Look for CDEByte store on aliexpress, they have good radio modules. Also a poor quality power supply can reduce the effective range.
      If you want to try the RFM69 radios, you can "convert" the ones you have with this https://www.mysensors.org/hardware/nrf2rfm69

      So these would be better?
      https://nl.aliexpress.com/item/E01-ML01DP5-Ebyte-2-4GHz-20dBm-2100m-nRF24L01-SPI-Wireless-transceiver-module/32638720689.html?spm=a2g0s.13010208.99999999.336.T3AfNk
      https://nl.aliexpress.com/item/CDEBYTE-2PCS-Lot-E01-ML01D-Wireless-Transceiver-For-Arduino-nRF24L01-2-4GHz-Antenna-Module-For-Microcontroll/32803704874.html?spm=a2g0s.13010208.99999999.333.T3AfNk
      https://nl.aliexpress.com/item/CDEBYTE-2PCS-Lot-Special-promotions-1800-meter-long-distance-nRF24L01-PA-LNA-wireless-modules-with-PCB/32803720600.html?spm=a2g0s.13010208.99999999.330.T3AfNk

      If I use one with PA_LNA on my Gateway are the pin-out the same as for the nrf24l+ as in the mysensors gatweay example?
      Also there are models with nrf24l+PA what is the difference with the nrf24l+ ones?

      E01-ML01DP5 Long Range SPI nRF24L01P 2.4Ghz 100mW SMA Antenna IoT Wireless Transceiver Transmitter Receiver nRF24L01P RF Module

      $4.59

      E01-ML01D SPI nRF24L01P 2.4Ghz 1mW PCB Antenna IoT uhf Wireless Transceiver nRF24L01+ Transmitter Receiver Module

      $3.31

      E01-ML01DP4 Long Range SPI nRF24L01P 2.4Ghz 100mW PCB Antenna IoT uhf Wireless Transceiver nRF24L01+ Transmitter Receiver Module

      $2.58
      posted in OpenHardware.io
      Mr_sensor
      Mr_sensor
    • RE: 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors

      @sundberg84 said in 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors:

      Everything is going fine so im taking this to the next level... from test to produktion.
      This sensor might be my most important summer sensor from now on 😉
      A couple of days ago I had some friends over which gave me a beer cooler, garden edition.
      Its pretty much a barrel in the ground which cools the beer down... (a bit atleast).

      0_1500394205429_1.JPG

      I must say Im very impressed with the RFM69 so far... except the price, there has been no trouble at all. No repeaters, no capacitors, no fine tuning... nothing. Pretty much solder 'n' play!

      This node is burried in the far end on the garden (25m) and has to penetrate 3 concrete + 1brick wall to reach the GW in the celler... no problems, first try and bang!

      So far... the temperature in the cooler isnt very impressive, and I have only tried the first layer. I was afraid I would loose radio coverage if I put the sensors far down... but I will try.

      Cheers mates!

      Hi, nice set-up. I have been reading this and havong a "newbie" question. I have a Newbie PCB build with the Nrf24l01+ which seems to give (me) a poor range.
      So would that improve having a rfm69 instead? Or will just adding an antenna improve the reach (I have more or less the same outside distance and concrete wall/ flooring I'd liek to cross). Now I just have a reach for approx 8 meters and one concrete floor (inside the house)? Which is not very good (even my z-wave devices are preforming much better - outside at 20 mtr from the house.
      Can the nrf240 be improved or do I need teh rfm69 (or even using a LORA ?).

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

      @sundberg84 Ok did try with just the bare pro mini + the temp sensor + resistor on a breadboard powered with 3.3v from ftdi adapter.
      And guess what? Than I get the temperature reading 🙂 So why is it not working on the board than? I Will check the soldering again and see if I can solder a new board.

      Dallas Temperature IC Control Library Demo
      Locating devices...Found 1 devices.
      Parasite power is: OFF
      Device 0 Address: 28FF5849011704D8
      Device 0 Resolution: 9
      Requesting temperatures...DONE
      Temp C: 21.00 Temp F: 69.80
      Requesting temperatures...DONE
      Temp C: 21.00 Temp F: 69.80
      Requesting temperatures...DONE
      Temp C: 21.00 Temp F: 69.80
      Requesting temperatures...DONE
      Temp C: 21.00 Temp F: 69.80
      Requesting temperatures...DONE
      Temp C: 21.00 Temp F: 69.80
      Requesting temperatures...DONE
      Temp C: 21.00 Temp F: 69.80
      Requesting temperatures...DONE ```
      
      So both sensor and arduino are working?
      posted in OpenHardware.io
      Mr_sensor
      Mr_sensor
    • RE: 💬 Easy/Newbie PCB for MySensors

      @sundberg84 I tried with other libraries, without success. Also changed the sensor for a new one, without any success. Only thing that made me wondering, now the sensor is on 3,3 volt? When looking at the net for samples, etc. some of them refer to 5volt? So could that be the problem here? Not providing 5 volt to the sensor?

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

      @sundberg84 I did measure some things. Also replaced the arduino to be sure that it was working (did nt make a difference)

      I found 3,3 volt between vcc and gnd on the sensor. Also between the data-pin of the sensor and the arduino there is continuity.
      The middle leg on the sensor and GND + VCC on the PCB is not resulting in any continuity(I am not really sure if I did measure it in the right way. It is a bit hard to get gnd + vcc on the multimeter pin together).

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

      @gohan Not a solder problem I think. This is no short on the board it is just the angel of the picture hiding the gap underneath. 🙂
      tried the same set-up with an other dallas sensor. still the same result.

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

      @dbemowsk said in 💬 Easy/Newbie PCB for MySensors:

      @mr_sensor And show a pic of the bottom of the board with the sensor.

      0_1519755501591_IMG_6065.jpg

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

      @sundberg84 I run the "single" sketch from temp library and this is what I get:

      Dallas Temperature IC Control Library Demo
      Locating devices...Found 0 devices.
      Parasite power is: OFF
      Unable to find address for Device 0
      Device 0 Address: 0000000000000000
      Device 0 Resolution: 0
      Requesting temperatures...DONE
      Temp C: -127.00 Temp F: -196.60
      Requesting temperatures...DONE
      Temp C: -127.00 Temp F: -196.60
      Requesting temperatures...DONE
      Temp C: -127.00 Temp F: -196.60
      Requesting temperatures...DONE
      Temp C: -127.00 Temp F: -196.60
      Requesting temperatures...DONE
      Temp C: -127.00 Temp F: -196.60
      Requesting temperatures...DONE
      Temp C: -127.00 Temp F: -196.60
      Requesting temperatures...DONE
      Temp C: -127.00 Temp F: -196.60
      Requesting temperatures...DONE
      Temp C: -127.00 Temp F: -196.60
      Requesting temperatures...DONE
      Temp C: -127.00 Temp F: -196.60
      Requesting temperatures...DONE
      Temp C: -127.00 Temp F: -196.60
      Requesting temperatures...DONE
      Temp C: -127.00 Temp F: -196.60
      
      posted in OpenHardware.io
      Mr_sensor
      Mr_sensor
    • RE: 💬 Easy/Newbie PCB for MySensors

      @sundberg84 0_1519738543082_IMG_6049.jpg
      0_1519738618518_IMG_6041.jpg

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

      @sundberg84 Yes thanks I did so. But do not get any temp read out? Have al in space also the 4,7 k resistor.

      this is my sketch:

      [code]
      
      
      /**
       * The MySensors Arduino library handles the wireless radio link and protocol
       * between your home built sensors/actuators and HA controller of choice.
       * The sensors forms a self healing radio network with optional repeaters. Each
       * repeater and gateway builds a routing tables in EEPROM which keeps track of the
       * network topology allowing messages to be routed to nodes.
       *
       * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
       * Copyright (C) 2013-2015 Sensnology AB
       * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
       *
       * Documentation: http://www.mysensors.org
       * Support Forum: http://forum.mysensors.org
       *
       * This program is free software; you can redistribute it and/or
       * modify it under the terms of the GNU General Public License
       * version 2 as published by the Free Software Foundation.
       *
       *******************************
       *
       * REVISION HISTORY
       * Version 1.0: Henrik EKblad
       * Version 1.1 - 2016-07-20: Converted to MySensors v2.0 and added various improvements - Torben Woltjen (mozzbozz)
       * 
       * DESCRIPTION
       * This sketch provides an example of how to implement a humidity/temperature
       * 
       * Dallas temperature sensor DS18B20
       *  
       * For more information, please visit:
       * http://www.mysensors.org/build/humidity
       * 
       HTU21D Humidity Sensor
       Hardware Connections (Breakoutboard to Arduino):
       -VCC = 3.3V
       -GND = GND
       -data  = D3 met pcb 470 uf resistor
       */
      
       
      #define MY_NODE_ID 4
      #define MY_PARENT_NODE_ID 0
      #define MY_PARENT_NODE_IS_STATIC
      
      // Enable debug prints
      #define MY_DEBUG
      
      // Enable and select radio type attached 
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      //#define MY_RS485
       
      #include <MySensors.h>
      #include <OneWire.h>  
      //#include <Wire.h>
      #include <SPI.h>
      #include <DallasTemperature.h>
      
      // Force sending an update of the temperature after n sensor reads, so a controller showing the
      // timestamp of the last update doesn't show something like 3 hours in the unlikely case, that
      // the value didn't change since;
      // i.e. the sensor would force sending an update every UPDATE_INTERVAL*FORCE_UPDATE_N_READS [ms]
      //static const uint8_t FORCE_UPDATE_N_READS = 10;
      
      #define COMPARE_TEMP 1 // 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 = 30000; // Sleep time between reads (in milliseconds)
      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[MAX_ATTACHED_DS18B20];
      int numSensors=0;
      bool receivedConfig = false;
      bool metric = true;
      
      #define CHILD_ID_TEMP 0
      #define CHILD_ID_BATTERY 1
      #define CHILD_ID_VOLT 2
      //#define CHILD_ID_PRCNT 3
      
      //float lastTemp;
      //float lastHum;
      
      //uint8_t nNoUpdatesTemp;
      //uint8_t nNoUpdatesHum;
      //boolean metric = true;
      
      
      
      
      void presentation()  
      { 
       // Send the Sketch Version Information to the Gateway                                                                                                                     
        sendSketchInfo("Temperature Sensor", "1.1");      
         
       // Register all sensors to gw (they will be created as child devices)                                                                                                     
      //  present(CHILD_ID_HUM, S_HUM);                                                                                                                                          
        present(CHILD_ID_TEMP, S_TEMP);
         present(CHILD_ID_BATTERY, S_MULTIMETER);                                                                                                                                         
        //metric = getControllerConfig().isMetric;
      
      // 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);
        }
         
      }
      
      int BATTERY_SENSE_PIN = A0;  // select the input pin for the battery sense point
                                                                                                                                                        
      unsigned long SLEEP_TIME = 60000; // Sleep time between reads (in milliseconds)  60000                                                                                           
      static int oldBatteryPcnt = 0;                                                                                                                                                                        
                                                                                                                                                                     
                                                                                                                                                                              
      //Create an instance of the object                                                                                                                                          
      
        MyMessage msg(0,V_TEMP);                                                                                                                                                                                                                                                                                                                           
      //MyMessage msgHum(CHILD_ID_HUM, V_HUM);                                                                                                                                      
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);                                                                                                                                   
      MyMessage msgBattery(CHILD_ID_BATTERY, V_VOLTAGE);
      //MyMessage msgBattery(CHILD_ID_BATTERY, V_PRC);
      
      
      void setup() {
          // Startup up the OneWire library
        sensors.begin();
      
           // use the 1.1 V internal reference
      #if defined(__AVR_ATmega2560__)
          analogReference(INTERNAL1V1);
      #else
          analogReference(INTERNAL);
      #endif
      
      // requestTemperatures() will not block current thread
        sensors.setWaitForConversion(false);
      
      } 
                                                                                                                                                                                                                                                                                                                                                       
      void loop()                                                                                                                                                                 
      {                                                                                                                                                                           
      
      
      // Fetch temperatures from Dallas sensors
        sensors.requestTemperatures();
      
        // query conversion time and sleep until conversion completed
        int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
        // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
        sleep(conversionTime);
      
        // 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 COMPARE_TEMP == 1
          if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) {
          #else
          if (temperature != -127.00 && temperature != 85.00) {
          #endif
      
            // Send in the new temperature
            send(msg.setSensor(i).set(temperature,1));
            // Save new temperatures for next compare
            lastTemperature[i]=temperature;
          }
        }
      
      
      // some delay here
         delay(500);
      
         // get the battery Voltage
           
          int sensorValue = analogRead(BATTERY_SENSE_PIN);
          delay(500);
      #ifdef MY_DEBUG
          Serial.println(sensorValue);
      #endif
      
          // 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
          int batteryPcnt = sensorValue / 10;
      
      #ifdef MY_DEBUG
          float batteryV  = sensorValue * 0.003363075;
          Serial.print("Child ID ");
          Serial.print(CHILD_ID_BATTERY);
          Serial.print("Battery Voltage: ");
          Serial.print(batteryV);
          Serial.println(" V");
      
          Serial.print("Battery Percent: ");
          Serial.print(batteryPcnt);
          Serial.println(" %");
      #endif
      
          if (oldBatteryPcnt != batteryPcnt) {
              // Power up radio after sleep
                    
              sendBatteryLevel(batteryPcnt);
              oldBatteryPcnt = batteryPcnt;
          } 
                                                                                                                                                                            
        sleep(SLEEP_TIME); //sleep a bit  
                                                                                                                                             
      }
      [/code]```
      
      

      | / |_ / | ___ _ __ ___ ___ _ __ ___
      | |/| | | | _
      \ / _ \ _ \/ __|/ _ \|
      _/ __|
      | | | | |
      | || | / | | _ \ _ | | \�
      |
      | |
      |_
      , |/ ___|| ||/_/|| |/
      |
      __/ 2.2.0

      16 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.2.0
      26 TSM:INIT
      28 TSF:WUR:MS=0
      34 TSM:INIT:TSP OK
      36 TSM:INIT:STATID=4
      38 TSF:SID:OK,ID=4
      40 TSM:FPAR
      43 TSM:FPAR:STATP=0
      45 TSM:ID
      47 TSM:ID:OK
      47 TSM:UPL
      53 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
      67 TSF:MSG:READ,0-0-4,s=255,c=3,t=25,pt=1,l=1,sg=0:1
      71 TSF:MSG:PONG RECV,HP=1
      75 TSM:UPL:OK
      77 TSM:READY:ID=4,PAR=0,DIS=1
      116 !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=NACK:0100
      2125 TSF:MSG:SEND,4-4-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=1,st=OK:2.2.0
      2138 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
      4177 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=11,pt=0,l=18,sg=0,ft=0,st=OK:Temperature Sensor
      4196 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.1
      4214 TSF:MSG:SEND,4-4-0-0,s=0,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
      4227 TSF:MSG:SEND,4-4-0-0,s=1,c=0,t=30,pt=0,l=0,sg=0,ft=0,st=OK:
      4235 MCO:REG:REQ
      4237 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      6246 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      8255 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      10264 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      12273 MCO:BGN:STP
      12275 MCO:BGN:INIT OK,TSP=1
      12279 MCO:SLP:MS=94,SMS=0,I1=255,M1=255,I2=255,M2=255
      12285 TSF:TDI:TSL
      12288 MCO:SLP:WUP=-1
      12290 TSF:TRI:TSB
      915
      Child ID 1Battery Voltage: 3.08 V
      Battery Percent: 91 %
      13297 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:91
      13305 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      13312 TSF:TDI:TSL
      13314 MCO:SLP:WUP=-1
      13316 TSF:TRI:TSB
      13320 MCO:SLP:MS=94,SMS=0,I1=255,M1=255,I2=255,M2=255
      13326 TSF:TDI:TSL
      13328 MCO:SLP:WUP=-1
      13330 TSF:TRI:TSB
      826
      Child ID 1Battery Voltage: 2.78 V
      Battery Percent: 82 %
      14340 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:82
      14346 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      14352 TSF:TDI:TSL

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

      @gohan said in 💬 Easy/Newbie PCB for MySensors:

      you can add a wire to the I2C pins, in your case you just need a short wire to a digital pin that are just next to the Extra area

      Ok. And if attaching a DS18B20 I have a pull up resistor soldered on the board. Than it is also just the digital pin I need from the board? D3 I think?

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

      @sundberg84 I have a "newby" question about how to use the Extra's part of the board. If I want to connect a DS18B20 sensor per example can I just solder it on the extra area and connect is with some wires to the pinout I need?
      Asking this because I did this with the i2c sensor on the board discussed here. having a wire form the extras towards the arduino i2c pins directly. Later I discovered that the i2c pins are also on the board.
      So how to deal with this?

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

      @sundberg84 Well I tried that but did not get the measurement straight from the pcb si I decided t solder a new board using the right capacitor this time (0,1uf instead of 1uf) made sure using the right resistors as well and adding a capacitor after the booster. Than with the same mini pro from the other board tested again and wow it is working as intended.

      Child ID 2Battery Voltage: 3.44 V
      Battery Percent: 102 %
      2930 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:102
      2938 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      2945 TSF:TDI:TSL
      2947 MCO:SLP:WUP=-1
      2949 TSF:TRI:TSB
      3065 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      T: 998.00
      3178 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      H: 998.00
      957
      Child ID 2Battery Voltage: 3.22 V
      Battery Percent: 95 %
      3690 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:95
      3698 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      3704 TSF:TDI:TSL
      3706 MCO:SLP:WUP=-1
      3708 TSF:TRI:TSB
      3815 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      T: 998.00
      3932 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      H: 998.00
      955
      Child ID 2Battery Voltage: 3.21 V
      Battery Percent: 95 %
      4442 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      4452 TSF:TDI:TSL
      4454 MCO:SLP:WUP=-1
      4456 TSF:TRI:TSB
      4560 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      T: 998.00
      4673 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      H: 998.00
      953
      Child ID 2Battery Voltage: 3.21 V
      Battery Percent: 95 %
      5185 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      5193 TSF:TDI:TSL
      5195 MCO:SLP:WUP=-1
      5197 TSF:TRI:TSB
      5304 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      T: 998.00
      5416 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      H: 998.00
      952
      Child ID 2Battery Voltage: 3.20 V
      Battery Percent: 95 %
      5926 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      5935 TSF:TDI:TSL
      5939 MCO:SLP:WUP=-1
      5941 TSF:TRI:TSB
      6045 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      T: 998.00
      6158 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      H: 998.00
      952
      Child ID 2Battery Voltage: 3.20 V
      Battery Percent: 95 %
      6670 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      6678 TSF:TDI:TSL
      6680 MCO:SLP:WUP=-1
      6682 TSF:TRI:TSB
      6789 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      T: 998.00
      6901 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      H: 998.00
      952
      Child ID 2Battery Voltage: 3.20 V
      Battery Percent: 95 %
      7411 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      7419 TSF:TDI:TSL
      7424 MCO:SLP:WUP=-1
      7426 TSF:TRI:TSB
      7530 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      T: 998.00
      7643 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      H: 998.00
      952
      Child ID 2Battery Voltage: 3.20 V
      Battery Percent: 95 %
      8155 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      8163 TSF:TDI:TSL
      8165 MCO:SLP:WUP=-1
      8167 TSF:TRI:TSB
      8273 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      T: 998.00
      8388 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      H: 998.00
      955
      Child ID 2Battery Voltage: 3.21 V
      Battery Percent: 95 %
      8898 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      8908 TSF:TDI:TSL
      8910 MCO:SLP:WUP=-1
      8912 TSF:TRI:TSB
      9021 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      T: 998.00
      9132 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      H: 998.00
      948
      Child ID 2Battery Voltage: 3.19 V
      Battery Percent: 94 %
      9646 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:94
      9654 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      9660 TSF:TDI:TSL
      9662 MCO:SLP:WUP=-1
      9664 TSF:TRI:TSB
      9771 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      T: 998.00
      9881 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      H: 998.00
      952
      Child ID 2Battery Voltage: 3.20 V
      Battery Percent: 95 %
      10395 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:95
      10403 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      10409 TSF:TDI:TSL
      10412 MCO:SLP:WUP=-1
      10414 TSF:TRI:TSB
      10520 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      T: 998.00
      10635 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:998.0
      H: 998.00
      953
      Child ID 2Battery Voltage: 3.21 V
      Battery Percent: 95 %
      11147 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      11155 TSF:TDI:TSL
      

      Now in mqtt I can see the percentage as:

      95
      qos : 0, retain : false, cmd : publish, dup : false, topic : **mygateway1-out/2/255/3/0/0**, messageId : , length : 30, Raw payload : 5753```
      
      But not the voltage?
      posted in OpenHardware.io
      Mr_sensor
      Mr_sensor
    • RE: 💬 Easy/Newbie PCB for MySensors

      @gohan said in 💬 Easy/Newbie PCB for MySensors:

      you are also missing the capacitor on the booster output for better stability

      Ok, I assumed it was not needed when using a battery. Which one to use there?

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

      @gohan said in 💬 Easy/Newbie PCB for MySensors:

      What are the resistor values you used? 0.1v is quite low

      Maybe I used the wrong capacitor it says 1uf (50v) but now I see it has to be 0,1uf could that be the problem here?

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

      @gohan said in 💬 Easy/Newbie PCB for MySensors:

      Resistors can be soldered either way, but if you read 0v on that capacitor pin it mean you have a problem between the battery and the capacitor, so you have to backtrack the connection that is missing

      I measured the capacitor again and get a 0,10 output.

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

      @sundberg84 said in 💬 Easy/Newbie PCB for MySensors:

      @mr_sensor - I can not see any errors on the pictures you posted.
      Can you measure the voltage on Booster-Vout and also on this pad.

      0_1518627818269_d0a0507b-dcfd-45c0-a8a7-288e718afc3d-image.png

      I did measure the parts you mentioned. Booster is 3,36 v and the other pad is 0,00 the input strait from the batteries is 2,80 v

      Also, Just for my info, does it matter how the resistors or capacitors are soldered on the board? My biggest problem is always determine the right resistors value and the right way to solder them (+ -). On the pcb some of them are coded (very handy for me as a beginner) with a G but not all of them?
      So my worry was that I maybe have soldered the "battery measurer" ones in the wring direction? Could that be the problem here?

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

      @gohan said in 💬 Easy/Newbie PCB for MySensors:

      I don't think it is PCB related, try to make sure it is not a faulty arduino

      I already changed the arduino for a fresh soldered one but that did not alter things.

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

      @sundberg84 Hi, I soldered a board holding a humidity and temperature sensor. That is working fine and reporting to may gateway (mqtt). Only thing which I do not get working ok is the battery level measurement. As I already posted in an other topic here.

      Here are some pictures of my board. The bat jumper is connected with a wire on the bottom. And the code I use on it right now.
      I already changed the pro mini for a fresh soldered one but still getting the the same result. Just ones giving the volt and % and after that only giving 0 volt as output.
      tried to include delay(500) in the sketch but that did not help. So how to solve this?

      
       
      #define MY_NODE_ID 2
      #define MY_PARENT_NODE_ID 0
      #define MY_PARENT_NODE_IS_STATIC
      
      // Enable debug prints
      #define MY_DEBUG
      
      // Enable and select radio type attached 
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      //#define MY_RS485
       
      #include <SparkFunHTU21D.h>
      #include <MySensors.h>  
      #include <Wire.h>
      #include <SPI.h>
      
      // Force sending an update of the temperature after n sensor reads, so a controller showing the
      // timestamp of the last update doesn't show something like 3 hours in the unlikely case, that
      // the value didn't change since;
      // i.e. the sensor would force sending an update every UPDATE_INTERVAL*FORCE_UPDATE_N_READS [ms]
      //static const uint8_t FORCE_UPDATE_N_READS = 10;
      
      #define CHILD_ID_HUM 0
      #define CHILD_ID_TEMP 1
      #define CHILD_ID_BATTERY 2
      //#define CHILD_ID_VOLT 2
      #define CHILD_ID_PRCNT 3
      
      float lastTemp;
      float lastHum;
      
      uint8_t nNoUpdatesTemp;
      uint8_t nNoUpdatesHum;
      boolean metric = true;
      
      
      
      
      void presentation()  
      { 
       // Send the Sketch Version Information to the Gateway                                                                                                                     
        sendSketchInfo("Humidity", "2.0");      
         
       // Register all sensors to gw (they will be created as child devices)                                                                                                     
        present(CHILD_ID_HUM, S_HUM);                                                                                                                                          
        present(CHILD_ID_TEMP, S_TEMP);
         present(CHILD_ID_BATTERY, S_MULTIMETER);                                                                                                                                         
        //metric = getControllerConfig().isMetric;
      
      
         
      }
      
      int BATTERY_SENSE_PIN = A0;  // select the input pin for the battery sense point
                                                                                                                                                        
      unsigned long SLEEP_TIME = 60000; // Sleep time between reads (in milliseconds)                                                                                             
      static int oldBatteryPcnt = 0;                                                                                                                                                                        
                                                                                                                                                                     
                                                                                                                                                                              
      //Create an instance of the object                                                                                                                                          
      HTU21D myHumidity;                                                                                                                                                         
      
                                                                                                                                                                                                                                                                                                                                   
      MyMessage msgHum(CHILD_ID_HUM, V_HUM);                                                                                                                                      
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);                                                                                                                                   
      MyMessage msgBattery(CHILD_ID_BATTERY, V_VOLTAGE);
      //MyMessage msgBattery(CHILD_ID_BATTERY, V_PRCNT);
      
      
      void setup() {
          myHumidity.begin();
      
           // use the 1.1 V internal reference
      #if defined(__AVR_ATmega2560__)
          analogReference(INTERNAL1V1);
      #else
          analogReference(INTERNAL);
      #endif
      
      
      } 
                                                                                                                                                                                                                                                                                                                                                       
      void loop()                                                                                                                                                                 
      {                                                                                                                                                                           
        float temperature = myHumidity.readTemperature();                                                                                                                         
        //if (!metric) {                                                                                                                                                            
        //    temperature = (temperature * 1.8) + 32.0;                                                                                                                             
        //}                                                                                                                                                                         
        send(msgTemp.set(temperature, 1));
        Serial.print("T: ");
        Serial.println(temperature);                                                                                                                                     
      
        float humidity = myHumidity.readHumidity();                                                                                                                               
        send(msgHum.set(humidity, 1));                                                                                                                                         
        Serial.print("H: ");
        Serial.println(humidity);
      
      
         // get the battery Voltage
           
          int sensorValue = analogRead(BATTERY_SENSE_PIN);
          delay(500);
      #ifdef MY_DEBUG
          Serial.println(sensorValue);
      #endif
      
          // 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
          int batteryPcnt = sensorValue / 10;
      
      #ifdef MY_DEBUG
          float batteryV  = sensorValue * 0.003363075;
          Serial.print("Child ID ");
          Serial.print(CHILD_ID_BATTERY);
          Serial.print("Battery Voltage: ");
          Serial.print(batteryV);
          Serial.println(" V");
      
          Serial.print("Battery Percent: ");
          Serial.print(batteryPcnt);
          Serial.println(" %");
      #endif
      
          if (oldBatteryPcnt != batteryPcnt) {
              // Power up radio after sleep
                    
              sendBatteryLevel(batteryPcnt);
              oldBatteryPcnt = batteryPcnt;
          } 
                                                                                                                                                                            
        sleep(SLEEP_TIME); //sleep a bit  
                                                                                                                                             
      }
      

      0_1518613859739_IMG_5970.jpg 0_1518613878092_IMG_5971.jpg 0_1518613893620_IMG_5972.jpg 1_1518613931939_IMG_5907.jpg 0_1518613931939_IMG_5906.jpg 0_1518613977125_IMG_5908.jpg

      posted in OpenHardware.io
      Mr_sensor
      Mr_sensor
    • RE: How to get battery volt / percentage message send to mqtt?

      @gohan Ok will try that see if I made a fault somewhere

      posted in Development
      Mr_sensor
      Mr_sensor
    • RE: How to get battery volt / percentage message send to mqtt?

      Still not getting it working! Any thoughts on this?

      posted in Development
      Mr_sensor
      Mr_sensor
    • RE: How to get battery volt / percentage message send to mqtt?

      @gohan

      Arduino Pro or Pro Mini
      Programmer AVR ISP
      ATmega328P (3,3v 8mhz)

      posted in Development
      Mr_sensor
      Mr_sensor
    • RE: How to get battery volt / percentage message send to mqtt?

      @gohan I'm using the EasyPCB board with an arduino pro mini 3,3v

      posted in Development
      Mr_sensor
      Mr_sensor
    • RE: How to get battery volt / percentage message send to mqtt?

      @gohan said in How to get battery volt / percentage message send to mqtt?:

      delay(500)

      Hi, tried that (already tried it with wait). Now I added it here:

      delay(500);
          int sensorValue = analogRead(BATTERY_SENSE_PIN);
      

      Also tried it here:

       if (oldBatteryPcnt != batteryPcnt) {
              // Power up radio after sleep
              delay(500);       
              sendBatteryLevel(batteryPcnt);
              oldBatteryPcnt = batteryPcnt;
          } 
                                                                                                                                                                            
        sleep(SLEEP_TIME); //sleep a bit  ```
      
      Both did not help still ending up with 0 . 
      So what should be the best place the right place to put the delay?
      posted in Development
      Mr_sensor
      Mr_sensor
    • RE: How to get battery volt / percentage message send to mqtt?

      @gohan Tried to find out what causing that but can not figure it out. I'm bot a real coderer so its trial and error 🙂 and trying to understand form other sketches / posts. Any idea where to look for?

      posted in Development
      Mr_sensor
      Mr_sensor
    • RE: How to get battery volt / percentage message send to mqtt?

      @yveaux changed the position of int oldBatteryPcnt = 0; outside of the loop and added the static prefix static int oldBatteryPcnt = 0;
      Still not giving me the right result the first message seem ok but than it only has 0 ?

      Child ID 2Battery Voltage: 0.43 V
      Battery Percent: 12 %
      2289 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:12
      2297 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      2304 TSF:TDI:TSL
      2306 MCO:SLP:WUP=-1
      2308 TSF:TRI:TSB
      2363 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:19.6
      T: 19.56
      2396 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:39.7
      H: 39.69
      0
      Child ID 2Battery Voltage: 0.00 V
      Battery Percent: 0 %
      2408 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:0
      2414 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      2420 TSF:TDI:TSL
      2422 MCO:SLP:WUP=-1
      2426 TSF:TRI:TSB
      2482 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:19.6
      T: 19.57
      2512 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:39.5
      H: 39.52
      0
      Child ID 2Battery Voltage: 0.00 V
      Battery Percent: 0 %
      2523 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      2531 TSF:TDI:TSL```
      posted in Development
      Mr_sensor
      Mr_sensor
    • How to get battery volt / percentage message send to mqtt?

      I Build a temp / hum sensor with the easyPcb board and Am able to get the temp and hum send to the Mqtt broker.
      Next thing is to get the battery voltage and % send to the Mqtt broker as well.
      Now that is giving me some problems. I merged the two scripts together, and tried to learn form other topics. But I'M not getting is right dough. This is my script right now:
      Also the output of the serial monitor.
      I have the feeling I am nearly there 🙂 Any help would be great!

      [code]
      /**
       * The MySensors Arduino library handles the wireless radio link and protocol
       * between your home built sensors/actuators and HA controller of choice.
       * The sensors forms a self healing radio network with optional repeaters. Each
       * repeater and gateway builds a routing tables in EEPROM which keeps track of the
       * network topology allowing messages to be routed to nodes.
       *
       * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
       * Copyright (C) 2013-2015 Sensnology AB
       * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
       *
       * Documentation: http://www.mysensors.org
       * Support Forum: http://forum.mysensors.org
       *
       * This program is free software; you can redistribute it and/or
       * modify it under the terms of the GNU General Public License
       * version 2 as published by the Free Software Foundation.
       *
       *******************************
       *
       * REVISION HISTORY
       * Version 1.0: Henrik EKblad
       * Version 1.1 - 2016-07-20: Converted to MySensors v2.0 and added various improvements - Torben Woltjen (mozzbozz)
       * 
       * DESCRIPTION
       * This sketch provides an example of how to implement a humidity/temperature
       * sensor using a DHT11/DHT-22.
       *  
       * For more information, please visit:
       * http://www.mysensors.org/build/humidity
       * 
       HTU21D Humidity Sensor
       Hardware Connections (Breakoutboard to Arduino):
       -VCC = 3.3V
       -GND = GND
       -SDA = A4 (use inline 330 ohm resistor if your board is 5V)
       -SCL = A5 (use inline 330 ohm resistor if your board is 5V)
       */
      
       
      #define MY_NODE_ID 2
      #define MY_PARENT_NODE_ID 0
      #define MY_PARENT_NODE_IS_STATIC
      
      // Enable debug prints
      #define MY_DEBUG
      
      // Enable and select radio type attached 
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      //#define MY_RS485
       
      #include <SparkFunHTU21D.h>
      #include <MySensors.h>  
      #include <Wire.h>
      #include <SPI.h>
      
      // Force sending an update of the temperature after n sensor reads, so a controller showing the
      // timestamp of the last update doesn't show something like 3 hours in the unlikely case, that
      // the value didn't change since;
      // i.e. the sensor would force sending an update every UPDATE_INTERVAL*FORCE_UPDATE_N_READS [ms]
      //static const uint8_t FORCE_UPDATE_N_READS = 10;
      
      #define CHILD_ID_HUM 0
      #define CHILD_ID_TEMP 1
      #define CHILD_ID_BATTERY 2
      //#define CHILD_ID_VOLT 2
      #define CHILD_ID_PRCNT 3
      
      float lastTemp;
      float lastHum;
      
      uint8_t nNoUpdatesTemp;
      uint8_t nNoUpdatesHum;
      boolean metric = true;
      
      
      void presentation()  
      { 
       // Send the Sketch Version Information to the Gateway                                                                                                                     
        sendSketchInfo("Humidity", "2.0");      
         
       // Register all sensors to gw (they will be created as child devices)                                                                                                     
        present(CHILD_ID_HUM, S_HUM);                                                                                                                                          
        present(CHILD_ID_TEMP, S_TEMP);
         present(CHILD_ID_BATTERY, S_MULTIMETER);                                                                                                                                         
        //metric = getControllerConfig().isMetric;
      
      
         
      }
      
                                                                                                                                                        
      unsigned long SLEEP_TIME = 60000; // Sleep time between reads (in milliseconds)                                                                                             
                                                                                                                                                                              
                                                                                                                                                                     
                                                                                                                                                                              
      //Create an instance of the object                                                                                                                                          
      HTU21D myHumidity;                                                                                                                                                         
      
                                                                                                                                                                                                                                                                                                                                   
      MyMessage msgHum(CHILD_ID_HUM, V_HUM);                                                                                                                                      
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);                                                                                                                                   
      MyMessage msgBattery(CHILD_ID_BATTERY, V_VOLTAGE);
      //MyMessage msgBattery(CHILD_ID_BATTERY, V_PRCNT);
      
      
      void setup() {
          myHumidity.begin();
      
           // use the 1.1 V internal reference
      #if defined(__AVR_ATmega2560__)
          analogReference(INTERNAL1V1);
      #else
          analogReference(INTERNAL);
      #endif
      } 
                                                                                                                                                                                                                                                                                                                                                       
      void loop()                                                                                                                                                                 
      {                                                                                                                                                                           
        float temperature = myHumidity.readTemperature();                                                                                                                         
        //if (!metric) {                                                                                                                                                            
        //    temperature = (temperature * 1.8) + 32.0;                                                                                                                             
        //}                                                                                                                                                                         
        send(msgTemp.set(temperature, 1));
        Serial.print("T: ");
        Serial.println(temperature);                                                                                                                                     
      
        float humidity = myHumidity.readHumidity();                                                                                                                               
        send(msgHum.set(humidity, 1));                                                                                                                                         
        Serial.print("H: ");
        Serial.println(humidity);
      
      
         // get the battery Voltage
         int BATTERY_SENSE_PIN = A0;  // select the input pin for the battery sense point
      
      //SLEEP_TIME = 900000;  // sleep time between reads (seconds * 1000 milliseconds)
      int oldBatteryPcnt = 0;
      
          int sensorValue = analogRead(BATTERY_SENSE_PIN);
      
      #ifdef MY_DEBUG
          Serial.println(sensorValue);
      #endif
      
          // 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
      
          int batteryPcnt = sensorValue / 10;
      
      #ifdef MY_DEBUG
          float batteryV  = sensorValue * 0.003363075;
          Serial.print("Child ID ");
          Serial.print(CHILD_ID_BATTERY);
          Serial.print("Battery Voltage: ");
          Serial.print(batteryV);
          Serial.println(" V");
      
          Serial.print("Battery Percent: ");
          Serial.print(batteryPcnt);
          Serial.println(" %");
      #endif
      
          if (oldBatteryPcnt != batteryPcnt) {
              // Power up radio after sleep
              sendBatteryLevel(batteryPcnt);
              oldBatteryPcnt = batteryPcnt;
          } 
      
        
      
                                                                                                                                                                                  
        sleep(SLEEP_TIME); //sleep a bit  
                                                                                                                                             
      }
      
      
      
      [/code]```
      
      

      16 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.2.0
      26 TSM:INIT
      28 TSF:WUR:MS=0
      34 TSM:INIT:TSP OK
      36 TSM:INIT:STATID=2
      38 TSF:SID:OK,ID=2
      40 TSM:FPAR
      43 TSM:FPAR:STATP=0
      45 TSM:ID
      47 TSM:ID:OK
      47 TSM:UPL
      51 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
      59 TSF:MSG:READ,0-0-2,s=255,c=3,t=25,pt=1,l=1,sg=0:1
      65 TSF:MSG:PONG RECV,HP=1
      69 TSM:UPL:OK
      69 TSM:READY:ID=2,PAR=0,DIS=1
      75 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
      81 TSF:MSG:READ,0-0-2,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      90 TSF:MSG:SEND,2-2-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.2.0
      100 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
      2111 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=11,pt=0,l=8,sg=0,ft=0,st=OK:Humidity
      2119 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:2.0
      2129 TSF:MSG:SEND,2-2-0-0,s=0,c=0,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      2138 TSF:MSG:SEND,2-2-0-0,s=1,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
      2146 TSF:MSG:SEND,2-2-0-0,s=2,c=0,t=30,pt=0,l=0,sg=0,ft=0,st=OK:
      2154 MCO:REG:REQ
      2158 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      2179 TSF:MSG:READ,0-0-2,s=255,c=3,t=27,pt=1,l=1,sg=0:1
      2185 MCO:PIM:NODE REG=1
      2187 MCO:BGN:STP
      2189 MCO:BGN:INIT OK,TSP=1
      2244 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:19.2
      T: 19.20
      2277 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:42.7
      H: 42.68
      127
      Child ID 2Battery Voltage: 0.43 V
      Battery Percent: 12 %
      2289 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:12
      2297 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      2304 TSF:TDI:TSL
      2306 MCO:SLP:WUP=-1
      2308 TSF:TRI:TSB
      2363 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:19.1
      T: 19.14
      2396 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:42.7
      H: 42.71
      0
      Child ID 2Battery Voltage: 0.00 V
      Battery Percent: 0 %
      2406 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      2414 TSF:TDI:TSL
      2416 MCO:SLP:WUP=-1
      2418 TSF:TRI:TSB
      2473 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:20.3
      T: 20.33
      2506 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:55.9
      H: 55.90
      0
      Child ID 2Battery Voltage: 0.00 V
      Battery Percent: 0 %
      2516 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      2525 TSF:TDI:TSL
      2527 MCO:SLP:WUP=-1
      2529 TSF:TRI:TSB
      2584 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:19.6
      T: 19.59
      2617 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:45.1
      H: 45.06
      0
      Child ID 2Battery Voltage: 0.00 V
      Battery Percent: 0 %
      2627 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      2635 TSF:TDI:TSL
      2637 MCO:SLP:WUP=-1
      2639 TSF:TRI:TSB
      2695 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:19.4
      T: 19.39
      2727 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:43.9
      H: 43.87
      0
      Child ID 2Battery Voltage: 0.00 V
      Battery Percent: 0 %
      2738 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      2746 TSF:TDI:TSL
      2748 MCO:SLP:WUP=-1
      2750 TSF:TRI:TSB
      2807 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:19.3
      T: 19.30
      2838 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:43.5
      H: 43.48
      0

      posted in Development
      Mr_sensor
      Mr_sensor
    • RE: DHT11 Arduino pro mini no temp readings

      Ok found out what topic is send to mqtt turned out to be:
      mygateway1-out/2/1/1/0/1 or mygateway1-out/2/0/1/0/1

      How to get an % and "C" to this topic value?

      posted in Development
      Mr_sensor
      Mr_sensor
    • RE: DHT11 Arduino pro mini no temp readings

      🙂 Great! That helped a lot. I Kicked that out when reading the Converting a sketch from 1.5 to 2.x article.

      4911 TSF:MSG:SEND,2-2-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:20.4
      4954 TSF:MSG:SEND,2-2-0-0,s=0,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:50.2
      4962 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      4968 MCO:SLP:TPD
      

      Now I only have to find out what to use for mqtt to read this sensor values. Thats still not very clear to me:
      Guess it would be something like:
      mygateway1-out/2/2/0/0/ or 2/2/0/0/1 ?

      Would it be possible to have something like this:

      mygateway-out/2/2/Temperature ?

      posted in Development
      Mr_sensor
      Mr_sensor
    • RE: DHT11 Arduino pro mini no temp readings

      since I did not get these Dht11 or Dht22 working, I decided to try an other sensor type to see if that would work better.
      So I connected a HTU21D sensor and included the library from sparkfun. Using there demo sketch I can see the sensor is working fine:

      HTU21D Example!
      Time:192 Temperature:20.8C Humidity:998.0%
      Time:1318 Temperature:20.8C Humidity:47.3%
      Time:2445 Temperature:20.7C Humidity:47.4%
      Time:3571 Temperature:20.7C Humidity:47.4%
      Time:4698 Temperature:20.7C Humidity:47.5%
      Time:5824 Temperature:20.7C Humidity:47.5%
      Time:6948 Temperature:20.7C Humidity:47.6%
      Time:8075 Temperature:20.7C Humidity:47.6%
      Time:9201 Temperature:20.7C Humidity:47.6%

      But when I include the "adapted" Mysensors sketch I found here in the forum it seems the temperatures are not read or something else is wrong?

      This is what is in the log file in a ongoing loop:

      MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
      4 TSM:INIT
      4 TSF:WUR:MS=0
      12 TSM:INIT:TSP OK
      14 TSM:INIT:STATID=2
      16 TSF:SID:OK,ID=2
      18 TSM:FPAR
      18 TSM:FPAR:STATP=0
      20 TSM:ID
      22 TSM:ID:OK
      22 TSM:UPL
      28 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
      47 TSF:MSG:READ,0-0-2,s=255,c=3,t=25,pt=1,l=1,sg=0:1
      53 TSF:MSG:PONG RECV,HP=1
      55 TSM:UPL:OK
      57 TSM:READY:ID=2,PAR=0,DIS=1
      63 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
      75 TSF:MSG:READ,0-0-2,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      86 TSF:MSG:SEND,2-2-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.1
      96 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
      2107 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=11,pt=0,l=8,sg=0,ft=0,st=OK:Humidity
      2119 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:2.0
      2129 TSF:MSG:SEND,2-2-0-0,s=0,c=0,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      2140 TSF:MSG:SEND,2-2-0-0,s=1,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
      2146 MCO:REG:REQ
      2164 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      2220 TSF:MSG:READ,0-0-2,s=255,c=3,t=27,pt=1,l=1,sg=0:1
      2226 MCO:PIM:NODE REG=1
      2228 MCO:BGN:INIT OK,TSP=1
      2 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
      6 TSM:INIT
      6 TSF:WUR:MS=0
      14 TSM:INIT:TSP OK
      16 TSM:INIT:STATID=2
      18 TSF:SID:OK,ID=2
      20 TSM:FPAR
      20 TSM:FPAR:STATP=0
      22 TSM:ID
      24 TSM:ID:OK
      26 TSM:UPL
      30 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
      57 TSF:MSG:READ,0-0-2,s=255,c=3,t=25,pt=1,l=1,sg=0:1
      63 TSF:MSG:PONG RECV,HP=1
      67 TSM:UPL:OK
      67 TSM:READY:ID=2,PAR=0,DIS=1
      73 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
      92 TSF:MSG:READ,0-0-2,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      102 TSF:MSG:SEND,2-2-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.1
      112 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
      2121 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=11,pt=0,l=8,sg=0,ft=0,st=OK:Humidity
      2134 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:2.0
      2144 TSF:MSG:SEND,2-2-0-0,s=0,c=0,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      2154 TSF:MSG:SEND,2-2-0-0,s=1,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
      2160 MCO:REG:REQ
      2164 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      2234 TSF:MSG:READ,0-0-2,s=255,c=3,t=27,pt=1,l=1,sg=0:1
      2240 MCO:PIM:NODE REG=1
      2242 MCO:BGN:INIT OK,TSP=1
      

      This is the sketch I use now I had to adopt it since it seemed to be for an older version of Mysensors. I'm no programmer so it might be messed up somehow 🙂

      /**
       * The MySensors Arduino library handles the wireless radio link and protocol
       * between your home built sensors/actuators and HA controller of choice.
       * The sensors forms a self healing radio network with optional repeaters. Each
       * repeater and gateway builds a routing tables in EEPROM which keeps track of the
       * network topology allowing messages to be routed to nodes.
       *
       * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
       * Copyright (C) 2013-2015 Sensnology AB
       * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
       *
       * Documentation: http://www.mysensors.org
       * Support Forum: http://forum.mysensors.org
       *
       * This program is free software; you can redistribute it and/or
       * modify it under the terms of the GNU General Public License
       * version 2 as published by the Free Software Foundation.
       *
       *******************************
       *
       * REVISION HISTORY
       * Version 1.0: Henrik EKblad
       * Version 1.1 - 2016-07-20: Converted to MySensors v2.0 and added various improvements - Torben Woltjen (mozzbozz)
       * 
       * DESCRIPTION
       * This sketch provides an example of how to implement a humidity/temperature
       * sensor using a DHT11/DHT-22.
       *  
       * For more information, please visit:
       * http://www.mysensors.org/build/humidity
       * 
       HTU21D Humidity Sensor
       Hardware Connections (Breakoutboard to Arduino):
       -VCC = 3.3V
       -GND = GND
       -SDA = A4 (use inline 330 ohm resistor if your board is 5V)
       -SCL = A5 (use inline 330 ohm resistor if your board is 5V)
       */
      
       
      #define MY_NODE_ID 2
      #define MY_PARENT_NODE_ID 0
      #define MY_PARENT_NODE_IS_STATIC
      
      // Enable debug prints
      #define MY_DEBUG
      
      // Enable and select radio type attached 
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      //#define MY_RS485
       
      #include "SparkFunHTU21D.h"
      #include <MySensors.h>  
      #include <Wire.h>
      #include <SPI.h>
      
      // Force sending an update of the temperature after n sensor reads, so a controller showing the
      // timestamp of the last update doesn't show something like 3 hours in the unlikely case, that
      // the value didn't change since;
      // i.e. the sensor would force sending an update every UPDATE_INTERVAL*FORCE_UPDATE_N_READS [ms]
      //static const uint8_t FORCE_UPDATE_N_READS = 10;
      
      #define CHILD_ID_HUM 0
      #define CHILD_ID_TEMP 1
      
      float lastTemp;
      float lastHum;
      uint8_t nNoUpdatesTemp;
      uint8_t nNoUpdatesHum;
      boolean metric = true;
      
      
      void presentation()  
      { 
       // Send the Sketch Version Information to the Gateway                                                                                                                     
        sendSketchInfo("Humidity", "2.0");      
         
       // Register all sensors to gw (they will be created as child devices)                                                                                                     
        present(CHILD_ID_HUM, S_HUM);                                                                                                                                          
        present(CHILD_ID_TEMP, S_TEMP);                                                                                                                                        
       
        //metric = getControllerConfig().isMetric;
      }
      
                                                                                                                                                        
      unsigned long SLEEP_TIME = 60000; // Sleep time between reads (in milliseconds)                                                                                             
                                                                                                                                                                              
                                                                                                                                                                     
                                                                                                                                                                              
      //Create an instance of the object                                                                                                                                          
      HTU21D myHumidity;                                                                                                                                                         
      
                                                                                                                                                                                                                                                                                                                                   
      MyMessage msgHum(CHILD_ID_HUM, V_HUM);                                                                                                                                      
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);                                                                                                                                   
                                                                                                                                                                                                                                                                                                                                                        
      void loop()                                                                                                                                                                 
      {                                                                                                                                                                           
        float temperature = myHumidity.readTemperature();                                                                                                                         
        //if (!metric) {                                                                                                                                                            
        //    temperature = (temperature * 1.8) + 32.0;                                                                                                                             
        //}                                                                                                                                                                         
        send(msgTemp.set(temperature, 1));                                                                                                                                     
      
        float humidity = myHumidity.readHumidity();                                                                                                                               
        send(msgHum.set(humidity, 1));                                                                                                                                         
                                                                                                                                                                              
        sleep(SLEEP_TIME); //sleep a bit  
                                                                                                                                             
      }
      

      Can anyone advise me on the code and the error log so I understand what's going on and what needs to be done to get it working? Thanks a lot.

      W.

      posted in Development
      Mr_sensor
      Mr_sensor
    • RE: DHT11 Arduino pro mini no temp readings

      This is the sketch I'm using.

      /**
       * The MySensors Arduino library handles the wireless radio link and protocol
       * between your home built sensors/actuators and HA controller of choice.
       * The sensors forms a self healing radio network with optional repeaters. Each
       * repeater and gateway builds a routing tables in EEPROM which keeps track of the
       * network topology allowing messages to be routed to nodes.
       *
       * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
       * Copyright (C) 2013-2015 Sensnology AB
       * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
       *
       * Documentation: http://www.mysensors.org
       * Support Forum: http://forum.mysensors.org
       *
       * This program is free software; you can redistribute it and/or
       * modify it under the terms of the GNU General Public License
       * version 2 as published by the Free Software Foundation.
       *
       *******************************
       *
       * REVISION HISTORY
       * Version 1.0: Henrik EKblad
       * Version 1.1 - 2016-07-20: Converted to MySensors v2.0 and added various improvements - Torben Woltjen (mozzbozz)
       * 
       * DESCRIPTION
       * This sketch provides an example of how to implement a humidity/temperature
       * sensor using a DHT11/DHT-22.
       *  
       * For more information, please visit:
       * http://www.mysensors.org/build/humidity
       * 
       */
      #define MY_NODE_ID 2
      #define MY_PARENT_NODE_ID 0
      #define MY_PARENT_NODE_IS_STATIC
      
      // Enable debug prints
      #define MY_DEBUG
      
      // Enable and select radio type attached 
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      //#define MY_RS485
       
      #include <SPI.h>
      #include <MySensors.h>  
      #include <DHT.h>
      
      
      // Set this to the pin you connected the DHT's data pin to
      #define DHT_DATA_PIN 3
      
      // Set this offset if the sensor has a permanent small offset to the real temperatures
      #define SENSOR_TEMP_OFFSET 0
      
      // Sleep time between sensor updates (in milliseconds)
      // Must be >1000ms for DHT22 and >2000ms for DHT11
      static const uint64_t UPDATE_INTERVAL = 60000;
      
      // Force sending an update of the temperature after n sensor reads, so a controller showing the
      // timestamp of the last update doesn't show something like 3 hours in the unlikely case, that
      // the value didn't change since;
      // i.e. the sensor would force sending an update every UPDATE_INTERVAL*FORCE_UPDATE_N_READS [ms]
      static const uint8_t FORCE_UPDATE_N_READS = 10;
      
      #define CHILD_ID_HUM 0
      #define CHILD_ID_TEMP 1
      
      float lastTemp;
      float lastHum;
      uint8_t nNoUpdatesTemp;
      uint8_t nNoUpdatesHum;
      bool metric = true;
      
      MyMessage msgHum(CHILD_ID_HUM, V_HUM);
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      DHT dht;
      
      
      void presentation()  
      { 
        // Send the sketch version information to the gateway
        sendSketchInfo("TemperatureAndHumidity", "1.1");
        
        // Register all sensors to gw (they will be created as child devices)
        present(CHILD_ID_HUM, S_HUM);
        present(CHILD_ID_TEMP, S_TEMP);
        
        metric = getControllerConfig().isMetric;
      }
      
      
      void setup()
      {
        dht.setup(DHT_DATA_PIN); // set data pin of DHT sensor
        if (UPDATE_INTERVAL <= dht.getMinimumSamplingPeriod()) {
          Serial.println("Warning: UPDATE_INTERVAL is smaller than supported by the sensor!");
        }
        // Sleep for the time of the minimum sampling period to give the sensor time to power up
        // (otherwise, timeout errors might occure for the first reading)
        sleep(dht.getMinimumSamplingPeriod());
      }
      
      
      void loop()      
      {  
        // Force reading sensor, so it works also after sleep()
        dht.readSensor(true);
        
        // Get temperature from DHT library
        float temperature = dht.getTemperature();
        if (isnan(temperature)) {
          Serial.println("Failed reading temperature from DHT!");
        } else if (temperature != lastTemp || nNoUpdatesTemp == FORCE_UPDATE_N_READS) {
          // Only send temperature if it changed since the last measurement or if we didn't send an update for n times
          lastTemp = temperature;
          if (!metric) {
            temperature = dht.toFahrenheit(temperature);
          }
          // Reset no updates counter
          nNoUpdatesTemp = 0;
          temperature += SENSOR_TEMP_OFFSET;
          send(msgTemp.set(temperature, 1));
      
          #ifdef MY_DEBUG
          Serial.print("T: ");
          Serial.println(temperature);
          #endif
        } else {
          // Increase no update counter if the temperature stayed the same
          nNoUpdatesTemp++;
        }
      
        // Get humidity from DHT library
        float humidity = dht.getHumidity();
        if (isnan(humidity)) {
          Serial.println("Failed reading humidity from DHT");
        } else if (humidity != lastHum || nNoUpdatesHum == FORCE_UPDATE_N_READS) {
          // Only send humidity if it changed since the last measurement or if we didn't send an update for n times
          lastHum = humidity;
          // Reset no updates counter
          nNoUpdatesHum = 0;
          send(msgHum.set(humidity, 1));
          
          #ifdef MY_DEBUG
          Serial.print("H: ");
          Serial.println(humidity);
          #endif
        } else {
          // Increase no update counter if the humidity stayed the same
          nNoUpdatesHum++;
        }
      
        // Sleep for a while to save energy
        sleep(UPDATE_INTERVAL); 
      }
      
      posted in Development
      Mr_sensor
      Mr_sensor
    • RE: DHT11 Arduino pro mini no temp readings

      @Mr_sensor Stil get the message

      Failed reading temperature from DHT!
      Failed reading humidity from DHT

      Also tried it with an dh22 I had (included a pull-up resistor between vcc and data) but get the same result. What can I do to get this working?
      If I use the arduino pro mini for an other sensor they are working fine (tested with a magnet-reed switch).

      posted in Development
      Mr_sensor
      Mr_sensor
    • RE: DHT11 Arduino pro mini no temp readings

      @tonnerre33 No I have one with pcb.

      posted in Development
      Mr_sensor
      Mr_sensor
    • RE: DHT11 Arduino pro mini no temp readings

      @hek Thanks for the reply. I just did a test with my multimeter and measuring at the dht11 it shows 3.46 so that should be ok right?
      I used the DHT11 some time ago with an esp8266 and than it was working fine. Could the pin 3 data be the problem?

      posted in Development
      Mr_sensor
      Mr_sensor
    • DHT11 Arduino pro mini no temp readings

      Hi,

      I'm trying to get my first sensor working. A DHT11 temp/ humidity sensor. I followed the instructions from the build part on Mysensors. Uploaded the sketch and had a look at the serial monitor.
      There it appeared that no temperatures are coming up. So I had a look at the connections and all seems fine to me. What could be the problem? Power?
      Also, having a look at the serial log, does it communicate with the gateway? I think so, but which lines are referring to that?
      The parts with: TSF:MSG:READ,0-0-1,s=255,c=3,t=27,pt=1,l=1,sg=0:1 ?

      Any advise on how to get the DHT11 to work? Thanks.

      Using the DHTlibrary as mentioned in the instructions.
      Arduino 1.8.2
      Mysensors 2.1.1
      Arduino pro mini ordered from aliexpress I am not sure which version I have both 3.3 volt and 5volt version (how to determine?).

      link text
      link text

      0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
      4 TSM:INIT
      4 TSF:WUR:MS=0
      12 TSM:INIT:TSP OK
      14 TSM:INIT:STATID=1
      16 TSF:SID:OK,ID=1
      18 TSM:FPAR
      18 TSM:FPAR:STATP=0
      20 TSM:ID
      22 TSM:ID:OK
      24 TSM:UPL
      32 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
      47 TSF:MSG:READ,0-0-1,s=255,c=3,t=25,pt=1,l=1,sg=0:1
      53 TSF:MSG:PONG RECV,HP=1
      55 TSM:UPL:OK
      57 TSM:READY:ID=1,PAR=0,DIS=1
      71 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
      79 TSF:MSG:READ,0-0-1,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      90 TSF:MSG:SEND,1-1-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.1
      100 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
      2117 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=11,pt=0,l=22,sg=0,ft=0,st=OK:TemperatureAndHumidity
      2129 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.1
      2144 TSF:MSG:SEND,1-1-0-0,s=0,c=0,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      2154 TSF:MSG:SEND,1-1-0-0,s=1,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
      2160 MCO:REG:REQ
      2166 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      2226 TSF:MSG:READ,0-0-1,s=255,c=3,t=27,pt=1,l=1,sg=0:1
      2232 MCO:PIM:NODE REG=1
      2234 MCO:BGN:STP
      2236 MCO:SLP:MS=1000,SMS=0,I1=255,M1=255,I2=255,M2=255
      2242 MCO:SLP:TPD
      2244 MCO:SLP:WUP=-1
      2246 MCO:BGN:INIT OK,TSP=1
      Failed reading temperature from DHT!
      Failed reading humidity from DHT
      2269 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      2279 MCO:SLP:TPD
      2281 MCO:SLP:WUP=-1
      Failed reading temperature from DHT!
      Failed reading humidity from DHT
      2304 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      2314 MCO:SLP:TPD
      2316 MCO:SLP:WUP=-1
      Failed reading temperature from DHT!
      Failed reading humidity from DHT
      2336 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255
      2347 MCO:SLP:TPD
      2349 MCO:SLP:WUP=-1```
      
      Any help would be appreciated. Thanks. W.
      posted in Development
      Mr_sensor
      Mr_sensor
    • RE: Max6675 Thermocouple project

      Any ideas on this any one? How to troubleshoot this? Would be nice to get this working. Thanks

      W.

      posted in Development
      Mr_sensor
      Mr_sensor
    • RE: HomeSeer

      Hi, I'm a Homeseer user, and I lately discovered the MQTT plugin. Its maintained well and gives you the possibilities you might be looking for. I have seen other users having it in use with there sensors and even switches (sonoff)

      posted in Homeseer
      Mr_sensor
      Mr_sensor
    • Max6675 Thermocouple project

      Hi, just started to explore the MySensors possibilities. The first project I'm building is a High temperature MAX6675 Thermocouple which send data to the MQTT broker.

      So I ordered some parts and started building the gateway with an arduino uno and Ethernet shield. Than connected the Max6675 and gave it a go!

      Although the set-up seems to be quit simple I can not get any temperature read from the sensor?
      If I connect it like some of the samples I found I end up with this:

      0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGA--,VER=2.1.1
      IP: 192.168.0.87
      0;255;3;0;9;MCO:BGN:STP
      MAX6675 test
      0;255;3;0;9;MCO:REG:NOT NEEDED
      0;255;3;0;9;MCO:BGN:INIT OK,TSP=NA
      IP: 192.168.0.87
      0;255;3;0;9;Attempting MQTT connection...
      0;255;3;0;9;MQTT connected
      0;255;3;0;9;Sending message on topic: mygateway1-out/0/255/0/0/17
      0;255;3;0;9;Sending message on topic: mygateway1-out/0/255/3/0/11
      0;255;3;0;9;Sending message on topic: mygateway1-out/0/255/3/0/12
      0;255;3;0;9;Sending message on topic: mygateway1-out/0/10/0/0/6
      Deg C = nan	 Deg F = nan
      Deg C = nan	 Deg F = nan
      Deg C = nan	 Deg F = nan
      Deg C = nan	 Deg F = nan
      Deg C = nan	 Deg F = nan
      Deg C = nan	 Deg F = nan
      Deg C = nan	 Deg F = nan
      Deg C = nan	 Deg F = nan
      Deg C = nan	 Deg F = nan
      Deg C = nan	 Deg F = nan
      Deg C = nan	 Deg F = nan
      Deg C = nan	 Deg F = nan
      Deg C = nan	 Deg F = nan
      
      

      I used this example for the wiring: link to max6675-temp-module-wiring

      Also had a look at the post about the max6675 here on the forum. After trying several combinations I run out of ideas. So maybe one of you can point me in the right direction to get this finally working 🙂

      This is the sketch I ended up after changing it several times.

      /**
       * The MySensors Arduino library handles the wireless radio link and protocol
       * between your home built sensors/actuators and HA controller of choice.
       * The sensors forms a self healing radio network with optional repeaters. Each
       * repeater and gateway builds a routing tables in EEPROM which keeps track of the
       * network topology allowing messages to be routed to nodes.
       *
       * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
       * Copyright (C) 2013-2015 Sensnology AB
       * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
       *
       * Documentation: http://www.mysensors.org
       * Support Forum: http://forum.mysensors.org
       *
       * This program is free software; you can redistribute it and/or
       * modify it under the terms of the GNU General Public License
       * version 2 as published by the Free Software Foundation.
       *
       *******************************
       *
       * REVISION HISTORY
       * Version 1.0 - Henrik Ekblad
       *
       * DESCRIPTION
       * The W5100 MQTT gateway sends radio network (or locally attached sensors) data to your MQTT broker.
       * The node also listens to MY_MQTT_TOPIC_PREFIX and sends out those messages to the radio network
       *
       * LED purposes:
       * - To use the feature, uncomment WITH_LEDS_BLINKING in MyConfig.h
       * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved
       * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
       * - ERR (red) - fast blink on error during transmission error or recieve crc error
       *
       * See http://www.mysensors.org/build/esp8266_gateway for wiring instructions.
       * nRF24L01+  ESP8266
       * VCC        VCC
       * CE         GPIO4
       * CSN/CS     GPIO15
       * SCK        GPIO14
       * MISO       GPIO12
       * MOSI       GPIO13
       *
       * Not all ESP8266 modules have all pins available on their external interface.
       * This code has been tested on an ESP-12 module.
       * The ESP8266 requires a certain pin configuration to download code, and another one to run code:
       * - Connect REST (reset) via 10K pullup resistor to VCC, and via switch to GND ('reset switch')
       * - Connect GPIO15 via 10K pulldown resistor to GND
       * - Connect CH_PD via 10K resistor to VCC
       * - Connect GPIO2 via 10K resistor to VCC
       * - Connect GPIO0 via 10K resistor to VCC, and via switch to GND ('bootload switch')
       *
        * Inclusion mode button:
       * - Connect GPIO5 via switch to GND ('inclusion switch')
       *
       * Hardware SHA204 signing is currently not supported!
       *
       * Make sure to fill in your ssid and WiFi password below for ssid & pass.
       */
      
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      // Enables and select radio type (if attached)
      //#define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      
      #define MY_GATEWAY_MQTT_CLIENT
      
      // Set this node's subscribe and publish topic prefix
      #define MY_MQTT_PUBLISH_TOPIC_PREFIX "mygateway1-out"
      #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "mygateway1-in"
      
      // Set MQTT client id
      #define MY_MQTT_CLIENT_ID "mysensors-1"
      
      // W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal)
      //#define MY_W5100_SPI_EN 4
      
      // Enable Soft SPI for NRF radio (note different radio wiring is required)
      // The W5100 ethernet module seems to have a hard time co-operate with
      // radio on the same spi bus.
      #if !defined(MY_W5100_SPI_EN) && !defined(ARDUINO_ARCH_SAMD)
      #define MY_SOFTSPI
      #define MY_SOFT_SPI_SCK_PIN 14
      #define MY_SOFT_SPI_MISO_PIN 16
      #define MY_SOFT_SPI_MOSI_PIN 15
      #endif
      
      // When W5100 is connected we have to move CE/CSN pins for NRF radio
      #ifndef MY_RF24_CE_PIN
      #define MY_RF24_CE_PIN 5
      #endif
      #ifndef MY_RF24_CS_PIN
      #define MY_RF24_CS_PIN 6
      #endif
      
      // Enable these if your MQTT broker requires usenrame/password
      #define MY_MQTT_USER ""
      #define MY_MQTT_PASSWORD ""
      
      // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
      #define MY_IP_ADDRESS 192,168,0,87
      
      // If using static ip you need to define Gateway and Subnet address as well
      #define MY_IP_GATEWAY_ADDRESS 192,168,0,1
      #define MY_IP_SUBNET_ADDRESS 255,255,255,0
      
      // MQTT broker ip address or url. Define one or the other.
      //#define MY_CONTROLLER_URL_ADDRESS "m20.cloudmqtt.com"
      #define MY_CONTROLLER_IP_ADDRESS 192, 168, 0, 36
      
      // The MQTT broker port to to open
      #define MY_PORT 1883
      
      /*
      // Enable inclusion mode
      #define MY_INCLUSION_MODE_FEATURE
      // Enable Inclusion mode button on gateway
      //#define MY_INCLUSION_BUTTON_FEATURE
      // Set inclusion mode duration (in seconds)
      #define MY_INCLUSION_MODE_DURATION 60
      // Digital pin used for inclusion mode button
      //#define MY_INCLUSION_MODE_BUTTON_PIN  3
      
      // Set blinking period
      #define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      // Flash leds on rx/tx/err
      // Uncomment to override default HW configurations
      //#define MY_DEFAULT_ERR_LED_PIN 16  // Error led pin
      //#define MY_DEFAULT_RX_LED_PIN  16  // Receive led pin
      //#define MY_DEFAULT_TX_LED_PIN  16  // the PCB, on board LED
      */
      
      #include <Ethernet.h>
      #include <MySensors.h>
      
      
      // Sample Arduino MAX6675 Arduino Sketch
      
      #include "max6675.h"
      
      #define MY_NODE_ID 10
      
      #define CHILD_ID_TEMP 10
      #define TEMP_SENSOR_DIGITAL_PIN 8
      
      int thermoSO = 8;
      int thermoCS = 9;
      int thermoSCLK = 10;
      
      MAX6675 thermo(thermoSCLK, thermoCS, thermoSO);
      int vccPin = 3;
      int gndPin = 2;
      
      MyMessage msg(CHILD_ID_TEMP, S_TEMP);
      
      void presentation()  { 
       
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Temp Sensor", "0.1");
      
        // Register all sensors to gateway (they will be created as child devices)
        present(CHILD_ID_TEMP, S_TEMP);
      }
      
      
      void setup() {
        Serial.begin(115200);
      // use Arduino pins 
        pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
        pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);
        
        Serial.println("MAX6675 test");
        
      
        // give the MAX a little time to settle
        delay(500);
      }
      
      void loop() {
        // basic readout test
        
         Serial.print("Deg C = "); 
         Serial.print(thermo.readCelsius());
         Serial.print("\t Deg F = ");
         Serial.println(thermo.readFahrenheit());
       
         delay(500);
      }
      

      0_1484995787091_IMG_3708.JPG

      0_1484995829154_IMG_3703.JPG

      posted in Development
      Mr_sensor
      Mr_sensor