[SOLVED]ESP8266_MQTT gate RFM69 not communicate with node



  • Hi guys.

    I loaded the following code into my gate

    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Use a bit lower baudrate for serial prints on ESP8266 than default in MyConfig.h
    //#define MY_BAUD_RATE 9600
    
    // Enables and select radio type (if attached)
    #define MY_RADIO_RFM69
    #define MY_IS_RFM69HW
    //#define MY_RFM69_FREQUENCY   RF69_868MHZ
    #define MY_RFM69_NEW_DRIVER
    #define MY_DEBUG_VERBOSE_RFM69
    
    //#define MY_RADIO_RFM95
    
    #define MY_GATEWAY_MQTT_CLIENT
    #define MY_GATEWAY_ESP8266
    
    // 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"
    
    // Enable these if your MQTT broker requires usenrame/password
    //#define MY_MQTT_USER "username"
    //#define MY_MQTT_PASSWORD "password"
    
    // Set WIFI SSID and password
    //#define MY_ESP8266_SSID "OrPiZero"
    //#define MY_ESP8266_PASSWORD "orangepi"
    #define MY_ESP8266_SSID "wanvo"
    #define MY_ESP8266_PASSWORD "merkulovanastya"
    
    // Set the hostname for the WiFi Client. This is the hostname
    // it will pass to the DHCP server if not static.
    // #define MY_ESP8266_HOSTNAME "mqtt-sensor-gateway"
    
    // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
    //#define MY_IP_ADDRESS 192,168,178,87
    
    // If using static ip you can define Gateway and Subnet address as well
    //#define MY_IP_GATEWAY_ADDRESS 192,168,178,1
    //#define MY_IP_SUBNET_ADDRESS 255,255,255,0
    
    // MQTT broker ip address.
    //#define MY_CONTROLLER_IP_ADDRESS 10, 0, 0, 1
    #define MY_CONTROLLER_IP_ADDRESS 192, 168, 0, 107
    
    // 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
    //#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 <ESP8266WiFi.h>
    #include <MySensors.h>
    
    void setup()
    {
        Serial.setDebugOutput(true);
    	// Setup locally attached sensors
    }
    
    void presentation()
    {
    	// Present locally attached sensors here
    }
    
    void loop()
    {
    	// Send locally attech sensors data here
    }
    

    And the gate does not try to search for nodes. This is what I get from the serial debugger

    MCO:BGN:INIT GW,CP=RPNGE---,VER=2.2.0-rc.2
    238 TSF:LRT:OK
    240 TSM:INIT
    241 TSF:WUR:MS=0
    242 RFM69:INIT
    243 RFM69:INIT:PIN,CS=15,IQP=2,IQN=2
    247 RFM69:PTX:LEVEL=5 dBm
    250 TSM:INIT:TSP OK
    251 TSM:INIT:GW MODE
    253 TSM:READY:ID=0,PAR=0,DIS=0
    256 MCO:REG:NOT NEEDED
    scandone
    f 0, scandone
    state: 0 -> 2 (b0)
    state: 2 -> 3 (0)
    state: 3 -> 5 (10)
    add 0
    aid 5
    cnt 
    
    connected with wanvo, channel 7
    dhcp client start...
    761 .ip:192.168.0.106,mask:255.255.255.0,gw:192.168.0.1
    1261 .1261 IP: 192.168.0.106
    1263 MCO:BGN:STP
    1265 MCO:BGN:INIT OK,TSP=1
    1267 IP: 192.168.0.106
    1269 Attempting MQTT connection...
    2275 MQTT connected
    2277 Sending message on topic: mygateway1-out/0/255/0/0/18
    pm open,type:2 0
    

    Noda is on, but does not see the gate.
    Tell me, what is the reason for this behavior of the gate?


  • Mod

    Welcome to the MySensors community @wanvo !

    A gateway will never scan for nodes. The output you posted is looks normal.

    Could you post the output of your node?



  • My Node out

     __  __       ____
    |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
    | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
    | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
    |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
            |___/                      2.2.0-rc.2
    
    18 MCO:BGN:INIT NODE,CP=RPNNA---,VER=2.2.0-rc.2
    28 TSM:INIT
    28 TSF:WUR:MS=0
    32 TSM:INIT:TSP OK
    34 TSM:INIT:STATID=1
    36 TSF:SID:OK,ID=1
    38 TSM:FPAR
    1038 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    3045 !TSM:FPAR:NO REPLY
    3047 TSM:FPAR
    4050 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    6060 !TSM:FPAR:NO REPLY
    6062 TSM:FPAR
    7065 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    9072 !TSM:FPAR:NO REPLY
    9074 TSM:FPAR
    10076 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    12083 !TSM:FPAR:FAIL
    12085 TSM:FAIL:CNT=1
    12087 TSM:FAIL:DIS
    12089 TSF:TDI:TSL
    22093 TSM:FAIL:RE-INIT
    22095 TSM:INIT
    22097 TSM:INIT:TSP OK
    22099 TSM:INIT:STATID=1
    22104 TSF:SID:OK,ID=1
    22106 TSM:FPAR
    23109 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    25116 !TSM:FPAR:NO REPLY
    25118 TSM:FPAR
    26120 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    28127 !TSM:FPAR:NO REPLY
    

    I checked this node with the gate OrangePiZero MQTT
    and the RF69 module on this gate was the same as on the ESP8266. Everything worked well.


  • Mod

    Double check the wiring as the gateway is not receiving anything



  • @wanvo I agree with gohan, check the wiring in the node.

    Don't take this as 100% sure but just as a hint - I think the fact that the node is showing TSP OK points in the direction that the IRQ wire might not be connected properly. I think that if the ones failing are the power wires or the SPI interface wires, you'd see a TSP fail message. Nothing wrong with checking all of them of course.



  • Thanks to all.
    The problem is solved.
    I forgot to add pin definitions to the sketch.

    #define MY_RF69_IRQ_PIN D1
    #define MY_RF69_IRQ_NUM MY_RF69_IRQ_PIN
    #define MY_RF69_SPI_CS D8 // NSS. Use MY_RFM69_CS_PIN for the development branch.```

Log in to reply
 

Suggested Topics

14
Online

11.4k
Users

11.1k
Topics

112.7k
Posts