Page 1 of 35

Phidgets Plugin Discussion

PostPosted: Sat Dec 24, 2011 6:44 pm
by berkinet
A holiday gift for Phidgets owners. I have started work on a Phidgets plugin and am now able to read the data stream from an 8/8/8 Interface Kit. There is still a lot of work to do. But, I am hoping to have a bare-bones beta out next week.

The first release will be limited to the 8/8/8 controller and a few common analog sensors, and maybe digital inputs and outputs. If you have a specific sensor you would like to see supported let me know (post here or via PM) and I will try to get those sensors done earlier.

Once the 8/8/8 (and similar Interface Kits)) are done I will start working on other stand-alone Phidgets. The RFID reader will probably be next. Again, let me know what you'd like to see, and I'll see if I can accommodate your requests.

Re: Phidgets Plugin

PostPosted: Sat Dec 24, 2011 7:29 pm
by matt (support)
Awesome! Maybe Santa will leave a Phidgets controller in my stocking tonight and I can try it out. Merry Christmas!

Progress report

PostPosted: Sat Dec 31, 2011 2:36 pm
by berkinet
The Phidgets plugin code is now stable enough, and with sufficient functionality to be shared with a small number of beta testers.

The plugin currently supports all interface kits (but only tested with the 8/8/8), digital inputs, digital outputs and few sensors, temperature, light and temp/humidity. Other than adding support for additional sensors, the next Phidget I will add is the RFID Reader. That should be done next week.

If you use your Phidgets to keep small animals alive or other mission critical tasks, I would not suggest you run the beta in place of your current interface. But, you should be able to run it along side whatever you are doing currently.

