Phidgets Plugin Discussion

Posted on
Mon Feb 05, 2018 11:38 pm
gtreece offline
Posts: 169
Joined: Sep 26, 2011

Re: Phidgets Plugin Discussion

BlaineM wrote:
gtreece wrote:
Just want to clarify that the phidgets library 21 requirement is meaning the libraries installed on my Indigo Mac, and not the libraries installed on the SBC? Wanting to know if I can a) safely apply updates to my SBC, and b) continue to buy SBC units without fear of them not working...

Yes, it's strictly the Mac that Indigo is running on. Can't speak to the updates you want to apply to the SBC, but a brand new out-of-the-box SBC will work as is against Indigo running 2.1 libraries and the Phidgets plugin.


When I log into my SBC, it has been showing phidget library 22 available for some time in the package list (along with many other packages). I went ahead and upgraded it tonight, and all appears well. The 8/8/8 on my SBC is starting to die randomly, and I'm sure it's due to heat issues of some sort. The SBC is running, but the 8/8/8 stops showing as available. It's in a harsh environment, so it doesn't surprise me, so I wanted to be sure if I order a replacement, that it will still work. Thanks for the reply.

Posted on
Tue Feb 06, 2018 1:21 am
berkinet offline
User avatar
Posts: 3063
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Phidgets Plugin Discussion

gtreece wrote:
...When I log into my SBC, it has been showing phidget library 22 available for some time in the package list (along with many other packages). I went ahead and upgraded it tonight, and all appears well. ....

Actually, you did not upgrade the Phidgets libs to 2.2. You added the 2.2 libs and are now running both. Had you deleted the 2.1 libs the plugin would have ceased to work.

For others who may have the same question: The phidgets plugin requires the phidgets 2.1 libs. Period. These libs must be running on any CPU that is hosting phidgets modules - that applies to the SBC, a Raspberry-Pi, Windows or Mac box. However, you may optionally run the 2.2 libs along side the 2.1 libs if you wish.

Posted on
Tue Feb 06, 2018 10:27 am
gtreece offline
Posts: 169
Joined: Sep 26, 2011

Re: Phidgets Plugin Discussion

berkinet wrote:
For others who may have the same question: The phidgets plugin requires the phidgets 2.1 libs. Period. These libs must be running on any CPU that is hosting phidgets modules - that applies to the SBC, a Raspberry-Pi, Windows or Mac box. However, you may optionally run the 2.2 libs along side the 2.1 libs if you wish.


Got it. Thanks for the clarification and thanks for the plugin. After the initial setup a few years ago, been ticking along great, and is allowing me to monitor and control my greenhouse without putting a full computer out there. Currently using it to monitor temp and humidity in the greenhouse, soil temp and soil moisture in the garden, and control a water valve to run misters in the greenhouse to cool it down. I may expand on that some this year, and try automating opening and closing of the greenhouse door and vents. I'm working right now to use a thermocouple to track when the heater turns on and off to calculate how much run time it has so I can predict propane tank changes better, based on overnight low temps.

Posted on
Thu Feb 08, 2018 2:20 am
gtreece offline
Posts: 169
Joined: Sep 26, 2011

Re: Phidgets Plugin Discussion

Sorry, another question.

With the 8/8/8 on my SBC pretty much dead, I moved some sensors off of it and onto the second 8/8/8 that is hooked up to the SBC. I've had both running the whole time, just had some sensors on one and some on the other.

I immediately noticed problems, in that sensors that had been giving reliable numbers previously, no longer were when connected to the other interface board. It seems to be related to the 'ratiometric' setting for the interface board, which is a setting that is per board, not per sensor. Some of my sensors are ratiometric and some are not.

After a little fiddling tonight, I have two questions:

1) is it possible at all, that the ratiometric setting on an interface board device, is actually backwards? I seem to be getting backwards accuracy based on that checkbox in the interface device setup.

2) is it possible to change the ratiometric setting, grab a sensor value and stuff it into a variable, and then change it back? For example, an every 5 minute schedule that toggled the ratiometric setting, updated a variable based on a particular sensor value, then toggled the ratiometric setting back.

I think my long term solution is to get back to two interface boards, with one set to ratiometric and one not, but wondering about the above in the short-term.

Posted on
Fri Feb 09, 2018 10:45 am
berkinet offline
User avatar
Posts: 3063
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Phidgets Plugin Discussion

gtreece wrote:
...
1) is it possible at all, that the ratiometric setting on an interface board device, is actually backwards? I seem to be getting backwards accuracy based on that checkbox in the interface device setup.

2) is it possible to change the ratiometric setting, grab a sensor value and stuff it into a variable, and then change it back? For example, an every 5 minute schedule that toggled the ratiometric setting, updated a variable based on a particular sensor value, then toggled the ratiometric setting back

