Heatpump + remote controller



  • Hello,
    happy xmas to all,
    I'm Edoardo and I'm playing with MySensors a lot since the last year.
    Today I decided to make a sensor that can turn on and off a heatpump from a relay (not implemented yet) with a remote controller with an 0.96" OLED I2C Display.
    Since I was making the code to work without mysensors the display work showing the temperature (obtained by a bme280), controls and display work flawlessly, but when I implemented the MySensrors part the display was stuck and didn't show up the loading splash screen.
    At the second attempt the Nano was rebooting itself (only on MySensors code).
    Can anyone explain me what I'm doing wrong?

    here are my sketches:

    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_RF24
    //#define MY_RADIO_NRF5_ESB
    //#define MY_RADIO_RFM69
    //#define MY_RADIO_RFM95
    
    // Defining BME280 sensor
    #include <Adafruit_Sensor.h>
    #include <Adafruit_BME280.h>
    
    #include <SPI.h>
    #include <Wire.h>
    #include <Adafruit_GFX.h>
    #include <Adafruit_SSD1306.h>
    //#include <MySensors.h>
    
    #define SCREEN_WIDTH 128 // OLED display width, in pixels
    #define SCREEN_HEIGHT 64 // OLED display height, in pixels
    
    // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
    #define OLED_RESET     4 // Reset pin # (or -1 if sharing Arduino reset pin)
    Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
    
    #define SEALEVELPRESSURE_HPA (1013.25)
    
    Adafruit_BME280 bme; // I2C
    #define BME280 0x76
    
    float setTemp;
    float temperature;
    float humidity;
    float pressure;
    bool stat = 0;
    long onPushMillis;
    bool firstPush = true;
    bool push = false;
    
    // constants won't change. They're used here to set pin numbers:
    const int pPin = 5;    // the number of the pushbutton pin
    const int mPin = 4;      // the number of the LED pin
    const int relay = 6;    //relay of the Heatpump activator
    
    void setup() {
      // Pin for push button
      pinMode(pPin, INPUT);
      pinMode(mPin, INPUT);
    
      // Show initial display buffer contents on the screen --
      // the library initializes this with an Adafruit splash screen.
      display.display();
      setTemp = (int)bme.readTemperature();
      delay(500);
     }
    
    //void presentation()
    //{
    //  // Send the sketch version information to the gateway and Controller
    //  sendSketchInfo("Heatpump controller", "1.0");
    //  present(0, S_HVAC);
    //}
    
    void loop() {
      temperature = float( bme.readTemperature() );
      humidity    = float( bme.readHumidity() );
      pressure    = float( bme.readPressure() ) / 100.0;
      stat = 0;
    
      if(digitalRead(mPin)){
        onPushMillis = millis();
        push = true;
        if (firstPush){
          mainScreen(1);
          delay(500);
          firstPush = false;
        }
        else {
          setTemp -= 0.5;
        }
        mainScreen(1);
        delay(250);
      }
      else if(digitalRead(pPin)){
        onPushMillis = millis();
        push = true;
        if (firstPush){
          mainScreen(1);
          delay(500);
          firstPush = false;
        }
        else {
          setTemp += 0.5;
        }
        mainScreen(1);
        delay(250);
      }
      else if (push && ((millis() - onPushMillis) >1000)){
        push = false;
        firstPush = true;
        }
      else if (push){ mainScreen(1);}
      else{ 
        mainScreen(0);
      }
      delay(50);
    }
    
    void mainScreen(bool i){
      
      display.clearDisplay();
      display.setCursor(0,0);
      display.setTextSize(1);
      display.setTextColor(WHITE);
      display.print(i ? "imposta temperatura" : "25/12/18");
      if (!i){
        display.setCursor((pressure < 1000) ? 84 : 80,0);
        display.print(pressure,0);
        display.print(" hPa");
      }
      display.setCursor(0,16);
      display.setTextSize(4);
      display.print(i ? setTemp : temperature,1);
      display.setCursor(104,16);
      display.print("C");
      display.setTextSize(1);
      display.setCursor(0,56);
      display.print("U: ");
      display.print(humidity,0);
      display.print('%');
      display.setCursor(52,56);
      display.print(!i ? setTemp : temperature,1);
      display.setCursor(92,56);
      display.print(!stat ? "spento" : "acceso");
    
      // Schema 
      display.drawFastHLine(0,52,128,WHITE);
      display.drawFastHLine(0,10,128,WHITE);
      display.drawFastVLine(42,54,10,WHITE);
      display.drawFastVLine(84,54,10,WHITE);
      display.display();
    }
    
    //void receive(const MyMessage &message)
    //{
    //  if (message.type==V_STATUS) {
    //    // Change relay state
    //    stat = message.getBool() ? 1 : 0;
    //    // Write some debug info
    //    Serial.print("Incoming change for sensor:");
    //    Serial.print(message.sensor);
    //    Serial.print(", New status: ");
    //    Serial.println(message.getBool());
    //  }
    //  else if (message.type==V_TEMP){
    //    setTemp = message.getFloat();
    //    Serial.println(setTemp);
    //  }
    //}
    
    

    Enabling MySensors:

    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_RF24
    //#define MY_RADIO_NRF5_ESB
    //#define MY_RADIO_RFM69
    //#define MY_RADIO_RFM95
    
    // Defining BME280 sensor
    #include <Adafruit_Sensor.h>
    #include <Adafruit_BME280.h>
    
    #include <SPI.h>
    #include <Wire.h>
    #include <Adafruit_GFX.h>
    #include <Adafruit_SSD1306.h>
    #include <MySensors.h>
    
    #define SCREEN_WIDTH 128 // OLED display width, in pixels
    #define SCREEN_HEIGHT 64 // OLED display height, in pixels
    
    // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
    #define OLED_RESET     4 // Reset pin # (or -1 if sharing Arduino reset pin)
    Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
    
    #define SEALEVELPRESSURE_HPA (1013.25)
    
    Adafruit_BME280 bme; // I2C
    #define BME280 0x76
    
    float setTemp;
    float temperature;
    float humidity;
    float pressure;
    bool stat = 0;
    long onPushMillis;
    bool firstPush = true;
    bool push = false;
    
    // constants won't change. They're used here to set pin numbers:
    const int pPin = 5;    // the number of the pushbutton pin
    const int mPin = 4;      // the number of the LED pin
    const int relay = 6;    //relay of the Heatpump activator
    
    void setup() {
      // Pin for push button
      pinMode(pPin, INPUT);
      pinMode(mPin, INPUT);
    
      // Show initial display buffer contents on the screen --
      // the library initializes this with an Adafruit splash screen.
      display.display();
      setTemp = (int)bme.readTemperature();
      delay(500);
     }
    
    void presentation()
    {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Heatpump controller", "1.0");
      present(0, S_HVAC);
    }
    
    void loop() {
      temperature = float( bme.readTemperature() );
      humidity    = float( bme.readHumidity() );
      pressure    = float( bme.readPressure() ) / 100.0;
      stat = 0;
    
      if(digitalRead(mPin)){
        onPushMillis = millis();
        push = true;
        if (firstPush){
          mainScreen(1);
          delay(500);
          firstPush = false;
        }
        else {
          setTemp -= 0.5;
        }
        mainScreen(1);
        delay(250);
      }
      else if(digitalRead(pPin)){
        onPushMillis = millis();
        push = true;
        if (firstPush){
          mainScreen(1);
          delay(500);
          firstPush = false;
        }
        else {
          setTemp += 0.5;
        }
        mainScreen(1);
        delay(250);
      }
      else if (push && ((millis() - onPushMillis) >1000)){
        push = false;
        firstPush = true;
        }
      else if (push){ mainScreen(1);}
      else{ 
        mainScreen(0);
      }
      delay(50);
    }
    
    void mainScreen(bool i){
      
      display.clearDisplay();
      display.setCursor(0,0);
      display.setTextSize(1);
      display.setTextColor(WHITE);
      display.print(i ? "imposta temperatura" : "25/12/18");
      if (!i){
        display.setCursor((pressure < 1000) ? 84 : 80,0);
        display.print(pressure,0);
        display.print(" hPa");
      }
      display.setCursor(0,16);
      display.setTextSize(4);
      display.print(i ? setTemp : temperature,1);
      display.setCursor(104,16);
      display.print("C");
      display.setTextSize(1);
      display.setCursor(0,56);
      display.print("U: ");
      display.print(humidity,0);
      display.print('%');
      display.setCursor(52,56);
      display.print(!i ? setTemp : temperature,1);
      display.setCursor(92,56);
      display.print(!stat ? "spento" : "acceso");
    
      // Schema 
      display.drawFastHLine(0,52,128,WHITE);
      display.drawFastHLine(0,10,128,WHITE);
      display.drawFastVLine(42,54,10,WHITE);
      display.drawFastVLine(84,54,10,WHITE);
      display.display();
    }
    
    void receive(const MyMessage &message)
    {
      if (message.type==V_STATUS) {
        // Change relay state
        stat = message.getBool() ? 1 : 0;
        // Write some debug info
        Serial.print("Incoming change for sensor:");
        Serial.print(message.sensor);
        Serial.print(", New status: ");
        Serial.println(message.getBool());
      }
      else if (message.type==V_TEMP){
        setTemp = message.getFloat();
        Serial.println(setTemp);
      }
    }
    

    Arduino IDE Compile (MySensors):

    Lo sketch usa 28798 byte (93%) dello spazio disponibile per i programmi. Il massimo è 30720 byte.
    Le variabili globali usano 924 byte (45%) di memoria dinamica, lasciando altri 1124 byte liberi per le variabili locali. Il massimo è 2048 byte.
    

    MySensors Messages from Arduino:

    23:34:40.390 -> qD⸮`OT_BJQSQL\f⸮⸮⸮B⸮⸮CA⸮⸮⸮%W⸮⸮⸮6j 
    23:34:41.703 ->  __  __       ____
    23:34:41.703 -> |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
    23:34:41.703 -> | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
    23:34:41.703 -> | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
    23:34:41.737 -> |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
    23:34:41.737 ->         |___/                      2.3.1
    23:34:41.737 -> 
    23:34:41.737 -> 16 MCO:BGN:INIT NODE,CP=RNNNA---,REL=255,VER=2.3.1
    23:34:41.737 -> 26 TSM:INIT
    23:34:41.737 -> 27 TSF:WUR:MS=0
    23:34:41.737 -> 34 TSM:INIT:TSP OK
    23:34:41.737 -> 35 TSF:SID:OK,ID=2
    23:34:41.773 -> 37 TSM:FPAR
    23:34:41.773 -> 73 TSF:MSG:SEND,2-2-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    23:34:41.878 -> 159 TSF:MSG:READ,0-0-2,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    23:34:41.878 -> 163 TSF:MSG:FPAR OK,ID=0,D=1
    23:34:43.802 -> 2081 TSM:FPAR:OK
    23:34:43.802 -> 2082 TSM:ID
    23:34:43.802 -> 2083 TSM:ID:OK
    23:34:43.802 -> 2085 TSM:UPL
    23:34:43.802 -> 2088 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    23:34:43.802 -> 2095 TSF:MSG:READ,0-0-2,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    23:34:43.802 -> 2100 TSF:MSG:PONG RECV,HP=1
    23:34:43.802 -> 2102 TSM:UPL:OK
    23:34:43.802 -> 2104 TSM:READY:ID=2,PAR=0,DIS=1
    23:34:43.835 -> 2108 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    23:34:43.835 -> 2117 TSF:MSG:READ,0-0-2,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    23:34:43.835 -> 2124 TSF:MSG:SEND,2-2-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.1
    23:34:43.835 -> 2132 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    23:34:44.559 -> 2841 TSF:MSG:READ,0-0-2,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    23:34:44.559 -> 2848 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=11,pt=0,l=19,sg=0,ft=0,st=OK:Heatpump controller
    23:34:44.559 -> 2859 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
    23:34:44.559 -> 2867 TSF:MSG:SEND,2-2-0-0,s=0,c=0,t=29,pt=0,l=0,sg=0,ft=0,st=OK:
    23:34:44.592 -> 2873 MCO:REG:REQ
    23:34:44.592 -> 2876 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    23:34:44.592 -> 2885 TSF:MSG:READ,0-0-2,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    23:34:44.592 -> 2890 MCO:PIM:NODE REG=1
    23:34:44.592 -> 2892 MCO:BGN:STP
    23:34:44.627 ->  
    23:34:44.627 ->  __  __       ____
    23:34:44.627 -> |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
    23:34:44.627 -> | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
    23:34:44.627 -> | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
    23:34:44.627 -> |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
    23:34:44.627 ->         |___/                      2.3.1
    23:34:44.627 -> 
    23:34:44.627 -> 18 MCO:BGN:INIT NODE,CP=RNNNA---,REL=255,VER=2.3.1
    23:34:44.627 -> 27 TSM:INIT
    23:34:44.627 -> 28 TSF:WUR:MS=0
    23:34:44.661 -> 35 TSM:INIT:TSP OK
    23:34:44.661 -> 37 TSF:SID:OK,ID=2
    23:34:44.661 -> 38 TSM:FPAR
    23:34:44.696 -> 75 TSF:MSG:SEND,2-2-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    23:34:45.610 -> 1007 TSF:MSG:READ,0-0-2,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    23:34:45.610 -> 1012 TSF:MSG:FPAR OK,ID=0,D=1
    23:34:46.713 -> 2082 TSM:FPAR:OK
    23:34:46.713 -> 2083 TSM:ID
    23:34:46.713 -> 2084 TSM:ID:OK
    23:34:46.713 -> 2086 TSM:UPL
    23:34:46.713 -> 2089 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    23:34:46.713 -> 2100 TSF:MSG:READ,0-0-2,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    23:34:46.713 -> 2105 TSF:MSG:PONG RECV,HP=1
    23:34:46.713 -> 2107 TSM:UPL:OK
    23:34:46.713 -> 2109 TSM:READY:ID=2,PAR=0,DIS=1
    23:34:46.713 -> 2113 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    23:34:46.749 -> 2122 TSF:MSG:READ,0-0-2,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    23:34:46.749 -> 2129 TSF:MSG:SEND,2-2-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.1
    23:34:46.749 -> 2138 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    23:34:47.565 -> 2948 TSF:MSG:READ,0-0-2,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    23:34:47.565 -> 2955 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=11,pt=0,l=19,sg=0,ft=0,st=OK:Heatpump controller
    23:34:47.565 -> 2965 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
    23:34:47.600 -> 2972 TSF:MSG:SEND,2-2-0-0,s=0,c=0,t=29,pt=0,l=0,sg=0,ft=0,st=OK:
    23:34:47.600 -> 2978 MCO:REG:REQ
    23:34:47.600 -> 2982 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    23:34:47.600 -> 2992 TSF:MSG:READ,0-0-2,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    23:34:47.600 -> 2997 MCO:PIM:NODE REG=1
    23:34:47.600 -> 2999 MCO:BGN:STP
    23:34:47.633 ->  
    23:34:47.633 ->  __  __       ____
    23:34:47.633 -> |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
    23:34:47.633 -> | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
    23:34:47.633 -> | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
    23:34:47.633 -> |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
    23:34:47.633 ->         |___/                      2.3.1
    23:34:47.633 -> 
    23:34:47.633 -> 17 MCO:BGN:INIT NODE,CP=RNNNA---,REL=255,VER=2.3.1
    23:34:47.633 -> 27 TSM:INIT
    23:34:47.633 -> 28 TSF:WUR:MS=0
    23:34:47.667 -> 34 TSM:INIT:TSP OK
    23:34:47.667 -> 36 TSF:SID:OK,ID=2
    23:34:47.667 -> 38 TSM:FPAR
    23:34:47.701 -> 74 TSF:MSG:SEND,2-2-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    23:34:48.545 -> 942 TSF:MSG:READ,0-0-2,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    23:34:48.582 -> 947 TSF:MSG:FPAR OK,ID=0,D=1
    23:34:49.685 -> 2081 TSM:FPAR:OK
    23:34:49.685 -> 2082 TSM:ID
    23:34:49.685 -> 2083 TSM:ID:OK
    23:34:49.719 -> 2085 TSM:UPL
    23:34:49.719 -> 2088 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    23:34:49.719 -> 2096 TSF:MSG:READ,0-0-2,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    23:34:49.719 -> 2101 TSF:MSG:PONG RECV,HP=1
    23:34:49.719 -> 2103 TSM:UPL:OK
    23:34:49.719 -> 2105 TSM:READY:ID=2,PAR=0,DIS=1
    23:34:49.719 -> 2109 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    23:34:49.754 -> 2118 TSF:MSG:READ,0-0-2,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    23:34:49.754 -> 2125 TSF:MSG:SEND,2-2-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.1
    23:34:49.754 -> 2134 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    23:34:50.559 -> 2933 TSF:MSG:READ,0-0-2,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    23:34:50.559 -> 2940 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=11,pt=0,l=19,sg=0,ft=0,st=OK:Heatpump controller
    23:34:50.559 -> 2951 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
    23:34:50.595 -> 2959 TSF:MSG:SEND,2-2-0-0,s=0,c=0,t=29,pt=0,l=0,sg=0,ft=0,st=OK:
    23:34:50.595 -> 2964 MCO:REG:REQ
    23:34:50.595 -> 2968 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    23:34:50.595 -> 2977 TSF:MSG:READ,0-0-2,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    23:34:50.595 -> 2982 MCO:PIM:NODE REG=1
    23:34:50.595 -> 2984 MCO:BGN:STP
    23:34:50.631 ->  
    23:34:50.631 ->  __  __       ____
    23:34:50.631 -> |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
    23:34:50.631 -> | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
    23:34:50.631 -> | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
    23:34:50.631 -> |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
    23:34:50.631 ->         |___/                      2.3.1
    23:34:50.631 -> 
    23:34:50.631 -> 17 MCO:BGN:INIT NODE,CP=RNNNA---,REL=255,VER=2.3.1
    23:34:50.631 -> 27 TSM:INIT
    23:34:50.631 -> 28 TSF:WUR:MS=0
    23:34:50.666 -> 34 TSM:INIT:TSP OK
    23:34:50.666 -> 36 TSF:SID:OK,ID=2
    23:34:50.666 -> 38 TSM:FPAR
    23:34:50.699 -> 74 TSF:MSG:SEND,2-2-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    23:34:51.467 -> 865 TSF:MSG:READ,0-0-2,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    23:34:51.467 -> 870 TSF:MSG:FPAR OK,ID=0,D=1
    23:34:52.700 -> 2081 TSM:FPAR:OK
    23:34:52.700 -> 2082 TSM:ID
    23:34:52.700 -> 2083 TSM:ID:OK
    23:34:52.700 -> 2085 TSM:UPL
    23:34:52.700 -> 2088 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    23:34:52.700 -> 2095 TSF:MSG:READ,0-0-2,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    23:34:52.700 -> 2100 TSF:MSG:PONG RECV,HP=1
    23:34:52.700 -> 2102 TSM:UPL:OK
    23:34:52.737 -> 2104 TSM:READY:ID=2,PAR=0,DIS=1
    23:34:52.737 -> 2108 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    23:34:52.737 -> 2115 TSF:MSG:READ,0-0-2,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    23:34:52.737 -> 2122 TSF:MSG:SEND,2-2-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.1
    23:34:52.737 -> 2130 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    23:34:53.559 -> 2939 TSF:MSG:READ,0-0-2,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    23:34:53.559 -> 2947 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=11,pt=0,l=19,sg=0,ft=0,st=OK:Heatpump controller
    23:34:53.559 -> 2956 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
    23:34:53.594 -> 2964 TSF:MSG:SEND,2-2-0-0,s=0,c=0,t=29,pt=0,l=0,sg=0,ft=0,st=OK:
    23:34:53.594 -> 2970 MCO:REG:REQ
    23:34:53.594 -> 2973 TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    23:34:53.594 -> 2982 TSF:MSG:READ,0-0-2,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    23:34:53.594 -> 2988 MCO:PIM:NODE REG=1
    23:34:53.594 -> 2990 MCO:BGN:STP
    23:34:53.631 ->  
    23:34:53.631 ->  __  __       ____
    23:34:53.631 -> |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
    23:34:53.631 -> | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
    23:34:53.631 -> | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
    23:34:53.631 -> |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
    23:34:53.631 ->         |___/                      2.3.1
    23:34:53.631 -> 
    23:34:53.631 -> 17 MCO:BGN:INIT NODE,CP=RNNNA---,REL=255,VER=2.3.1
    23:34:53.631 -> 27 TSM:INIT
    23:34:53.631 -> 28 TSF:WUR:MS=0
    23:34:53.631 -> 34 TSM:INIT:TSP OK
    23:34:53.631 -> 36 TSF:SID:OK,ID=2
    23:34:53.668 -> 38 TSM:FPAR
    23:34:53.706 -> 74 TSF:MSG:SEND,2-2-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    23:34:54.407 -> 791 TSF:MSG:READ,0-0-2,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    23:34:54.407 -> 796 TSF:MSG:FPAR OK,ID=0,D=1
    23:34:55.698 -> 2081 TSM:FPAR:OK
    23:34:55.698 -> 2082 TSM:ID
    23:34:55.698 -> 2083 TSM:ID:OK
    23:34:55.733 -> 2085 TSM:UPL
    23:34:55.733 -> 2122 !TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=NACK:1
    

    Imgur

    Useful data:
    – Clone Arduino Nano
    – MySensors Library 2.3.1
    – Working NRF24L04+
    – Working OLED Display



  • Perhaps the 3.3V voltage regulator on the Nano does not provide enough current to power both the radio module and the OLED display? You could test the setup first with the display disconnected. If that works then you can try and find a way to power the display from a different source.



  • Maybe its some memory issues, I would try to test the sketch without the display, and remove all display code inclusive removing the declarations #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h>
    You have already successfully tested that code with display is working fine, now you need to test the Mysensors code without display code.

    If this is successfully, I would combine the codes, but remove debug, remove all code for Serial.print, and remove #define MY_DEBUG


Log in to reply
 

Suggested Topics

  • 3
  • 1
  • 8
  • 6
  • 5
  • 2

54
Online

11.4k
Users

11.1k
Topics

112.7k
Posts