Announcement

Collapse
No announcement yet.

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

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

    Originally posted by S.Morris View Post
    Ok guys I am now pulling my air out on this one and could do with some help.

    my server where homeseer 3 is installed is running windows 7 just in case it matters

    Ok what I am trying to do is control my Samsung KS9000 TV (2016)
    I am connected via serial Ex-link from my TV to my server and so far I have been able to control the tv only by sending this type of command 08 22 00 00 00 01 D5 Hex via two different serial port programs so that would confirm that the cable is ok and the port setting are correct.
    But for the life of me I can't get drule's serial plugin to work,

    Here is what I have done
    created a serial connection on comport 7 to the specs that worked on the other programs 9600/8bits/1stop/none/none/1
    I have then tested the Samsung commands examples in binary, raw text and it just does nothing I have even tried the above code but that just crashes the plugin

    [IMG][/IMG]

    Thanks

    Steve
    That's not good! I use the plugin to control a couple of different Samsung TVs every day. If it didn't work, my wife would soon let me know. It definitely shouldn't be crashing the plugin like that.

    It would be good to get your connection and command details to see if I can reproduce the crash.

    The commands that work for me are in binary format. For Power On for instance, I send 0x08 0x22 0x00 0x00 0x00 0x02 0xd4.

    -David

    Comment


      Actually, I think I can reproduce the crash already. If I leave the 0x prefix off any hex values the plug falls over. Bad on my part but easy to fix. I shan't put out an update with just this fix in but will include in the next release. The workaround is to make sure that your prefix hex values with 0x.

      -David

      Comment


        Hi David

        well all I did to get it to crash was send this command " 08 22 00 00 00 01 D5 " has a binary

        whilst it doesn't work in your plugin it does work ok in two other serial programs.

        when I send your Samsung off test code ( 0x08 0x22 0x00 0x00 0x00 0x01 0xD5 ) the port monitor show this " 000000: 0x08 0x22 0x00 0x00 0x00 0x01 0xd "

        it seem to be missing the 5 off the end

        Comment


          Originally posted by S.Morris View Post
          Hi David

          well all I did to get it to crash was send this command " 08 22 00 00 00 01 D5 " has a binary

          whilst it doesn't work in your plugin it does work ok in two other serial programs.

          when I send your Samsung off test code ( 0x08 0x22 0x00 0x00 0x00 0x01 0xD5 ) the port monitor show this " 000000: 0x08 0x22 0x00 0x00 0x00 0x01 0xd "

          it seem to be missing the 5 off the end
          I don't know which other two serial programs you are using but they must default to binary numbers being in hex. My plugin assumes numbers are decimal unless you prefix with $, x or 0x.

          As for the last number being truncated, now that is a dumb bug on my part! The last digit does indeed get dropped from binary commands sent to a serial port. The last digit doesn't get dropped from binary commands sent to tcp or udp connections. Since my Samsung TVs are connected via a serial server, I never noticed that before.

          v30 takes care of this (and stops the plugin from crashing if you leave out prefixes from hex numbers) and is on its way over to cheeryfool for him to upload to the main thread. In the meantime you can add an extra 00 to the end of your command and your TV should work. Bear in mind though that you'll need to remove it once you start running v30, or the Samsung command will fail again.

          -David

          Comment


            Originally posted by drule View Post
            I don't know which other two serial programs you are using but they must default to binary numbers being in hex. My plugin assumes numbers are decimal unless you prefix with $, x or 0x.



            As for the last number being truncated, now that is a dumb bug on my part! The last digit does indeed get dropped from binary commands sent to a serial port. The last digit doesn't get dropped from binary commands sent to tcp or udp connections. Since my Samsung TVs are connected via a serial server, I never noticed that before.



            v30 takes care of this (and stops the plugin from crashing if you leave out prefixes from hex numbers) and is on its way over to cheeryfool for him to upload to the main thread. In the meantime you can add an extra 00 to the end of your command and your TV should work. Bear in mind though that you'll need to remove it once you start running v30, or the Samsung command will fail again.



            -David


            Great news. I too had a similar situation where sending commands to my Samsung TV crashed the plugin. Finally gave up and now have a script to send those commands. May go back in give new plugin a new test. Wanted to also process the reply back if command was successful.


            Sent from my iPhone using Tapatalk

            Comment


              Originally posted by drule View Post
              I don't know which other two serial programs you are using but they must default to binary numbers being in hex. My plugin assumes numbers are decimal unless you prefix with $, x or 0x.

              As for the last number being truncated, now that is a dumb bug on my part! The last digit does indeed get dropped from binary commands sent to a serial port. The last digit doesn't get dropped from binary commands sent to tcp or udp connections. Since my Samsung TVs are connected via a serial server, I never noticed that before.

              v30 takes care of this (and stops the plugin from crashing if you leave out prefixes from hex numbers) and is on its way over to cheeryfool for him to upload to the main thread. In the meantime you can add an extra 00 to the end of your command and your TV should work. Bear in mind though that you'll need to remove it once you start running v30, or the Samsung command will fail again.

              -David
              Thanks appreciate you sorting it so prompt

              Comment


                A BIG thanks the 00 at the end sorted it

                And just incase someone might find useful I have attached a spread sheet for the Samsung TV codes
                Attached Files
                Last edited by S.Morris; December 18, 2017, 06:37 PM.

                Comment


                  Version 0.0.0.30 uploaded here. Fixes the 2 bugs around Hex serial commands discussed below.
                  cheeryfool

                  Comment


                    Originally posted by cheeryfool View Post
                    Version 0.0.0.30 uploaded here.
                    May I suggest an improvement of the first post on how to download?

                    Code:
                    curl -o drhsIpPlugIn30.zip https://forums.homeseer.com/attachment.php?attachmentid=65270&d=1513646551
                    Do observer that this link above can be used from your favorite ssh client, like putty.exe, and will ONLY work for 0.0.0.30 since the attachmentid will change for every version (and so the filename of course).

                    This way one never needs to download to a PC and then transfer it over... Just log into HomeSeer with homeseer/
                    . After the download, you will of course need to extract the files, something like this maybe...
                    Code:
                    unzip drhsIpPlugIn30.zip
                    mv /usr/local/HomeSeer/HSPI_drhsIpPlugIn.exe HSPI_drhsIpPlugIn.exe.old
                    cp ./HSPI_drhsIpPlugIn.exe /usr/local/HomeSeer/HSPI_drhsIpPlugIn.exe
                    chmod 755 /usr/local/HomeSeer/HSPI_drhsIpPlugIn.exe
                    </password>

                    Comment


                      Ok I am in a mess again for some reason everything has stopped working

                      created a code by pasted this code in " 08 22 00 00 00 02 D4 " has I did yesterday but now I am get " drhsIpPlugIn Invalid multi char in binary string " any ideas?

                      Ok UPDATE

                      the codes that didn't work yesterday now seem to working and the one that did work don't Go figure
                      Last edited by S.Morris; December 19, 2017, 03:10 PM.

                      Comment


                        Originally posted by S.Morris View Post
                        Ok I am in a mess again for some reason everything has stopped working

                        created a code by pasted this code in " 08 22 00 00 00 02 D4 " has I did yesterday but now I am get " drhsIpPlugIn Invalid multi char in binary string " any ideas?
                        Remember, you need the 0x prefix for hex numbers. Without it, the plugin will treat numbers as decimal and 'D4' is an invalid decimal number.

                        Comment


                          Thanks

                          Comment


                            Script feedback to device status or global varible to display in HSTouch

                            Team,

                            GREAT plugin. As I newbie to HS3 and this plugin, thru the post in this thread and help from drule... I've got almost everything working, I have my Denon 3808ci via IP and my Panasonic projector via Serial taking commands via C-escaped command sets. So physical control is working.

                            I want to attempt to take the next step and take detail status responses from both and display them.

                            I used the following script example early in this thread to get the plugin to post all responses to the loh from the Denon by this script:

                            Public Sub Main(Param() As Object)
                            hs.WriteLog("drhsIpPlugin", Param(2).ToString)
                            End Sub

                            What I wanted to accomplish with this feedback is 2 things, one I wanted it to update my virtual device I created to mimic the Denon 3808ci connection in this plugin via the RS232 reply status v/s the status created via the commands. I've successfully added a virtual devices, and can control in from the Device Management screen per the Denon device status. 2nd was how to get the responses being posted to the log to at min be sent a global variable I assume, so I can add a text box to HSTouch and create a display screen that mimics my display on the DEnon 3808ci. How is this done? Do I just add hs.createvar("XXX??") after the hs.writelog? Then I assume I would somehow call that variable and display that feedback text, examples are input, volume, dolby etc, I know how to get each of those via a command to list.. Just needed a little help??

                            Any assistance would be great.
                            Last edited by KeyMix; December 26, 2017, 10:55 PM.

                            Comment


                              Thanks for a nice plugin. I started to make a serial connection by myself, but it was slow and bad, and then I found this. Nice work.

                              All my outbound connections seems to be OK, but I try to get some data from my Clearone PSR1212 Matrix.

                              I have attached my connections, Callback scripts, my events and my log.

                              I do use a GC 100-12. Putty works well.

                              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, BinaryData.Length)
                              
                                  hs.WriteLog("Pass-thru", ConnectionName)
                                  hs.WriteLog("Pass-thru", FromIp)
                                  hs.WriteLog("Pass-thru", AsciiData)
                                  hs.WriteLog("Pass-thru", "There are " & BinaryData.Length.ToString & " bytes of binary data.")
                              
                                  For n as Int16 = 0 to UBound(BinaryData)
                                      hs.WriteLog("Pass-thru b" & n.ToString, BinaryData(n).ToString)
                                  Next
                              End Sub
                              Attached Files

                              Comment


                                Originally posted by Xian View Post
                                Thanks for a nice plugin. I started to make a serial connection by myself, but it was slow and bad, and then I found this. Nice work.

                                All my outbound connections seems to be OK, but I try to get some data from my Clearone PSR1212 Matrix.

                                I have attached my connections, Callback scripts, my events and my log.

                                I do use a GC 100-12. Putty works well.
                                OK, I think there are possibly a couple of things going on here. The first is that your connection "Matrise" isn't listening yet. You need to click on the icon on the right with the red crossed through circle. It will change to a green tick when the connection starts listening.

                                This might be enough but I'm concerned that Homeseer event will get to the last data received/script action before your device has had the chance to respond. You might need to insert a wait action in-between the last send command and the send to script action.

                                You will probably want to remove the script setting from the connection definition in the plugin setup.

                                I have a repro running now, so let me know if I can help more.

                                -David

                                Comment

                                Working...
                                X