1) It is possible, but I don't think so. You can check the state of the Ratiometric setting in the Phidgets control pane
2)That might work and you might try it. However, the plugin receives broadcasts of changes, so you'd have to wait until the next update before changing back.

FWIW, I think your proposal for 2 8/8/8s makes the most sense.

Posted on
Fri Feb 09, 2018 3:11 pm
loafbread offline
Posts: 129
Joined: May 25, 2009

Re: Phidgets Plugin Discussion

I had to replace a failed Phidgets 8/8/8 and it seems that I have to delete and redefine each attached device. Does that make sense? I am hoping there is a way to make Indigo recognize the old devices that were created for the previous 8/8/8. I have a lot of dependences on each device and it will take a lot of editing if I can't find a way to get the system to recognize things. The Phidgets is attached to a Raspberry Pi. When I put the new phidgets in, I just changed the serial number in the Interface Kit definition.

Thanks for such a great plugin. I have three Raspberry Pis with 8/8/8s attached. They have been working for years.

Posted on
Sat Feb 10, 2018 8:56 am
berkinet offline
User avatar
Posts: 3063
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Phidgets Plugin Discussion

loafbread wrote:
...I am hoping there is a way to make Indigo recognize the old devices that were created for the previous 8/8/8. I have a lot of dependences on each device and it will take a lot of editing if I can't find a way to get the system to recognize things.....

Unfortunately, there is no direct way to do what you want. Sensor “devices” are not really devices but are actually aliases for the ports on the interfaceKit. If you are comfortable with the shell and a unix editor you might try modifying the plugin’s saved preferences by hand. But, I have actually never done that and it might not work.

Posted on
Sun Apr 29, 2018 5:22 pm
landry offline
Posts: 16
Joined: Jul 30, 2017

Re: Phidgets Plugin Discussion

Hi Berkinet

Its been a while since I have been on the forum so that means Im having no problems or I'm not trying anything new yet. Thanks for the great plug in. After my solar hot water project, I am now starting to build my own phidget run weather station...hopefully a better mousetrap! I have contacted Boisy at wether scoop an he is writing an update for is WeatherSnoop plug in so his WeatherSnoop program can get the data published so this would not be just a selfish endeavor.

My question is regarding the phidget 1054 frequency counter. I have ordered this to play with since this will be the interface with my tilting bucket rain sensor.
The phidget interface shows a reset button that can be used restart the count which is necessary for precipitation reporting. My plan is to run a Python script within Indigo to activate the reset on scheduled time bases. Will I be able to do this or does script have to be running on the phidgetsbc.?

If I can do it within Indigo. any suggestion s how to write the script to access the button would be greatly appreciated. Scheduling i can handle.....I just want to push that button.

Thanks for any input Berkinet..and anyone else that doesn't have the urge to say don't touch that button!

Posted on
Tue May 01, 2018 6:48 am
berkinet offline
User avatar
Posts: 3063
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Phidgets Plugin Discussion

landry wrote:
...I am now starting to build my own phidget run weather station...hopefully a better mousetrap! I have contacted Boisy at wether scoop an he is writing an update for is WeatherSnoop plug in so his WeatherSnoop program can get the data published so this would not be just a selfish endeavor.

Great project. I'll be interested in the outcome.

landry also wrote:
My question is regarding the phidget 1054 frequency counter. I have ordered this to play with since this will be the interface with my tilting bucket rain sensor.
The phidget interface shows a reset button that can be used restart the count which is necessary for precipitation reporting. My plan is to run a Python script within Indigo to activate the reset on scheduled time bases. Will I be able to do this or does script have to be running on the phidgetsbc.?

If I can do it within Indigo. any suggestion s how to write the script to access the button would be greatly appreciated. Scheduling i can handle.....I just want to push that button.

Thanks for any input Berkinet..and anyone else that doesn't have the urge to say don't touch that button!.

Well, what you really want is a count rather than a frequency. The 1054 might still do what you want, though, I need to look into how to reset it programmatically. I don't think the plugin supports that function. I will see how much work it would take to add it. However, since all you want is a count, you could probably achieve that just using a digital input on the SBC/InterfaceKit and then make a trigger that fires every time the input has any change. The action would be to increment a variable. Total rain could be maintained by another trigger that fired on any change in the counter variable and multiplied the counter value by whatever the quantity of rain causes the gauge to tip... then store that value in another variable. Resetting would just be an action to set the two variables to zero.

Posted on
Tue May 01, 2018 5:01 pm
landry offline
Posts: 16
Joined: Jul 30, 2017

Re: Phidgets Plugin Discussion

Hi Berkinet

Ah the power of Indigo..nice suggestion Berkiet.

