Page 1 of 1
Serial Device Walk-Through if anyone has the time.
Posted: Wed Nov 09, 2005 5:10 pm
by gorfllub
Ok. I am trying to set up one of my thermostats. Its of the HAI variety, and runs in serial.
Docs for the unit are avail upon request.
I have set up a hardware interface using the generic serial module.(Named it HAI Thermostat) I have set the communications parameters as per the Stat's requirements.
Added a couple of commands and the appropriate strings to send.
That part "seems" to be OK.
I created a device (Living Room Thermostat) as well as a task.
From this point on I am having troubles. I can't seem to comprehend what I need to do to actually send the command. The command I want to send is a string that queries the stat for the current temp. After That, I of course need to receive and decipher the incoming info, but that is later on........
Thanks in advance for the help.
Posted: Wed Nov 09, 2005 10:26 pm
by ScottBot
The online help can explain this better than I can in a post, but it's hard to find the Generic Serial Device help file. Under the Help/Plugin Help menu, select the help for the Sample Serial Device. This should give you the steps needed to create the Serial device definition, then create the serial device, then map the Property Values of the serial device to commands in the Hardware Interface.
Posted: Sun Jan 01, 2006 5:21 pm
by gorfllub
Ok, after much frustration, I still cannot seem to do anything through housebot to communicate with the stats.
I downloaded a program called ComDebug to see if I could "talk" to the thermostat. And I can! Using ComDebug as a terminal, I can send the strings to the Thermostat and get responses.
The strings are sent in HEX. 300 Baud, 1 stop bit, 8 data bits, no parity.
Now, that part seems to be ok, but here is some more data:
In the ComDebug program, I can set RTS and DTR "high". This seems to be required by the thermostat.
" The transmitted voltage levels are generated by using DTR as a +12V source....... Therefore DTR must be set hig at all times by the host, and the host must not transmit while the stat is transmitting"
The good things are: I know the stat works, and I wired it correct. The commands work fine when sent manually, and I get appropriate responses back.....
Also, the codes (strings?) require a checksum at the end. I figure these out manually for the "terminal" operation, as well as my test codes for HB. Is there some way of me not having to figure this out myself?? I am useless at HEX, and takes me time to figure each one out..... I dont want to have to do this for 300 strings later once i get this working....
If someone could push me in the right direction with a blunt object, it would be immensely appreciated!
Posted: Mon Jan 02, 2006 4:44 am
by Richard Naninck
300 Baud does not pop up in the options for the Generic Serial Device. You can type it in manually, but I am not sure if it is supported at all. I am sure ScottBot could answer that for you. If 300 baud is not supported, you are at a dead end already.
As for the DTR, you have to try the different settings available. Not much of help here either.
How do you setup your hex strings? There can be NO spaces in between the codes. So a hex string like: 0A 3F 66 5B would have to be put in the device as: 0A3F665B
Also watch out with hex string 25. It is used as a special character %. So if 25 is listed in one of your hex strings, have it followed by a % character.
So 0A3F6625 would only work if 0A3F6625% is set in the device.
Hope this helps a bit
Posted: Mon Jan 02, 2006 7:40 pm
by gorfllub
Ok. Scott, will the Serial Device run at 300 baud?
Posted: Mon Jan 02, 2006 7:53 pm
by ScottBot
gorfllub wrote:Ok. Scott, will the Serial Device run at 300 baud?
Sure. You have to enter the baud manually in the combo, since it's not one of the pre-populated rates.
Posted: Tue Jan 03, 2006 9:45 pm
by gorfllub
Well, thats not the issue then........
Posted: Thu Jan 12, 2006 8:05 pm
by gorfllub
Ok, Well,
I found some scripts for another bit of software that run these stats. If I send them to someone, could they take a peek and see if it would be easy to convert to HB?
They are VB scripts i think.......
Posted: Fri Jan 13, 2006 12:00 pm
by Richard Naninck
Before these scripts are of any use, you need to be able to send a direct command through HB to your thermostat.
Just reply with some more stuff you did to get it to work.
- Give us an example of a hex string for your device.
- Then tell us how you put this hex string in your hardware device
- Also tell us if the Commands from your device are assigned to commandstrings from your hardware device
- etc etc etc.
By going through your previous posts, you say that you have problems with sending commands, but you don't tell us all the steps you took to (not) get that far.
Posted: Fri Jan 13, 2006 9:38 pm
by gorfllub
Ok.
I go to Stteings -> Configure General Serial Port Devices.
- I then make a device in there. (Tstat)
- I create a property such as "Fan"
In the Hardware interface, I set up an interface called Thermostat
I command configuration, I put in a couple of strings that relate to thermostat commands. For example, the easiest one is to query the Tstat about its status. This string would be: 010203 Thats it. (01 would be the stat address, 02 is the message type/query and 03 is the checksum)
(Code documentation here:
http://www.saskjunction.com/stat.pdf )
Set up the configuration for 300 baud, 8 data bits, parity none, 1 stop bit. I have messed with the RTS and DTR settings in every which way.
I add the above command (Retrieve Data) and set it to hex and in the Write Data area I put in 010203
Now, The command Terminator is something i have left blank... Do I need something here??
Anyhow, I go create a device now. (Using the earlier created interface) I add a property (Get data) and in commands, I assign the retrieve data command to the property. (For example, a property of 1 on the Get Data "should" send the get data command to the stat) No? Nothing shows up in the Received Data area.......
This is where I am lost. I must be missing something relatively simple, but I just dont have it yet. I am still waiting/listening for that very loud, audible, Click inside my head..... Lol
Posted: Fri Jan 13, 2006 10:23 pm
by ScottBot
Just to make sure that the data is being sent to the thermostat, enable hardware interface tracing and let us know what you see.
To generate a trace file:
- Select the Hardware Interface from the Tree View.
- Click on the 'Hardware Module Type' button at the top of the Interface Property list.
- Click on the 'Enabled' checkbox to turn on tracing.
- Try and send the command again. This should generate data in the log file.
- Turn the tracing off by clearing the 'Enabled' checkbox set previously.
- In the main tree view, look in "Logging/System Log" for the output, or in the InterfaceTrace.*.csv file (found in the HouseBot\Logs directory).