Building an Internet-of-Things device, or perhaps recording continuous video, requires a low-power, high capacity storage system, preferably utilizing inexpensive hardware. In specific cases, your device might be remote or might deal with high vibration intensities, like being mounted on a piece of industrial equipment, on a robot, or in a vehicle. Such circumstances make solid-state storage indispensable.
I started out looking at building a network-attached storage server using a Raspberry Pi; they are great little single board computers after all. However, there are a few things that make them less than ideal for this sort of thing. Firstly, the network port is only 300Mbit/s in the latest 3B+, and 100Mbit/s in older generations. Secondly, the USB ports are only USB 2.0 (480Mbit/s), so they are significantly slower than USB 3.0 (5Gbit/s). USB connectors are not always the best for high vibration environments and can have intermittent connection errors because of this, or fail from fatigue if the cable is not well-secured. USB cables, especially 2.0 ones, don’t perform particularly well in high EMI environments either, such as near VFD driven motors.
After comparing numerous appealing options on the market, I picked up an ODroid HC1 (Home Cloud 1) from their UK Distributor (https://odroid.co.uk). It’s a very compact and reasonably priced single-board computer. The advertised benchmarks are pretty staggering on the HC1, compared to other single board computers in a similar price range.
When purchased from Hard Kernel directly, the unit would cost US$49, not including shipping, a power supply, or a hard drive. Hard Kernel also offers some very impressive boards in a RasPi form factor, with gobs of processing power for those who are willing to pay for it. The HC1 appealed to me for being dedicated to controlling network-attached storage, completely stripped down of any extraneous functionality. It’s also rather compact despite being mounted to a massive heatsink that doubles as an open enclosure, with the option of including a top cover for those who would prefer one.
I would have liked to have WiFi functionality built-in, as well as the ability to run multiple drives for RAID and data security in the event of a disk failure. While the Odroid HC1 is lacking such features, it retains a single USB port, which could optionally be used to connect a USB WiFi dongle. I was interested in WiFi for convenience, to be able to check the drive’s contents from a mobile device, rather than writing or reading bulk data. RAID, on the other hand, is a bit tougher on single board computers unless you begin looking at x86 based machines, adding graphics processors, or considering additional power hungry features. It was tough to find a compact, low-power option, so I had to give up on RAID.
I ended up going with a one terabyte Samsung 860 Evo SATA SSD for the storage device, and a Sandisk 16 gigabyte microSDHC card for the boot device. I tried to get away with an old two gigabyte microSD card, but it was too slow for the operating system. The 16gb Sandisk microSDHC was the cheapest name-brand card available. If you’re looking for an extremely rugged setup, the Samsung 860 Evo PRO drives are double the price but offer almost four times the flash durability of the Evo, which could be well worth it for a remote installation collecting critical data. The PRO version also consumes considerably less power. A slightly more budget-oriented option from Samsung is the Qvo line, which has about half the flash durability of the Evo. I decided to go with the Samsungs over any other brand because my hardware doesn’t provide the option for RAID. I’ve had no issues with them in the past, and have 9 of them in continuous operation, so I decided to stick with what has worked well for me before.
Mechanical disks are not a good idea for low power, vibration intensive, or harsh environments. They are very cheap for the storage capacity they offer compared to a quality SSD, but vibration kills them very quickly, as do dust and moisture. An SSD consumes far less power than a mechanical disk, and doesn’t suffer from spin-up time coming out of sleep when you want to start writing data.
Samsung 860 EVO SSD and ODroid HC1 after purchase.
There are several network attached storage operating systems available for single board computers. I decided to use OpenMediaVault because it runs on a considerable number of ARM-based single-board computers, allowing you to follow along even if you go a different route (like a Raspberry Pi). It also has a very easy to use web interface for setting it up and managing shares/users, thus requiring no command line or SSH!
Configuring and running the ODroid HC1 is simply a matter of plugging in the hard disk, flashing and plugging in the SD card, and finally, connecting ethernet and power. Let's go through these step-by-step.
Firstly, let's get the firmware image onto the SD card.
Download the image “OMV_4_Odroid_XU4_HC1_HC2.img.xz” from Sourceforge.
Download any image flasher of your choice. We’ll be working with Etcher (https://etcher.io/) in this article because it’s straightforward to use.
Plug the microSD card into your computer.
Open Etcher and select the downloaded image, then your drive.
Click Flash!
While Etcher is flashing and validating the image on your SD card, you can assemble the ODroid HC1 and hard drive by simply plugging the hard drive into the HC1’s SATA connector.
The ODroid HC1 connected to the Samsung disk make for very compact network attached storage.
Then flip over and use the included screws to secure the drive.
You can then plug in the ethernet cable.
Once you connect the ethernet cable, you’d be done with connecting all the hardware.
Once Etcher has finished flashing the SD card, you can go ahead and plug it into the HC1 and then connect power. OpenMediaVault crucially requires a stable internet connection on its first boot. I tried booting my HC1 the first time connected to a network that included a wireless link, which wasn’t particularly high quality, and had significant difficulty getting the device to work. However, I had instant success plugging the HC1 directly into the wired portion of the network.
It can take a while for the first boot, so make a tea or coffee, or check out some of the other articles on this blog. Leave the HC1 to boot and install for at least 15 minutes; there’s no visual indication that it has finished, so it’s better to leave the device a bit longer than to do anything with it too soon.
You’ll want to check whatever provides DHCP addresses on your network (typically your internet router in a home or small office) to look at the connected clients, and find the IP address of the ODroid. Alternatively, you can use an IP scanning tool to find it—a popular choice is Angry IP Scanner (I prefer the legacy version as it doesn’t require Java). If this is your only ODroid on the network, you can probably skip finding the IP address and browse to http://odroidxu4/ in your web browser. Otherwise, go to the IP address with your browser.
Configuring OpenMediaVault starts with logging in.
The default username and password are admin / openmediavault.
The first thing you’ll want to do is go to System⇒General Settings and then Web Administrator Password to change your password.
Then you can head to System⇒Update Management to make sure you have all the latest packages. Hit the Check button, then click the checkbox next to Package Information to select all and press the Update Button
Please wait a moment while OpenMediaVault installs its updates.
Once the updates are done, you’ll want to reboot. You can hit the ⋮ menu icon in the top right of the dashboard and select reboot.
If you’re using an existing hard drive, or your hard drive comes pre-formatted, you will need to delete the partitions before proceeding. You can go to the Storage⇒File Systems menu, select any /dev/sda* entries and Delete them. However, be sure you don’t touch the /dev/mmc
item, as that is the SD card you are booting from!
Setting up a hard disk requires that you create a file system.
Once you have an empty disk, you can click the Create button. Give your drive a volume label, make sure EXT4 is selected for the file system and click OK.
This will probably take a few minutes to complete.
Once that’s done, click Close, then select /dev/SDA1 and then click the Mount button. You will then need to click Apply for the drive to be mounted.
The apply button can be found on the top right corner of the devices table.
Next up, you’ll need a user to access the file share with. Go to Access Rights Management⇒User in the menu, then click Add.
Now that we’re done with storage, we need to configure access rights management.
Set the username and password then click Add. Then, you will need to Apply the changes as you did when mounting the new file system. You now have a user to access the file share.
We will need to configure basic options when creating a new user.
Head to Access Rights Management⇒Shared Folders and click Add.
Simply give the share a name like “logdata” and click Add. Ideally, you should also set the permissions to deny “others” access, so only users can access the folder.
Creating a shared folder allows the user we just created to transfer data to and from the network attached storage.
Once the share is created, you can select it and then click the Privileges button to add your user.
You want to select the Read/Write check box and then click Save. Again, you need to apply these changes.
Finally, click the ACL button, beside the Privileges button you previously clicked, and do the same thing then Apply and Close.
Head to the Services - SMB/CIFS menu option. This is the file server on the device.
Click Enable then Save and Apply.
Do not forget to click the apply button to save the changes you make.
Once you have enabled the SMB server, click the Shares tab and then click the Add button. You can select the share previously created and then click the Save button, then Apply the changes.
In windows, you can go to \\odroidxu4\ (or \\ipaddress\) in Windows Explorer to see if the share is set-up correctly. Enter the credentials you created earlier when prompted.
We can use our credentials to see and access the shared folder on the OCDroid from any other computer on the network.
Copying to or from the drive, you should see transfer rates of about 95-115Mbytes/second over a wired network, which is approximately as fast as a gigabit network can transfer. The throughput on the HC1 is rather impressive.
OpenMediaVault also supports other means of file transfer. If the device generating all the data you need to store doesn’t support SMB file systems (Windows shares), then you might want to also enable FTP. FTP isn’t as fast as SMB, generally speaking, however, if you are using a microcontroller, it’s easier to implement than SMB shares are.
The FTP server can also be rather handy for browsing the server from a remote location. If you want to access the FTP server from a basic microcontroller, you probably don’t want SSL to be required, just optional. If you need to run the FTP server without SSL, you should only access the server over the internet via a VPN tunnel into the network to which the NAS connected.
Go to Services⇒FTP then check the Enable box and click Save.
Now you can go to the Shares tab and Add the share just like you did for the SMB share above. Don’t forget to click Save and then Apply the configuration changes.
If you’re looking to build a remote data storage server that uses very little power and takes up only a small amount of space, the Odroid HC1 is an excellent option. If you’re in a very humid or moist environment, you might want to break out the conformal coating and give the board a generous coat on both sides, and potentially on the inside of your hard drive too (only if you are using a solid-state disk). The conformal coat will make sure the boards don’t suffer from corrosion.
The large heatsink on the Odroid adds a great deal of rigidity to the setup, so there’s minimal worry that the SATA connector will see any fatigue from vibrations or impacts. Paired with a solid-state drive, this gives you a robust network-attached storage device.
As mentioned earlier, for the ultimate robustness, it would be ideal to have the data mirrored automatically on two drives. Better yet, we could have multiple drives on RAID 6, but then we would be well past the scopes of ‘compact,’ ‘low power,’ and ‘cost effective’. The Odroid HC1 heat sink/enclosures are stackable so it would be possible to simply use two NAS together and use software syncing such as RSync, which OpenMediaVault can configure for you, on the second system to copy files from the first. By syncing the two systems, you would possess some failover and data retention capability should a drive fail.
Would you like to find out more about how Altium Designer® can help you with your next PCB design? Talk to an expert at Altium.