I know your suggestion will give rain totals over a period of time however weather stations also report real time rain rates (well almost realtime they usually poll every 25 seconds0. A freqeuency counter will report total time and pulses. Just by polling pulses and time, a rate can be calculated. I did check to see if the frequency counter can handle the rate range a tipping bucket will use, phidget claims very low frequency can be done (we'll with in the range of the tipping bucket specs) by setting the frequency max number on the control panel.

Not sure how time digital inputs in indigo without the frequency counter.

Posted on
Wed May 02, 2018 1:52 am
berkinet offline
User avatar
Posts: 3063
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Phidgets Plugin Discussion

landry wrote:
...Not sure how time digital inputs in indigo without the frequency counter.
Well, you could...
Run a schedule, say once a minute, that would read the current total rainfall and subtract it from the previous minute's total (and then save the new total as that last total). That would give you total rainfall per minute.

So, to summarize:
  • Create 5 variables: rainCount, rainFallTotal, rainFallLastTotal, rainFallCurrentMin
  • Create a trigger that fires every time the digital input has any change (I.e. the rain gauge has tipped)
    • The trigger action would be to increment rainCount.
  • Create a second trigger that fires on any change in rainCount
    • Multiply rainCount by whatever the quantity of rain causes the gauge to tip
    • Store the resulting value in, rainFallTotal
  • Create a schedule, say once every minute, that will subtract rainFallLastTotal from rainFallTotal
    • Save the result in rainFallCurrentMin
    • Optionally write rainFallCurrentMin to a file for graphing, etc.
  • Resetting would just be an action to set all 5 variables to zero

Posted on
Wed May 02, 2018 10:13 pm
landry offline
Posts: 16
Joined: Jul 30, 2017

Re: Phidgets Plugin Discussion

I copied you on all the variables needed to calculate rainfall data.

My only problem is understanding digital input with pulse signal. How do ai catch that pulse if the phidget input does not broadcast its state change to indigo.
writing a script to read the input state frequent enough to ensure that every transition on all the lines is captured, will eventually get erroneous data.

Analog is much easier, I just use time scheduled scripts to read the raw input and calculate values into the variable list and once the variable list is updated indigo activates the triggers.


without a frequency counter how does the phidget digital input update indigo? does the phidget control panel count have an inter face to count the pulses?

Posted on
Thu May 03, 2018 4:07 am
berkinet offline
User avatar
Posts: 3063
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Phidgets Plugin Discussion

landry wrote:
...My only problem is understanding digital input with pulse signal. How do ai catch that pulse if the phidget input does not broadcast its state change to indigo.... ...without a frequency counter how does the phidget digital input update indigo? does the phidget control panel count have an inter face to count the pulses?
In fact, InterfaceKit inputs do broadcast changes in the state of the digital inputs. First, you have to create a digital input device in Indigo. Then, the device you created for the input will change from on to off as a ground is connected or removed from the input.

Now, assuming your tipping rain gauge simply closes or opens a switch each time it toggles (tips) you just connect one-side of the tipping switch to ground on the SBC and the other side to a digital input. No you can trigger on any change in the onOff state of that input.

Posted on
Thu May 03, 2018 4:08 am
berkinet offline
User avatar
Posts: 3063
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Phidgets Plugin Discussion

landry wrote:
...My only problem is understanding digital input with pulse signal. How do ai catch that pulse if the phidget input does not broadcast its state change to indigo.... ...without a frequency counter how does the phidget digital input update indigo? does the phidget control panel count have an inter face to count the pulses?
In fact, InterfaceKit inputs do broadcast changes in the state of the digital inputs. First, you have to create a digital input device in Indigo. Then, the device you created for the input will change from on to off as a ground is connected or removed from the input.

Now, assuming your tipping rain gauge simply closes or opens a switch each time it toggles (tips) you just connect one-side of the tipping switch to ground on the SBC and the other side to a digital input. No you can trigger on any change in the onOff state of that input.

Posted on
Thu May 03, 2018 10:30 am
BlaineM offline
Posts: 25
Joined: Jan 13, 2012

Re: Phidgets Plugin Discussion

I'd just like to confirm that what Berkinet is suggesting is exactly how I've done the exact same thing with a tipping bucket rain gauge. I simply have a trigger on the state change of the digital input which then captures the state change. My own situation is a bit more complex in that I'm logging the 0.01" of rainfall of my particular gauge into a database for plotting purposes, but the variables could easily be used instead depending on your end goal. In my case, I had a requirement to see rainfall over time. I do have variables that track both lifetime and seasonal rainfall in addition to stuffing the event into a database. I reset the seasonal rainfall at the end of every July, but everything's in the database if I need to recreate anything.

Who is online

Users browsing this forum: No registered users and 0 guests