This is the mh client interface for my K8055 interface board daemon. Once you have created a K8055 object, you must tell it which input ports you are interested in using the doUpdate... methods.

  $k8055 = new K8055;
  if ($Reload) {

Whenever the value of these ports change, $k8055->state_now will return the name of the port that has changed (i.e. 'digital 4'). The state of each port is checked every 10 seconds (by default, can be changed).

Use the write... methods to change the value of the output ports.


K8055 daemon MisterHouse Interface http://www.velleman.be/ot/en/product/view/?id=351346




For one pass, will return the name of the input port that has just changed.

  if ($state=$k8055->state_now()) {
    if ($state eq 'digital 5') {
      speak "The digital 5 port just changed value";
    if ($state eq 'counter 1') {
      speak "Counter number 1 just changed";
    if ($state eq 'analogue 2') {
      speak ("Analogue port 2 now reads ".$k8055->readAnalogue(2));
readAnalogue, readDigital, readCounter

Returns the value of the given port as read on the last check.

  # returns the last read value of digital port 4
writeAnalogue, writeDigital

Sets the value of the output ports.

  # sets analogue port 2 to 143/255 x 5V (i.e. 0=0 V, 255 = 5 V).

Resets the given counter.

  # resets counter 2

Sets the debounce of each counter in milliseconds.

  # sets the debounce of timer 1 to 350ms
doUpdateAnalogue, doUpdateDigital, doUpdateCounter

Tells the object to care about the given port(s). If this command isn't called, then the corresponding read... method will always return -1 and the state variable will never be set.

  # read and monitor digital ports 2, 3 and 5

Sets how often we update the input port readings. Defaults to 10 seconds.

  # input ports will be read every 2 seconds.

Gets the current auto update period in seconds.

  print "current update period is ".$k8055->getUpdatePeriod()." seconds";

Immediate requests updated values from the ports that we are interested in. Note that the data will not immediately be available on return from this method as updates are asynchronous.



k8055_host - Hostname that is running k8055d.

k8055_port - Port on hostname to which daemon is listening.


Matthew Williams




This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.