Presentation of local sensor with GatewayESP8266MQTTClient seems to fail



  • Hi MySensors,

    I was doing some tests yesterday with an ESP8266-01 as an MQTT Client Gateway. Really impressive work from you Henrik and the rest of the team.

    When trying to add a local sensor to the ESP8266MQTTClient Gatway, the Presentation part doesn't seems to work. Nothing is being sent to the MQTT Broker.

    #include <ESP8266WiFi.h>
    #include <MySensor.h>

    MyMessage msg(1,V_TRIPPED);

    void setup() {
    }

    void presentation() {
    // Present locally attached sensors here
    sendSketchInfo("Test", "1.0");
    present(1, S_DOOR);
    }

    If I add the same commands to the loop they're being sent forward to the Broker.

    void loop() {
    // Present locally attached sensors here
    sendSketchInfo("Test", "1.0");
    present(1, S_DOOR);
    wait(5000);
    }

    I'm using ESP8266-01 for my tests without any radio (NRF24L01/RFM69) attached.
    The rest is working great, so far.

    // Enables and select radio type (if attached)
    //#define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69

    I'm using the development branch, and it's up-to date.


  • Admin

    Hmm.. that has probably been forgotten for the MQTT client gateway...

    Could you try adding:

    if (presentation)
        presentation();
    

    Here:
    https://github.com/mysensors/Arduino/blob/development/libraries/MySensors/core/MyGatewayTransportMQTTClient.cpp#L148



  • @hek
    Yes, that fixed the issue. Thanks. 😃


Log in to reply
 

Suggested Topics

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts