Skip to content
  • 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. Ethernet Gateway problem
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store

Ethernet Gateway problem

Scheduled Pinned Locked Moved Troubleshooting
93 Posts 18 Posters 47.4k Views 6 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.
  • NuubiN Offline
    NuubiN Offline
    Nuubi
    wrote on last edited by
    #17

    How often your sketch is sending? Just thinking that if it send continuously, things get piled up.

    1 Reply Last reply
    0
    • Dan S.D Offline
      Dan S.D Offline
      Dan S.
      Hero Member
      wrote on last edited by
      #18

      sensor sends light level once per minute (if it changes during that time). Only one sense reporting

      1 Reply Last reply
      0
      • Dan S.D Offline
        Dan S.D Offline
        Dan S.
        Hero Member
        wrote on last edited by
        #19

        I now have the gateway plugged into the computer to read the serial moniter. Had the sensor hooked up before and the gateway was plugged into the vera. Per the Serial.print line in the gateway sketch it showing the messages it is sending to the sensor. Will see if it hangs up after a while when it is not plugged into the internet. Given that it seems to be executing the main loop properly, would think it is a hardware problem that causes it to eventually stop.

        1 Reply Last reply
        0
        • Dan S.D Offline
          Dan S.D Offline
          Dan S.
          Hero Member
          wrote on last edited by
          #20

          With the Ethernet gateway hooked to the pc and on the serial monitor, it just keeps humming along with no hang ups. So my gateway hangups are Ethernet related.

          1 Reply Last reply
          0
          • Dan S.D Offline
            Dan S.D Offline
            Dan S.
            Hero Member
            wrote on last edited by
            #21

            Would like to try the softSPI solution but as a newbie I am not sure how to modify the gateway sketch and associated libraries to do this. Can anyone provide specific step by step instructions on how to modify and compile the gateway with softSPI?

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

              I am a bit short on time tonight, but here is at least some pointers to get this to work:

              1. Get the patched RF24 lib
              2. Download the DigitalIO library and add it to your library tree (next to MySensors lib)
              3. Patch RF24_config.h to enable softspi, uncomment
                //#define SOFTSPI
                and select pins to use with
                const uint8_t SOFT_SPI_MISO_PIN = 15;
                const uint8_t SOFT_SPI_MOSI_PIN = 14;
                const uint8_t SOFT_SPI_SCK_PIN = 16;
                The setting above mean MOSI on A0, MISO on A1 and SCK on A2 on an Arduino Nano.

              I am going to give it another shot to patch the code to use the hardware SPI but I need a couple of days to do it (have other things going on at the moment). If I fail I will check with @hek if the ethernet gw description should be updated with info on how to use softSPI or how we should proceed (perhaps choosing a different ethernet module). No matter what, I intend to bend the W5100 to my will and once I got it wrestled down, I will share the details. This thread would be a good place to track that:

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

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

                I am a bit short on time tonight, but here is at least some pointers to get this to work:

                1. Get the patched RF24 lib
                2. Download the DigitalIO library and add it to your library tree (next to MySensors lib)
                3. Patch RF24_config.h to enable softspi, uncomment
                  //#define SOFTSPI
                  and select pins to use with
                  const uint8_t SOFT_SPI_MISO_PIN = 15;
                  const uint8_t SOFT_SPI_MOSI_PIN = 14;
                  const uint8_t SOFT_SPI_SCK_PIN = 16;
                  The setting above mean MOSI on A0, MISO on A1 and SCK on A2 on an Arduino Nano.

                I am going to give it another shot to patch the code to use the hardware SPI but I need a couple of days to do it (have other things going on at the moment). If I fail I will check with @hek if the ethernet gw description should be updated with info on how to use softSPI or how we should proceed (perhaps choosing a different ethernet module). No matter what, I intend to bend the W5100 to my will and once I got it wrestled down, I will share the details. This thread would be a good place to track that:

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

                @Anticimex Thanks for your input. I downloaded the digitalio library. I assume that I should overwrite the Rf24 lib entries in the Mysensors Utilities lib folder with their patched counterparts?

                hekH 1 Reply Last reply
                0
                • Dan S.D Dan S.

                  @Anticimex Thanks for your input. I downloaded the digitalio library. I assume that I should overwrite the Rf24 lib entries in the Mysensors Utilities lib folder with their patched counterparts?

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

                  @Dan-S.

                  Yes, exactly. And un-comment SOFTSPI-define in RF24_config.h

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

                    Correct. And I forgot to mention that you also need to include digitalio.h in you gateway sketch as well in order to compile.
                    I have had some promising progress with my software patches. I hope to bring good news by the end of the week.

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

                    1 Reply Last reply
                    0
                    • Dan S.D Offline
                      Dan S.D Offline
                      Dan S.
                      Hero Member
                      wrote on last edited by
                      #26

                      In doing research on this I came across:
                      https://github.com/nicoverduin/rf24
                      Didn't know whether you all considered his implementation, but appears to have the same objective of allowing for softSPI on the radio.

                      1 Reply Last reply
                      0
                      • Dan S.D Offline
                        Dan S.D Offline
                        Dan S.
                        Hero Member
                        wrote on last edited by
                        #27

                        Am getting a compile error on this line in RF24.h:

                        SoftSPI<SOFT_SPI_MISO_PIN, SOFT_SPI_MOSI_PIN, SOFT_SPI_SCK_PIN, SPI_MODE> spi;

                        error: ISO C++ forbids declaration of 'SoftSPI' with no type
                        error: expected ';' before '<' token

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

                          Am getting a compile error on this line in RF24.h:

                          SoftSPI<SOFT_SPI_MISO_PIN, SOFT_SPI_MOSI_PIN, SOFT_SPI_SCK_PIN, SPI_MODE> spi;

                          error: ISO C++ forbids declaration of 'SoftSPI' with no type
                          error: expected ';' before '<' token

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

                          @Dan-S. have you included digitalio.h in your sketch?

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

                          1 Reply Last reply
                          0
                          • Dan S.D Offline
                            Dan S.D Offline
                            Dan S.
                            Hero Member
                            wrote on last edited by
                            #29

                            Double checked. Yes I have.

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

                              Hum...then I cannot think of anything more than that I had to change (because I made that mistake and the error message looks familiar).
                              But if you are patient a while longer, I will push a patch to githup with a fix for the ethernet gateway sketch so it works with HW SPI. I have confirmed it now.

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

                              1 Reply Last reply
                              0
                              • Dan S.D Offline
                                Dan S.D Offline
                                Dan S.
                                Hero Member
                                wrote on last edited by
                                #31

                                Figured it out and had a successful compile. Did not have my digital IO Lib properly set up. Now to download and test on the gateway!

                                1 Reply Last reply
                                0
                                • Dan S.D Offline
                                  Dan S.D Offline
                                  Dan S.
                                  Hero Member
                                  wrote on last edited by
                                  #32

                                  Compiled successfully and downloaded. But doesn't show any signs of operation when plugged in. Guess I will wait for your patch.

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

                                    My patch is now merged to the development branch.
                                    Note that I had to increase the SPI clock divider to get it to work on my breadboard. This might not be needed for everybody, but in case you cannot get it to work, it might be worth a try on that.
                                    For details, see here:

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

                                    1 Reply Last reply
                                    0
                                    • Dan S.D Offline
                                      Dan S.D Offline
                                      Dan S.
                                      Hero Member
                                      wrote on last edited by
                                      #34

                                      I looked at your new gateway sketch and noted you use pin 4 f0r Ethernet enable. According to arduino Ethernet shield documentation, pin 4 is used for writing to the sd card on the shield. You select the W5100 with pin 10 and the sd card with pin 4. So if you have an Ethernet shield, should you be using pin 10 to select and deselect the W5100 instead of pin 4 as you do in your breadboard setup?

                                      AnticimexA 2 Replies Last reply
                                      0
                                      • Dan S.D Dan S.

                                        I looked at your new gateway sketch and noted you use pin 4 f0r Ethernet enable. According to arduino Ethernet shield documentation, pin 4 is used for writing to the sd card on the shield. You select the W5100 with pin 10 and the sd card with pin 4. So if you have an Ethernet shield, should you be using pin 10 to select and deselect the W5100 instead of pin 4 as you do in your breadboard setup?

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

                                        @Dan-S. You are probably right. I use no shields, just a Nano, so I am free to use any available pin. But I have left this configurable so it is possible to change which pin to use if needed.

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

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

                                          I looked at your new gateway sketch and noted you use pin 4 f0r Ethernet enable. According to arduino Ethernet shield documentation, pin 4 is used for writing to the sd card on the shield. You select the W5100 with pin 10 and the sd card with pin 4. So if you have an Ethernet shield, should you be using pin 10 to select and deselect the W5100 instead of pin 4 as you do in your breadboard setup?

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

                                          @Dan-S. I checked again, and I actually think you mixed two things here. I use pin 10, it is the slave select signal for the ethernet shield/module.
                                          It is not to be confused with the SPI_EN signal, which is more of a free-standing GPIO. It could be that having that signal on D4 makes it incompatible with certain shields, but you cannot use pin 10, because that is reserved for SPI slave select on the ethernet shield (and therefore the library).
                                          SPI_EN and SS is not the same thing. And on a Nano D4 is the only one left unless you want to use an analog pin, one of the UART pins or one of the interrupt-pins. I picked D4 since I use a Nano (and the MySensors site reports the Nano as the "officially supported" option). But I did try to make it possible to change this without having to hack the code, so I hope you can still make use of the patch (or create a new pull request for @hek to consider).

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

                                          Dan S.D 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          12

                                          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
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular