Announcement

Collapse
No announcement yet.

Serial communication: Hyperterminal OK, hs.sendtocomport fails - Solved!

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

    Serial communication: Hyperterminal OK, hs.sendtocomport fails - Solved!

    While I'm waiting for my cables needed to use the plugin for my Monoprice HDMI switch, I thought I would use hs.comportsend to operate the switch.

    It works great using hyperterminal. If I send "A2" I set the output A to port 2. If I send "on" I turn the unit on, "off" turns the unit off, and so on.

    I thought it was just a matter of opening the com port (14 in this instance) and do:
    Code:
    hs.OpenComPort(14,"9600,n,8,1",1,"","")
    hs.sendtocomport(14, "A1" & vbCrLf)
    hs.CloseComPort(14)
    While this works great in hyperterminal, I don't have the same luck using scripts. I'm sure there is something I don't know about serial communication, but what is it?

    Thanks!
    Last edited by Moskus; April 18, 2013, 08:43 AM.
    HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
    Running on Windows 10 (64) virtualized
    on ESXi (Fujitsu Primergy TX150 S8).
    WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

    Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

    #2
    Much of the older scripted to serial HS software opened the serial port when booting HS and closed it when shutting it down. SnelvCID does this today with the netcid box.

    That said though it should really function the same once that HS is running.

    Give it a try anyways; put an open com port statement in your startup text and and close statement in your shutdown text.

    ' Steves CID

    hs.runex "SnevlCallerID_funcs.vben","open_port",""

    ' Steves CID
    hs.runex "SnevlCallerID_funcs.vben","close_port",""
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
    Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
    HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

    HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
    HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

    Comment


      #3
      What you really are saying is that I need a delay between opening the comport and sending data?
      HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
      Running on Windows 10 (64) virtualized
      on ESXi (Fujitsu Primergy TX150 S8).
      WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

      Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

      Comment


        #4
        I don't think a delay is either necessary nor likely to fix the problem. I've used both methods and they both seem to work the same.

        FWIW, I had a similar case a few weeks ago. I tried all sorts of stuff, but the thing that finally worked was moving to a different computer port. I have no idea what the original problem was. What was even more puzzling is that the original port worked fine for weeks, then transmission suddenly stopped. As soon as I changed ports everything started working again, and has worked flawlessly since. At least it's worth a try.
        Mike____________________________________________________________ __________________
        HS3 Pro Edition 3.0.0.548, NUC i3

        HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

        Comment


          #5
          Here my 16 plus serial port connections (maybe 20 something today) / configurations haven't really changed in years.

          They are all using the same device controller; IE: Digi Edgeports and 1 Digi USB hub (to a few USB to serial) and two Quatech boxes.

          That said I have never really lost com with any of them except for the Z-Troller.

          The Z-troller is on one com port of maybe 3 utilized on the HS Standard box test box.

          The "test" though was disabling the Z-Troller plugin, disconnecting the com port, reconnecting the com port and re-enabling the Z-Troller plugin.

          The most current beta boot up and shut down of Homeseer is probably the quickest that I have seen in many years of beta testing.

          Most interesting "phenomenon" cropped up relating to serial port communications and specficially with HSPhone/NetCID/W2C box. Recieved 4 calls this morning after shutting down HSTouch (disabling the plugin). I did not hear any TTS relating the four calls since shutting down HSTouch. I decided to call myself to test the TTS and then ended up hearing the TTS for the four previously incoming phone calls. That and I did not see the CID's come up on HS until I made the last call to myself.
          Last edited by Pete; April 18, 2013, 10:16 AM.
          - Pete

          Auto mator
          Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
          Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
          HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

          HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
          HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

          X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

          Comment


            #6
            Hmmm! Now even Hyperterminal won't play nice:

            HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
            Running on Windows 10 (64) virtualized
            on ESXi (Fujitsu Primergy TX150 S8).
            WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

            Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

            Comment


              #7
              In the root of the HS folder there are two file with an example how to do it. They are called comm_open1.ttxt and com_event.txt
              Have a look at those two, maybe it will help. Not sure of it will.
              - Bram

              Send from my Commodore VIC-20

              Ashai_Rey____________________________________________________________ ________________
              HS3 Pro 3.0.0.534
              PIugins: ZMC audio | ZMC VR | ZMC IR | ZMC NDS | RFXcom | AZ scripts | Jon00 Scripts | BLBackup | FritzBox | Z-Wave | mcsMQTT | AK Ikea

              Comment


                #8
                Attached are a couple of freeware serial port diagnostic tools that will help some.
                Attached Files
                - Pete

                Auto mator
                Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                Comment


                  #9
                  "Telko A/S"? Really? Go Norwegians!


                  But no explanation on the weird characters in Hyperterminal (or anything else)?
                  HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
                  Running on Windows 10 (64) virtualized
                  on ESXi (Fujitsu Primergy TX150 S8).
                  WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

                  Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

                  Comment


                    #10
                    I would guess that the HDMI switcher com port settings on the HDMI switch may have gotten trashed (reboot HDMI switch) and / or Hyperterminal comm port settings got trashed (which can happen and I have seen that).

                    In a synopsis; shut down and unplug the HDMI switch box and the testing box and start again. You might also be talking to another serial port (not the HDMI one).
                    - Pete

                    Auto mator
                    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                    Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                    HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                    HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                    HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                    X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                    Comment


                      #11
                      Thank you all for your input and suggestion. However, once again it doesn't work because I'm an idiot.

                      It turns out that this switch doesn't use the same protocol for communication as the other HDMI switches. This uses plain ASCII commands and responses.

                      And the speed NEEDS to be set to 4800. Once I figured that out, it was plain sailing...
                      HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
                      Running on Windows 10 (64) virtualized
                      on ESXi (Fujitsu Primergy TX150 S8).
                      WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

                      Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

                      Comment


                        #12
                        Good News!

                        Yup:
                        It works great using hyperterminal
                        Thought you had the baud set right originally. Here I still utilized a GPS for time sync. The newer one has an adjustable baud rate which I really have never seen before.
                        - Pete

                        Auto mator
                        Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                        Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                        HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                        HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                        HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                        X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                        Comment


                          #13
                          A GPS for time sync! Hmmm, now there's an idea.
                          (Don't you trust internet time?)

                          The HDMI matrix is awesome!
                          I feel like people are used to technology being smart, but why this isn't more common I have no idea.
                          HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
                          Running on Windows 10 (64) virtualized
                          on ESXi (Fujitsu Primergy TX150 S8).
                          WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

                          Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

                          Comment


                            #14
                            (Don't you trust internet time?)
                            no

                            $GPGLL,4134.4418,N,08800.6301,W,202206.477,A*29
                            $GPGGA,202206.48,4134.4418,N,08800.6301,W,1,09,0.9,00223,M,, ,,*37
                            $GPRMC,202206.48,A,4134.4418,N,08800.6301,W,00.0,000.0,21041 3,02.,W*68
                            $GPGSA,A,3,16,32,31,20,29,06,13,03,23,,,,1.8,0.9,1.5*3D
                            $GPGSV,3,1,11,16,80,164,41,23,60,307,42,13,33,312,46,20,33,2 35,40*75
                            $GPGSV,3,2,11,31,28,073,46,32,28,202,42,06,27,143,46,03,21,1 62,44*79
                            $GPGSV,3,3,11,29,08,036,46,07,02,270,,10,02,330,,,,,*4E
                            Last edited by Pete; April 21, 2013, 03:23 PM.
                            - Pete

                            Auto mator
                            Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                            Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                            HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                            HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                            HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                            X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                            Comment


                              #15
                              Originally posted by Moskus View Post
                              A GPS for time sync! Hmmm, now there's an idea.
                              (Don't you trust internet time?)
                              You have to trust the internet, everything on the internet is true, I know because I read that on the internet once.


                              ~Bill

                              Comment

                              Working...
                              X