Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
N

Nicklas Starkel

@Nicklas Starkel
About
Posts
58
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Long time test done with soil sensor!
    N Nicklas Starkel

    Alright, so in 2016 (the 14th of November 2016 started recording into SQL) I created a soil sensor.
    I used 3.3V pro mini with regulator removed and powered by Vin pin. Also removed leds from the pro mini.
    Connected to a prong inserted into the soil.
    Every hour it woke up, measured and sent info to the gateway.
    Driven by two AA batteries it showed battery voltage at 3.074V at the start.
    In the end of 2024 it showed 2.399 which should be sufficient to get several years more or measurements.
    However, one of the batteries had started to leak (cheap battery!).
    But it's safe to say this sensor did its job very well with recorded measurements of over 57000 data points!
    And to top this I had not the gateway set up some time, but the soil sensor still was on.
    So those records are obviously not recorded.

    So this little bad boy continued for 8 years with measurements for 6.5 years recorded.
    The prong looks like new.

    Just thought I'd let you all know this sunshine story :)

    My Project

  • openHAB 2.2 binding
    N Nicklas Starkel

    @TimO, cool that you are stil on it, even if it's on the "todo-list".
    Kudos and keep up the great work :)

    OpenHAB

  • openHAB 2.2 binding
    N Nicklas Starkel

    @TimO , is this binding supported via mysensors MQTT gateway?
    In previous bending inormation you had some text indicating that you would implement it. But all that is gone.
    So I'm thinking you either implemented it, or aborted that feature :)

    OpenHAB

  • openHAB 2.0 binding
    N Nicklas Starkel

    @TimO , did you ever get MQTT to work or do you need someone to test?

    OpenHAB

  • Watering flowers on the balcony + LED illumination
    N Nicklas Starkel

    I recently managed to build a small irrigation system for my balcony, using mysensors of course!
    It was picked up by Sweden's best "smart home"-shop "m.nu" and I had a chance to blog about it.
    @hek , I didn't really clean up the code so you actually got credit for it on their facebook page, lol.
    Hope you approve or I will make them change it.
    Maybe you can see a trade off with the fame and that I also mentioned mysensors.org :)

    Swedish version:
    https://blog.m.nu/gastblogg-styrning-av-bevattning-balkonglador/

    English using google translate:
    https://translate.google.com/translate?sl=sv&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=https%3A%2F%2Fblog.m.nu%2Fgastblogg-styrning-av-bevattning-balkonglador%2F&edit-text=

    Cheers

    My Project

  • openHAB 2.0 binding
    N Nicklas Starkel

    I was checking back on this bindning and it really has matured!
    On GitHub I see that there are some updates referring to MqTT protocol.
    Are they available in the JAR that is posted here?
    http://www.oberfoell.com/openhab2/org.openhab.binding.mysensors-2.0.0-SNAPSHOT.jar

    Kudos on the great work!

    OpenHAB

  • delay different functions in loop
    N Nicklas Starkel

    After some hours of sleep and refactoring everything, now I think I've managed to get everything working.
    I have some problem wrapping my head around "forceTransmit" command and how it works.
    Also, millis() is also something I have to learn :)

    Here is the code if anyone finds it interesting.
    What it does is measure soil moisture every hour and sends info (normal forkthingie).
    Also reading every 30 seconds for temperature and humidity (si7021)
    If humidity changes by 1 or temperature by 0.2 it will send info.
    If no info has been sent it will force send info every 20 minutes.

    3 Relays are there to power water pumps and a LED strip.

    i have now semi-learned the use of functions, which is fun :)
    cheers!

    /**
     * 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
     * Example sketch showing how to control physical relays.
     * This example will remember relay state after power failure.
     * http://www.mysensors.org/build/relay
     */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    //Network
    #define MY_NODE_ID 62
    #define MY_PARENT_NODE_ID 0
    #define MY_PARENT_NODE_IS_STATIC
    #define MY_RADIO_NRF24
    //Includes
    #include <SPI.h>
    #include <MySensors.h>
    #include <SI7021.h>
    #include <RunningAverage.h>
    //Define Relay
    #define RELAY_1  3  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
    #define RELAY_2  4  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
    #define RELAY_3  5  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
    #define NUMBER_OF_RELAYS 3 // Total number of attached relays
    #define RELAY_ON 1  // GPIO value to write to turn on attached relay
    #define RELAY_OFF 0 // GPIO value to write to turn off attached relay
    #define RELEASE "1.4"
    //Define Moisture things
    #define AVERAGES 2
    
    // Child sensor ID's
    #define CHILD_ID_TEMP  5
    #define CHILD_ID_HUM   6
    #define CHILD_ID_MOISTURE 7
    // How many milli seconds between each measurement of temp and humidity
    #define MEASURE_INTERVAL 30000
    // FORCE_TRANSMIT_INTERVAL, this number of times of wakeup, the sensor is forced to report all values to the controller
    #define FORCE_TRANSMIT_INTERVAL 2000 // 20minutes
    // HUMI_TRANSMIT_THRESHOLD tells how much the humidity should have changed since last time it was transmitted. Likewise with
    // TEMP_TRANSMIT_THRESHOLD for temperature threshold.
    #define HUMI_TRANSMIT_THRESHOLD 1.0
    #define TEMP_TRANSMIT_THRESHOLD 0.2
    #define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
    #define N_ELEMENTS(array) (sizeof(array)/sizeof((array)[0]))
    #define STABILIZATION_TIME 1000 // Let the sensor stabilize before reading
    SI7021 humiditySensor;
    
    // Sensor messages
    MyMessage msgHum(CHILD_ID_HUM, V_HUM);
    MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
    MyMessage msgMoist(CHILD_ID_MOISTURE, V_HUM);
    MyMessage msgR1(RELAY_1, V_STATUS);
    MyMessage msgR2(RELAY_2, V_STATUS);
    // Global settings
    const unsigned long tUpdateTemp = 5000; // update interval
    unsigned long t0;
    const unsigned long tUpdateMoist = 360000; // update interval
    unsigned long t1;
    int measureCount = 0;
    boolean isMetric = true;
    boolean highfreq = true;
    boolean transmission_occured = false;
    
    // Storage of old measurements
    float lastTemperature = -100;
    int lastHumidity = -100;
    int oldMoistureLevel = -1;
    //Change direction on moisture
    byte direction = 0;
    //Moisture sensor pins
    RunningAverage raHum(AVERAGES);
    const int SENSOR_ANALOG_PINS[] = {A0, A1}; // Sensor is connected to these two pins. Avoid A3 if using ATSHA204. A6 and A7 cannot be used because they don't have pullups.
    
    void before()
    {
        for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++)
        {
            // Then set relay pins in output mode
            pinMode(pin, OUTPUT);
            // Set relay to last known state (using eeprom storage)
            digitalWrite(pin, loadState(sensor)?RELAY_ON:RELAY_OFF);
        }
    }
    
    void setup()
    {
      Serial.begin(115200);
      humiditySensor.begin();
      isMetric = getControllerConfig().isMetric;
      Serial.print(F("isMetric: ")); Serial.println(isMetric);
      raHum.clear();
      t0=millis();
      t1=millis();
      //sendTempHumidityMeasurements(true);
      //sendMoistureMeasurements();
      delay(250);
      for (int i = 0; i < N_ELEMENTS(SENSOR_ANALOG_PINS); i++)
      {
        pinMode(SENSOR_ANALOG_PINS[i], OUTPUT);
        digitalWrite(SENSOR_ANALOG_PINS[i], LOW); 
      }
    }
    
    void presentation()
    {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("RelayTempHumMoist", "1.0");
      for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++)
      {
        // Register all sensors to gw (they will be created as child devices)
        present(sensor, S_BINARY,"Relays");
      }
      present(CHILD_ID_TEMP,S_TEMP,"Temperature");
      present(CHILD_ID_HUM,S_HUM,"Humidity");
      present(CHILD_ID_MOISTURE, S_HUM,"Moisture");
    }
    
    
    void loop()
    {
      measureCount ++;
      bool forceTransmit = false;
      transmission_occured = false;
      if (measureCount > FORCE_TRANSMIT_INTERVAL)
      {
        forceTransmit = true; 
        measureCount = 0;
        Serial.print(F("inne i loopen :"));
      }
    
    if ((millis() - t1) > tUpdateMoist) sendMoistureMeasurements();
        sendTempHumidityMeasurements(forceTransmit);
    }
    
    void sendTempHumidityMeasurements(bool force)
    {
      wait(MEASURE_INTERVAL);
      bool tx = force;
      si7021_env data = humiditySensor.getHumidityAndTemperature();
      raHum.addValue(data.humidityPercent);
      float diffTemp = abs(lastTemperature - (isMetric ? data.celsiusHundredths : data.fahrenheitHundredths)/100.0);
      float diffHum = abs(lastHumidity - raHum.getAverage());
      Serial.print(F("TempDiff :"));Serial.println(diffTemp);
      Serial.print(F("HumDiff  :"));Serial.println(diffHum);
      t0 = millis();
      if (isnan(diffHum)) tx = true; 
      if (diffTemp > TEMP_TRANSMIT_THRESHOLD) tx = true;
      if (diffHum > HUMI_TRANSMIT_THRESHOLD) tx = true;
    
      if (tx)
      {
        measureCount = 0;
        float temperature = (isMetric ? data.celsiusHundredths : data.fahrenheitHundredths) / 100.0;
    
        int humidity = data.humidityPercent;
        Serial.print("T: ");Serial.println(temperature);
        Serial.print("H: ");Serial.println(humidity);
    
        send(msgTemp.set(temperature,1));
        send(msgHum.set(humidity));
        lastTemperature = temperature;
        lastHumidity = humidity;
        transmission_occured = true;
      }
    }
        
    void sendMoistureMeasurements()
    {
      pinMode(SENSOR_ANALOG_PINS[direction], INPUT_PULLUP); // Power on the sensor
      analogRead(SENSOR_ANALOG_PINS[direction]);// Read once to let the ADC capacitor start charging
      sleep(STABILIZATION_TIME);
      int moistureLevel = (1023 - analogRead(SENSOR_ANALOG_PINS[direction]));
    
      // Turn off the sensor to conserve battery and minimize corrosion
      pinMode(SENSOR_ANALOG_PINS[direction], OUTPUT);
      digitalWrite(SENSOR_ANALOG_PINS[direction], LOW);
    
      direction = (direction + 1) % 2; // Make direction alternate between 0 and 1 to reverse polarity which reduces corrosion
      // Always send moisture information so the controller sees that the node is alive
    
      // Send rolling average of 2 samples to get rid of the "ripple" produced by different resistance in the internal pull-up resistors
      // See http://forum.mysensors.org/topic/2147/office-plant-monitoring/55 for more information
      if (oldMoistureLevel == -1)
      { // First reading, save value
        oldMoistureLevel = moistureLevel;
      }
      send(msgMoist.set((moistureLevel + oldMoistureLevel +  0.5) / 2 / 10.23, 1));
      oldMoistureLevel = moistureLevel;
      t1 = millis();
    }
    
    void receive(const MyMessage &message)
    {
      // We only expect one type of message from controller. But we better check anyway.
      if (message.type==V_STATUS)
      {
        // Change relay state
        digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF);
        // Store state in eeprom
        saveState(message.sensor, message.getBool());
        // Write some debug info
        Serial.print("Incoming change for sensor:");
        Serial.print(message.sensor);
        Serial.print(", New status: ");
        Serial.println(message.getBool());
      }
    }```
    Troubleshooting

  • delay different functions in loop
    N Nicklas Starkel

    Well, it's been a couple of hours now I've been trying to get things to work but now I have to ask for help.
    I understand that you can call a function from the loop.
    I have combined the sketches: RELAY, SOIL MOISTURE and SI7021 (which is a temperature/humidity sensor).

    all parts are working as expected but I want for instance the soil moisture to only be activated and do it's stuff every hour or so.
    While the temperature/humidity should be checked every 5 minutes and send info if changed + forced every 30 minutes..
    I have gotten it to work, but it's not a nice sketch, and I have problem with the timings.
    Because if I call the functions they only work if I add a serial print to see if it's actually counting.
    If I comment it out, it will show everything like every 3 seconds..
    I understand my sketch is aweful, but it's the best I can do at the moment (still learning).

    Someone that could take a look and/or point em in the right direction?
    Thanks.

    /**
     * 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
     * Example sketch showing how to control physical relays.
     * This example will remember relay state after power failure.
     * http://www.mysensors.org/build/relay
     */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    #define MY_NODE_ID 62
    #define MY_PARENT_NODE_ID 0
    #define MY_PARENT_NODE_IS_STATIC
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    // Enable repeater functionality for this node
    //#define MY_REPEATER_FEATURE
    #include <SPI.h>
    #include <MySensors.h>
    #include <SI7021.h>
    #include <RunningAverage.h>
    
    #define RELAY_1  3  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
    #define RELAY_2  4  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
    #define RELAY_3  5  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
    #define NUMBER_OF_RELAYS 3 // Total number of attached relays
    #define RELAY_ON 1  // GPIO value to write to turn on attached relay
    #define RELAY_OFF 0 // GPIO value to write to turn off attached relay
    #define RELEASE "1.4"
    
    #define AVERAGES 2
    
    // Child sensor ID's
    #define CHILD_ID_TEMP  5
    #define CHILD_ID_HUM   6
    #define CHILD_ID_MOISTURE 7
    
    // How many milli seconds between each measurement
    #define MEASURE_INTERVAL 30000
    // FORCE_TRANSMIT_INTERVAL, this number of times of wakeup, the sensor is forced to report all values to the controller
    #define FORCE_TRANSMIT_INTERVAL 120000
    
    // HUMI_TRANSMIT_THRESHOLD tells how much the humidity should have changed since last time it was transmitted. Likewise with
    // TEMP_TRANSMIT_THRESHOLD for temperature threshold.
    #define HUMI_TRANSMIT_THRESHOLD 0.2
    #define TEMP_TRANSMIT_THRESHOLD 0.2
    #define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
    #define N_ELEMENTS(array) (sizeof(array)/sizeof((array)[0]))
    #define MOISTURE_TIME 5000 //1800000 // Sleep time between reads (in milliseconds)
    #define STABILIZATION_TIME 1000 // Let the sensor stabilize before reading
    SI7021 humiditySensor;
    
    // Sensor messages
    MyMessage msgHum(CHILD_ID_HUM, V_HUM);
    MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
    MyMessage msg(CHILD_ID_MOISTURE, V_HUM);
    // Global settings
    int measureCount = 0;
    int TempHum = 0;
    int Moisture = 0;
    boolean isMetric = true;
    boolean highfreq = true;
    boolean transmission_occured = false;
    
    // Storage of old measurements
    float lastTemperature = -100;
    int lastHumidity = -100;
    int oldMoistureLevel = -1;
    byte direction = 0;
    RunningAverage raHum(AVERAGES);
    const int SENSOR_ANALOG_PINS[] = {A0, A1}; // Sensor is connected to these two pins. Avoid A3 if using ATSHA204. A6 and A7 cannot be used because they don't have pullups.
    void before()
    {
        for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
            // Then set relay pins in output mode
            pinMode(pin, OUTPUT);
            // Set relay to last known state (using eeprom storage)
            digitalWrite(pin, loadState(sensor)?RELAY_ON:RELAY_OFF);
        }
    }
    
    void setup()
    {
    Serial.begin(115200);
      Serial.print(F("Sensebender Micro FW "));
      Serial.print(RELEASE);
      Serial.flush();
    
      humiditySensor.begin();
    
    
      Serial.flush();
      Serial.println(F(" - Online!"));
    
      isMetric = getControllerConfig().isMetric;
      Serial.print(F("isMetric: ")); Serial.println(isMetric);
      raHum.clear();
      sendTempHumidityMeasurements(false);
      present(CHILD_ID_MOISTURE, S_HUM);
      for (int i = 0; i < N_ELEMENTS(SENSOR_ANALOG_PINS); i++) {
        pinMode(SENSOR_ANALOG_PINS[i], OUTPUT);
        digitalWrite(SENSOR_ANALOG_PINS[i], LOW);
    }
    }
    void presentation()
    {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Relay", "1.0");
    
        for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
            // Register all sensors to gw (they will be created as child devices)
            present(sensor, S_BINARY);
            present(CHILD_ID_TEMP,S_TEMP);
            present(CHILD_ID_HUM,S_HUM);
            present(CHILD_ID_MOISTURE, S_HUM);
        }
    }
    
    
    void loop()
    {
      TempHum ++;
      Moisture ++;
      measureCount ++;
      bool forceTransmitTemp = false;
      bool forceTransmitMoist = false;
      transmission_occured = false;
    
      if (TempHum > FORCE_TRANSMIT_INTERVAL) { // force a transmission
        //forceTransmitTemp = true; 
        TempHum = 0;
        sendTempHumidityMeasurements(forceTransmitTemp);
      }
      if (Moisture > MOISTURE_TIME) { // force a transmission
        //forceTransmitMoist = true;
        Moisture = 0;
        sendMoistureMeasurements(forceTransmitMoist);
      }
          Serial.print(F("TempHum interval  :"));Serial.println(TempHum); 
      //wait(MEASURE_INTERVAL);  
    }
    void sendTempHumidityMeasurements(bool force)
    {
      bool tx = force;
    
      si7021_env data = humiditySensor.getHumidityAndTemperature();
    
      raHum.addValue(data.humidityPercent);
    
      float diffTemp = abs(lastTemperature - (isMetric ? data.celsiusHundredths : data.fahrenheitHundredths)/100.0);
      float diffHum = abs(lastHumidity - raHum.getAverage());
    
      Serial.print(F("TempDiff :"));Serial.println(diffTemp);
      Serial.print(F("HumDiff  :"));Serial.println(diffHum); 
    
      if (isnan(diffHum)) tx = true; 
      if (diffTemp > TEMP_TRANSMIT_THRESHOLD) tx = true;
      if (diffHum > HUMI_TRANSMIT_THRESHOLD) tx = true;
    
      if (tx) {
        TempHum = 0;
        float temperature = (isMetric ? data.celsiusHundredths : data.fahrenheitHundredths) / 100.0;
    
        int humidity = data.humidityPercent;
        Serial.print("T: ");Serial.println(temperature);
        Serial.print("H: ");Serial.println(humidity);
    
        send(msgTemp.set(temperature,1));
        send(msgHum.set(humidity));
        lastTemperature = temperature;
        lastHumidity = humidity;
        transmission_occured = true;
        }
      }
    void sendMoistureMeasurements(bool force) {
    pinMode(SENSOR_ANALOG_PINS[direction], INPUT_PULLUP); // Power on the sensor
      analogRead(SENSOR_ANALOG_PINS[direction]);// Read once to let the ADC capacitor start charging
      sleep(STABILIZATION_TIME);
      int moistureLevel = (1023 - analogRead(SENSOR_ANALOG_PINS[direction]));
    
      // Turn off the sensor to conserve battery and minimize corrosion
      pinMode(SENSOR_ANALOG_PINS[direction], OUTPUT);
      digitalWrite(SENSOR_ANALOG_PINS[direction], LOW);
    
      direction = (direction + 1) % 2; // Make direction alternate between 0 and 1 to reverse polarity which reduces corrosion
      // Always send moisture information so the controller sees that the node is alive
    
      // Send rolling average of 2 samples to get rid of the "ripple" produced by different resistance in the internal pull-up resistors
      // See http://forum.mysensors.org/topic/2147/office-plant-monitoring/55 for more information
      if (oldMoistureLevel == -1) { // First reading, save value
        oldMoistureLevel = moistureLevel;
      }
      send(msg.set((moistureLevel + oldMoistureLevel +  0.5) / 2 / 10.23, 1));
      oldMoistureLevel = moistureLevel;
      transmission_occured = true;
      Serial.print("M: ");Serial.println(moistureLevel);
        }
    
    void receive(const MyMessage &message)
    {
        // We only expect one type of message from controller. But we better check anyway.
        if (message.type==V_STATUS) {
            // Change relay state
            digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF);
            // Store state in eeprom
            saveState(message.sensor, message.getBool());
            // Write some debug info
            Serial.print("Incoming change for sensor:");
            Serial.print(message.sensor);
            Serial.print(", New status: ");
            Serial.println(message.getBool());
      
        }
    }```
    Troubleshooting

  • Wall mounted 'mood light' v2
    N Nicklas Starkel

    Hey @AWI

    I have some trouble using this with MqTT messages.
    I can get alarm to go off by sending a payload of '1' to 'InMQTT/62/4/1/0/2' and subsequently turn it off with any other value.

    But I can't get the rest of your functions to work!
    If I read your code correct, to set a solid color I would have to send several MqTT messages to the children?
    Ex, I would have to send 'InMQTT/62/1/1/0/40' and payload ex 'Candle' first.
    Then 'InMQTT/62/1/1/0/2' with payload of '1' to turn it on?
    I was looking at the serial protocol and do not find what V_Dimmer is for type. (https://www.mysensors.org/download/serial_api_20#variable-types)

    Anyways, i cant get it to work properly, maybe you could shed some light (pun not intended :+1: ) )?

    My Project

  • [SOLVED] After upgrade to mysensors 2.1 problems with radio module might manifest itself more.
    N Nicklas Starkel

    @Anticimex and @tekka .
    I just upgraded my GW (MEGA) and most sensors.
    I do not know what you did, but my range is incredible now (and everything works!)
    I had good coverage in my apartment before, but if I went outside my front door it started failing (steel security door).
    Now, I can not only go outside the door, I can actually go 3 stairs down in my building with AWIs NRF tester.
    Same hardware is used and nothing has changed from my part.

    Kudos and thank you.

    Troubleshooting

  • [SOLVED] After upgrade to mysensors 2.1 problems with radio module might manifest itself more.
    N Nicklas Starkel

    @Anticimex , eh, no apologies needed. I'm thankful mysensors is opensource and actually FREE!
    Cool that you found a bug and if I helped, I'm glad :)

    Troubleshooting

  • [SOLVED] After upgrade to mysensors 2.1 problems with radio module might manifest itself more.
    N Nicklas Starkel

    @Anticimex I not sure I follow you and perhaps I am doing it wrong :)
    I power my arduinos via their usb jacket, 5V/2.1A
    If I'm using the NRF plate it has its own dedicated regulator hence its getting 3xAAA 4.5V.
    Otherwise I am using 2xAA which is around 3.3V connected to VCC/GND of the radio module and GND is also connected to the arduino.

    Troubleshooting

  • [SOLVED] After upgrade to mysensors 2.1 problems with radio module might manifest itself more.
    N Nicklas Starkel

    @Anticimex
    I power either with 3xAAA (4.5V) if I'm using the plate.
    If I'm using only capacitor I power with 2xAA (3.3V).
    Tried both versions with same results. Only difference is Arduino/MEGA.
    All batteries fresh and also checked with voltmeter ;)

    Troubleshooting

  • [SOLVED] After upgrade to mysensors 2.1 problems with radio module might manifest itself more.
    N Nicklas Starkel

    @tekka that was my next goal ;)

    I just built an UNO with an ethernet shield and low and behold its working with 47uF capacitor.
    Conclusion:
    MEGA does not work with NRF plate adapter nor 47uF capacitor.
    UNO works with 47uF capacitor only (not with plate).

    All nodes are reporting in (mixed 2.0 and 2.1).
    I use @AWI quality meter with NRF plate board to test as well and it is OK.

    So same NRF hardware yields different results on UNO and MEGA for me.

    Troubleshooting

  • [SOLVED] After upgrade to mysensors 2.1 problems with radio module might manifest itself more.
    N Nicklas Starkel

    @Anticimex maybe I was not clear enough or used the wrong words?
    I still understand that the problem is not with signing.
    I pointed out that using signing provokes the error.
    The error is still an underlying issue weather it be my hardware or it be NRF module code in mysensors 2.1.

    Troubleshooting

  • [SOLVED] After upgrade to mysensors 2.1 problems with radio module might manifest itself more.
    N Nicklas Starkel

    Well so I deleted whole Arduino to make sure I got everything fresh.
    Installed arduino and mysensors 2.0 via library manager and also mysensors HW arduino manager in preferences.

    Updated my gateway and all nodes work with signing ON.
    The nodes are a mixture now with mysensors 2.0 as well as 2.1.

    I updated library to 2.1 in my GW and instantly I have failed messages with Signing ON.

    To make sure, I powered the GW from one source and NRF separately from external source (5v computer usb)
    No changes. I tried different NRF as well as NRF PA with big antenna.
    I even tried different antennas (used to other applications). With mysensors 2.0 they work, with 2.1 fails.

    I took a node and powered it similar with external power source (3x1.5v AAA) for the NRF but it would still give me fails.

    When I go back to mysensors 2.0 everything works great again.

    I guess I'll stick with 2.0 and wait and see if other people upgrade their stuff and use signing might see the same problem with their hardware.

    Troubleshooting

  • [SOLVED] After upgrade to mysensors 2.1 problems with radio module might manifest itself more.
    N Nicklas Starkel

    @Anticimex I understand that the problem is not with signing itself.
    I also understand that with longer messages with low power things it gets extra difficult.

    What I am saying is mysensors 2.1 did something and my hardware can't cope with it.

    I have tried socket adapters for NRF modules.
    I have tried giving them external power.
    I tried without socket adapters.
    Giving external power as well.
    I have tried 47uF capacitator.

    Mind you, I have tried several different hardware pieces as well just to make sure.

    I will redo everything above again just to make sure and report back.

    Troubleshooting

  • [SOLVED] After upgrade to mysensors 2.1 problems with radio module might manifest itself more.
    N Nicklas Starkel

    @tekka Im not saying it doesn't work, but it doesn't work ;)

    I have spent some hours yesterday and today testing different possibilities.
    However, as soon as I enable soft signing it just my nodes get no reply or partial reply sometimes.

    If I disable softsigning in GW, everything works perfect.

    I would guess that the problem could be with my hardware as everything except my ethernetshield is china clones.
    But since I had used everything and everything worked without a flaw (with signing) and the only thing I did was update library via arduino, and uploaded the same sketch (without editing it) to the GW.
    I would beg to differ that something is not broken with mysensors 2.1. Or atleast maybe compability has been lowered.
    Or mysensors 2.1 changed something in the use of the NRF chips (the + as well as PA with big antenna!).

    I uninstalled arduino completely, but had some problems installing 2.0 as it complained about some stuff about my arduino mega. But when I installed 2.1 it worked with mega which is also weird.

    It is no biggie that signing doesn't work for me, but It bugs me that this should be simple and it isn't.

    To sum up:
    My NRF works without signing. It even works behind steel heat radiators across my flat (yes, did that for testing purposes!)
    Switch on signing and I can barely connect to my GW.

    Troubleshooting

  • [SOLVED] After upgrade to mysensors 2.1 problems with radio module might manifest itself more.
    N Nicklas Starkel

    @Anticimex

    I had built the NRF tester and had perfect coverage with no drops in my apartment before (with signing!) from any of my NRFs.

    To test further I even put one of those plateboards for testing NRF to my gateway. Added external power from another source.
    Did the same to my NRF tester but still it fails.
    Have put them close and also gone around in my apartment to eliminate distance signal error, still the same.
    So only difference is mysensors 2.1.
    However, since no one else is complaining then maybe the problem IS with my setup.
    Or could also be that no one else has updated ;)

    I'm using Arduino 1.6.11, maybe I should install 1.8.1?

    Troubleshooting

  • [SOLVED] After upgrade to mysensors 2.1 problems with radio module might manifest itself more.
    N Nicklas Starkel

    So I took the plunge and sent the same sketch as I had when using mysensors 2.0 to my Arduino Mega with w5100 ethernet shield.
    It is the MQTT sketch.

    After this I could not use any nodes with signing.

    LOGS as follow.

    Gateway:

    0;255;3;0;9;Attempting MQTT connection...
    0;255;3;0;9;MQTT connected
    0;255;3;0;9;Sending message on topic: MyMQTT/0/255/0/0/18
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=255,c=0,t=17,pt=0,l=5,sg=0:2.1.0
    0;255;3;0;9;!TSF:MSG:SIGN VERIFY FAIL
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    0;255;3;0;9;!TSF:MSG:SIGN VERIFY FAIL
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=255,c=3,t=11,pt=0,l=17,sg=0:Sensebender Micro
    0;255;3;0;9;!TSF:MSG:SIGN VERIFY FAIL
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    0;255;3;0;9;!TSF:MSG:SEND,0-0-6-6,s=255,c=3,t=16,pt=0,l=0,sg=0,ft=0,st=NACK:
    0;255;3;0;9;!TSF:MSG:SIGN FAIL
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    0;255;3;0;9;TSF:MSG:SEND,0-0-6-6,s=255,c=3,t=16,pt=0,l=0,sg=0,ft=0,st=OK:
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=255,c=3,t=17,pt=6,l=25,sg=0:192E7CA3C75EA05198759BA9F6FF17532DA77693DED0692059
    0;255;3;0;9;!TSF:MSG:SEND,0-0-6-6,s=255,c=3,t=27,pt=1,l=1,sg=1,ft=0,st=NACK:1
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    0;255;3;0;9;!TSF:MSG:SEND,0-0-6-6,s=255,c=3,t=16,pt=0,l=0,sg=1,ft=0,st=NACK:
    0;255;3;0;9;!TSF:MSG:SIGN FAIL
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=1,c=1,t=0,pt=7,l=5,sg=0:26.9
    0;255;3;0;9;!TSF:MSG:SIGN VERIFY FAIL
    0;255;3;0;9;TSF:MSG:READ,6-6-0,s=0,c=1,t=1,pt=2,l=2,sg=0:34
    0;255;3;0;9;!TSF:MSG:SIGN VERIFY FAIL
    

    And this is a NODE:

    0 MCO:BGN:INIT NODE,CP=RNNNAS-,VER=2.1.0
    3 TSM:INIT
    4 TSF:WUR:MS=0
    11 TSM:INIT:TSP OK
    13 TSM:INIT:STATID=6
    15 TSF:SID:OK,ID=6
    17 TSM:FPAR
    53 TSF:MSG:SEND,6-6-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2060 !TSM:FPAR:NO REPLY
    2062 TSM:FPAR
    2105 TSF:MSG:SEND,6-6-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    4112 !TSM:FPAR:NO REPLY
    4114 TSM:FPAR
    4118 TSF:MSG:SEND,6-6-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    6125 !TSM:FPAR:NO REPLY
    6127 TSM:FPAR
    6130 TSF:MSG:SEND,6-6-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    8138 !TSM:FPAR:FAIL
    8139 TSM:FAIL:CNT=1
    8141 TSM:FAIL:PDT
    18144 TSM:FAIL:RE-INIT
    18146 TSM:INIT
    18153 TSM:INIT:TSP OK
    

    If I remove the below signing code in the GW it all works OK.

    #define MY_SIGNING_SOFT
    #define MY_SIGNING_SOFT_RANDOMSEED_PIN 7
    #define MY_SIGNING_REQUEST_SIGNATURES
    

    Anyone else with the same problem (ping @Anticimex )?
    I downgraded my arduino boards to 1.6.11 as per instructions in some other posts.
    I also ran the signing sketch again (software backend) on my nodes, but to no avail.

    //Nicklas

    Troubleshooting
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular