Announcement

Collapse
No announcement yet.

HS.Ping return code

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

    HS.Ping return code

    Hi all,

    does anyone knows the meaning of "1" as a return code for the Ping function? According to the documentation, the function should :

    "Returns 0 if host is alive and 26118 if host is not available."

    The statement: RC = hs.Ping ("www.homeseer.com")

    generated a RC of 1 when my router was having problem (no web access on all computer)

    Thank you!

    Richard

    #2
    What version of HomeSeer are you running? This was broken but was supposed to be fixed on the latest betas.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Returns 0 if host is alive and 26118 if host is not available.
      LOL only in HS would you see a return code of 0 if the host was there, but 26118 if not. What, was 26118 Rich's lucky number for the week?

      Comment


        #4
        HomeSeer version is: 2.1.104.0

        Thank you!

        Richard

        Comment


          #5
          I've been having the problem with hs.ping returning 26118 for quite a while now. The problem is, the hosts are there, valid and pingable. I have three IP address that always return 26118. If I ping the host name, versus the IP, then the ping returns the 0 as expected. If I ping 192.168.0.1, the ping returns 26118, and this is a valid host. If I ping 192.169.0.3 (which is valid also), the ping returns 0. For my hosts that aren't there, I am receiving a 1 as expected. HS version 2.1.173.0. For the moment, I've just modified my scripts to treat a 0 or 26118 as a valid ping.
          HS: 2.5.0.60
          Environment: Virtual XP as guest in VMWare Server running under Win 7
          Plug-ins: MLHSPlugin|RCS Serial Thermostat|UltraLog|UltraMon|
          Misc: 303 Devices, 313 Events, 68+ Scripts

          HSeer: 3.0.0.54
          Environment: Virtual XP as guest in VMWare Server running under Win 7
          Plug-ins: BLGData|BLRF|BLRadar|BLRandom|BLSpeech
          UltraM1G3|UltraECM3|UltraMon3|UPBSpud|Z-Wave
          Misc: 148 Devices, 116 Events, 9+ Scripts (so far, still converting)

          Comment


            #6
            Ok, another quick comment. I did find that I had one hs.ping to a name, versus an IP, that wasn't a valid host, and it returned 26188 also, so that blows away the theory about pinging names always working. But, once I changed back to the IP address, it then returned 1. So, as long as you ping all IPs, it seems then, and only then, 26188 and 0 are valid, pingable IP addresses, in theory anyway...
            HS: 2.5.0.60
            Environment: Virtual XP as guest in VMWare Server running under Win 7
            Plug-ins: MLHSPlugin|RCS Serial Thermostat|UltraLog|UltraMon|
            Misc: 303 Devices, 313 Events, 68+ Scripts

            HSeer: 3.0.0.54
            Environment: Virtual XP as guest in VMWare Server running under Win 7
            Plug-ins: BLGData|BLRF|BLRadar|BLRandom|BLSpeech
            UltraM1G3|UltraECM3|UltraMon3|UPBSpud|Z-Wave
            Misc: 148 Devices, 116 Events, 9+ Scripts (so far, still converting)

            Comment


              #7
              Hi

              I have this hs.ping issue too. If I ping a host that is down by ip I get a return code of 1 and sometimes 0! If I ping a device from hs.ping and from the windows command line using ping.exe I can normally get a 0 response on a host that is down, which is odd. I run HS 2.5.0.5 on XPSP3.

              If I ping from a windows command line on a host that is down I just see "request timed out", no other devices are responding with other icmp messages on the failed devices behalf. Can this be fixed?

              Thanks

              Comment


                #8
                In vs 2.5.0.44 this is quite definitely not fixed.
                I got up this morning to a log full of backed up events (queue full) and traced it to an event which uploads to Weather Underground every five seconds. The site seemed to be down.
                OK, I figured I could fix this by pinging the site before attempting the upload. When a site is available, hs.ping does seem to report "0", however reports "1" when it is not. So far. I don't really care one way or the other what is reported, so long as the response is accurate (and conforms to the documentation). Either the docs need to change or the response.
                Real courage is not securing your Wi-Fi network.

                Comment


                  #9
                  Hi

                  I don't use hs.ping but use something like this instead:

                  Public Function PingDevice(ByRef host As String)
                  Dim ping As New System.Net.NetworkInformation.Ping
                  Return ping.Send(host).Status
                  End Function


                  I then call and use the code this way:

                  Dim PingStatus As long = PingDevice("x.x.x.x")
                  if PingStatus.ToString <> "0" then
                  'Device x.x.x.x is down
                  else
                  'Device x.x.x.x is up
                  end if

                  HTH!

                  Comment


                    #10
                    Bert

                    What codes are returned by your routine please and what do they mean?

                    Simon

                    Comment


                      #11
                      Oddly I was messing with this past could of days and noticed that hs.ping was returning 1 rather than the documented 26118 or whatever. Has this been changed by HS?

                      Comment


                        #12
                        Originally posted by simonog View Post
                        Bert

                        What codes are returned by your routine please and what do they mean?

                        Simon
                        Hi simon,

                        As per the user manual.


                        Ping
                        Purpose
                        Indicates of a host is available.

                        Parameters
                        Parameter: host name
                        Type: string
                        Description: Name or IP address of the host to ping.

                        Returns
                        Return value: host status
                        Type: integer
                        Description: Returns 0 if host is alive and 26118 if host is not available.


                        I hope this helps.

                        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


                          #13
                          Think Simon was asking about the System.Net.NetworkInformation script posted in post #9. The replies are listed here http://msdn.microsoft.com/en-us/libr...ly.status.aspx . Albeit MSDN seems to suggest that the IPStatus enumeration would be the reply I am not sure where the reply of '0' would come from. I'll stop before I end up confusing myself further.

                          Were there not some problems with the .net ping command only recently? I thought that it was named as being at fault for some sort of leak/crash of HS.

                          Comment


                            #14
                            Originally posted by simonog View Post
                            Bert

                            What codes are returned by your routine please and what do they mean?

                            Simon
                            Hi

                            The full range of codes returned is available here http://msdn.microsoft.com/en-us/library/windows/desktop/aa394350(v=vs.85).aspx

                            I do a lot of pinging from HS but I only need to see if the status is up or down really, hence my code just checks to see if the return value is 0 or not.

                            HTH

                            Comment


                              #15
                              I was indeed asking about the .net return values.

                              Thank you to those who provided links; and I too have a memory there was some issue with .net and pings.

                              my recent experience with Homeseer is that hs.ping returns just 0 or 1. 26118 has not appeared once. I do assume, however, that hs.ping is just an interface to the .net ping in which case it will suffer from any .net bug if there still is one.

                              Simon

                              Comment

                              Working...
                              X