Announcement

Collapse
No announcement yet.

How to force connection at startup ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to force connection at startup ?

    Hello,

    I'm doing some tests on Arduino's Uno and Mega since a week now, aiming to get a stable alarm system.

    I've got one recurrent issue, that could prevent me using Arduino for that purpose :

    When I plug in the Mega, it has never (never) connected directly to HS. But if I just reset the board (either on the main board or the Ethernet shield), than the connection occurs perfectly (and very quickly).

    In the event of a power failure, that could have dramatic consequences. Yes of course I'm considering some DC emergency power, but that's not enough.

    So... what could be the solutions for that ?

    Maybe creating some HS event that could simulate pressing the reset button ?

    Or maybe adding some code to the sketch ?

    In fact, I don't understand why turning the Arduino On or resetting it do NOT have the same effect.

    If someone here can enlighten me, I'll be very thankful.

    Michel

    #2
    Well, should I be the only one here who's arduinos never directly connected without a manual reset ?

    The plugin seems to work perfectly : if I press the button, than the HS+plugin auto-connect function works great.

    But if I just power on the board, nothing happens but a static led on the Mega's ehternet shield.

    Help would be really appreciated here

    Comment


      #3
      Michel,

      As you said the reset button and power on the board should have the same effect. The only thing I can think is your ethernet shield is not ready and is missing the commands on power-up. Try adding a small delay in the sketch to see if that helps.
      Change
      Code:
      //*****************************Setup Void*********************************
      void setup() { 
      #if Debug
      to

      Code:
      //*****************************Setup Void*********************************
      void setup() {
      
      delay(1000);
      
      #if Debug
      Greig.
      Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
      X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
      Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
      Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
      Scripts =
      Various

      Comment


        #4
        Hi,


        The test here under is made on an UNO board, as I can't connect anymore my MEGA to the IDE (Windows creates some port 1 that can't be used by the IDE). Well that's another story.

        So.

        I've added the line you invited me to. Didn't work. I changed to 3.000 ms, nothing happens.

        But !

        When the Arduino is connected through USB, then powering up is great and connections is establishing correctly, without needing reset.

        So I removed the new line, and the connection is ok too.

        The problem is somewhere else.

        For this test, I was using a good 12v power supply -> DC/DC buck to 7.5v into the Arduino's jack. I don't think that this power supply could be at the origin of the issue.

        Are you aware of something like the Ethernet shield that could be differently powered by the board, depending whether we feed the Arduino in this or that way ?

        And, still, why a reset doesn't give the same result as turn off/turn on ???

        Thank you,


        Michel


        EDIT : additional test : USB 5v smartphone power supply doesn't work neither. No connection, shield seems to be down (with slow flashing led). Only the USB PC power supply works great with a spontaneous connection to HS (and as a reminder : this PC is not the HS server).

        Comment


          #5
          Is this a genuine Arduino Ethernet shield? You are describing the problems I had with many clone shields. I have also had a lot of problems with clone boards. Since running only genuine Ethernet shields and genuine Mega boards, mine connect and stay connected. I have two Mega boards that are critical to my heating and hot water that have had 0 connection problems for a couple of years. In addition to the 4 Arduino Megas I have 6 NodeMCU boards. The NodeMCUs have occasional connection issues, maybe one board once a week, at most. They usually end up reconnecting on their own, but I do have a routine that will restart the system if the lost connection is persistent. This will usually get the board to connect. The last time that event ran was last month. Here are my 10 boards (1-4 are Megas). I restarted my system yesterday morning after including/excluding a few Z-Wave devices. Everything has remained connected since.You will note that they all connected within a second or two.

          Click image for larger version  Name:	1FA3C519-7E91-4CC4-A385-BF9B3E98A255.jpeg Views:	0 Size:	114.0 KB ID:	1339544
          HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

          Comment


            #6
            Originally posted by Michelob View Post
            Hi,


            The test here under is made on an UNO board, as I can't connect anymore my MEGA to the IDE (Windows creates some port 1 that can't be used by the IDE). Well that's another story.
            Under Windows 10, Com 1 is usually the computer’s primary Com port. When a Mega (or UNO) is connected by USB, the IDE should see the board at Com 3 or higher. I have seen mine show up as high as Com 8 when I go through all of my boards to upload sketches. I only upload to the Arduino boards by serial, the NodeMCUs are all done OTA.
            HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

            Comment


              #7
              Hi Randy,

              Thanks for your reply.

              About the Mega USB issue, I must precise that it connected one week ago, and I was able to upload the Arduino plugin sketch. As you say, it was connected, if I remember well, on port 4. What did I do since ? Just updated the IDE from 1.6.8 to 1.8.9 (as I use now the latest Beta).

              I juste tried to plug it on my laptop, and I've got the same message in the Windows Device Manager (in French : ¨Périphérique USB inconnu (échec de demande de descripteur de périphérique).

              My guess is that something has burned in the board.

              About the issue that made me writing here and your suggestion : well, the board and the Shield are Elegoo ones. Isn't it genuine ones ? Could you give me a link or a reference ? I'm going to buy some (ESP8266 and ESP32 are on their way from China and are supposed to come in december).

              Thanks again,

              Michel

              Comment


                #8
                Originally posted by Michelob View Post
                Hi Randy,

                Thanks for your reply.

                About the Mega USB issue, I must precise that it connected one week ago, and I was able to upload the Arduino plugin sketch. As you say, it was connected, if I remember well, on port 4. What did I do since ? Just updated the IDE from 1.6.8 to 1.8.9 (as I use now the latest Beta).

                I juste tried to plug it on my laptop, and I've got the same message in the Windows Device Manager (in French : ¨Périphérique USB inconnu (échec de demande de descripteur de périphérique).

                My guess is that something has burned in the board.

                About the issue that made me writing here and your suggestion : well, the board and the Shield are Elegoo ones. Isn't it genuine ones ? Could you give me a link or a reference ? I'm going to buy some (ESP8266 and ESP32 are on their way from China and are supposed to come in december).

                Thanks again,

                Michel
                Elegoo are not genuine Arduino, they are Chinese clones. Genuine boards will have the Arduino logo. There are some counterfeit boards out there as well.

                This should help. I can promise you clones and fakes will give you much more of a headache than they are worth. With Chinese clone shields, I couldn't get mine to connect or stay connected. With clone mega boards I would end up with stuck inputs and bouncing outputs. Most of the clone Mega boards were OK. Most, if not all of the clone Ethernet shields would not connect properly.
                HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

                Comment


                  #9
                  Thanks Randy.

                  Comment


                    #10
                    Greig, or anyone else,

                    Beside the Randy's suggestion, any further idea about my issue ?

                    Thanks

                    Mich

                    Comment


                      #11
                      I think Randy's suggestions are good as with your tests you have proven that the board will connect on startup but there is a hardware fault causing the problems.
                      Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
                      X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
                      Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
                      Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
                      Scripts =
                      Various

                      Comment


                        #12
                        Thanks Greig.

                        While waiting for receiving a brand new original Arduino, I'm doing some more tests. I'm going on telling this story here as this could be helpful for anyone else.

                        Look...

                        If I power up some smartpone power supply, already connected to the Arduino USB plug, I've got the same issue.

                        But !

                        If I first turn the power supply ON, then afterwards pluggin in the USB, the Arduino is self-connecting without any reset. Great ! whoopeee ! Well, just half whoopeee because this means I could solve my problem with some relay+temporisation system, which is ok, but not that clean as a process.

                        I found some suggestion on the Arduino notice, telling that sometimes, if you're powering it with external supply, the Bootloader is stuck as it receives some bad signal :

                        https://www.arduino.cc/en/guide/troubleshooting#toc6

                        I tried the 10k resistor trick, but it didn't work.

                        I think there's a very short moment when you turn on a power supply, where the current is not yet stabilized, or something.

                        Keep you posted. And if all this gives anyone here some idea, please share

                        Michel

                        Comment


                          #13
                          What is the power supply you are using?

                          This sounds like a power supply that is either noisy or more likely coming up too slow. An Arduino does its own reset after a slight delay when power is applied, but if the supply does not get to at least 5V immediately this reset could occur before the CPU has sufficient voltage to function properly. When you perform a second manual reset, the voltage probably has stabilized. This sort of problem can be exacerbated by a clone with lower quality components. I personally have had no problem with mine using 5V switch mode power supplies, but 5.5-7V is recommended. On the Arduino is a 5V analog voltage regulator. Mine are now all POE powered so the board and network are connected at once. Unfortunately POE Ethernet shields are difficult to find.

                          The NodeMCU boards operate on 3.3V, so a 5V wall wart powers them quite nicely.
                          HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

                          Comment


                            #14
                            Thanks for your reply, Randy. I'm using a lot of different power supplies in the context of my tests. The one that made a good start is a 5v switching power supply. I banned non-switching ones, and the others (for tests) are 12v ones, and I'm also using a variable Buck DC-DC.

                            But in fact, I cannot reproduce anymore the good start that I saw yesterday. It's really discouraging. Probably yesterday, I plugged the Arduino a bit too quick, making it correctly start not because of a fully operationnal power supply, but because of some power remaining in the board, instead... The only thing I can ensure is that all the leds where down when I plugged it.

                            So the issue is still a mystery to me, even though I'm holding on to your hypothesis : a non stable current, at a bad moment in the Arduino's boot sequence, or in the system Arduino + Shield.

                            There are some leads here about some capacitor added somewhere on the board :

                            https://forum.arduino.cc/index.php?topic=256771.0

                            Should I try this trick ?

                            Thanks

                            Michel





                            Comment


                              #15
                              Originally posted by Michelob View Post

                              Should I try this trick ?

                              Thanks

                              Michel
                              I don't think that will help. I still lean toward a poor quality reset circuit on the board or a bad Ethernet shield. Like I wrote before all of my connection issues (and i had many) went away completely when I went to genuine Arduino shields and boards. It clearly has nothing to do with the plug-in or the network since a hard reset at the board always cures it, showing me that the board is not cleany reset at power up, which was also the symptom of the clone boards I was using in 2014. I have 4 Ethernet connected Arduino Mega boards in service since late in 2014 when I replaced all of my Chinese clones with genuine product. . .

                              HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

                              Comment

                              Working...
                              X