LogOTANode & LogOTAGateway



  • Hi All,

    Someone could confirm me that LogOTANode & LogOTAGateway sketch example work correctly.

    I'm unable to test the OTA degug feature because all characters sent by the node are unreadeable.

    In fact, I do not try with the logOTAGateway sketch, because I aready have a gateway running. But I use a new node with unique ID to receive all debug messages from the fist node (LogOTANode).

    TX_LogOTANode.ino (TX OTA)

    /**
     * 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.
     *
     *******************************
     *
     * DESCRIPTION
     *
     * Example for sending debug messages over the air (OTA).
     *
     */
    
    
    
    // Enable debug
    #define MY_DEBUG
    
    // Enable OTA debugging to Node 100
    #define MY_DEBUG_OTA (100)
    
    // Allow sending logs without MY_DEBUG_OTA enabled
    #define MY_OTA_LOG_SENDER_FEATURE
    
    #define MY_NODE_ID 50
    
    
    // Disable ACK for debug messages
    //#define MY_DEBUG_OTA_DISABLE_ACK
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    
    #include <MySensors.h>
    
    void setup()
    {
    }
    
    void presentation()
    {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("TX DebugSensor", "1.0");
    }
    
    // Arduino loop
    int c=0;
    void loop()
    {
      // Wait some time
      if (sleep(3000)==MY_SLEEP_NOT_POSSIBLE) {
        delay(3000);
      }
    
      // Count loops
      c++;
    
      // A debug message
      DEBUG_OUTPUT(PSTR("DEBUG\nc=%" PRId16 "\nmillis=%" PRId32 "\n"), c, hwMillis());
    
      // Send a log message with ACK to a node
      OTALog(100, true, PSTR("LOG\nc=%" PRId16 "\nmillis=%" PRId32 "\n"), c, hwMillis() );
    
    
      
    }
    

    RX_LogOTANode.ino (RX OTA)

    /**
    * 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.
    *
    */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable OTA log display
    #define MY_OTA_LOG_RECEIVER_FEATURE
    
    #define MY_NODE_ID 100
    
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    
    #define MY_BAUD_RATE 115200
    
    #include <MySensors.h>
    
    void setup()
    {
      // Setup locally attached sensors
    }
    
    void presentation()
    {
        sendSketchInfo("RX DEBUG Display", "1.0");
    
    }
    
    void loop()
    {
      // Send locally attached sensor data here
    }
    
    
    
    // Traite les messages provenant de la Gateway
    void receive(const MyMessage &message){
    
      OTALogPrint(message);
      
    }
    
    

    Pse confirm if the sketchs above are OK and run on your side.
    Thanks in advance.


 

251
Online

7.6k
Users

8.5k
Topics

91.2k
Posts