lego (12) Linux (39) pi (20) Thinkpads (4)

Tuesday, 17 December 2013

My headless Raspberry Pi server [day 5 of 20-days-of-posts series]

Intention: To be used as a headless download server -- nzbget, transmission, http stream download, gdrive upload/download, etc.

  • No need for the VIDEO port (going to use HDMI)
  • No need for AUDIO jack (going to use HDMI)
  • Minimal need for HDMI; only for troubleshooting boot issues
  • No need to access camera port, GPIO pins, etc
  • Continued use of a 1.8/2.5" SATA drive for primary storage
The headless server will be connected directly to the router via ethernet (no need for wifi).  There is no need for a keyboard or mouse.  One USB port will be occupied with a connect to the hub.  The 2.5" SATA hard drive will be plugged into the powered USB hub.  The second USB port would be used for a keyboard when needed for troubleshooting.

Like with most of my lego projects, I don't provide full schematics and block lists.  My opinion is that if you have unused lego that you can use for a project like this, you make use of what you have, improvising as you go.

This is my "spruced" up Raspberry Pi, where I have integrated a rocker-style power switch (with reset butt) and integrated 7-port USB hub (Monoprice 7-port USB hub).  The hub is powered by a 2amp power brick.  The power brick is fairly slim -- in a power bar, it would prevent another brick being plugged into the plugs next to it, but it does provide enough clearing to allow someone to plug a power cable into adjacent plugs.  The hub will provide enough power (1amp) to power the Pi.  Unlike other high-powered USB hubs that I have tried, the hub will provide greater than 0.5amp to device connected to it even though there is no host connected to it.  This is critical.  A lot of other hubs I have tried, they will provide high-power to a USB device connected to the hub only if there is an established host connection to the hub.  Therefore, if you try to connect a Pi to the hub, it is not able to provide enough power to the Pi to start it up because there is no host connected to the hub.  The Pi needs to be powered up before it will establish a host connection with the hub.

With the Monoprice 7-port USB hub, the hub will provide enough power the usb connections to power the Pi up even before the host connection is established.  This is witnessed by a red light on the hub, which indicates it is powered on.  When the Pi itself is powered on and started, blue lights will turn on the hub to indicate connections of those devices to the host have been established.

The hub also prevents backpowering over USB if there is a USB cable connected to the micro USB power port on the Pi using any one of the powered USB ports on the hub.  This allow for a switch to actually work.  Without this ability, the power switch would be futile as the Pi would become powered on automatically via the host connection between the Pi and hub when the hub gets powered on.

The hub will provide 3 internal USB connections (used for things embedded into the lego case), 2 top USB connections and 2 USB connections along the same side as the Pi's USB ports.

First actions that were performed was the readying of the USB webmail notifier, (disassembling, cutting and resoldering the wires) described in a previous post.

Second actions that were performed was the readying of the USB hub.  The plastic case was removed, which was fairly simple enough.

Power Consumption:

Measured with a kill-a-watt meter, here are the power consumption numbers for this Raspberry Pi server.

Consumption (Watts)
USB Hub (idle) ~ 0 W
Raspberry Pi
w/ rocker power switch
w/ USB Hub
2.5 W
Raspberry Pi
w/ rocker power switch
w/ USB Hub
w/ 2.5" 5400rpm Hard Drive
5.5 W (idle)
6 - 6.5 W (spin up)

Front-side view



Like the original server-pi case I constructed previously, I have a 2.5" HD drive bay for which I provide ventilation lego bricks.  You can see where the deconstructed hub sits, right on to of the Pi.  The left inset window shows the lights from the hub (red and blue).  The right window where I have situated one of the deconstructed USB WebMail Notifier LED lights.  It is plugged directly into a USB port on the hub (one of three that are "internal", obstructed by the lego case).

Not much to see from the front side view; no special windows or openings.  The ventilation holes are for 2.5" SATA hard drive.  The bottom extends out 1 lego brick outward to accommodate the 2.5" hard drive being wider than the size of the Raspberry Pi.

The video and audio ports are intentionally inaccessible.  The Raspberry Pi LEDs are also covered.

The height of the original case was 5 blocks.  The revised case uses 7 blocks.  The length of the case is 16 blocks, which is actually down by 2 blocks (originally was 18 blocks), even considering that we added a power switch that is 3 blocks in length.

Right-side view:



The SD card slot is now accessible.  The SD card depicted has a plastic "extension tab" tapped to it so that I can slide it in and out.  I needed to accommodate the power switch on this side, and that prevented me from dropping the length of the front side by another block size, that would have provided me enough access to the SD card without an "extension tab".  The micro USB power connect of the Pi is now opened up (as opposed to the old setup of internally wiring the port to the opposite side).  I've added a "flag" swing door.  There are these two pole holders on the case (one is depicted with a black lego pole).  I use have these attached so I can slide out these poles and use them to hit the internal reset button on the power switch (more on that later).

A top side perspective of the same-side:

Back-side view:



You can see the minimum width of the case has been extended by 1 block size, and around the HDMI port, the unit's width gradually extends further out two block sizes.  This is to accommodate the hub that sits overtop the pi.  There is a slight opening of 1/3rd block size along the base of the daughter board board on the hub.  Two of the upright facing ports are attached to the hub by a daughter board.  Instead of making the unit an additional block size in width, I leave this gap to accommodate this board.

The blue window swings open from the top and provides access to the HDMI port.  I only use this when troubleshooting boot-up issues.

Left-side view:


There are a lot of changes on this side.  We have access to the ethernet port and the two USB ports.  The Raspberry Pi LEDs are no longer covered up, viewable through a window.

I have added a flag door, similar to the opposite side, where it can be swung up or down, to cover up partially or completely, the two USB ports on the Pi.

With the integrated hub, we now have two USB ports accessible that are powered by the hub.  The entire unit (with Pi) are powered by the dim socket, connected to a 2amp 5V power brick supplied by the hub.  The right micro USB port on the hub is the host connection port.  It will be wired to one of the Pi USB ports by a short micro USB cable, depicted later on.

The 1.8" or 2.5" SATA hard drive slides in the bottom base.   The door panel mechanism that I used to snap on before has been replaced (since I found they often fell off).  Instead, I have another one of those flag pole mechanisms, where I slide it vertically up or down.  When in the down position, it will obstruct the drive bay opening, preventing a hard drive from sliding out.

Top-side view:



From the top view, we can see have access to two upper powered USB ports.  These are handy for plugging in flash drives, external hard drives, etc.  One I typically will use to power the Pi using the power switch.  You could also just backpower the Pi using the host connection alone, but then you won't be able to power the device on/off with the rocker-style switch, nor reset it using the reset button.

The rocker-style power switch is accessible by the swinging upper door.  The reset button (next to the switch) can be toggled by using the flag pole.

And the bottom....

From the bottom-side view, we can see the base the size is 16 by 12 blocks.

Wired up...

Now time for some action shots.

The first video demonstrates booting up and turning off.

With the script running on the integrated multi-coloured LED.

No comments:

Post a Comment