Problems with Node sensor



  • Hello guys!. I got tutorial "http://www.makeuseof.com/tag/diy-smart-home-sensors-arduino-mysensors-openhab/". But i didn't see humiditysensor in library. Then, i got code from https://www.mysensors.org/build/humidity and uploaded sketch on my sensors node and serial monitor look like this alt text
    and
    alt text
    it's different to what i see in tutorial alt text
    what is "st=bc"?
    Thank you for taking the time to help and sorry because my English is not good.



  • I have the same problem with different nodes. Yesterday only one node hade this problem today i have 2 nodes.
    any commens on this topic?

    i have a ethernet gateway.

    Tms:fpar:fail


  • Mod

    Welcome to the MySensors community @tandobkhcm and @mhko ! I'll handle tandobkhcm's problem first since that's the problem where I have some information.

    https://forum.mysensors.org/topic/666/debug-faq-and-how-ask-for-help has information on how to read the debug output. bc means broadcast.

    find parent (fpar) means the node is searching for a way to reach a parent (usually the gateway but can be a repeater node in a more advanced setup, read https://www.mysensors.org/about/network for more details).

    fpar fail means that the node was unable to find a way to reach a parent.

    Please share information on gateway setup, which radio you are using and share the sketch for the gateway.

    radio fail means that the node is unable to initialize the radio. This is usually due to incorrect wiring.



  • Hi @mfalkvidd !. Thank you for that infomations. I'll read https://ci.mysensors.org/job/Verifiers/job/MySensorsArduino/branch/development/Doxygen_HTML/group__MyTransportgrp.html#details.

    After I convert Mysensors 1.5.x -> 2.0 it's probably working. But i don't see temperature and humidity to display serial monitor
    alt text

    My code for Humiditysensor :

    #define MY_NODE_ID 1 // Sets a static id for a node
    
    #define MY_DEBUG    // Enables debug messages in the serial log
    
    #define MY_RF24_CE_PIN 9    // Radio specific settings for RF24
    #define MY_RF24_CS_PIN 10 // Radio specific settings for RF24 (you'll find similar config for RFM69)
    
    
     //Enabdle if use NRF24
     #define MY_RADIO_NRF24
     //Enable if use RFM69
     //#define MY_RADIO_RFM69
     //Enable iff use RS485
     //#define MY_RS485
    
    #include <SPI.h>
    #include <MySensors.h>  
    #include <DHT.h>  
    
    #define CHILD_ID_HUM 0
    #define CHILD_ID_TEMP 1
    #define HUMIDITY_SENSOR_DIGITAL_PIN 2
    unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
    
    DHT dht;
    float lastTemp;
    float lastHum;
    boolean metric = true; 
    MyMessage msgHum(CHILD_ID_HUM, V_HUM);
    MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
    
    
    void presentation()  
    { 
      dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); 
    
      // Send the Sketch Version Information to the Gateway
      sendSketchInfo("Humidity", "1.0");
    
      // Register all sensors (they will be created as child devices)
      present(CHILD_ID_HUM, S_HUM);
      present(CHILD_ID_TEMP, S_TEMP);
      
      metric = getConfig().isMetric;
    }
    
    void loop()      
    {  
      delay(dht.getMinimumSamplingPeriod());
    
      float temperature = dht.getTemperature();
      if (isnan(temperature)) {
          Serial.println("Failed reading temperature from DHT");
      } else if (temperature != lastTemp) {
        lastTemp = temperature;
        if (!metric) {
          temperature = dht.toFahrenheit(temperature);
        }
        send(msgTemp.set(temperature, 1));
        Serial.print("T: ");
        Serial.println(temperature);
      }
      
      float humidity = dht.getHumidity();
      if (isnan(humidity)) {
          Serial.println("Failed reading humidity from DHT");
      } else if (humidity != lastHum) {
          lastHum = humidity;
          send(msgHum.set(humidity, 1));
          Serial.print("H: ");
          Serial.println(humidity);
      }
    
      sleep(SLEEP_TIME); //sleep a bit
    }
    
    

    For gateway

    // 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 "username"
    //#define MY_MQTT_PASSWORD "password"
    
    // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
    #define MY_IP_ADDRESS 192,168,10,103
    
    // If using static ip you need to define Gateway and Subnet address as well
    #define MY_IP_GATEWAY_ADDRESS 192,168,10,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, 10, 102
    
    // 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>
    
    void setup() {
    }
    
    void presentation() {
      // Present locally attached sensors here
    }
    
    
    void loop() {
      // Send locally attached sensors data here
    }
    

    My router
    alt text



  • Thanks for the time and effort.
    The links did help me, sometime it can be very difficult to find the relevant information for problem solving, so the help i much appreciated.

    it all turn out to be a dodig antenna connector on me GW radio. I am using the nRF24L01+PA+LNA.



  • Guys, i'm having the same problem but with a serial GW..

    Any ideas?


Log in to reply
 

Suggested Topics

  • 3
  • 6
  • 1
  • 2

1
Online

11.4k
Users

11.1k
Topics

112.7k
Posts