Simple Serial Plugin - just to use for debugging

Posted on
Sat Jan 17, 2015 8:21 am
hamw offline
Posts: 1212
Joined: Mar 31, 2008

Re: Simple Serial Plugin - just to use for debugging

I wonder if you could rename the plug-in and therefore create a new instance? Not exactly the same as handling multiple devices, but would have the same effect.

Posted on
Sat Jan 17, 2015 11:27 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Simple Serial Plugin - just to use for debugging

You can clone plugins to create additional instances of them, but note you need to edit the plugin's Contents/Info.plist file so that both the CFBundleDisplayName and CFBundleIdentifier are unique for the clone. Also note that devices, actions, etc. created by the clone will be in their own sandbox and will only be accessible/usable by the clone. That is, the original plugin won't recognize them since they have a different plugin creator ID. Give what is needed here, that should be fine.

Image

Posted on
Sat Jan 17, 2015 1:08 pm
Ksullivan offline
Posts: 83
Joined: Feb 22, 2014

Re: Simple Serial Plugin - just to use for debugging

Hi Wiery

Have entered the code but are getting the error below, any ideas?

17 Jan 2015 19:04:49
Script Error embedded script: [Errno 35] Resource temporarily unavailable: '/dev/cu.usbserial-A602B3P0'
Script Error Exception Traceback (most recent call shown last):

embedded script, line 15, at top level
File "/Library/Application Support/Perceptive Automation/Indigo 6/IndigoPluginHost.app/Contents/PlugIns/serial/serialutil.py", line 296, in __init__
self.open()
File "/Library/Application Support/Perceptive Automation/Indigo 6/IndigoPluginHost.app/Contents/PlugIns/serial/serialposix.py", line 295, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK | os.O_EXLOCK)
OSError: [Errno 35] Resource temporarily unavailable: '/dev/cu.usbserial-A602B3P0'

Posted on
Sat Jan 17, 2015 1:27 pm
wiery offline
Posts: 288
Joined: Jun 02, 2008
Location: Ireland

Re: Simple Serial Plugin - just to use for debugging

It sounds like coolterm is also open, close it down to free up the serial port

Posted on
Sun Jan 18, 2015 5:58 am
Ksullivan offline
Posts: 83
Joined: Feb 22, 2014

Re: Simple Serial Plugin - just to use for debugging

Thanks Wiery it was the Simple Serial Plugin holding the serial port, is there a way I can receive code back?


Sent from my iPad using Tapatalk

Posted on
Sun Jan 18, 2015 6:36 am
wiery offline
Posts: 288
Joined: Jun 02, 2008
Location: Ireland

Re: Simple Serial Plugin - just to use for debugging

It depends on the device, does coolterm give a response ? If it does then yes, I think it just needs slight mod to the code. My Somfy RTS don't respond so didn't need it

Posted on
Sun Jan 18, 2015 7:21 am
Ksullivan offline
Posts: 83
Joined: Feb 22, 2014

Re: Simple Serial Plugin - just to use for debugging

Yes when I use coolterm and call for a status update then I get a response


Sent from my iPad using Tapatalk

Posted on
Tue Jan 20, 2015 2:23 pm
Ksullivan offline
Posts: 83
Joined: Feb 22, 2014

Re: Simple Serial Plugin - just to use for debugging

Hi Jim

Im getting these messages in the event log but the amplifier doesn't respond, any ideas? :? :(


Action Group new action group
Simple Serial Plugin Debug Queue has 1 command(s) waiting.
Simple Serial Plugin Debug Processing command: REQ88C
Simple Serial Plugin Debug Sending command:REQ88C
Schedule Update Time/Date/Day
Simple Serial Plugin Response from serial device (text): , of length 0 characters
Simple Serial Plugin Debug Decimal string is
Simple Serial Plugin Debug Hex string is
Simple Serial Plugin Debug REQ88C

Thank you

Keith

Posted on
Fri Feb 06, 2015 8:20 am
yergeyj offline
Posts: 260
Joined: Dec 29, 2004

Re: Simple Serial Plugin - just to use for debugging

Keith (and others),

First, apologies for not seeing this on the forum, as I hadn’t seen any traffic on this plugin page for quite some time.

So, to send a command so that the plugin will respond, you need to embed the python code in an Action Item directed at the plugin, similar to the example on the main plugin page:

