Announcement

Collapse
No announcement yet.

IP / Serial Plugin for HS3 (by "drule") - Discussion Thread

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

    Hi everyone!

    I've just had a chance to look over the code again and I can see why data received over a serial port is failing to trigger events and pass-thru scripts. I'm working on fixing that now and hope to have an update very soon.

    Cheers
    -David

    Comment


      Originally posted by peterpc View Post
      When I have an IP connection and in the connections list I have selected a script to run, hs.writelog("eth484 ", Params(2)) gives you the ascii data in that script.
      How can I change that to binary data?
      You are correct, the plugin is only passing ascii data to scripts. I can add passing of binary data fairly easily. Would it work for you if the plugin passed an extra parameter that was an array of bytes?

      Cheers
      -David

      Comment


        Hello Drule,

        Good to hear from you! And even better that you have identified the issue with serial data not triggering scripts.

        Is the issue with ASCII data only present in the IP functionality or could it also exist in the serial code? I'm actually receiving hex codes so I believe the passing of Binary data would be helpfull for me to on the serial line too

        Thank you very much for the efforts so far!

        Kind regards,

        Remko.

        Comment


          Originally posted by drule View Post
          You are correct, the plugin is only passing ascii data to scripts. I can add passing of binary data fairly easily. Would it work for you if the plugin passed an extra parameter that was an array of bytes?

          Cheers
          -David
          Yes, that will be perfect!
          Thank you.
          Peter

          http://ohh.pcgsm.nl

          Comment


            I've just sent the next version over to cheeryfool for him to test and post on the library forum. Serial comms should now trigger events correctly and I've changed pass-thru script handling to pass an array of bytes as well as the ascii string. However, to make this happen I had to change the parameter structure passed to the pass-thru script. Now instead of passing an HS2-style Chr(0) separated string, I pass an HS3-style array of objects. Unfortunately this means you will have to modify your existing scripts to compensate. :-(

            The new structure looks like this:
            Code:
            Sub Main(param() As Object)
                Dim ConnectionName As String = param(0)
                Dim FromIp As String = param(1)
                Dim AsciiData As String = param(2)
                Dim BinaryData(UBound(param(3))) As Byte
                Array.Copy(param(3), BinaryData, UBound(BinaryData)-1)
            
                hs.WriteLog("Pass-thru", ConnectionName)
                hs.WriteLog("Pass-thru", FromIp)
                hs.WriteLog("Pass-thru", AsciiData)
                hs.WriteLog("Pass-thru", "There are " & UBound(BinaryData).ToString & " bytes of binary data.")
            End Sub
            Cheers!
            -David

            Comment


              Hello Drule,

              Thanks for the effort and right before the weekend.

              Hopefully it will be uploaded quickly so I have something to do this weekend.

              Remko.

              Comment


                Originally posted by connor View Post
                Hello Drule,

                Thanks for the effort and right before the weekend.

                Hopefully it will be uploaded quickly so I have something to do this weekend.

                Remko.
                I will try and get to it tonight. Sorry, had a few competing items running this week,
                cheeryfool

                Comment


                  No issues, I'm already very happy that Drule was able to implement the fix. Thanks to you both for the great work!

                  Comment


                    OK I dropped v20 into my HS3 environment and fired it up and performed rudimentary testing with no issues. I have not tested the new return path functionality, but David did.

                    I have posted the new version to the release thread, but left version 19 there also for now.

                    I will clean up the posts and add the usual changelog later.

                    Guys. Please confirm if this version resolves the return path issue for your scenarios

                    Cheers
                    James
                    cheeryfool

                    Comment


                      Hello,

                      My script is being triggered by data being received on my serial port so that appears to work now. Thanks Guys!

                      I modified the code by drule above to write individual bytes to the log

                      I can receive the data that I'm expecting, but I'm experiencing two issues

                      1. The log shows an error that I do not understand. See below.
                      2. I think I'm having a timing issue. I'm expecting two messages within close time of each other, one of 7 and the other of 8 bytes. Sometimes the plugin decodes 15 bytes.

                      @ Drule is there a delay time required between two consecutive messages?
                      Attached Files

                      Comment


                        I am getting the same error:

                        t-02 22:08:37 Error 3 Running script drhsip_eth484.vb :Exception has been thrown by the target of an invocation.->Does entry point Main exist in script? at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Obj ect obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at A.c17b105f989efe61e5979e67bec1ef734.cffd66cb0782c50126727e3f a75582d7a()

                        How did you modify the script to get the individual byte readings?
                        Peter

                        http://ohh.pcgsm.nl

                        Comment


                          It looks like the last 2 bytes are not converted:
                          Attached Files
                          Peter

                          http://ohh.pcgsm.nl

                          Comment


                            @Peter: Have you made any progress?

                            Unfortunately I have not had that much time, but I'll be able to look into the issues a bit more later this week and to provide some more debug information.

                            Kind regards,

                            Remko.

                            Comment


                              Originally posted by connor View Post
                              @Peter: Have you made any progress?

                              Unfortunately I have not had that much time, but I'll be able to look into the issues a bit more later this week and to provide some more debug information.

                              Kind regards,

                              Remko.
                              I am missing the last 2 bytes in the script, but I think it will work then.
                              Did not test the serial script yet. I am still running HS2 until the IP script is working.
                              Then I can replace my Ocelot secu16 units with ETH484 units. I am using the inputs for all my wired motion sensors. So changing to the ETH484 units will force me to use HS3 and not using the Ocelot anymore. (Ocelot worked for more then 12 years without any problems, but the HS3 plugin will not be updated that is forcing me to the ETH484. Nice thing about the ETH484 is that you can config it to push when an input changes.)
                              Peter

                              http://ohh.pcgsm.nl

                              Comment


                                Tested the COM port.
                                Script is running now. But also at serial port I am missing the last 2 bytes.
                                @ Remko, do you receive all the bytes?
                                Peter

                                http://ohh.pcgsm.nl

                                Comment

                                Working...
                                X