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. [SOLVED] Problems with Ethernet Gateway (Arduino Ethernet Shield)

[SOLVED] Problems with Ethernet Gateway (Arduino Ethernet Shield)

Scheduled Pinned Locked Moved Troubleshooting
67 Posts 12 Posters 34.6k Views 3 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.
  • korttomaK korttoma

    I have now tried on a breadboard with the same result "0;0;3;0;9;check wires". Swapped out the Pro Mini to a Nano same result. My conclusion would be that the Ethernet board I have can just not be used.

    eth.jpg

    How I connected:
    Ethernet board arduino pin
    NSS/SS D10
    MO/MO A0
    MI/MI A1
    SOK/CK A2
    V+5 tried with 3.3v 5v and 9v
    GND GND

    The radio was connected according to this

    I'm still gona try the none SOFTSPI setup if I get the same result. edit -> same result here

    AnticimexA Offline
    AnticimexA Offline
    Anticimex
    Contest Winner
    wrote on last edited by
    #32

    @korttoma That W5100 module has no SPI_EN signal out on the pins, so you have to use soft SPI for it, or it will block the radio module. Or you can HW-patch the module to drive the inverse of the CS pin on the SPI_EN pin on the W5100 ASIC. If you instead does pull out SPI_EN to the Arduino you can use the config in the gateway sketch to handle the SPI_EN for you. I do this for my GW which has a W5100 module with SPI_EN available and it works a treat.

    Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

    1 Reply Last reply
    0
    • korttomaK Offline
      korttomaK Offline
      korttoma
      Hero Member
      wrote on last edited by
      #33

      I tried to use the SOFT_SPI but I always get check wires. So it seems like there is also something else. Only time I managed to get the sketch running was with the none soft_spi setup and I had power disconnected from the Ethernet module during startup and connected it later.

      • Tomas
      AnticimexA 1 Reply Last reply
      0
      • korttomaK korttoma

        I tried to use the SOFT_SPI but I always get check wires. So it seems like there is also something else. Only time I managed to get the sketch running was with the none soft_spi setup and I had power disconnected from the Ethernet module during startup and connected it later.

        AnticimexA Offline
        AnticimexA Offline
        Anticimex
        Contest Winner
        wrote on last edited by
        #34

        @korttoma Sorry to be asking these probably stupid questions but have you checked that

        • all wires are properly connected, and in-line with the config in the software
        • the RF module is ok (tested multiple ones)
        • supply voltage is relatively free of noise (I have seen noice up to 1V in relative amplitude without proper decoupling on my breadboard)

        I am pretty sure you will never get the GW running on that module without either SOFT_SPI or a HW patch to it.
        To me it sounds like a good start would be to get to the point where you can get it running on SOFT_SPI without the W5100 "present". Just to establish that you can communicate with the RF module.
        If you can do it on HW SPI, then it should not be a problem with the RF module itself, more a config error for SOFT_SPI.

        Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

        1 Reply Last reply
        0
        • korttomaK Offline
          korttomaK Offline
          korttoma
          Hero Member
          wrote on last edited by
          #35

          I we tried allot of different sources of power, this was the firs thing I did. I have a stupid question to. The radio connection are the same even if I use soft_spi right? Or should also the radio be connected to the 3 analog pins?

          • Tomas
          AnticimexA 1 Reply Last reply
          0
          • korttomaK korttoma

            I we tried allot of different sources of power, this was the firs thing I did. I have a stupid question to. The radio connection are the same even if I use soft_spi right? Or should also the radio be connected to the 3 analog pins?

            AnticimexA Offline
            AnticimexA Offline
            Anticimex
            Contest Winner
            wrote on last edited by
            #36

            @korttoma No, the whole point of using SOFT_SPI is that you use different pins. The reason is that the W5100 "hogs" the SPI interface, so if you cannot access SPI_EN on W5100 then you cannot share SPI pins with W5100.

            Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

            AnticimexA 1 Reply Last reply
            0
            • hekH hek

              @p0lar

              For normal sensors you should probably run with the hardware SPI. So yes. disable it when gateway has been compiled and flashed.

              P Offline
              P Offline
              p0lar
              wrote on last edited by p0lar
              #37

              @hek Cool. maybe we can add a #define gateway and #define sensor to switch it between automagically.

              W5100 gateway working 2+ days so far on 1.4.1 with this mod. THANKS

              1 Reply Last reply
              0
              • korttomaK Offline
                korttomaK Offline
                korttoma
                Hero Member
                wrote on last edited by korttoma
                #38

                Found the problem. It was actualy this coment that made do the setup completely wrong:

                @BulldogLowell said:
                @niccodemi said:

                const uint8_t SOFT_SPI_MISO_PIN = 15;
                const uint8_t SOFT_SPI_MOSI_PIN = 14;
                const uint8_t SOFT_SPI_SCK_PIN = 16;
                

                and these are the correct pinouts for my Arduino Ethernet Shield, correct?

                This is moving the SPI communication between the Uno and the shield off to another set of pins, and we are leaving the radio pins on hardware SPI?

                So from this I had moved the Ethernet SPI pins to the allocated SOFT_SPI pins and not the radio pins like I was supposed to. @Dan-S did correct Jim but somehow I missed that part.

                • Tomas
                hekH 1 Reply Last reply
                0
                • korttomaK korttoma

                  Found the problem. It was actualy this coment that made do the setup completely wrong:

                  @BulldogLowell said:
                  @niccodemi said:

                  const uint8_t SOFT_SPI_MISO_PIN = 15;
                  const uint8_t SOFT_SPI_MOSI_PIN = 14;
                  const uint8_t SOFT_SPI_SCK_PIN = 16;
                  

                  and these are the correct pinouts for my Arduino Ethernet Shield, correct?

                  This is moving the SPI communication between the Uno and the shield off to another set of pins, and we are leaving the radio pins on hardware SPI?

                  So from this I had moved the Ethernet SPI pins to the allocated SOFT_SPI pins and not the radio pins like I was supposed to. @Dan-S did correct Jim but somehow I missed that part.

                  hekH Offline
                  hekH Offline
                  hek
                  Admin
                  wrote on last edited by
                  #39

                  @korttoma said:

                  and these are the correct pinouts for my Arduino Ethernet Shield, correct?

                  No, this is the new pinout for the radio. Radio uses SoftSPI and the ethernet uses the good old hw SPI..

                  korttomaK 1 Reply Last reply
                  0
                  • hekH hek

                    @korttoma said:

                    and these are the correct pinouts for my Arduino Ethernet Shield, correct?

                    No, this is the new pinout for the radio. Radio uses SoftSPI and the ethernet uses the good old hw SPI..

                    korttomaK Offline
                    korttomaK Offline
                    korttoma
                    Hero Member
                    wrote on last edited by
                    #40

                    @hec that was what I was trying to explain with my post also. It was an earlier post by Jim that got me to do the setup incorrectly.

                    • Tomas
                    1 Reply Last reply
                    0
                    • AnticimexA Anticimex

                      @korttoma No, the whole point of using SOFT_SPI is that you use different pins. The reason is that the W5100 "hogs" the SPI interface, so if you cannot access SPI_EN on W5100 then you cannot share SPI pins with W5100.

                      AnticimexA Offline
                      AnticimexA Offline
                      Anticimex
                      Contest Winner
                      wrote on last edited by
                      #41

                      @Anticimex said:

                      @korttoma No, the whole point of using SOFT_SPI is that you use different pins. The reason is that the W5100 "hogs" the SPI interface, so if you cannot access SPI_EN on W5100 then you cannot share SPI pins with W5100.

                      Sorry for being confusing. The SOFT_SPI feature affects the RF module, not the W5100 module. Sorry for being unclear on that point.
                      But the reason for having SOFT_SPI is because of the W5100 modules violation of SPI praxis.
                      So; when using SOFT_SPI, RF module needs to be wired differently.

                      Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

                      1 Reply Last reply
                      0
                      • korttomaK Offline
                        korttomaK Offline
                        korttoma
                        Hero Member
                        wrote on last edited by
                        #42

                        Just to make things a bit more clear for the next guy with a W5100 module that wants to use the SOFT_SPI :

                        download Master library 1.4.1

                        Patch file RF24_config.h (xxxx\MySensors\utility) to enable softspi,

                        uncomment (remove //) #define SOFTSPI

                        and change pin numbers as below:

                        const uint8_t SOFT_SPI_MISO_PIN = 15;
                        const uint8_t SOFT_SPI_MOSI_PIN = 14;
                        const uint8_t SOFT_SPI_SCK_PIN = 16;
                        

                        Connecto radio and Ethernet module according to this:

                        connections.jpg

                        start arudino ide 1.5.8, open Ethernet Gateway sketch and amend/add below lines

                        add this line: #include <DigitalIO.h>

                        comment UIPEthernet.h (//#include <UIPEthernet.h>)

                        uncomment Ethernet.h (#include <Ethernet.h>)

                        and choose IP address

                        • Tomas
                        AnticimexA BulldogLowellB 2 Replies Last reply
                        0
                        • korttomaK korttoma

                          Just to make things a bit more clear for the next guy with a W5100 module that wants to use the SOFT_SPI :

                          download Master library 1.4.1

                          Patch file RF24_config.h (xxxx\MySensors\utility) to enable softspi,

                          uncomment (remove //) #define SOFTSPI

                          and change pin numbers as below:

                          const uint8_t SOFT_SPI_MISO_PIN = 15;
                          const uint8_t SOFT_SPI_MOSI_PIN = 14;
                          const uint8_t SOFT_SPI_SCK_PIN = 16;
                          

                          Connecto radio and Ethernet module according to this:

                          connections.jpg

                          start arudino ide 1.5.8, open Ethernet Gateway sketch and amend/add below lines

                          add this line: #include <DigitalIO.h>

                          comment UIPEthernet.h (//#include <UIPEthernet.h>)

                          uncomment Ethernet.h (#include <Ethernet.h>)

                          and choose IP address

                          AnticimexA Offline
                          AnticimexA Offline
                          Anticimex
                          Contest Winner
                          wrote on last edited by
                          #43

                          @korttoma Good overview. Actually, it is also possible to skip the IP address and use DHCP. Works just fine (though obviously you need a router that assignes a known IP to your chosen MAC, since the controller needs to know the IP of the GW.

                          Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

                          korttomaK 1 Reply Last reply
                          0
                          • korttomaK korttoma

                            Just to make things a bit more clear for the next guy with a W5100 module that wants to use the SOFT_SPI :

                            download Master library 1.4.1

                            Patch file RF24_config.h (xxxx\MySensors\utility) to enable softspi,

                            uncomment (remove //) #define SOFTSPI

                            and change pin numbers as below:

                            const uint8_t SOFT_SPI_MISO_PIN = 15;
                            const uint8_t SOFT_SPI_MOSI_PIN = 14;
                            const uint8_t SOFT_SPI_SCK_PIN = 16;
                            

                            Connecto radio and Ethernet module according to this:

                            connections.jpg

                            start arudino ide 1.5.8, open Ethernet Gateway sketch and amend/add below lines

                            add this line: #include <DigitalIO.h>

                            comment UIPEthernet.h (//#include <UIPEthernet.h>)

                            uncomment Ethernet.h (#include <Ethernet.h>)

                            and choose IP address

                            BulldogLowellB Offline
                            BulldogLowellB Offline
                            BulldogLowell
                            Contest Winner
                            wrote on last edited by
                            #44

                            @korttoma

                            I'm happy to see you have it working and nice job with the table, I think it caps off the whole thread.

                            It would be nice to see this setup as one of the detailed instructions on the main MySensors webpages.

                            @Anticimex, great to see the contribution!

                            1 Reply Last reply
                            0
                            • M Offline
                              M Offline
                              Mrlynx
                              Hardware Contributor
                              wrote on last edited by
                              #45

                              Is it possible to use soft SPI for ethernet module and keep the original wiring for radio module?

                              http://www.sa2avr.se

                              AnticimexA 1 Reply Last reply
                              0
                              • M Mrlynx

                                Is it possible to use soft SPI for ethernet module and keep the original wiring for radio module?

                                AnticimexA Offline
                                AnticimexA Offline
                                Anticimex
                                Contest Winner
                                wrote on last edited by
                                #46

                                @Mrlynx No. Ethernet library uses HW SPI.

                                Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

                                1 Reply Last reply
                                0
                                • AnticimexA Anticimex

                                  @korttoma Good overview. Actually, it is also possible to skip the IP address and use DHCP. Works just fine (though obviously you need a router that assignes a known IP to your chosen MAC, since the controller needs to know the IP of the GW.

                                  korttomaK Offline
                                  korttomaK Offline
                                  korttoma
                                  Hero Member
                                  wrote on last edited by
                                  #47

                                  @Anticimex said:

                                  it is also possible to skip the IP address and use DHCP

                                  So what do I need to change in the sketch to use DHCP?

                                  • Tomas
                                  AnticimexA 1 Reply Last reply
                                  0
                                  • korttomaK korttoma

                                    @Anticimex said:

                                    it is also possible to skip the IP address and use DHCP

                                    So what do I need to change in the sketch to use DHCP?

                                    AnticimexA Offline
                                    AnticimexA Offline
                                    Anticimex
                                    Contest Winner
                                    wrote on last edited by
                                    #48

                                    @korttoma You set up the ethernet lib with only MAC, no IP as argument.

                                    Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

                                    Dan S.D 1 Reply Last reply
                                    0
                                    • AnticimexA Anticimex

                                      @korttoma You set up the ethernet lib with only MAC, no IP as argument.

                                      Dan S.D Offline
                                      Dan S.D Offline
                                      Dan S.
                                      Hero Member
                                      wrote on last edited by
                                      #49

                                      @Anticimex Is there any advantage to using DHCP?

                                      1 Reply Last reply
                                      0
                                      • BulldogLowellB Offline
                                        BulldogLowellB Offline
                                        BulldogLowell
                                        Contest Winner
                                        wrote on last edited by
                                        #50

                                        Wether you use DHCP reservation on your router, or set the IP in the sketch, you need a static IP. You are configuring that static IP in the MySensors configuration on your Vera (assuming you are using Vera).

                                        1 Reply Last reply
                                        0
                                        • AnticimexA Offline
                                          AnticimexA Offline
                                          Anticimex
                                          Contest Winner
                                          wrote on last edited by
                                          #51

                                          There is an advantage in using DHCP.

                                          1. You do not have to recompile and reflash your GW if you for some reason need to change it.
                                          2. If you have an environment using DHCP, introducing a device that enforces a certain IP is very bad practice, and you should then make sure your DHCP server make sure to not assign any device the same IP. Consequently, since the controller needs to know the IP of the GW, when DHCP is used, the DHCP server needs to statically tie the IP in question to the MAC the GW uses. But I think that is a much more sane solution in a network.

                                          Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

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


                                          20

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 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