Close

Making the rack 'smart'

A project log for Raspberry Pi Rack for the Pi 4

A 3d printed enclosure to house multiple Pis, updated for the Raspberry Pi 4

dave-peduDave Pedu 10/11/2019 at 21:150 Comments

I've been playing with the idea of making the Raspberry Pi enclosure smart - that is, giving it features beyond being a dumb power distribution plane. Specifically, adding some degree of out-of-band management. This kind of system management - also called lights-out or sometimes ipkvm, allows you to manage the device as if you were physically interacting with it. For this project, this would translate to something like power management and remote serial.

A frequent problem for servers is the administrator making some change that locks out all users, including themselves. Common causes of this are breaking ssh, the network configuration, or network login related things. But another cause can be a crash or freeze of the system. In this situation, you need physical access to the server to either cycle power to reboot it from the crash, or log in using a physical keyboard and monitor. This is an obvious problem if you are not nearby the device.

Out-of-band management solves this problem. It allows you to access the console and control server power over an internet connection. 

The Raspberry Pi has a lesser-known feature called the Serial Console. This kind of interface is extremely common in computing devices - almost every motherboard has this feature, sometimes coupled with serial-over-ip. Other electronics, such as wireless routers, use them as a debug port. Enabling this feature turns 2 pins on the raspi's GPIO header into serial rx/tx pins that the operating system can read or write. While you can technically do anything using this port within the OS, the most common use is, again, the serial console. Linux is able to present a login and command prompt that keystrokes, transmitted over serial, interact with. It ends up being very similar to a normal ssh console. There's more info about how to set up and use this feature over here.

So what does all this mean for this project? Initially, nothing. It's an add-on idea I may pursue afterwards. But here's how it would go:

The tray holding each pi would gain 2 more connections that route through the connector into the backplane. On the backplane there would be serial connections for however many Pis you have. Dealing with this many serial ports would be inconvenient, so I need to design some multiplexing circuitry. Some brief research and queries in the Freenode #arduino chatroom suggests that CMOS logic 'and' gates will do the trick here. ANDing the serial signal with a control signal effectively lets you multiplex a serial line.

The backplane is where this multiplexing circuitry would reside. There would be some kind of microcontroller that can operate the serial multiplexer and read/write data. This microcontroller could also control relays to control power to each individual Pi.

The last question is how the user will operate this system. It should be over an IP connection, so an ethernet interface is probably the best option. Another option would be the classic esp8266, but I want to avoid using wifi. Hard-wired connections are simply more stable. I've seen ethernet shields for arduino. Once the microcontroller has an IP connection, it should be possible to build a simple telnet interface 

So, to summarize - I think it would be a really interesting project to add a control plane to this rack. It would provide a telnet over IP connection that could be used to access individual pi's serial console and power on/off individual Pis. 

Also, for a quick update - I'm about half done modeling the rack. I still need to add cuts to separate it into easily 3d printable parts and add various mounts for assembly and circuitry and the like.

Discussions