Connection ok but no comunication



  • Hi everyone 🙂

    I've build a relay to control my Senseo. All seems ok, I power the arduino/relay with a 5V transfo from USB charger, all seems ok, my arduino was add by the GW, but i can't send order to it.

    See below my log

    Tue Jan 09 2018 14:06:48 GMT+0100 (CET) : 0;255;3;0;9;TSF:MSG:READ,5-5-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    Tue Jan 09 2018 14:06:48 GMT+0100 (CET) : 0;255;3;0;9;TSF:MSG:BC
    Tue Jan 09 2018 14:06:48 GMT+0100 (CET) : 0;255;3;0;9;TSF:MSG:FPAR REQ,ID=5
    Tue Jan 09 2018 14:06:48 GMT+0100 (CET) : 0;255;3;0;9;TSF:CKU:OK,FCTRL
    Tue Jan 09 2018 14:06:48 GMT+0100 (CET) : 0;255;3;0;9;TSF:MSG:GWL OK
    Tue Jan 09 2018 14:06:49 GMT+0100 (CET) : 0;255;3;0;9;!TSF:MSG:SEND,0-0-5-5,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
    Tue Jan 09 2018 14:06:49 GMT+0100 (CET) : 0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.1
    Tue Jan 09 2018 14:06:49 GMT+0100 (CET) : 0;255;3;0;9;TSM:INIT
    Tue Jan 09 2018 14:06:49 GMT+0100 (CET) : 0;255;3;0;9;TSF:WUR:MS=0
    Tue Jan 09 2018 14:06:49 GMT+0100 (CET) : 0;255;3;0;9;TSM:INIT:TSP OK
    Tue Jan 09 2018 14:06:49 GMT+0100 (CET) : 0;255;3;0;9;TSM:INIT:GW MODE
    Tue Jan 09 2018 14:06:49 GMT+0100 (CET) : 0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
    Tue Jan 09 2018 14:06:49 GMT+0100 (CET) : 0;255;3;0;9;MCO:REG:NOT NEEDED
    Tue Jan 09 2018 14:06:49 GMT+0100 (CET) : 0;255;3;0;14;Gateway startup complete.
    Tue Jan 09 2018 14:06:49 GMT+0100 (CET) : 0;255;0;0;18;2.1.1
    Tue Jan 09 2018 14:06:49 GMT+0100 (CET) : 0;255;3;0;9;MCO:BGN:STP
    Tue Jan 09 2018 14:06:49 GMT+0100 (CET) : 0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    

    Oh, and when I send a request, I see that :

    Tue Jan 09 2018 16:48:38 GMT+0100 (CET) : 5;1;1;1;2;1
    Tue Jan 09 2018 16:48:39 GMT+0100 (CET) - Server connected
    Tue Jan 09 2018 16:48:39 GMT+0100 (CET) - Response: 5;1;1;1;2;1
    Tue Jan 09 2018 16:48:39 GMT+0100 (CET) - Connexion closed
    Tue Jan 09 2018 16:48:39 GMT+0100 (CET) : 0;255;3;0;9;TSF:MSG:SEND,0-0-5-5,s=1,c=1,t=2,pt=0,l=1,sg=0,ft=0,st=OK:1
    Tue Jan 09 2018 16:48:39 GMT+0100 (CET) : 0;255;3;0;9;TSF:MSG:READ,5-5-0,s=1,c=1,t=2,pt=0,l=1,sg=0:1
    Tue Jan 09 2018 16:48:39 GMT+0100 (CET) : 0;255;3;0;9;TSF:MSG:ACK
    

    Thanks for your help, and happy new year 🙂


  • Mod

    Can you please post your code?



  • /**
     * The MySensors Arduino library handles the wireless radio link and protocol
     * between your home built sensors/actuators and HA controller of choice.
     * The sensors forms a self healing radio network with optional repeaters. Each
     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
     * network topology allowing messages to be routed to nodes.
     *
     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
     * Copyright (C) 2013-2015 Sensnology AB
     * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
     *
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * version 2 as published by the Free Software Foundation.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - Henrik Ekblad
     *
     * DESCRIPTION
     * Example sketch showing how to control physical relays.
     * This example will remember relay state after power failure.
     * http://www.mysensors.org/build/relay
     */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_NRF5_ESB
    //#define MY_RADIO_RFM69
    //#define MY_RADIO_RFM95
    
    // Enable repeater functionality for this node
    #define MY_REPEATER_FEATURE
    
    #include <MySensors.h>
    
    #define RELAY_PIN 4  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
    #define NUMBER_OF_RELAYS 2 // Total number of attached relays
    #define RELAY_ON 1  // GPIO value to write to turn on attached relay
    #define RELAY_OFF 0 // GPIO value to write to turn off attached relay
    
    
    void before()
    {
        for (int sensor=1, pin=RELAY_PIN; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
            // Then set relay pins in output mode
            pinMode(pin, OUTPUT);
            // Set relay to last known state (using eeprom storage)
            digitalWrite(pin, loadState(sensor)?RELAY_ON:RELAY_OFF);
        }
    }
    
    void setup()
    {
    
    }
    
    void presentation()
    {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Relay", "1.0");
    
        for (int sensor=1, pin=RELAY_PIN; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
            // Register all sensors to gw (they will be created as child devices)
            present(sensor, S_BINARY);
        }
    }
    
    
    void loop()
    {
    
    }
    
    void receive(const MyMessage &message)
    {
        // We only expect one type of message from controller. But we better check anyway.
        if (message.type==V_STATUS) {
            // Change relay state
            digitalWrite(message.sensor-1+RELAY_PIN, message.getBool()?RELAY_ON:RELAY_OFF);
            // Store state in eeprom
            saveState(message.sensor, message.getBool());
            // Write some debug info
            Serial.print("Incoming change for sensor:");
            Serial.print(message.sensor);
            Serial.print(", New status: ");
            Serial.println(message.getBool());
        }
    }```

  • Mod

    In the node log, do you see the " Incoming change for sensor:" message?



  • Oh, when I plug a nano on computer with USB the GW connect without problem


  • Mod

    Did you try different power supplies? Did you put capacitor near the radio module?



  • I try 2 power supplies, and I put the radio far away from it.

    And I use a decoupling capacitor like says in "Connecting the radio" page

    I don't understand what happend wrong with the log, can you explain me? Thank's


  • Mod

    You need to debug the node, not the gateway, look in node's log.


Log in to reply
 

Suggested Topics

  • 3
  • 6
  • 1
  • 2

9
Online

11.4k
Users

11.1k
Topics

112.7k
Posts