I am trying to control my projector thru rs-232. I cant get anything to work. I tried connecting to it in hyperterminal but it does not respond to any of the commands. How do I know if my device is detected by my computer? In the device manager it just show COM1. Should my projector name show up there?
Announcement
Collapse
No announcement yet.
Need Rs-232 Help
Collapse
X
-
Can only speak for my own experience but for the most part I think you will not know when a serial device is connected and not know what it is in device manager - they don't exchange data in the same way a USB device does. Only the software that connects to the device will be able to tell if its connected or not - what sort of commands is it expecting? Does it come with any software that you could monitor the port to see exactly what data is being exchanged (there are some freeware port monitor programs out there somewhere)? Have you searched on here aswell...someone may have written a script for it at some point..
-
Originally posted by comgle64 View PostYes and Yes. But i'm not sure if my computer is seeing the device. How could I test this?
Comment
-
http://files.support.epson.com/pdf/pltw1_/pltw1_cm.pdf
Page 4 Shows how the command should be.
this is the scrip I am trying to run.
Sub Main()
hs.OpenComPort 1,"9600,N,8,1",1,"",""
hs.SendToComPort 1, "SOURCE A0"
hs.CloseComPort(1)
End Sub
Does this all look right?
Comment
-
Years (over 10) with my Sony DTV box I would have to hit escape and some control keys to get a prompt on the RS-232 port. If you have an old modem with an RS-232 port on it I would connect it to the computer to test the port. Find the com number then type ATZ and see if you get a response. If you do you are fine with the com port on the computer. I would then maybe do a google search for the command structure, baud rate etc for your device to make sure you set your terminal for the right configs. You have to make sure too if its using a straight thru RS-232 or a null cable (cross over).
-break working on a receipe for lentil soup with italian sausage....great stuff....- Pete
Auto matorHomeseer 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 11X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant
Comment
-
Try running this (call it projector.vb);
Code:Sub Main(ByVal Parms As Object) Dim COMPort As Integer = 1 hs.openComPort(COMPort, "9600,N,8,1", 1, "projector.vb", "Receive") hs.SendToComPort(COMPort, "SOURCE A0" & vbCr) hs.closecomport(COMPort) End Sub Sub Receive(ByVal Parms As String) hs.writelog("Projector", "Received From Projector: " & Parms) End Sub
Comment
-
Good News!
I make up my own RS-232/RJ45 cables and always have problems with the colors for the connectors - IE typically the red and brown wires. My wife helps me a bit with a very bright light to make up for my color blindness.- Pete
Auto matorHomeseer 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 11X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant
Comment
-
Originally posted by mrhappy View PostTry running this (call it projector.vb);
Code:Sub Main(ByVal Parms As Object) Dim COMPort As Integer = 1 hs.openComPort(COMPort, "9600,N,8,1", 1, "projector.vb", "Receive") hs.SendToComPort(COMPort, "SOURCE A0" & vbCr) hs.closecomport(COMPort) End Sub Sub Receive(ByVal Parms As String) hs.writelog("Projector", "Received From Projector: " & Parms) End Sub
Basically what I want to do is get the data from the comport and use that data to update the status of a virtual device.
Comment
-
Originally posted by comgle64 View PostI tried Your script and it sends the command to the com port but it does not write anything to the log.
Basically what I want to do is get the data from the comport and use that data to update the status of a virtual device.
hs.openComPort(1, "9600,N,8,1", 1, "projector.vb", "Receive")
line maybe putting it in your startup.vb (that way it opens when HS starts), then put another line in shutdown.vb so it shuts when you close HS down;
hs.closecomport(1)
that way anything received during the course of HS running would be sent to the Receive subroutine in the projector.vb script and hopefully then in the log. As long as the com port has been opened by whatever means you can send the data to it using hs.sendtocomport (perhaps from an immediate script command)
You would then need to examine what sort of replies you get in the HS log and look at the string to further examine it and set a virtual device, i'm not sure what else apart from the source you can get from the projector but it would then be something like (this is very rough coding, no error checking)
(This is based on the sample reply of 'SOURCE=21' in that PDF document if you give the command SOURCE?)
Code:Sub Receive(ByVal Parms As String) Dim SplitStr() As String Dim DeviceCode As String = "Z1" Dim StartStr As String = "Projector Source:" SplitStr = Split(Parms, Chr(61)) 'this splits the string on the = sign, split(0) should hold SOURCE, split(1) =, split(2) should hold the actual source If SplitStr(0) = "SOURCE" Then Select Case SplitStr(2) Case "A0" hs.setdevicestring(DeviceCode, StartStr & " HDMI", True) Case "41" hs.setdevicestring(DeviceCode, StartStr & " Video (RCA)", True) Case "43" hs.setdevicestring(DeviceCode, StartStr & " Video (YCbCr)", True) End Select End If End Sub
Comment
Comment