Phidgets Plugin Discussion

Posted on
Mon Feb 18, 2013 6:30 pm
berkinet offline
User avatar
Posts: 3400
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Phidgets Plugin Discussion

Hamw. A hub is fine.
Yves1992. You do not need an account. I have verified the link is good. Try copying the link and pasting it into your browser.

Posted on
Mon Feb 18, 2013 7:07 pm
Otis offline
Posts: 210
Joined: Jan 24, 2006

Re: Phidgets Plugin Discussion

Yes, the 1017 0/0/8 Relay board can be directly connected to your Mac via USB and should work with the Phidgets plugin without an SBC. However, I have just found a small bug that would have prevented the 1017 outputs from being defined as individual devices. Please download a copy of v0.4.7 from dropbox. Then delete your existing 1017 device and add a new one. In the device creation dialog you should now see a button that says: Read ifKit Config. Click that, then save, close and reload the plugin. You can then create individual devices for each of the 1017 output relays.


I did all that successfully, with no change in the result. The Plugin is still not seeing any USB port assigned to the 1017. (I didn't expect it to).

Regarding the web service. It is possible to connect directly with the Phidget from the plugin using USB. However, since a USB connection is exclusive, you would not be able to see that Phidget with the Phidgets Preferences pane or any other application. Use of the Web Service allows the Phidgets to be shared and is recommended. Note that the direct USB connection has not been thoroughly tested. If you decide to use a USB connection and have problems, please post the issues to this forum. Thanks.


If the USB connection is exclusive, does that mean that if I successfully access the 1017 with the Preference Pane to set its communication mode to USB, will doing that prohibit the Plugin from seeing it via USB? If so, that sounds like a problem because as far as I know I have to use the Preference pane to set the communication to USB instead of the default web service before defining the unit in the Plugin. Am I wrong?

I'm seeing a number of different Phidgets error messages in the logs and I can't easily reconstruct the scenarios for each. I can't justify the cost of the SBC board for this application, and USB would do everything I need, so I'll put the 1017 aside for now and monitor the forum to see if there's any news. If you'd like me to try any specific tests, I'd be glad to help.

To summarize the problem as I see it, the Plugin is not recognizing the 1017 and displaying its USB port, even though the Phidgets Preference pane configures and operates it, and the 1017 appears correctly in the Apple System Report listing USB devices that are attached.

Posted on
Mon Feb 18, 2013 7:32 pm
berkinet offline
User avatar
Posts: 3400
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Phidgets Plugin Discussion

Otis wrote:
...If the USB connection is exclusive, does that mean that if I successfully access the 1017 with the Preference Pane to set its communication mode to USB, will doing that prohibit the Plugin from seeing it via USB? If so, that sounds like a problem because as far as I know I have to use the Preference pane to set the communication to USB instead of the default web service before defining the unit in the Plugin. Am I wrong?

I'm seeing a number of different Phidgets error messages in the logs and I can't easily reconstruct the scenarios for each. I can't justify the cost of the SBC board for this application, and USB would do everything I need, so I'll put the 1017 aside for now and monitor the forum to see if there's any news. If you'd like me to try any specific tests, I'd be glad to help....

You cannot have a Phidget open in the Phidget Preference pane General tab and also use it in Indigo. If you want to use a Phidget in both Indigo and the Preference pane you MUST use the Web Service and then open the Phidget in the Preference pane's Bonjour tab.

Here is what you need to do:
Plug your Phidget's interface kit 1017 into the Mac's USB port. Open the Phidgets Preference pane and, on the Web Service tab click Start WebService and also check Start Automatically. You should enter a ServerID, but leave the Port at 5001 and do not enter a Password.

Then, click the Bonjour tab and make sure your Phidget is listed. Note the Serial number.

Now, in Indigo create a new Device, for Type: select the Phidgets plugin, for Model:, select Phidget Interface Kit. In the new window that appears, select the 1017 Interface Kit Model, enter the Serial number, select IP Network and enter 127.0.0.1 for the address, Now, click the Read ifKit Config button. Then click save.

Then, reload the Phidgets plugin.

If you do not see your new device in the Indigo device window with a state of Online, please copy any errors and post them here.

If you do see your device, you can then proceed to create individual devices for each of the 8 relay outputs. For these, select devide Type: InterfaceKit Digital Output. In the new window which appears, select your 1017 device and then select the output relay number. Save and close and reload the plugin.

Also, in the Phidgets Preference pane, check your Phidget21 Library version. If it is not Version 2.1.8 Dec 18, 2012 you should get an update from the Phidgets web site.

Posted on
Mon Feb 18, 2013 8:59 pm
Otis offline
Posts: 210
Joined: Jan 24, 2006

Re: Phidgets Plugin Discussion

OK, thanks for the clarification. I do remember a reference to Bonjour earlier in this thread. I guess I should have gone back and read more carefully.

I can now access the 1017 and create individual devices. But when I create an action with one of these devices, the Edit Action pane only gives two choices for Output Action: Pulse On/Off and Pulse Off/On. Should I see a Turn On and Turn Off action, too? The pulse actions do turn the relays on and off, and perhaps that's the intent of the design.

Also, the Action settings include a pulse time in ms. But this setting seems to have no effect on the actual pulse length. The relay pulses either on or off for a very short time regardless of that setting. For example, controlling relay 7 with a pulse length of 1000ms, the log displays (note the last line showing 0.0ms):

Trigger Phidget
Phidgets Debug Action:
delayAmount : 900
description : control a interfacekit digital output device
deviceId : 0
pluginId : com.perceptiveautomation.indigoplugin.Phidgets
pluginTypeId : phDigitalDevPulse
props : com.perceptiveautomation.indigoplugin.Phidgets : (dict)
phDevice : 1072129987 (string)
phFunction : pulseOnOff (string)
pulseLength : 1000 (string)
replaceExisting : True
textToSpeak :

Phidgets Debug dev:None
Phidgets Debug Action:pulseOnOff Device:7 Pulse Length:1000
Phidgets Debug InterfaceKit: Serial: 367350, Set index:7 to pulseOnOff, pulseLength: 1000
Phidgets Debug InterfaceKit: Set index:7 to pulseOnOff for 0.0ms


Again, is that the intent of the design at this stage of development?

Thanks again for your patient help.

Posted on
Mon Feb 18, 2013 9:20 pm
berkinet offline
User avatar
Posts: 3400
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Phidgets Plugin Discussion

Otis wrote:
...when I create an action with one of these devices, the Edit Action pane only gives two choices for Output Action: Pulse On/Off and Pulse Off/On. Should I see a Turn On and Turn Off action, too? The pulse actions do turn the relays on and off, and perhaps that's the intent of the design.

Also, the Action settings include a pulse time in ms. But this setting seems to have no effect on the actual pulse length. The relay pulses either on or off for a very short time regardless of that setting. For example, controlling relay 7 with a pulse length of 1000ms,...

Congratulations on getting your Phidgets Relay working. Phidgets Interface Kit output devices are created as Indigo relay type devices. That is to say they are functionally identical to an INSTEON or X10 relay device. As such, they can be controlled in the same way as any other relay device: Device Action -> Control Light/Appliance. For that reason, there are no special plugin defined actions for On and Off. Note that the Phidgets output devices will also appear in the Indigo-Touch app.

On the other hand, sub-second pulsing is commonly needed in control applications and cannot be accomplished with Indigo's Auto-Off After option. For that reason, I added the pulse feature as a plugin defined action. However, at the moment, the pulsing blocks the plugin keeping it from doing any other work (that will be addressed in a future release). So, to avoid any unintended problems, I limited the pulse length to 1000ms. Anything longer is modulo 1000. I.e. 500ms, 1500ms & 2500ms all result in a 500ms pulse. Also, for pulses 1 second and longer, the Auto-Off feature works pretty well - unless you need exactly 1.5 s, etc., and it doesn't block!

As to the 1000ms pulse ending up as zero -- I think you found a bug. I forgot to check if the time was an exact multiple of 1000 and 1000 modulo 1000 = 0. I'll get that fixed in the next update. But for now, 999mmm should work almost as well as 1000 :wink:

Posted on
Mon Feb 18, 2013 9:32 pm
Otis offline
Posts: 210
Joined: Jan 24, 2006

Re: Phidgets Plugin Discussion

I think I understand it all now, and again thank you for your assistance.

Posted on
Mon Feb 18, 2013 9:44 pm
Otis offline
Posts: 210
Joined: Jan 24, 2006

Re: Phidgets Plugin Discussion

Hmm. Maybe I spoke too soon. Setting the action to Control Light/Appliance / Turn On / PhidgetDevice causes this error in the log:

Trigger Phidget
Phidgets Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 322, in actionControlDimmerRelay
<type 'exceptions.NameError'>: global name 'metaMode' is not defined


I'll check into it more tomorrow. (And by the way, a delay of 900ms works correctly, as you indicated).

Posted on
Mon Feb 18, 2013 10:26 pm
berkinet offline
User avatar
Posts: 3400
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Phidgets Plugin Discussion

Otis wrote:
...Setting the action to Control Light/Appliance / Turn On / PhidgetDevice causes this error in the log:

Trigger Phidget
Phidgets Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 322, in actionControlDimmerRelay
<type 'exceptions.NameError'>: global name 'metaMode' is not defined

Nice catch since the problem only occurred if the plugin was in debug mode. This has been fixed in 0.4.8 - see the next post.

Posted on
Sun Feb 24, 2013 5:17 am
loafbread offline
Posts: 136
Joined: May 25, 2009

Re: Phidgets Plugin Discussion

Your plugin keeps getting better. The best Digital Input system for Indigo.
thanks for your work

Posted on
Sun Feb 24, 2013 10:52 am
ckeyes888 offline
Posts: 2160
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Phidgets Plugin Discussion

loafbread wrote:
Your plugin keeps getting better. The best Digital Input system for Indigo.
thanks for your work


Definitely second that! Been working perfectly.

Thanks,

Carl

Posted on
Tue Feb 26, 2013 4:53 pm
berkinet offline
User avatar
Posts: 3400
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Minor bug found

I have found a minor bug in beta 0.5.0. If you send the TextLCD a message greater than the screen size in characters, the plugin will become non-responsive and need to be re-loaded. This will be fixed in the next release. But, in the meantime, the work-around is to make sure any messages are not longer than the screen size (20 or 40 characters depending on the screen).

Posted on
Thu Feb 28, 2013 6:20 pm
loafbread offline
Posts: 136
Joined: May 25, 2009

Re: Phidgets Plugin Discussion

I am trying to define a Digital Output on a 0/16/16 1012_2. I get the errors below when I click "Click to Continue" on the Configure InterfaceKit Digital Output pane. I didn't have any trouble defining the board. I restarted the plugin a few times. I just can't get the DO defined. I can operate the DOs from the Phidgets Preference Pane. I can't define DIs either. The 0/16/16 is plugged into the SBC that is working fine. I am running plugin v0.5.0.

Feb 28, 2013 7:11:38 PM
Phidgets Error Error in plugin execution UiAction:

Traceback (most recent call last):
File "plugin.py", line 650, in ifKitSetIOSize
<type 'exceptions.ValueError'>: invalid literal for int() with base 10: ''

Phidgets Error Error in plugin execution GetUiDynamicList:

Traceback (most recent call last):
File "plugin.py", line 534, in getIfKitIOList
<type 'exceptions.ValueError'>: invalid literal for int() with base 10: ''

Posted on
Thu Feb 28, 2013 7:20 pm
berkinet offline
User avatar
Posts: 3400
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Phidgets Plugin Discussion

loafbread wrote:
I am trying to define a Digital Output on a 0/16/16 1012_2. I get the errors below when I click "Click to Continue" ...


Actually, there was a bug in the device creation for the 1012 - the Read IfKit Config button never displayed so the device was defined as having no ports. It should be fixed in beta 0.5.1 available on dropbox.

This release has a number of internal changes, notably in the TextLCD support. I was planning on releasing it this weekend, but go ahead and try it and I'll just bump the official release to 0.5.2 when I finish it.

For other users. No need to update to this release unless you have a 1012.

Posted on
Fri Mar 01, 2013 5:08 am
loafbread offline
Posts: 136
Joined: May 25, 2009

Re: Phidgets Plugin Discussion

I got v0.5.1 but still have a problem. When I define the Interface Kit and click "Read IfKit Config" I get this error.

Mar 1, 2013 6:05:55 AM
Phidgets Error Error in plugin execution UiAction:

Traceback (most recent call last):
File "plugin.py", line 974, in readIfKitConfig
File "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Phidgets.indigoPlugin/Contents/Server Plugin/Phidgets/Devices/InterfaceKit.py", line 338, in getDataRateMin
<class 'Phidgets.PhidgetException.PhidgetException'>:

Posted on
Fri Mar 01, 2013 10:11 am
berkinet offline
User avatar
Posts: 3400
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Phidgets Plugin Discussion

Well, getting closer. The problem is I do not have a 1012 to test with so it is a little hit and miss. But, I did find a small error, so try 0.5.1a on dropbox and let me know. This should resolve the problem, or at least generate a different error, and that would probably be enough to nail this down.

Page 8 of 35 1 ... 5, 6, 7, 8, 9, 10, 11 ... 35

Who is online

Users browsing this forum: No registered users and 2 guests