User Tools

Site Tools


operations:rpiips

IPSPi1Hb: Raspberry Pi Internet Power Switch

An Internet Power Switch (IPS) has been built for Mt Pleasant. Its main purpose is to provide remote and local control of power to a small cluster in the computer room. This can be operated from the front panel of the device or remotely via a terminal window. There are also several Remote Switches which plug into a wall socket and allow remote control of a single device via WiFi. Software on the IPS allows for control of these devices.

Hardware consists of a Raspberry Pi PC inside the IPS, connected to two relay boards for managing power switching and a custom-made circuit board primarily for managing input from front-panel buttons and displaying switch status on the panel.

Software running on the Raspberry Pi consists of four programs:

  1. A front-end program, SwitchInterface.py, runs from a terminal window. Multiple instances can be run at once. It provides a user interface for monitoring and control of the rack-mounted IPS and all available Remote Switches.
  2. Behind this is RemoteRelayServer.py which runs a MQTT server and manages input from buttons on the front panel of the IPS. The MQTT server accepts requests from SwitchInterface.py and from the Remote Switches. The Remote Switches are designed to have their WiFi switched off for most of the time to keep radio interference to a minimum, but report in once per minute (or at another configurable interval). RemoteRelayServer.py manages requests to switch this device and sends any update commands to the Remote Switch whenever it checks in on the network.
  3. RemoteRelayServer.py Interacts with the hardware in the rack-mounted IPS. It takes commands via MQTT from RemoteSelayServer.py and actually switches the corresponding relay. It also controls the LEDs that indicate status of the switches. The circuit board also has three temperature and humidity sensors attached and this software logs their values every minute to a SQL database.
  4. IPSTHServer.py provides temperature and humidity data to MONICA on request

The Remote Switches have Arduino-compatible ESP8266 NodeMCU microcontrollers to manage a single relay switch. Each microcontroller runs software to manage the relay, WiFi connection, MQTT communication, a local button and some LEDs. When powered on it will connect to the local WiFi network if configured or start up as an access point if not, allowing a local connection for initial configuration (which is saved to non-volatile memory for next time). The software is in the Arduino directory, called RelayControl.ino.

Network

Mount the SD card.

Enable ssh: touch /Volumes/boot/ssh

IP address: 131.217.63.5 hostname: ipspihb

interface eth0 static ip_address=131.217.61.28/26 # /26 = netmask of 255.255.255.192 static routers=131.217.61.1 static domain_name_servers=131.217.0.19

/home/www/auscope/opswiki/data/pages/operations/rpiips.txt · Last modified: 2019/04/16 22:44 by Jim Lovell