dmeeker@mac.com wrote:Got the new plugin, and set up a test, trying to send the on command to an htd.com lync controller to turn on a home audio zone.
The plugin is throwing the following error in the Indigo event log:
Traceback (most recent call last):
File "plugin.py", line 250, in directJandy
File "plugin.py", line 186, in queueSerialCmd
<type 'exceptions.AttributeError'>: 'Plugin' object has no attribute 'commQueue'
Simple Serial Plugin Error Error in plugin execution ExecuteAction:
If you want more details on what commands I am sending (set up an action that had six steps, a different string being sent for each byte.
thanks ahead of time.
dave
dfiedler wrote:Wish List - Generic Serial Plugin
I am away from my system until November. I have Serial Bridge interfacing with a "LiteTouch" controller.
http://www.litetouch.com/
I have output strings delimitated by a CR sent to the "LiteTouch" controller over a USB Serial interface and I recieve text strings from the "LiteTouch" controller delimitated by a CR which contain information on switch presses in the house.
So I am looking for a generic plugin that is listening on the serial port and when it gets a text string followed by a CR it triggers an event passing the string to a variable. It becomes the users responsibility to parse the string and trigger indigo events.
This same plugin when used as an output will write an output string with a CR to the serial port.
From what I see here the output part is being addressed. I need the plugin to reliably read the string from the Serial Port and trigger the script that will parse the string and cause indigo events to happen. It would seem that strings being read by the plugin must be buffered and then processed. In my environment I do not expect simultaneous events nor more than two strings in a 5 second period. But for a generic plugin I would thing more strings must be handled.
Thanks.
Richard
dfiedler wrote:Just started to work with your Plugin. Pardon me for being slow but I added the plugin to my devices but when I went to triggers to try to get a line of text sent over the serial line I could not seem to get the trigger to give me one.
How do I read a line of text?
Thanks
dfiedler wrote:Thanks for the reply.
Your plugin does half of the job. It sends out characters to a device.
I need that too. But what I also need is that when this device sends some characters back they will be put into a variable instead of the log.
I am not worrying about buffering. When another string gets sent it overwrites the first.
Thanks
### Log response - this plugin does not parse or do anything with the response, but it's still called decodeResponse.
### May have more than one item in response string, even if sending command
def decodeResponse(self, devId, responseString, commDirection):
stringLen = len(responseString)
indigo.server.log("Response from serial device: " + responseString + ", of length " + str(stringLen) + " characters")
## Just add the following line to have the response update "your" Indigo variable.
indigo.variable.updateValue("YourVar", responseString)
Action Group Test - Query Zone Name Full String
Simple Serial Plugin Debug Queue has 1 command(s) waiting.
Simple Serial Plugin Debug Processing command: 0x020x000x010x0C0x010x10
Simple Serial Plugin Debug Sending command:0x020x000x010x0C0x010x10
.
Simple Serial Plugin Response from serial device: , of length 0 characters
Simple Serial Plugin Debug 0x020x000x010x0C0x010x10
command completed.
Nov 24, 2011 12:57:53 PM
Action Group Test - Query Zone Name
Simple Serial Plugin Debug Queue has 6 command(s) waiting.
Simple Serial Plugin Debug Processing command: 0x02
Simple Serial Plugin Debug Sending command:0x02
.
Simple Serial Plugin Response from serial device: , of length 0 characters
Simple Serial Plugin Debug 0x02
command completed.
Simple Serial Plugin Debug Queue has 5 command(s) waiting.
Simple Serial Plugin Debug Processing command: 0x00
Simple Serial Plugin Debug Sending command:0x00
.
Simple Serial Plugin Response from serial device: , of length 0 characters
Simple Serial Plugin Debug 0x00
command completed.
Simple Serial Plugin Debug Queue has 4 command(s) waiting.
Simple Serial Plugin Debug Processing command: 0x01
Simple Serial Plugin Debug Sending command:0x01
.
Simple Serial Plugin Response from serial device: , of length 0 characters
Simple Serial Plugin Debug 0x01
command completed.
Simple Serial Plugin Debug Queue has 3 command(s) waiting.
Simple Serial Plugin Debug Processing command: 0x0C
Simple Serial Plugin Debug Sending command:0x0C
.
Simple Serial Plugin Response from serial device: , of length 0 characters
Simple Serial Plugin Debug 0x0C
command completed.
Simple Serial Plugin Debug Queue has 2 command(s) waiting.
Simple Serial Plugin Debug Processing command: 0x01
Simple Serial Plugin Debug Sending command:0x01
.
Simple Serial Plugin Response from serial device: , of length 0 characters
Simple Serial Plugin Debug 0x01
command completed.
Simple Serial Plugin Debug Queue has 1 command(s) waiting.
Simple Serial Plugin Debug Processing command: 0x10
Simple Serial Plugin Debug Sending command:0x10
.
Simple Serial Plugin Response from serial device: , of length 0 characters
Simple Serial Plugin Debug 0x10
command completed.
dmeeker@mac.com wrote:...
Query Zone Name
Head(1 byte): 0x02
Reserved Byte(1 byte): 0x00
Zone Address(1 byte): 1-6
Command(1 byte): 0x0D
Data (1 byte):0x00
so, an example would be to query Zone1 Status:
0x02 + 0x00 + 0x01 + 0x0D + 0x00 + Checksum
The Checksum, the docs tell me, is each item totaled up.
So the actual string is:
0x02 + 0x00 + 0x01 + 0x0C + 0x01 + 0x10
And it should return the Zone Name (in this case for Zone 1)
...
Thank you so so so much.
Happy Thanksgiving!
Dave
Nov 25, 2011 8:53:45 AM
Action Group Test - Query Zone Name copy
Simple Serial Plugin Debug Queue has 1 command(s) waiting.
Simple Serial Plugin Debug Processing command: \x02\x00\x01\x0c\x01\x10
Simple Serial Plugin Debug Sending command:\x02\x00\x01\x0c\x01\x10
.
Simple Serial Plugin Response from serial device: , of length 0 characters
Simple Serial Plugin Debug \x02\x00\x01\x0c\x01\x10
command completed.
dmeeker@mac.com wrote:Jim,
Thanks for the quick response.
So, in the text box where I designate what string to send over the port, I am typing:
\x02\x00\x01\x0c\x01\x10
Did you mean that? (one single command)
Or do you intend the \ to be line breaks?
In any case, when I send this over the port, my log shows:Nov 25, 2011 8:53:45 AM
Action Group Test - Query Zone Name copy
Simple Serial Plugin Debug Queue has 1 command(s) waiting.
Simple Serial Plugin Debug Processing command: \x02\x00\x01\x0c\x01\x10
Simple Serial Plugin Debug Sending command:\x02\x00\x01\x0c\x01\x10
.
Simple Serial Plugin Response from serial device: , of length 0 characters
Simple Serial Plugin Debug \x02\x00\x01\x0c\x01\x10
command completed.
Users browsing this forum: No registered users and 0 guests