The plugin currently only supports the Phidgets Webservice (local or remote) and is event driven (no polling required. Here is a screenshot of the devices window:
Screen Shot 2011-12-31 at 12.33.23 .png
Screen Shot 2011-12-31 at 12.33.23 .png (41.53 KiB) Viewed 9650 times

Please PM me if you would like to test the plugin and also let me know if there are specify sensors you would like to have added.

Re: Phidgets Plugin

PostPosted: Sat Aug 11, 2012 7:47 am
by philc
I'm interested in this plugin...mainly because Insteon devices are so dang expensive. Deploying a light/temperature/humidity sensor network throughout the house with Insteon devices can easily climb into the multiple thousands. Phidgets, on the other hand, look like a much less expensive way to deploy a sensor network.
Any update on where you might be with this one? I'm kinda chicken/egg on this one...would like to get Phidgets to try them out, but sorta pointless unless there's a solid way to make it work with Indigo. If you're committed to getting this going, I'll commit to purchasing some hardware to test it.

Re: Phidgets Plugin

PostPosted: Sat Aug 11, 2012 11:30 am
by berkinet

#1...The Phidgets plugin works and is stable for the basic sensors you have noted (light/temperature/humidity). It will probably work with any sensor that hooks up to an Interface Board, but most have not been tested, although they are supported in the plugin.

#2... There are 3 or 4 people, other than me, using the plugin. I believe one has it working, but I have not heard back from the others, so I am not sure if they have had problems.

#3... There may, unintentionally, be some dependencies to my own installation as a by-product of the development process. I think I have resolved most of these, but there could be a few other issues.

#4... I am away from my Phidgets installation for another 3 months. This means only the most basic support will be available. I will not be able to do more serious development, or fix complex issues.

However, I think you should be able to get the basic setup you want working in a stable and reliable manner. I will certainly work with you to resolve any problems you ,might encounter that can be addressed while I am away from my development system.

Now, as far as which controller to buy. I would suggest you take a serious look at the SBC2. It costs around 2x what the 8/8/8 costs. But, the ability to just plug it into the network anywhere you want is worth a lot. Otherwise, (if you use a USB board) you may end up running a lot of wires through your house back to your Mac. Also, since the SBC2 is essentially a Linux box, you can run lots of other software on it.

If you decide to proceed, and I hope you do, PM me with your email address and I will send you a link to the plugin.

Re: Phidgets Plugin

PostPosted: Sun Aug 12, 2012 4:43 am
by philc
Appreciate the quick feedback!

I am sold on going forward, but I'll have to polish the sales pitch to CINCHOUSE. We have a tasking priority mismatch (CINCHOUSE #1 - remodel downstairs powder room), so the marketing on this one is going to take me a while.

I agree with the SBC2 sentiments. Seems like I could mount one of those upstairs (closet ceiling, attic probably gets too hot), deploy the sensor network upstairs, and just have one ethernet cable going up through the wall in the stairwell. Probably mount another one in the basement and run the sensors to the first floor up from there. Forgive my lack of imagination, but I'm trying to figure out what else I could do with that little Linux box. Might help the marketing pitch to be able to "sell" it with multiple functionalities.


Re: Phidgets Plugin

PostPosted: Sun Aug 12, 2012 7:13 am
by berkinet
Well, for me the killer WAF app was to add sensors to our espresso machine so I know when the boiler is at pressure and the group heads are at temperature, and can then make an announcement that it is safe to get out of bed.

BTW, you can also use the SBC2 over Wi-Fi by connecting it to an AirportExpress (extend a wireless network).

As for linux apps. Well, you can use the SBC to connect serial devices and then forward the serial connection over your LAN. You can also easily run programs locally on the box that interact with Indigo using the RestfulAPI. SInce the SBC includes a USB hub, you can then monitor and forward data from virtually any USB device - think presence detection and USB controlled devices. Also, don't forget that the SBC has 8 digital output ports, so you can operate garage doors, alarms, or whatever you can interface to with a simple circuit closure or relay.

I have posted separately about using a relay closure and digital-input to create an Indigo device out of almost anything you can interface to.

Please post your ideas back to the forums, I am sure others will be interested, and you may inspire some new ideas as well.

Re: Phidgets Plugin

PostPosted: Tue Sep 11, 2012 6:25 am
by tricksel
Hi Berkinet,

A little curious; would the Phidget RFID be in some pipeline for the plugin? Looks seriously good!

Re: Phidgets Plugin

PostPosted: Tue Sep 11, 2012 6:48 am
by berkinet
Phidget RFID is already supported. However, there is no application layer support, the plugin just updates the RFID tag state of the RFID device and writes to the log. You would then need to trigger off changes in the device tag state and invoke some additional software to do anything useful... Like open a door. (You could also tail the log file and look for tag reads in a shell script.)

Note that Indigo does not (yet) support argument passing from triggers. So, the software that is invoked by the trigger would then need to read the tag value from the device. Also note, since custom plugin device scripting is not supported in AppleScript, you would need to create the interface software in Python.

Re: Phidgets Plugin

PostPosted: Mon Sep 24, 2012 11:06 am
by Yves1922

I have a "1048_0 - PhidgetTemperatureSensor 4-Input"
Is there a plugin for this board?


Re: Phidgets Plugin

PostPosted: Mon Sep 24, 2012 11:19 am
by berkinet
Yves1922 wrote:
...I have a "1048_0 - PhidgetTemperatureSensor 4-Input"
Is there a plugin for this board?

Yes, the 1048 is supported by the plugin. However, at this time only the 4 inputs are supported, not the 5th on-board sensor.

Re: Phidgets Plugin

PostPosted: Mon Sep 24, 2012 11:57 am
by Yves1922
Great, from where do I get the plugin?

Thx Berkinet

Re: Phidgets Plugin

PostPosted: Mon Sep 24, 2012 12:09 pm
by berkinet
Yves1922 wrote:
Great, from where do I get the plugin? ...

Re: Phidgets Plugin

PostPosted: Mon Nov 05, 2012 11:39 pm
by screen
Hey Berkinet, This plugin looks great. I just got my 2/2/2 (1011_0) InterfaceKit and am trying to hookup a light sensor (1127). I've run into a little plugin error that is preventing me from fully configuring the sensor device. In the 'Edit Device Settings' window I select the InterfaceKit and then press 'Click to Continue', this is when the following python casting error is thrown:

Code: Select all
  Phidgets Error                  Error in plugin execution UiAction:

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

Since I know you are using sensors with the 8/8/8 and you don't have the 2/2/2 it's probably a bug related to a difference between the two. With verbose debugging on I see that ifKitSensors is a blank string. Here's the interface pluginProps from a reload:

Code: Select all
model : Phidget Interface Kit
name : Phidgets 2/2/2 InterfaceKit
pluginId : com.perceptiveautomation.indigoplugin.Phidgets
pluginProps : com.perceptiveautomation.indigoplugin.Phidgets : (dict)
     ifKitCommType : IP (string)
     ifKitConfig :  (string)
     ifKitDigitalInputs :  (string)
     ifKitDigitalOutputs :  (string)
     ifKitIpAddress : (string)
     ifKitIpPort : 5001 (string)
     ifKitModel : 1011 (string)
     ifKitSensorRateMax_0 :  (string)
     ifKitSensorRateMax_1 :  (string)
     ifKitSensorRateMax_2 :  (string)
     ifKitSensorRateMax_3 :  (string)
     ifKitSensorRateMax_4 :  (string)
     ifKitSensorRateMax_5 :  (string)
     ifKitSensorRateMax_6 :  (string)
     ifKitSensorRateMax_7 :  (string)
     ifKitSensorRateMin_0 :  (string)
     ifKitSensorRateMin_1 :  (string)
     ifKitSensorRateMin_2 :  (string)
     ifKitSensorRateMin_3 :  (string)
     ifKitSensorRateMin_4 :  (string)
     ifKitSensorRateMin_5 :  (string)
     ifKitSensorRateMin_6 :  (string)
     ifKitSensorRateMin_7 :  (string)
     ifKitSensorTrigger_0 :  (string)
     ifKitSensorTrigger_1 :  (string)
     ifKitSensorTrigger_2 :  (string)
     ifKitSensorTrigger_3 :  (string)
     ifKitSensorTrigger_4 :  (string)
     ifKitSensorTrigger_5 :  (string)
     ifKitSensorTrigger_6 :  (string)
     ifKitSensorTrigger_7 :  (string)
     ifKitSensors :  (string)
     ifKitSerial : 259367 (string)
     ifKitSerialPort :  (string)
     phLabel1 :  (string)
     phLabel2 :  (string)
     phSeparator1 :  (string)

edit: I've traced backwards and see that this error may stem from another error when editing the settings of the Interface. When I press 'Read IfKit Config', which I believe should populate the ifKitSensors string, I get the following error:

Code: Select all
  Phidgets Debug                  typeId:
  Phidgets Debug                  devId:
  Phidgets Error                  Error in plugin execution UiAction:

Traceback (most recent call last):
  File "", line 561, in readIfKitConfig
<type 'exceptions.AttributeError'>: 'str' object has no attribute 'isAttached'

I am attempting to run my Interface over IP initially. I'll move it over to a direct USB connection and see if I have the same problem. I did see a hardcoded IP in the readIfKitConfig function but I'm not even executing that far.

Re: Phidgets Plugin

PostPosted: Mon Nov 19, 2012 12:39 am
by screen
I realize that there is no USB support yet so I never did get this working properly. I tried setting up an applescript based poller for my light sensor but about once a day the driver freaks out and I have to kill it to get Indigo responsive again. Is the last link posted the latest version of the beta plugin?