Oled nothing is displayed



  • Hello,
    I'm still quite a beginner and I hope you can help me.

    I wanted to connect a DHT22, an OLED display to a Nano and transfer the whole thing to a gateway with RS485 wire.
    The display doesn't show anything as soon as I include the mysesnsors.h library.
    I just made a sample sketch for it.
    MySensors version is currently 2.3.1
    I've tried everything, but I can't do it.

    // Enable debug prints
    #define MY_DEBUG
    
    // Enable RS485 transport layer
    #define MY_RS485
    
    // Define this to enables DE-pin management on defined pin
    #define MY_RS485_DE_PIN 2
    
    // Set RS485 baud rate to use
    #define MY_RS485_BAUD_RATE 9600
    
    // Enable this if RS485 is connected to a hardware serial port
    //#define MY_RS485_HWSERIAL Serial1
    
    #define MY_NODE_ID 4
    #include <SPI.h>
    #include <MySensors.h> 
    #include <Wire.h>
      
    #include <SSD1306_text.h>
    
    #define OLED_RST 4
    SSD1306_text oled(OLED_RST);
    
    
    
    
    void setup()
    {
    
      oled.init();
      oled.clear();                 // clear screen
    
      oled.setTextSize(1, 1);
      oled.setCursor(0);
      oled.print("OK");
    }
    
    
    void loop()      
    {  
    
      
    }
    


  • @NONO87 What does the debug monitor tell you?



  •  
    09:50:01.147 ->  __  __       ____
    09:50:01.147 -> |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
    09:50:01.147 -> | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
    09:50:01.147 -> | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
    09:50:01.147 -> |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
    09:50:01.181 ->         |___/                      2.3.2
    09:50:01.181 -> 
    09:50:01.181 -> 16 MCO:BGN:INIT NODE,CP=RSNNA---,FQ=16,REL=255,VER=2.3.2
    09:50:01.181 -> 26 TSM:INIT
    09:50:01.181 -> 28 TSF:WUR:MS=0
    09:50:01.181 -> 29 TSM:INIT:TSP OK
    09:50:01.181 -> 31 TSM:INIT:STATID=4
    09:50:01.181 -> 32 TSF:SID:OK,ID=4
    09:50:01.181 -> 34 TSM:FPAR
    53 ?TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2060 !TSM:FPAR:NO REPLY
    09:50:03.219 -> 2062 TSM:FPAR
    09:50:03.219 -> 2079 ?TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    4087 !TSM:FPAR:NO REPLY
    09:50:05.223 -> 4089 TSM:FPAR
    4107 ?TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    6115 !TSM:FPAR:NO REPLY
    09:50:07.260 -> 6117 TSM:FPAR
    6134 ?TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    8142 !TSM:FPAR:FAIL
    09:50:09.297 -> 8143 TSM:FAIL:CNT=1
    09:50:09.297 -> 8145 TSM:FAIL:DIS
    09:50:09.297 -> 8147 TSF:TDI:TSL
    18149 TSM:FAIL:RE-INIT
    09:50:19.282 -> 18151 TSM:INIT
    09:50:19.282 -> 18152 TSM:INIT:TSP OK
    09:50:19.282 -> 18154 TSM:INIT:STATID=4
    09:50:19.282 -> 18156 TSF:SID:OK,ID=4
    09:50:19.316 -> 18158 TSM:FPAR
    09:50:19.316 -> 18177 ?TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    20185 !TSM:FPAR:NO REPLY
    09:50:21.323 -> 20187 TSM:FPAR
    20205 ?TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    22212 !TSM:FPAR:NO REPLY
    09:50:23.362 -> 22214 TSM:FPAR
    09:50:23.362 -> 22233 ?TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    24240 !TSM:FPAR:NO REPLY
    09:50:25.366 -> 24242 TSM:FPAR
    24260 ?TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    26267 !TSM:FPAR:FAIL
    09:50:27.403 -> 26268 TSM:FAIL:CNT=2
    09:50:27.403 -> 26270 TSM:FAIL:DIS
    09:50:27.403 -> 26272 TSF:TDI:TSL
    36275 TSM:FAIL:RE-INIT
    09:50:37.419 -> 36277 TSM:INIT
    09:50:37.419 -> 36278 TSM:INIT:TSP OK
    09:50:37.419 -> 36280 TSM:INIT:STATID=4
    09:50:37.419 -> 36282 TSF:SID:OK,ID=4
    09:50:37.419 -> 36284 TSM:FPAR
    36302 ?TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    38311 !TSM:FPAR:NO REPLY
    09:50:39.457 -> 38313 TSM:FPAR
    09:50:39.457 -> 38332 ?TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    40339 !TSM:FPAR:NO REPLY
    09:50:41.461 -> 40341 TSM:FPAR
    40359 ?TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    42368 !TSM:FPAR:NO REPLY
    09:50:43.496 -> 42370 TSM:FPAR
    42388 ?TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    44395 !TSM:FPAR:FAIL
    09:50:45.534 -> 44396 TSM:FAIL:CNT=3
    09:50:45.534 -> 44398 TSM:FAIL:DIS
    09:50:45.534 -> 44400 TSF:TDI:TSL
    54403 TSM:FAIL:RE-INIT
    09:50:55.543 -> 54405 TSM:INIT
    09:50:55.543 -> 54406 TSM:INIT:TSP OK
    09:50:55.543 -> 54408 TSM:INIT:STATID=4
    09:50:55.543 -> 54410 TSF:SID:OK,ID=4
    09:50:55.543 -> 54412 TSM:FPAR
    09:50:55.543 -> 54430 ?TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    56438 !TSM:FPAR:NO REPLY
    09:50:57.546 -> 56440 TSM:FPAR
    09:50:57.580 -> 56459 ?TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    58466 !TSM:FPAR:NO REPLY
    09:50:59.581 -> 58468 TSM:FPAR
    58486 ?TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    
    


  • Hello @NONO87, looks like your node isn't able to establish a connection with the gateway, so it's stuck in the transport initialization sequence and never enters the loop() or even setup() where the OLED is initialized. Here's the boot sequence diagram for reference.

    You may try to add #define MY_TRANSPORT_WAIT_READY_MS 1 (or anything > 0) to timeout transport initialization early and see if the OLED is still working.

    If it does, you next goal would be to find out why this node doesn't connect to the gateway. The node is either unable to receive messages from the gateway or the messages it sends don't reach the gateway.

    Is the serial module correctly wired? Configuration is fine on both devices? Is the gateway working and does it receive find parent request from this node?

    You may want to use the Log Parser to make the serial output "human readable".



  • Thank you so much!

    After using #define MY_TRANSPORT_WAIT_READY_MS 1, I was able to see something on the display. Then I started looking for why the transmission wasn't working.
    The problem was that the rs485 5V connection had a shaky connection.


Log in to reply
 

Suggested Topics

  • 8
  • 4
  • 2
  • 8
  • 2
  • 9
  • 5
  • 6

248
Online

9.8k
Users

10.3k
Topics

106.8k
Posts