Skip to content

Distributed proxies

ggodart edited this page Jan 5, 2021 · 1 revision

There are several reasons you might want to run one or more extra proxy versions of MisterHouse:

  • Allows the real real MisterHouse to not pause while reading or writing to slow interfaces (e.g. X10 CM11, CM17, or iButton).
  • You can monitor and control remote serial ports. For example, an old PC running MisterHouse in a barn, or an internet connected PC in a vacation home.
  • Sharing of interfaces between different MisterHouse boxes. For example, you can run a test version of MisterHouse to debug new code without buying a 2nd interface.
  • Use small, quiet, low power PC's in different rooms to distribute speech from your main MisterHouse with the speak rooms= parm, using ethernet instead of a relay / PA wiring scheme.
  • Wean yourself off of one OS onto another, sharing ports from your old computer to the new one.

To run a proxy MisterHouse, copy and modify the mh/bin/mh_proxy.ini and mh_proxy (unix) or mh_proxy.bat (windows) files. Then run mh_proxy. If you have tk installed, you may want to run mh_proxy -tk 1 while debugging.

Another option, instead of running a simple pruned down MisterHouse with mh_proxy, you can also simply run a 2nd normal version of MisterHouse, and simply include the proxy code dir in you mh.ini code_dir parameter and add the server_proxy_port parameter. For example:

 code_dir = c:/misterhouse/my_code,c:/misterhouse/mh/code/proxy
 server_proxy_port = 8085   # Used by the proxy_server.pl

On your main MisterHouse box, change your mh.ini port parameter to point to the address:port of the proxy box, like this:

 cm11_port           = proxy localhost:8085
 cm17_port           = proxy localhost:8085
 iButton_serial_port = proxy localhost:8085

You can start or restart either the main MisterHouse or mh_proxy before or after the other one and they should sync up. Tested interfaces include cm11, cm17, iButton, weeder, mr26, wx200 weather, modem, netcallerid, and ham tnc.

If you want to put an iButton port on a proxy, you will need to also run a code file on the proxy that defines all the iButtons you will use on that port. These iButton item names must match those on in your real code on your main MisterHouse box. One way to do this is to share the same iButton.pl code file on your proxy as you use on your main MisterHouse box, using the mh.ini/mh.proxy.ini code_dir and load_code parameters. For example:

Main MisterHouse:

  code_dir  = c:/misterhouse/bruce

Proxy MisterHouse:

  code_dir  = $Pgm_Root/code/proxy,c:/misterhouse/bruce
  only_load = proxy_server.pl,ibutton.pl

If you want to distribute speech to mh_proxy machines, see mh/code/public/speak_proxy.pl for example code.

Clone this wiki locally