Announcement

Collapse
No announcement yet.

Monitoring Devices in Real Time

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #46
    I've updated the SDK so now I'm current.

    But now I'm pretty confused.

    In my old code, I was using RegisterEventCB. There is no corresponding UnregisterEventCB.

    But there are some new methods: RegisterGenericEventCB and RegisterStatusChangeCB and their corresponding Unregister calls.

    So, I tried out RegisterGenericEventCB. I'm not able to get it to work. I get the error "Public member 'name' on type 'MarshalByRefObject' not found." as soon as I call the RegisterGenericEventCB command. Per the documentation, I've added a Name property, used Inherits MarshalByRefObject in the class definition, and made the class serializable.

    Here's my code:

    Code:
    <serializable()><serializable()>Serializable() _   'Removed LT and GT for this post because they don't render properly
    Public Class hsclass
        Inherits MarshalByRefObject
    
        Private _Name As String = "hsClass1"
        Public Event HSEventReceived(ByVal evtype As Integer, ByVal parms As Object)
    
        Public Sub HSEvent(ByVal evtype As Integer, ByVal parms As Object)
            RaiseEvent HSEventReceived(evtype, parms)
        End Sub
    
        Public Property Name() As String
            Get
                Return _Name
            End Get
            Set(ByVal value As String)
                _Name = value
            End Set
        End Property
    
        Public Sub New()
            'This line errors out with </serializable()></serializable()>Public member 'name' on type 'MarshalByRefObject' not found.
    <serializable()><serializable()>         hsapp.RegisterGenericEventCB("*", Me)
        End Sub
    
    End Class
    Just to reiterate, I'm NOT running this in a plug-in -- it's an external app.

    help!
    </serializable()></serializable()>

    Comment


      #47
      Additionally, RegisterStatusChangeCB appears to only work for scripts, since its second parameter is a string and not an object. Is that correct?

      Comment


        #48
        Did you try to create a name property with a lowercase n ?
        --
        stipus

        Comment


          #49
          Originally posted by stipus View Post
          Did you try to create a name property with a lowercase n ?
          I did. Same result.

          Comment


            #50
            I've been updating the realtime device display program gradually as I needed additional information, and I thought I'd make it available to anyone interested.

            I think I've included all of the suggestions from this thread.

            Let me know what you think. It is available at:

            http://www.tenholder.net/tenWare2/tenDisplayHsDevices


            tenholde
            tenholde

            Comment


              #51
              Originally posted by tenholde View Post
              I've been updating the realtime device display program gradually as I needed additional information, and I thought I'd make it available to anyone interested.

              I think I've included all of the suggestions from this thread.

              Let me know what you think. It is available at:

              http://www.tenholder.net/tenWare2/tenDisplayHsDevices


              tenholde

              Would you mind sharing the source code?

              Thanks
              Ron T.

              Comment


                #52
                http://www.tenholder.net/temp/tenDis...icesSource.zip


                Have you tried running it yet?

                tenholde
                tenholde

                Comment


                  #53
                  I have tried connecting both on the HomeSeer computer and on a remote but I get the attached error message.

                  Hope you can read it, it is a bit small
                  Attached Files

                  Comment


                    #54
                    Originally posted by moose View Post
                    I have tried connecting both on the HomeSeer computer and on a remote but I get the attached error message.

                    Hope you can read it, it is a bit small
                    Make sure you put HomeSeer2.dll, Scheduler.dll and HS2Util.dll in the same folder where you run the application on the remote machine.

                    Comment


                      #55
                      Originally posted by moose View Post
                      I have tried connecting both on the HomeSeer computer and on a remote but I get the attached error message.

                      Hope you can read it, it is a bit small
                      Are you still having problems?

                      tenholde
                      tenholde

                      Comment


                        #56
                        only small unhandled error in Friend Sub UpdateDeviceDisplay()

                        sometime wrong read currentdevice (i= -1), and after unhandled NullReferenceException

                        Comment


                          #57
                          Remote Usage

                          Hello,

                          I have downloaded and compiled the HSRealtime project. It works on the same machine as HS2, but when I try and use it on a different machine in my home, I have some issues.

                          First, I was getting
                          Cannot connect to HomeSeer: Can not connect to the remote host \"gtcp://<hsserver>:8737\". System error message: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 192.168.###.###:8737.

                          After that, I opened TCP port 8737 and I stopped getting the message, but I am not seeing any content. Is is possible to run this on a remote computer?

                          By the way, I already have two firewall rules for the Homeseer executable on my computer, one for all TCP ports and one for all UDP ports. What program is listening on 8737 then?

                          Thanks in advance,
                          Jim

                          Comment


                            #58
                            When you debug your application what error do you get and where does it fail in the code?

                            Comment


                              #59
                              Originally posted by technerd View Post
                              When you debug your application what error do you get and where does it fail in the code?
                              I will check tonight, but I don't think I am getting any further errors. There are certainty no unhandled exceptions being thrown. If the code has a try/catch somewhere and is eating the error--that's always a possibility.

                              Comment


                                #60
                                Originally posted by technerd View Post
                                When you debug your application what error do you get and where does it fail in the code?
                                Nope, no errors, it just didn't work. But, I did figure out that I also needed the interop.dll and now it appears fine.

                                Thanks,
                                Jim

                                Comment

                                Working...
                                X