Page 1 of 1

Serial Communication with Homeseer

Posted: Thu Feb 17, 2011 11:05 pm
by Verkenner
Hi All,

Want to send text to a MK158 Serial-display-kit from Velleman.
http://www.velleman.eu/distributor/prod ... ?id=350997

Connected the RS-232-wiring with 2 wires (Ground and Data).
With terminal emulator FOXTerm I send (and read) to the MK158 terminal. That works (with win7) with speed 2400 b/s.

But sending text from Homeseer to the display only B~ is on the Velleman-display.

In the HS-logging (no errors):
17-2-2011 21:33:22 Event Event Trigger "Com Port"
17-2-2011 21:33:22 Event Running script in background: comport.txt


This is the HomeSeer-script in the Event:

sub main()
Dim PortNumber
Portnumber=8
hs.OpenComPort PortNumber,"2400,N,8,1",1,"",""
hs.SendToComPort PortNumber,"Biertje?"
hs.Closecomport PortNumber
end sub


Perhaps the script is ok.
But is handshaking needed? Or VCC (+) wiring?
Anybody connected this Velleman-MK158 to Homeseer?


Any help appeciated !
Verkenner

Re: Serial Communication with Homeseer

Posted: Thu Feb 17, 2011 11:52 pm
by esschenk
Hello Verkenner,

I Have made a homemade Serial Display
mayne this will help
I dont no if the commands are usefull
dont forget to open the comport in the startup script

http://www.domotica.famschenk.eu/Wireless_Display.html

Ed

Re: Serial Communication with Homeseer

Posted: Fri Feb 18, 2011 12:05 am
by Digit
Maybe you have to add a Carriage Return (CR), Chr(13) .
Check the manual.

Re: Serial Communication with Homeseer

Posted: Fri Feb 18, 2011 10:29 am
by Verkenner
Sorry next time in English.

Ed, Digit, dank voor de hulp.

Naar aanleiding van jullie suggesties en voorbeelden heb ik het script aangepast.
Dit werkt wel:

sub main()
Dim PortNumber
Portnumber=8
hs.OpenComPort PortNumber,"2400,N,8,1",1,"",""

hs.SendToComPort PortNumber,"1"
hs.WaitSecs 1
hs.SendToComPort PortNumber,"2"
hs.WaitSecs 1
hs.SendToComPort PortNumber,"3"
hs.WaitSecs 1
hs.SendToComPort PortNumber,"4"
hs.WaitSecs 1
hs.SendToComPort PortNumber,"5"
hs.WaitSecs 1
hs.SendToComPort PortNumber,"6"

hs.Closecomport PortNumber
end sub


De oorzaak lijkt een timing probleem (mede omdat de MK158 geen handshaking heeft).
En wellicht omdat de COM-poort van de PC veel sneller is.

Groet van Verkenner

Re: Serial Communication with Homeseer

Posted: Fri Feb 18, 2011 10:57 am
by Digit
What, en er komt nog steeds "Biertje?" op het scherm?? :lol:

HS.walking-fridge

Posted: Fri Feb 18, 2011 6:57 pm
by Verkenner
Yes, with this script :D

10 Loop:
20 hs.Open-the-fridge
30 hs.SendToComPort PortNumber,"5", fetch a bottle
40 hs.WaitSecs 1
50 hs.SendToComPort PortNumber,"B", fetch a bottle
60 hs.WaitSecs 1
70 hs.SendToComPort PortNumber,"I", fetch a bottle
80 hs.WaitSecs 1
90 hs.SendToComPort PortNumber,"E", fetch a bottle
100 hs.WaitSecs 1
110 hs.SendToComPort PortNumber,"R", fetch a bottle
120 hs.close-the-fridge
130 Do loop as long as Temp_Fridge is <5 degrees C

HIK :D
Verkenner