I am a bit confused over wiring ethernet gateway



  • Hi
    I am trying to use a Uno R3 with Arduino ethernet shield as a MQTT gateway but I want to get it set up as an ethernet gateway first. I am not sure how to wire it up as the table below has caused a lot of confusion!
    Arduino NRF24L01 Radio Ethernet module
    GND GND GND
    3.3V VCC VCC
    13 SCK
    12 MISO/SO
    11 MOSI/SI
    10 SS/CS
    A2 MISO
    A1 MOSI
    A0 SCK
    6 CSN
    5 CE

    Do I wire the radio to the analogue pins for MISO, MOSI, SCK or do I use the digital pins on the ethernet shield?

    Thanks


  • Admin

    The table is pretty clear here (if you use W5100 and SoftSPI):
    https://www.mysensors.org/build/ethernet_gateway

    The radio use A1/A2 for MOSI/MISO.



  • Thanks @hek I have set it up that way and I have made the softspi change to the code but I am now getting the 0;0;3;0;9;radio init fail error. I have the 4.7uF cap in and all the connectors are tight. Is there any other ways of getting more info out than 0;0;3;0;9;radio init fail ?
    I am using a wireless chip that seems to work ok in a serial gateway.


  • Admin

    Does the radio still fail If you remove power from the w5100 while starting up? It's quite power hungry.



  • I am powering the Uno with 12 v not just the usb power.

    I have now set the uno up as a temp / humidity sensor and I am seeing:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
    sensor started, id=255, parent=0, distance=1
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
    T: 23.00
    req id
    send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
    H: 49.00

    I can see some entries in the gateway serial when I restart the dht sensor:
    0;0;3;0;9;gateway started, id=0, parent=0, distance=0
    0;0;3;0;14;Gateway startup complete.
    0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
    255;255;3;0;3;
    0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
    255;255;3;0;3;
    0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
    255;255;3;0;3;
    0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
    255;255;3;0;3;
    0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
    255;255;3;0;3;
    0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
    255;255;3;0;3;
    0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
    255;255;3;0;3;

    so I assume the radio is working properly. Should I see the temp and humidity values in the gateway output in the way I do in the sensor output?


  • Hardware Contributor

    req id means it tries to fetch an ID from the controller - do you use a controller that can assign ID?



  • @sundberg84
    Hi
    Yes, I am using a gateway that will hand out an address ok to another sensor so that seems ok. The gateway does seems to see something coming in when I restart the dht sensor so I am assuing it is something wrong in the software. I have swapped the radio over with the gateway and this seems ok with the motion sensor that has been handed id 105. I am not with the hardware at the moment, I will have a look at the software and see if I can see anytbing I have messed up but can't test till later. I might try a different sensor instead so I am using different software. I have a few different bits to play with.

    Thanks for the reply


  • Hardware Contributor

    @mark_venn The gateway does not hand out any ID - you need a controller like Vera or Domoticz behind to do that. If you dont have that the node will keep asking if you dont set it manually - do you have that (I guess since its worked with another node).

    If you think its in the software, clearing the eeprom might be useful



  • @sundberg84
    I am not attached to a controller at the moment; the traces on the gateway with a motion sensor have worked differently then. I assume the code for the motion sensor has a hard coded value in then?

    0;0;3;0;9;gateway started, id=0, parent=0, distance=0
    0;0;3;0;14;Gateway startup complete.
    0;0;3;0;9;read: 105-105-0 s=255,c=3,t=15,pt=2,l=2,sg=0:0
    105;255;3;0;15;0
    0;0;3;0;9;read: 105-105-0 s=255,c=0,t=17,pt=0,l=5,sg=0:1.5.4
    105;255;0;0;17;1.5.4
    0;0;3;0;9;read: 105-105-0 s=255,c=3,t=6,pt=1,l=1,sg=0:0
    105;255;3;0;6;0
    0;0;3;0;9;read: 105-105-0 s=255,c=3,t=11,pt=0,l=13,sg=0:Motion Sensor
    105;255;3;0;11;Motion Sensor

    ...
    ...
    ...
    0;0;3;0;9;read: 105-105-0 s=1,c=1,t=16,pt=0,l=1,sg=0:1
    105;1;1;0;16;1
    0;0;3;0;9;read: 105-105-0 s=1,c=1,t=16,pt=0,l=1,sg=0:0
    105;1;1;0;16;0
    0;0;3;0;9;read: 105-105-0 s=1,c=1,t=16,pt=0,l=1,sg=0:1
    105;1;1;0;16;1
    0;0;3;0;9;read: 105-105-0 s=1,c=1,t=16,pt=0,l=1,sg=0:0
    105;1;1;0;16;0

    The gateway I am using is the serial gateway running on a nano


  • Hardware Contributor

    @mark_venn - as i said, you need a controller if you want to use automatic ID.
    Your motion dec is probably hardcoded ID as many examples are in the forum.

    Use gw.begin(NULL, AUTO, true) change auto to nodeID and true to false if you have battery sensor



  • @sundberg84
    I am going to hok the whole system up to openHAB or possibly Domoticz once I have more sensors working. I am most likely to use MQTT as the final gateway but wanted to get something working, the ethernet gateway would not work properly. I think MQTT will give me more data space to pass messages around. I am going to tyr the ethernet gw again tonight once I get back from uni


  • Admin

    I would suggest using the development branch. No special configuration is needed for the W5100 sketch.



  • @hek
    Does this include not needing the softspi fix?


  • Admin

    It's enabled automatically for the w5100 gateway.


Log in to reply
 

Suggested Topics

  • 4
  • 20
  • 17
  • 9
  • 2
  • 15

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts