Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. newbie: ethernet gw and first sensor

newbie: ethernet gw and first sensor

Scheduled Pinned Locked Moved Troubleshooting
8 Posts 3 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    otto001
    wrote on last edited by
    #1

    Hi forum,

    I am just trying to build up my first ethernet gateway and first test sensor and I am kind of desperated....

    What I did:

    I built an ethernet gateway using this tutorial: http://www.mysensors.org/build/ethernet_gateway
    I am using a W5100 shield (which I just stuck onto the arduino) and a UNO R3.

    Terminal message when starting the gateway:

    0;0;3;0;14;Gateway startup complete.
    

    My fhem instance looks fine connecting to the gateway.
    Then I build a sensor using a second UNO R3, but all i get is:

    send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,st=fail:
    sensor started, id 1
    send: 1-1-255-0 s=255,c=0,t=17,pt=0,l=5,st=fail:1.4.1
    send: 1-1-255-0 s=255,c=3,t=6,pt=1,l=1,st=fail:255
    send: 1-1-255-0 s=3,c=0,t=0,pt=0,l=5,st=fail:1.4.1
    send: 1-1-255-0 s=3,c=1,t=16,pt=2,l=2,st=fail:1
    

    This is the sketch I used:

    // Simple binary switch example 
    // Connect button or door/window reed switch between 
    // digitial I/O pin 3 (BUTTON_PIN below) and GND.
    
    #include <MySensor.h>
    #include <SPI.h>
    #include <Bounce2.h>
    #include <MyConfig.h>
    
    //int node_id = 1;
    #define CHILD_ID 3
    #define BUTTON_PIN  3  // Arduino Digital I/O pin for button/reed switch
    
    MySensor gw;
    Bounce debouncer = Bounce(); 
    int oldValue=-1;
    
    // Change to V_LIGHT if you use S_LIGHT in presentation below
    MyMessage msg(CHILD_ID,V_TRIPPED);
    
    void setup()  
    {  
    //  gw.begin(NULL, node_id);
      gw.begin();
     // Setup the button
      pinMode(BUTTON_PIN,INPUT);
      // Activate internal pull-up
      digitalWrite(BUTTON_PIN,HIGH);
      
      // After setting up the button, setup debouncer
      debouncer.attach(BUTTON_PIN);
      debouncer.interval(5);
      
      // Register binary input sensor to gw (they will be created as child devices)
      // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. 
      // If S_LIGHT is used, remember to update variable type you send in. See "msg" above.
      gw.present(CHILD_ID, S_DOOR);  
    }
    
    
    //  Check if digital input has changed and send in new value
    void loop() 
    {
      debouncer.update();
      // Get the update value
      int value = debouncer.read();
     
      if (value != oldValue) {
         // Send in the new value
         delay(100);
         gw.send(msg.set(value==HIGH ? 1 : 0));
         oldValue = value;
      }
    } 
    

    What else to tell? I am using Fedora Linux and have both arduinos connected using USB. I am using NRF24L01+ transceiver module which I wired according to the tutorials. I do not use any external resistors or capacitors....
    Help would be VERY appreciated...

    Thanks in advance!

    Otto

    1 Reply Last reply
    0
    • marceltrapmanM Offline
      marceltrapmanM Offline
      marceltrapman
      Mod
      wrote on last edited by
      #2

      You don't say anything about the/a controller :worried:

      Fulltime Servoy Developer
      Parttime Moderator MySensors board

      I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
      I have a FABtotum to print cases.

      1 Reply Last reply
      0
      • O Offline
        O Offline
        otto001
        wrote on last edited by
        #3

        /a controller? I am using two UNOs R3 if you mean those?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sebas
          wrote on last edited by
          #4

          You will need a controller that gives your sensors an Id and will process the data that is generated by them. The sensors connect to the gateway and the gateway connects to the controller.

          Have a look at this page for the possible controllers you can use. I'm using Domoticz on a Raspberry Pi but you can install that on a Windows, Linux or Apple computer as well.

          1 Reply Last reply
          0
          • O Offline
            O Offline
            otto001
            wrote on last edited by
            #5

            Oh sorry - I am using fhem...
            The gateway is recognized by fhem already, but obviously no connection between gateway and sensor :-(

            1 Reply Last reply
            0
            • O Offline
              O Offline
              otto001
              wrote on last edited by
              #6

              ahm... just to understand it:
              I have connected the gateway to the controller (fhem), but did not define any sensors yet in fhem.
              Shouldnt the sensor connect to the gateway nevertheless?????

              1 Reply Last reply
              0
              • S Offline
                S Offline
                sebas
                wrote on last edited by
                #7

                If I understood correctly (I'm new with MySensors myself) the controller hands out the id's used by the sensors and gateway. Try adding the sensor to fhem and see if that helps.

                O 1 Reply Last reply
                0
                • S sebas

                  If I understood correctly (I'm new with MySensors myself) the controller hands out the id's used by the sensors and gateway. Try adding the sensor to fhem and see if that helps.

                  O Offline
                  O Offline
                  otto001
                  wrote on last edited by
                  #8

                  oh no - got it :-)
                  I bought some 4.7 uF capacitors today and now everything works fine arghhhh
                  but thanks for your help!

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  13

                  Online

                  11.7k

                  Users

                  11.2k

                  Topics

                  113.1k

                  Posts


                  Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • MySensors
                  • OpenHardware.io
                  • Categories
                  • Recent
                  • Tags
                  • Popular