mysensor gateway with ENC28J60 Ethernet doubts!



  • This post is deleted!


  • @pw44 said in mysensor gateway with ENC28J60 Ethernet doubts!:

    seams there is no interaction

    This is what it looks like to me, too.

    I base that on:

    • 13182 GWT:TSA:ETH OK which I am guessing means Ethernet is working?
    • Then it just keeps sending GWT:RFC:MSG=0;255;3;0;2; which, according to log parser and serial protocol API documentation command internal (3) value of 2 is "I_VERSION" described as "Used to request gateway version from controller." And because it just keeps sending it over and over, I agree with you, and also think that is where the problem lie.

    Any progress on your end in the meantime?



  • @TRS-80 said in mysensor gateway with ENC28J60 Ethernet doubts!:

    @pw44 said in mysensor gateway with ENC28J60 Ethernet doubts!:

    seams there is no interaction

    This is what it looks like to me, too.

    I base that on:

    • 13182 GWT:TSA:ETH OK which I am guessing means Ethernet is working?
    • Then it just keeps sending GWT:RFC:MSG=0;255;3;0;2; which, according to log parser and serial protocol API documentation command internal (3) value of 2 is "I_VERSION" described as "Used to request gateway version from controller." And because it just keeps sending it over and over, I agree with you, and also think that is where the problem lie.

    Any progress on your end in the meantime?

    No no progress yet. Does not speaks with mycontroller or home assistant.



  • @pw44

    Hi All,

    when i disconnect the usb cable (power is on and ethernet cable connected), the gateway stops responding to ping.

    Any hint?

    BR


  • Mod

    This post is deleted!


  • i really can't figure what is going on. with usb connected, i can ping to gateway, with usb disconnected, ping stops. yes, i have a 2 A power supply delivering 3,3 V to nano v3, rf42 and ens28j60 and ethernet cable on rj45.

    does anyone have a reliable gateway working able to share the knowledge with me?



  • Focus on the communication between controller and your gateway. It sounds to me like your gateway is working.

    I never used MYSController, but I would imagine you should be seeing something coming across in there. Double check all your settings. Make sure MYSController is running before you start the gateway. Because after initial announcement, I think the gateway will mostly just sit there unless it has some node(s) to talk to (I could be wrong about that).

    Let me dig up my working Ethernet gateway sketch. It is also on a Nano, so maybe it can help you figure it out. Mine is MQTT though (sounds like yours just straight Ethernet?). With MQTT you don't even need a controller really, you can just start a command line client and listen for messages. Although I would imagine MYSController should provide some similar functionality.

    /*
     * 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 <[email protected]>
     * Copyright (C) 2013-2019 Sensnology AB
     * Full contributor list: https://github.com/mysensors/MySensors/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
     * Contribution by a-lurker and Anticimex
     * Contribution by Norbert Truchsess <[email protected]>
     * Contribution by Tomas Hozza <[email protected]>
     *
     *
     * DESCRIPTION
     * The EthernetGateway sends data received from sensors to the ethernet link.
     * The gateway also accepts input on ethernet interface, which is then sent out to the radio network.
     *
     * The GW code is designed for Arduino 328p / 16MHz.  ATmega168 does not have enough memory to run this program.
     *
     * LED purposes:
     * - To use the feature, uncomment MY_DEFAULT_xxx_LED_PIN in the sketch below
     * - RX (green) - blink fast on radio message received. In inclusion mode will blink fast only on presentation received
     * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
     * - ERR (red) - fast blink on error during transmission error or receive crc error
     *
     * See http://www.mysensors.org/build/ethernet_gateway for wiring instructions.
     *
     */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_RF24
    //#define MY_RADIO_NRF5_ESB
    //#define MY_RADIO_RFM69
    //#define MY_RADIO_RFM95
    
    // Enable gateway ethernet module type
    #define MY_GATEWAY_W5100
    
    // Following were missing from https://www.mysensors.org/build/mqtt_gateway, had to get from
    // https://github.com/mysensors/MySensors/blob/master/examples/GatewayW5100MQTTClient/GatewayW5100MQTTClient.ino
    #define MY_GATEWAY_MQTT_CLIENT
    
    // Set this node's subscribe and publish topic prefix
    #define MY_MQTT_PUBLISH_TOPIC_PREFIX "home/gateways/mysensors0-out"
    #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "home/gateways/mysensors0-in"
    
    // Set MQTT client id
    #define MY_MQTT_CLIENT_ID "mysensors-0"
    //down to here
    
    // W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal)
    //#define MY_W5100_SPI_EN 4
    
    // Enable Soft SPI for NRF radio (note different radio wiring is required)
    // The W5100 ethernet module seems to have a hard time co-operate with
    // radio on the same spi bus.
    #if !defined(MY_W5100_SPI_EN) && !defined(ARDUINO_ARCH_SAMD)
    #define MY_SOFTSPI
    // Note: When using analog functions, these pins are numbered (A)0-5. but these same pins are
    // numbered 14-19 when used with digital functions.
    #define MY_SOFT_SPI_SCK_PIN 14  // A0
    #define MY_SOFT_SPI_MISO_PIN 16  // A2
    #define MY_SOFT_SPI_MOSI_PIN 15  // A1
    #endif
    
    // When W5100 is connected we have to move CE/CSN pins for NRF radio
    #ifndef MY_RF24_CE_PIN
    #define MY_RF24_CE_PIN 5
    #endif
    #ifndef MY_RF24_CS_PIN
    #define MY_RF24_CS_PIN 6
    #endif
    
    // Enable UDP communication
    //#define MY_USE_UDP  // If using UDP you need to set MY_CONTROLLER_IP_ADDRESS or MY_CONTROLLER_URL_ADDRESS below
    
    // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
    //#define MY_IP_ADDRESS 192,168,178,66
    
    // 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
    
    // Renewal period if using DHCP
    //#define MY_IP_RENEWAL_INTERVAL 60000
    
    // The port to keep open on node server mode / or port to contact in client mode
    #define MY_PORT 1883  // was 5003 (?) but 1883 is default for MQTT
    
    // 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, x, y  // this is my MQTT broker address
    //#define MY_CONTROLLER_URL_ADDRESS "my.controller.org"
    
    // The MAC address can be anything you want but should be unique on your network.
    // Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use.
    // Note that most of the Arduino examples use  "DEAD BEEF FEED" for the MAC address.
    #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00
    
    
    // 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
    // Uncomment to override default HW configurations
    //#define MY_DEFAULT_ERR_LED_PIN 7  // Error led pin
    //#define MY_DEFAULT_RX_LED_PIN  8  // Receive led pin
    //#define MY_DEFAULT_TX_LED_PIN  9  // Transmit led pin
    
    #if defined(MY_USE_UDP)
    #include <EthernetUdp.h>
    #endif
    #include <Ethernet.h>
    #include <MySensors.h>
    

    I will mention that I am using W5500, which my understanding is maybe more reliable / better than the ENC module (I could be wrong about that, in fact the ENC module is listed as supported, so...?)? One thing I did read is that the ENC module apparently needs a lot more memory, because it does not implement as much of the IP stack in hardware as the W5x00 modules do. May or may not be relevant. But from what I can tell, it looks like your Ethernet is working?

    Also, please try and hang in there and be patient, instead of spamming topics everywhere. Sooner or later you should get some help. But we are all volunteers here, helping out in our free time. And there are not a lot of us.



  • @TRS-80 Thank you for your kind answer. WIll wait.



  • In the meantime, check some of the things I mentioned. And/or, keep reading and searching Internet. You might make some progress. Keep reporting back how you are coming along, steps you tried, etc...

    Just be methodical. Take notes, etc... You can do it!



  • How are you troubleshooting? Monitoring serial? Network?


Log in to reply
 

Suggested Topics

  • 87
  • 1
  • 5
  • 2
  • 5
  • 10

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts