Controlling BOINC with household programmable thermostat?

Message boards : BOINC client : Controlling BOINC with household programmable thermostat?
Message board moderation

To post messages, you must log in.

AuthorMessage
Lawrence Wade

Send message
Joined: 13 Nov 19
Posts: 2
Canada
Message 93696 - Posted: 13 Nov 2019, 23:19:33 UTC

Hi Everyone!

Thanks for BOINC. I am glad to contribute my CPU cycles to good causes.

I live in Ottawa, Canada; our city experiences very cold winters. My home is very energy efficient - and, in fact, due to solar load I often have to keep my air conditioner running into October. My home is heated with electric baseboard heaters, but they only cycle on during the coldest winter days. There is no practical possibility of installing heat pumps, so please do not suggest them.

There are several computers running at all times in my home, and during the summer months I do not allow BOINC to run at all as it heats my home, so my computers use very aggressive power management settings during Ottawa's hot and humid summers.

My theory is that my electrons can do something useful on their way to becoming heat, and 1500W of electric heat is the same whether it comes from baseboards or CPUs. It costs my wallet and our planet the same amount regardless.

https://boinc.berkeley.edu/wiki/Heat_and_energy_considerations

I have a programmable thermostat designed for a conventional gas or oil furnace on my wall; the R-W terminals operate as a switch which, when closed, is the "Call for Heat" signal to the furnace. With my current system, I could easily use the R-W terminals to hold the serial (COM1/COM2) port's status lines like DSR high during a Call for Heat and low any time the thermostat is satisfied.

(NOTE: do NOT connect a computer's serial port directly to an existing thermostat. However, it would be easy to use an optocoupler to detect an existing thermostat's Call for Heat signal so that DSR or similar is held high ONLY when the existing heating system is running.)

RS-232 serial seems ideal since the signalling voltage is +/-12V allowing for relatively large distances between the "master" host and the thermostat, serial ports are legacy devices but are simple and likely to remain relatively common for the next few years due to their industrial uses, serial ports tend to incorporate relatively robust electrical interfaces, and serial ports require only trivial external hardware to detect the status of a switch position.

Let's say my baseboard heaters are untouched but set to click on at 18C. Let's say that my programmable thermostat is set to maintain 21C. That way, my home is held at 21C and primarily heated by BOINC. If my computers fail to keep up (ie. crashed, failed, no work units, or just a really cold night), my home and my pipes will not freeze because the baseboards have clicked on. Redundancy must be considered and must use existing building-code-approved and unmodified heating systems because the loss of heat can cause catastrophic damage to a building in a cold climate.

Those familiar with HVAC will recognize this as a multistage heating system; typically the first stage in such a system is a heat pump (not practical in my home) and the second stage is backup direct electric heat.

The physical interface between the thermostat and the serial port of one computer is easy and I will document the construction of adapters which will work as an adjunct to an existing heating system, but here's what I need help with:

There are n computers on my LAN, running a variety of operating systems and hardware platforms which support BOINC. They all have a variety of non-elective tasks to do. These n computers on my LAN need to pause and unpause their BOINC calculations based on an on/off switch connected to an unused serial port of one arbitrary machine. My hope is for a relatively fine-grained (within, let's say, 5 minutes or better) system where DSR goes high and all the hosts on my network start computing (and heating!), DSR goes low and all the hosts on my LAN pause computing. Existing BOINC controls for CPU load and such must still be respected; I have these computers running because I need them for my own tasks.

The thermostat I use is inconsequential and likely to vary greatly among BOINC contributors with a similar situation. Mine is a Honeywell CT3500. Call for Heat means the R-W contacts are closed.

Think of it as a light switch connected to the serial port of one machine on my LAN. I turn it on, and my computers use all their idle CPU time for BOINC. I turn it off, and all my computers pause BOINC within some reasonable housekeeping time frame (I don't want them to lose the work they've done). All I want is for BOINC on my LAN to start and stop with a switch on the serial port of one host.

Is there some elegant way to control multiple LAN-connected BOINC clients in this way?

My electrical load is directly tied to my heating load during the winter months. Whether my electric heating comes from burning coal or hydroelectric dams or from an RBMK nuclear reactor, my goal is to minimize the electrical load on the grid and therefore the environment. And if I have to use electricity to heat my home, I'd like it to mean more to the planet than running a resistor.

There must be more than a few electrically-heated places with lots of computers who could benefit BOINC and other distributed computing projects by throwing at least some of their heating energy through silicon rather than nichrome. I think, for example, of a local college which has electrical baseboard heat in a CAD design classroom. On a cold winter night, why are baseboard heaters on and CPUs idle?

What does everyone think?

Thanks,

Lawrence Wade
Ottawa, Canada
ID: 93696 · Report as offensive
Profile Keith Myers
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 17 Nov 16
Posts: 869
United States
Message 93709 - Posted: 14 Nov 2019, 19:49:52 UTC - in response to Message 93696.  

Seems like you are overthinking things. Just have your computer normally in suspended state until you have your RW contacts send on a Wake-on-Lan signal to your computers to come out of hibernation and start crunching to generate heat. You can generate the WOL command with a Raspberry Pi for example. When the thermostat RW contacts open after reaching its setpoint, send the suspend command to the computers.

But you could do all the above with just the RPi by sending SSH commands since it is already on your network. The WOL command is handy for remoting into your network from outside. But really isn't necessary since your system is an internal closed-loop control configuration.
ID: 93709 · Report as offensive
Lawrence Wade

Send message
Joined: 13 Nov 19
Posts: 2
Canada
Message 93710 - Posted: 14 Nov 2019, 20:55:24 UTC - in response to Message 93709.  

Seems like you are overthinking things. Just have your computer normally in suspended state until you have your RW contacts send on a Wake-on-Lan signal to your computers to come out of hibernation and start crunching to generate heat. You can generate the WOL command with a Raspberry Pi for example. When the thermostat RW contacts open after reaching its setpoint, send the suspend command to the computers.

I like what you suggest, but these machines are not purely space heaters. They do other things on my LAN, and I need them to be running.

renice won't work either, because that doesn't change the CPU load, it only changes the priority to the kernel's scheduler.

So, again, what I need is one light switch to start and stop the BOINC clients on n hosts. That's it.

I can come up with a way to make a lock file based on the status of the serial port (or some other interface), but then I have to export by NFS (and possibly Samba for Windows hosts) that lock file to n computers running BOINC clients. This already sounds like a logistical and security nightmare, and I don't know that it will even gracefully shut down BOINC - I want it to pause and not lose the work it was doing.

If BOINC checked an arbitrary website (in this case 192.168.x.y) every 60 seconds to see if it had permission to run, that would be ideal. An option:

$ boinc --check_thermostat 192.168.x.y:80/run_boinc.txt

run_boinc.txt could also set many parameters, from interval between checks to project choices to shutting down all BOINC activities as soon as the air conditioner turns on. This could allow BOINC to be easily scaled to huge numbers of hosts on the same LAN and with their behaviours consistent with the goals of the organization donating CPU cycles to BOINC.

I dunno. This is why I am asking this community of BOINC developers and fellow BOINC fans.

BOINC has many, many options. Is there something I can use to do what I would like to do?

Light switch on: All BOINC clients on my LAN are crunching numbers for the projects I have chosen and within the settings I have defined per host.
Light switch off: All BOINC clients save their work, lose none of their work, and pause BOINC but remain available for other tasks.

Thanks, everyone!

Lawrence
ID: 93710 · Report as offensive
MarkJ
Volunteer tester
Help desk expert

Send message
Joined: 5 Mar 08
Posts: 272
Australia
Message 93736 - Posted: 16 Nov 2019, 3:43:12 UTC

If you could write something to pass the on/off to the system you probably could just use boinccmd to suspend processing. Maybe just touch a file for the “on” event and have a script that checks if the file exists every 5 minutes or so and then issue a boinccmd to resume or suspend.

One drawback would be if BOINC stays suspended for a couple of weeks then tasks will time out so you’d need to somehow finish off the work on hand when you transition from winter (heating mode) to spring or summer.
MarkJ
ID: 93736 · Report as offensive

Message boards : BOINC client : Controlling BOINC with household programmable thermostat?

Copyright © 2024 University of California.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.