Announcement

Collapse
No announcement yet.

Problems with com port

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

    Problems with com port

    Hello everyone. It has been a long time away for me. This will be my first post in about 2 years! After moving house twice and putting all my stuff in storage, it is now being unpacked. Refitting the HA has made it to the top of the list and I have found my first new problem:

    I have purchased an RS232 LCD display for simple status messages. It works fine with Hyperterminal (2400, 8, none,1 and flow control off). The problem is interfacing with HS. I can get the com port open and send the string but the display only shows the first charcter of each string. I have tried every variation on the theme that I have found in the message board but can't figure out what is going on.

    The script I am using is below:

    sub main()
    Dim e
    e=hs.OpenComPort(2,"2400,n,8,1",1,"","")
    if e<> "" then
    hs.writelog "Error opening COM2",e
    else hs.writelog "COM2", "Opened"
    end if
    hs.SendToComPort 2, chr(13) 'blanks the screen
    hs.waitsecs 2
    hs.SendToComPort 2, "Testing"
    hs.CloseComPort 2
    end sub

    Any suggestions?

    The display is http://www.vellemanprojects.com/es/e...iew/?id=350997

    Jon

    #2
    Debugging comm issues

    I've mentioned it before in other threads, but this kind of problem should be easy to troubleshoot with a freeware program: http://www.symcod.com/billsm/ (Bill Serial Monitor). After you install it, you will configure it to talk to the serail port (com2) and you will conmfigure Homeseer to talk on an internal pseudo port (the serial monitor defaults to com10). You'll be able to see all the traffic going to and from the device. (See the screen shot below).

    Then do the same thing with hyperterminal (configuring it to use com10) and compare the traffic. I expect the difference will be pretty obvious (what to do about it in Homeseer may not be quite so obvious, however).

    I wouldn't be too surprised if your problem has something to do with handshaking (either hardware or software), so you might also want to experiment with DTR/DSR and CTS/CSR signals

    Pete

    Comment


      #3
      Try the following.
      1. Add hs.OpenComPort 2,"9600,n,8,1",0,"","" to your startup script
      2. Rem out hs.CloseComPort 2 in your script
      3. Add hs.CloseComPort 2 in your shutdown script.
      Last edited by jay; May 15, 2006, 04:03 PM. Reason: error

      Comment


        #4
        Jay,

        Thanks for the suggestion, unfortunatley I have tried that with exactly the same results!

        Pete,

        I have downloaded the program and will try it when I get home tonight. I suspect it is to do with the flow control. I guess since Hyperterminal defaults to 'hardware' that VBS interface does the same. Unfortunately I don't see any way to change the flow control to 'none' in VBS. Hopefully that program will highlight something I can implement in a script....

        Will let you know how I get on.

        Jon

        Comment


          #5
          Pete,

          I don't seem to be able to discern much difference! The actual data is identical. The only thing is the relative speed that the data goes may be different. With that in mind I think I may have to write a somewhat more complicated script....

          thanks for your help

          Jon

          Comment

          Working...
          X