Version 0.5.0 available 27-Sep-2011
• Same version - since I never distributed it - but EOL bug fixed.
Version 0.7.0 available 30-Sep-2011
• Added configuration of serial port (baud rate, parity, data bits and stop bits) with help from DomoPat
Version 0.9.0 available 13-Oct-2011
• Added support for multiple serial port connections, via use of python threads and queues.
Version 0.9.1 available 27-Nov-2011
• Added support for sending decimal or hexadecimal strings to serial port with new Actions. Note that previous Action has been renamed from "directSerial" to "textToSerial" to allow easy differentiation from decimal and hex versions of the actions. PLEASE SEND ANOTHER PM, with your e-mail if you want the latest version.
Version 0.9.2 available 28-Nov-2011
• Fixed bugs with version 0.9.1 with sending decimal/hexadecimal strings.
Version 0.9.3 available 19-Dec-2011
• Added states, which display the most recent response, in text, decimal and hexadecimal notation.
Version 0.9.4 available 16-Feb-2013
• Modified decimal and hexadecimal decoding to catch and exit when values greater than 127 or 7F, respectively, are included, as current code uses character strings extensively, which cannot accommodate the extended Ascii characters. [Extended ASCII supported as of version 0.9.5 ]
Version 0.9.5 available 13-Feb-2015
• The decimal I/O option has been removed to simplify the plugin programming, as I don’t think anyone was using it anyway.
• The EOL set-up now includes “none” as an end-of-line option for commands. This allows use with a device that does not require an EOL, or allows the EOL to be specified for each command if the user so chooses.
• The device setup for the plugin has a new option, to specify “Format for I/O commands." The options are Text (only Standard ASCII character set allowed) and Hexadecimal (Extended ASCII characters from 0x00 through 0xFF allowed).
• IMPORTANT NOTE: Although communications to-from a device allows the use of the Extended ASCII character set, communications to-from the user and the Indigo log still require using the standard ASCII character set, therefore, hexadecimal commands from Actions, etc. are still specified using the format “23, 50, 55, 4D, 50, 3F, 00, FF” but can include characters beyond 7F.
• Feedback to the Indigo log, and the states (lastResponseHex and lastResponseText) are now tied to the specified I/O format type, i.e. text logging for text commands/responses/state, and hexadecimal logging (in 0x00, 0xFF, … format) for hexadecimal commands/responses/state.
This plugin is intended as a simple plugin to test a serial connection that communicates with text commands.
(If you are interested in having the plugin, please send me a PM with your e-mail address noted, and I will send you a copy of the plugin.)
Notes:
• Assumes a Serial Adaptor is connected to the Indigo server, typically using a USB-serial adaptor such as the Keyspan USA-19HS USB Serial Adapter
• To install this (or any new) plugin, place the .plugin file into the Indigo 5 > Plugins (Disabled) folder, then restart the server.
Configuration:
Create a New Device
Type: Plugin
Plugin: Simple Serial Plugin
Model: Simple Serial Connection
Edit Device Settings
Serial port: Select your serial port connected to the your Serial Adaptor (e.g. USA19H47P1.1)
Baud rate: 300-57600 (Default=9600)
Parity: None, Odd, Even (Default=None)
Data bits: 7, 8 (Default=8)
Stop bits: 1, 2 (Default=1)
End-of-line for commands: Choose <CR>, <CR><LF>, <LF>or "none" to end commands
Format for I/O commands: Choose "Text" or "Hexadecimal"
Devices States:
lastResponseText - Most recent response, in Text notation.
lastResponseHexadecimal - Most recent response, in Hexadecimal notation.
Actions:
There is a single set of default actions:
Send direct command to serial device - used to send commands directly to the serial port / adaptor, typically for debugging. Note that there is no syntax checking. Each command as typed has the EOL character selected in Edit Device Settings appended before sending to the serial port. The two variants of the action allow for text or hexadecimal command strings, with the latter expecting comma delimited strings.
Scripting Support:
Plugin ID: org.yergeyjDoesntHaveaURL.simpleserial
Send Text Command to Serial Device
Action ID: textToSerial
Properties for scripting: newCommand (text with command content; EOL added by plugin, per serial device setup)
Example:
Code: Select all
simpleSerialId = indigo.server.getPlugin("org.yergeyjDoesntHaveaURL.simpleserial")
if simpleSerialId.isEnabled():
simpleSerialId.executeAction("textToSerial", deviceId=1842531032, props={"newCommand":"#PUMP?"})
Action ID: hexToSerial
Properties for scripting: newCommand (text with command content; EOL added by plugin, per serial device setup)
Example:
Code: Select all
simpleSerialId = indigo.server.getPlugin("org.yergeyjDoesntHaveaURL.simpleserial")
if simpleSerialId.isEnabled():
simpleSerialId.executeAction("hexToSerial", deviceId=1842531032, props={"newCommand":"23, 50, 55, 4D, 50, 3F"})
Jim Yergey - 27-Sep-2011, most recently updated 13-Feb-2015