ethernet gateway tsp fail

  • Hello!

    I am using a raspberry pi 4 that has openhabian as an SO.

    I have installed mysensors binding in the karaf console with these 2 lines:

    bundle:start 237

    Now, mysensors binding appears active:Screenshot 2020-10-05 at 22.30.52.png

    I have also installed the additional features as said here (the mqtt and serial).

    I have followed the instructions here and configured the gateway like this ./configure --my-gateway=ethernet --my-port=5003. I ran make afterwards.

    I am using a Wemos that has the following code

    // Enable debug prints to serial monitor
    #define MY_DEBUG

    #define MY_GATEWAY_ESP8266

    //#define MY_WIFI_SSID "DIGI-7xj8"
    //#define MY_WIFI_PASSWORD "redacted"

    #define MY_WIFI_SSID "TP-Link_DFA1"
    #define MY_WIFI_PASSWORD "redacted"

    // Enable UDP communication
    #define MY_USE_UDP // If using UDP you need to set MY_CONTROLLER_IP_ADDRESS or MY_CONTROLLER_URL_ADDRESS below

    // Set the hostname for the WiFi Client. This is the hostname
    // it will pass to the DHCP server if not static.
    #define MY_HOSTNAME "ESP8266_GW"

    // The port to keep open on node server mode
    #define MY_PORT 5003

    // How many clients should be able to connect to this gateway (default 1)

    // Controller ip address. Enables client mode (default is "server" mode).
    // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere.
    #define MY_CONTROLLER_IP_ADDRESS 192,168,0,104
    #define IP_PORT 5003

    #include <MySensors.h>

    uint32_t SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
    #define DIGITAL_INPUT_SENSOR 3 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!)

    #define MY_NODE_ID 1
    #define CHILD_ID 1 // Id of the sensor child

    // Initialize motion message
    MyMessage msg(CHILD_ID, V_TRIPPED);

    void setup()
    pinMode(DIGITAL_INPUT_SENSOR, INPUT); // sets the motion sensor digital pin as input

    void presentation()
    // Send the sketch version information to the gateway and Controller
    sendSketchInfo("Motion Sensor", "1.0");

    // Register all sensors to gw (they will be created as child devices)
    present(CHILD_ID, S_MOTION);


    void loop()
    // Read digital motion value
    //bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
    bool tripped=true;
    //send(msg.set(tripped?"1":"0")); // Send tripped value to gw

    // Sleep until interrupt comes in on motion sensor. Send update every two minute.
    //sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);


    When I run this command sudo ./bin/mysgw I have the following error:

    Screenshot 2020-10-05 at 22.34.42.png

    Do you have any suggestions?

  • Mod

    @Stoica-Andreea are you planning to use both the raspberry pi gateway and the wemos gateway at the same time? If so, could you tell us more about what you are building?

    Or did you intend to use the wemos as a node? (Not a gateway)

  • I intend to use wemos as a node and the raspberry as the gateway.

    I want to implement a system on openhab with the mysensors binding. I am trying to read a value from a sensor attached to wemos (I have removed the interactive part and I am only sending a true "1" value for the tripped variable) then send it to the raspberry pi and later display it via the openhab platform.

    For now, I am testing the interaction between wemos and raspberry in the openhabian terminal.

  • Mod

    Thanks for explaining.

    Start with removing #define MY_GATEWAY_ESP8266 from the wemos sketch, and add #define MY_RADIO_RF24 instead. This will make the wemos a node instead of a gateway.

    Then check wiring on the raspberry pi, as discussed in the other thread. Communication will not work when the gateway is unable to initialize the nrf24 radio chip.

  • I have missed an important detail in the earlier post.

    I am working on a project that has some constraints - I have to find a way to send data through Wifi and another way to send data through radio waves (the nrf).

    This post was regarding the Wifi connection. From what I understood from your last post, the communication between the gateway and the node is established through the nrf24 module and then the message is send via Wifi. Is that correct?

    Also, if you could point me out a method using mysensors with the Wifi only it would be very helpful.

  • Mod tried to describe how MySensors works.

    A MySensors gateway can run on ta Raspberry Pi, or on a Wemos (or a number of other hardware).

    A MySensors gateway can communicate with a controller using a (virtual) usb port, wifi, wired internet, cellular internet, etc.

    For your wifi connection, you can use a wemos gateway if you like. In that case, there is no need to connect a nrf24 radio to the wemos.

    For "radio waves" you can build a MySensors node with nrf24 if you like. If you do that, you will need a gateway that also has a nrf24 radio.

Log in to reply

Suggested Topics