Code: Select all
simpleSerialId = indigo.server.getPlugin("org.yergeyjDoesntHaveaURL.simpleserial")
if simpleSerialId.isEnabled():
   simpleSerialId.executeAction("hexToSerial", deviceId=577450175, props={"newCommand":"23, 50, 55, 4D, 50, 3F”})

Also, you have to translate the hex command into Ascii as above. For the hex code example you sent me in a PM (\x52\x45\x51\x38\x38\x43\x00\x00\x33\x0F\x00\x20\x20\xFF), the right command would be “52, 45, 51, 38, 38, 43, 00, 00, 33, 0F, 00, 20, 20” - and unfortunately, if the “\xFF” is required at the end, the plugin as currently implemented will not work, as it uses extensive Ascii character manipulations and anything higher than 7F cannot be handled (per the help page entry for revision 0.9.4).

Because this has come up with several folks who have tried the plugin, I'm going to have a look at implementing a version that does not require Ascii-only commands.

Jim

Posted on
Fri Feb 13, 2015 8:48 am
yergeyj offline
Posts: 260
Joined: Dec 29, 2004

Re: Simple Serial Plugin - just to use for debugging

Version 0.9.5 is now available, and DOES {finally) support hexadecimal commands and responses using the full Extended ASCII character set (00 through FF).

Please send a PM with your e-mail address if you would like a copy.

Jim

Posted on
Sat Feb 14, 2015 4:43 pm
Ksullivan offline
Posts: 83
Joined: Feb 22, 2014

Re: Simple Serial Plugin - just to use for debugging

Hi Jim

I have just noticed that the trigger from last Hex command is not working even when i copy the received code from the log. It does when when i use “has any change” but when you use “last response hex” becomes equal to” i get no trigger. This will be handy to update a variable.
Thank you
Keith


Sent from my iPad using Tapatalk

Posted on
Sat Feb 14, 2015 10:28 pm
yergeyj offline
Posts: 260
Joined: Dec 29, 2004

Re: Simple Serial Plugin - just to use for debugging

Ksullivan wrote:
Hi Jim

I have just noticed that the trigger from last Hex command is not working even when i copy the received code from the log. It does when when i use “has any change” but when you use “last response hex” becomes equal to” i get no trigger. This will be handy to update a variable.
Thank you
Keith
Sent from my iPad using Tapatalk


Keith,

Below is what my Trigger main page looks like for a hexadecimal state change "Becomes Equal to." Unfortunately, you can’t see the whole text field without scrolling within it. When creating a Trigger, be careful not to include any spaces before or after, and no quotes in the text field for comparison.

I expect you realize this, but just to be sure, note that if you copy from the log, and then enter a command that responds back with the same value, it won’t trigger for “Becomes Equal to" as the value hasn’t changed. You have to force a different value, and then resend the command that gives the response that will initiate the trigger.

Jim
Attachments
Trigger for Simple Serial %22Last Response%22 State Change.png
Trigger for Simple Serial %22Last Response%22 State Change.png (25.6 KiB) Viewed 15761 times

Posted on
Sun Feb 15, 2015 3:10 am
Ksullivan offline
Posts: 83
Joined: Feb 22, 2014

Re: Simple Serial Plugin - just to use for debugging

Thanks Jim all sorted


Sent from my iPad using Tapatalk

Posted on
Sat Oct 31, 2015 7:55 pm
Vig offline
Posts: 111
Joined: Oct 06, 2015

Re: Simple Serial Plugin - just to use for debugging

This might be a dumb question but what variable is responsible for setting this device state that will show On/Off under the State column in Indigo?

thanks,
Vig

Posted on
Wed Jan 13, 2016 2:11 pm
yergeyj offline
Posts: 260
Joined: Dec 29, 2004

Re: Simple Serial Plugin - just to use for debugging

Vig wrote:
This might be a dumb question but what variable is responsible for setting this device state that will show On/Off under the State column in Indigo?

thanks,
Vig


Vig,

First, sorry I didn't see this post until today! I had checked in a few weeks back to see if there were any new questions, but somehow missed your post.

In answer, there is no state displayed for a device set up with the Simple Serial Plugin (it's simple :wink: ). That said, you can tell the state simply from the text color of the device linked to the plugin. Note that you can enable/disable communication between a device and Indigo using an option-click.

Plugin Enabled, Device Communication with Indigo Enabled: Device will appear in black text
Plugin Disabled, Device Communication with Indigo Enabled: Device will appear in red text
Plugin Enabled or Disabled, Device Communication with Indigo Disabled: Device will appear in gray text

I have used this to set up multiple devices with the Simple Serial Plugin, and then only had one of them with "enabled communication" with Indigo.

Hope this helps,
Jim

Who is online

Users browsing this forum: No registered users and 1 guest