• header.categories
    • header.recent
    • header.tags
    • header.popular
    • register
    • login

    Frequent errors related to Ethernet Gateways

    scheduled pinned locked moved Troubleshooting
    19 posts 4 posters 2.8k views 2 watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • jkandasaJ offline
      jkandasa @Daniele
      global:last-edited-by,

      @Daniele
      Have you tried to restart MyController OS once?
      Do you remember anything you did recently on your router, something like block ports?
      any firmware upgrade happened recently on your router?

      one-reply-to-this-post last-reply-time reply quote 0
      • D offline
        Daniele
        global:last-edited-by,

        @jkandasa I restart MyController Raspberry regularly (scheduled once per week), I tried doing that manually but nothing changed.
        No changes on the router, but you made me remember I recently re-uploaded the sketches of my gateways and in this way I upgraded their mysensors library version.
        I'll try downgrade one of them and see if this helps.

        one-reply-to-this-post last-reply-time reply quote 1
        • D offline
          Daniele
          global:last-edited-by,

          I made many tests in these days.

          On the arduino side:

          • downgrading mysensors library
          • reducing and than disabling the RF24 message buffer feature
          • Soft SPI
          • adding capacitors to get a more stable power

          On the RPI side:

          • moved the ethernet connection from a switch to the main router
          • moved from ethernet to wifi (to understand if there could be any issue on the RPI ethernet port)
          • upgrading to mycontroller 1.5
          • new SD card

          I still see ethernet related errors, but now the message is slightly different, it talks about connection reset instead of broken pipe:

          2020-04-14 10:04:42,138 ERROR [mc-th-pool-4] [org.mycontroller.standalone.gateway.ethernet.EthernetDriver:107] Exception,
          java.net.SocketException: Connection reset
          	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:115)
          	at java.net.SocketOutputStream.write(SocketOutputStream.java:143)
          	at org.mycontroller.standalone.gateway.ethernet.EthernetDriver.write(EthernetDriver.java:104)
          	at org.mycontroller.standalone.gateway.ethernet.GatewayEthernet.write(GatewayEthernet.java:44)
          	at org.mycontroller.standalone.provider.EngineAbstract.auditQueue(EngineAbstract.java:229)
          	at org.mycontroller.standalone.provider.EngineAbstract.run(EngineAbstract.java:133)
          	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          	at java.lang.Thread.run(Thread.java:748)
          

          @jkandasa could you please give me more details about the meaning of the 2 error messages?

          Thanks
          Daniele

          jkandasaJ one-reply-to-this-post last-reply-time reply quote 0
          • jkandasaJ offline
            jkandasa @Daniele
            global:last-edited-by, jkandasa

            @Daniele The error says,
            Your connection between MyController and ethernet gateway reset.

            Possible causes may be:

            • MySensors ethernet gateway hardware issue

            Try to replicate your old stable firmware to check the hardware.

            Update: After this error, the connection will be reestablished automatically. But it will take couple of moments(you lose your data on this period)

            one-reply-to-this-post last-reply-time reply quote 0
            • D offline
              Daniele
              global:last-edited-by,

              @jkandasa I've not been clear: could you please explain what's the difference between "Broken pipe" and "Connection reset" errors?

              I yet tried with the old firmware, but I get the same errors, so the issue is somewhere else. =(

              jkandasaJ one-reply-to-this-post last-reply-time reply quote 0
              • jkandasaJ offline
                jkandasa @Daniele
                global:last-edited-by, jkandasa

                @Daniele

                I guess you have a problem with your MySensors gateway ethernet device attached with Arduino
                If you have an additional ethernet hardware test with it.

                • java.net.SocketException: Broken pipe (Write failed): Writing to a connection when the other end(your gateway) has already closed it

                • java.net.SocketException: Connection reset: on the server side when the client(your gateway) closed the socket connection before the response could be returned over the socket

                one-reply-to-this-post last-reply-time reply quote 0
                • D offline
                  Daniele
                  global:last-edited-by,

                  @jkandasa said in Frequent errors related to Ethernet Gateways:

                  our MySensors gateway ethernet device attached with Arduino

                  That's the same thing I thought, but having 4 of them all failing sounds a bit odd....
                  That's why I started looking also on the RPI side.
                  I tried also moving the ethernet cables from the swtich to the main router, to understand if the switch is having some issue, but still getting the same issues.

                  jkandasaJ AvamanderA topic:replies-to-this-post, 2 last-reply-time reply quote 0
                  • jkandasaJ offline
                    jkandasa @Daniele
                    global:last-edited-by,

                    @Daniele said in Frequent errors related to Ethernet Gateways:

                    That's the same thing I thought, but having 4 of them all failing sounds a bit odd....

                    ah, really a tough situation.
                    Can you power down all the 4 gateways?
                    Power up at a time only one gateway and test with it, if it looks good, test the next gateway

                    one-reply-to-this-post last-reply-time reply quote 0
                    • AvamanderA offline
                      Avamander @Daniele
                      global:last-edited-by,

                      @Daniele

                      That's the same thing I thought, but having 4 of them all failing sounds a bit odd....

                      Maybe the gateways' DHCP lease runs out, they lose their IP and don't ask it back soon enough?

                      skywatchS one-reply-to-this-post last-reply-time reply quote 0
                      • skywatchS offline
                        skywatch @Avamander
                        global:last-edited-by,

                        @Avamander That's not a bad suggeation!

                        @Daniele Try re-flashing the gateways and see how that works.

                        one-reply-to-this-post last-reply-time reply quote 0
                        • D offline
                          Daniele
                          global:last-edited-by,

                          @skywatch done multiple times during my tests, but nothing changed!

                          skywatchS one-reply-to-this-post last-reply-time reply quote 0
                          • skywatchS offline
                            skywatch @Daniele
                            global:last-edited-by,

                            @Daniele When you said before you had tried a 'new SD' card, did you flash that card from an image or use a fresh install?

                            one-reply-to-this-post last-reply-time reply quote 0
                            • D offline
                              Daniele
                              global:last-edited-by,

                              @skywatch said in Frequent errors related to Ethernet Gateways:

                              d tried a 'new SD' card, did you flash tha

                              fresh install

                              skywatchS one-reply-to-this-post last-reply-time reply quote 0
                              • skywatchS offline
                                skywatch @Daniele
                                global:last-edited-by,

                                @Daniele Then I am out of ideas at the moment, sorry! But I do know the pain you have now. It happened to me a few days ago that a GW just stopped without any real reason. I re-plugged into the pi and all came back up again.

                                There is discussion on MS forum about using optiboot bootloader to get full benefit from watchdog timer. There it is said that watchdog is not working in standard 'Chinese' bootloader.

                                Maybe worth looking into - its going to be raining here after today (think summer just came and went for us!).... So I should have some time to 'fiddle' a little....

                                AvamanderA one-reply-to-this-post last-reply-time reply quote 0
                                • D offline
                                  Daniele
                                  global:last-edited-by,

                                  I can confirm, chinese nano bootloader does not support watchdog.
                                  All my nanos have MySBootloader (for this reason and to be able to use OTA update), but I don't want to use it on GWs since it takes 10-15 seconds to start because it searches for a GW in order to chech new OTA updates.
                                  What I tried is to enable watchdog on a Uno (which in my experiments seems to support watchdog), but till now I haven't found a good way to check ethernet connectivity without interfering with GW functioning.
                                  Do you have any idea on that?
                                  Thanks
                                  Daniele

                                  skywatchS one-reply-to-this-post last-reply-time reply quote 0
                                  • skywatchS offline
                                    skywatch @Daniele
                                    global:last-edited-by,

                                    @Daniele Have you tried monitoring it with wireshark?

                                    one-reply-to-this-post last-reply-time reply quote 1
                                    • AvamanderA offline
                                      Avamander @skywatch
                                      global:last-edited-by, Avamander

                                      @skywatch said in Frequent errors related to Ethernet Gateways:

                                      There it is said that watchdog is not working in standard 'Chinese' bootloader.

                                      Yes, some products ship with the old bootloader.

                                      You can either use an existing Arduino or an USBASP as an ISP programmer to flash a new bootloader, not tremendously difficult if you just wire it up and press the button in Arduino IDE.

                                      @Daniele
                                      I still have this question though, instead of watchdog, did you check that your ethernet module/code just renews its DHCP lease? I forgot to do that on one of my projects and had very similar issues. You should also maybe add a piece of code that sends ICMP ping to your gateway every 1h to make sure ARP cache doesn't time out - avoids that issue too.

                                      one-reply-to-this-post last-reply-time reply quote 0
                                      • D offline
                                        Daniele
                                        global:last-edited-by,

                                        @Avamander could you please post me an example of DHCP renewal?
                                        I investigated the ICMP ping idea but I've not been able to get something working, since the ping seems to interfere with GW code. Did you manage to use it in a mysensors GW?

                                        one-reply-to-this-post last-reply-time reply quote 0
                                        • first-post
                                          last-post

                                        0

                                        online

                                        644

                                        users

                                        532

                                        topics

                                        3.4k

                                        posts
                                        Copyright © 2015-2025 MyController.org | Contributors | Localization