Leaving the previous post up as a warning for future me's.
Don't follow it. Do not use the X725.
As it turns out, it can (and will) at some point fry the SD card, leaving you with a bricked NAS. From the looks of it, chances of this are highest when it loses main power, which you'd think would be the main point of a battery-backed UPS system.
It is not a question of whether this will happen, but when. For me it was a few months. Luckily, this was only the SD card; the RAID array and the Pi itself were fine.
Anyway, since being able to have remote and timed startups and shutdowns, I have no converted the system to one with an official PoE-Hat, and a PoE switch that can be controlled remotely. It wakes up every night for backup tasks, and then nicely goes to sleep again.
So far, amazingly, without destroying the SD card :)
Edit: WARNING Do not follow the advice in this post. Do not get the X725.
Recently, my old NAS system died on me, and I was in the market for something else. The only thing I use it for is backups, so I don't really need much in terms of fancy NAS features like seamless streaming and a web-interfaces.
One thing that had been annoying me for several years (on several ready-made NAS boxes) though was the software in general: either it was propietary, or it was Linux-based but modified for the NAS hardware. In both cases the manufacturer stopped updating it, and -if at all possible- updating the firmware and OS was a major hassle.
So I was wondering: why not get a bare RAID enclosure, and make a NAS from a Raspberry Pi?
My system would have the following hard requirements:
- RAID-1 support, with other RAID types as a bonus
- IPv6 support
- Accessible through ssh
- Ability to automatically go to sleep or shut down when not in use (both because of power saving and because RAID enclosures are noisy)
Points 1, 2 andd 3 are easy: Raspbian (and many other operating systems) have decent software RAID support, and of course fully support IPv6.
Point 4 however, was an issue: Not only does the Raspberry Pi not have a real way of shutting down, it also doesn't support wake-on-lan, which would be the easiest way to power it up again.
But there's nothing some additional hardware can't fix.
One way to overcome that would be to power it through a smart power hub, and simply enable/disable power as needed. But there would be a drawback: simply cutting power is dangerous when doing file-system intensive things, such as backups. I wouldn't want to shut it down halfway through a write operation.
But I found something else: The Suptronics X725 expansion board. This provides 3 things:
- Option to fully shut down the raspberry pi
- Wake-on-Lan
- UPS functionality with a few batteries
That third one is a bonus that makes this a better solution to the smart power outlet option: not only can we have controlled shutdowns, we can also have them when the power is out! Although, the most useful thing for this would be to prevent data write errors in case of a power loss, which in the current setup wouldn't actually work, since the RAID enclosure has its own power supply (without UPS, atm).
The documentation on the X725 is a bit on the sparse side though; it has several bold-lettered but not-so-clear warnings about how to blow up your hardware. So let's start with that.
With the board placed on the Pi, there's three ways to power the board and the Pi. USE ONLY ONE OF THEM.
- The USB-3 socket on the Pi itself
- The micro-USB socket on the board
- The power plug socket on the X725
On thing that makes this a bit scary it that there are 2 micro-usb ports on the board. The usb power socket is the one on the long side (it has the helpful text "2A CHG" next to it.
So what's the other micro-usb for? It's for the second network interface. Since the Pi can't do wake-on-lan, this board adds a network interface that does support it, but it works through usb.
With that, I have a system that is low-powered, well-supported by software, and able to wake up in the middle of the night to perform backups, then go to sleep again.
LED clock
November 28, 2013 at 10:44 PM | categories: making, 3d printing, projects
Another project nearing comple^h^h^h good enough to hang on a wall:
A LED-based clock, with light as hands.
It all started out when I found the awesome NeoPixel line of products from Adafruit, one of the more interesting ones being the 60-LED strip.
I picked one up (because you know, because), and the best thing to use it for for now was a clock. I had an ATTiny AVR lying around, and wanted to make something to replace my pretty boring standard clock.
Luckily I had a 3d printer to print a clock case at exactly the right size, so I 'only' had to make something to set the time, show it, and if possible, adjust colors etc.
Of course it wasn't as simple as that. For starters, the led strip didn't work out of the box. When supplied with some power, it would light up randomly for a fraction of a second, then go dark again. My first guess was that it didn't get enough power (a full 60 LED with controllers for each led can take a bit of power that may not be supplied fully by a small chip such as an ATTiny), but as it turns out, it simply came with wires soldered on the wrong side of the strip.
Luckily it's not that hard to resolder with the right connections, so once I had discovered that, lighting up the right LEDs was quite simple. Except for one, the last one on the strip. But 59 out of 60 is good enough for now.
It turned out to be more of a challenge to actually show the time with only one AVR that doesn't have a very accurate internal oscillator, and worse, one that can easily run out of program stack space and start behaving eratically.
After some measurements, tweaking, and rewriting, it still doesn't serve as a clock very well; it runs fine for about 24 hours, but then it goes haywire and needs a reset.
But it does look mighty fine. It can show the time in different colors, and the second hand is completely optional.
Plans for v2 are in the works. Starting with an RTC, and I'm thinking about adding a light sensor to automatically adjust its brightness.
But first I need to figure out where to hide the electronics then. I guess I really do need to figure out how to make custom form PCBs at some point.
Philips Hue rf remote control
October 01, 2013 at 11:47 PM | categories: making, 3d printing, projects
The Philips Hue lights are awesome, but it can get a bit tiresome to start that phone app, probably wait for the wifi to connect, and then select your scenario.
TBH, the app serves pretty wel to configure scenarios, but I am not a really big fan of its interface.
I want buttons! Actual, physical buttons.
I also wanted to do something with RF anyway to see how it works.
Combine those to, and you get a remote for your Hues!
The receiving end it currently still just a breadboard and an Arduino, plugged into a computer running a python control script, but version 1 of the remote is finished.
As you can maybe see, it has 5 buttons, for 5 scenarios (one being 'off'), and one slider to set the brightness.
Here's the 'normal' scenario, and dimmed:
And for those emergencies, all lights set to red:
I may post a larger build report later, with more details (and perhaps some code), but for now I'll leave you with some keywords; ATTiny84, Cosa libraries, lots of wires (I really need to figure out how to make custom pcbs), and the case was printed on an Ultimaker.
On to v2 ;)
Dodecahedron speaker
July 05, 2013 at 09:32 PM | categories: making, 3d printing, projects
This project has been finished (well, finished-ish, as always) for quite a while now, but I just realized I never got around to writing it up. In fact, I already extended it, but that's something for a different post.
Way, way before I even had a printer I saw this Instructable. And immediately fell in love with it. It had never left my mind as a want-to-build-at-some point thing, and some time ago I finally got around to doing it.
But of course mine is completely different ;)
For starters, I did not want 'just' a speaker, I wanted one that had an integrated amplifier, much like those computer speakers you see everywhere. I wanted it to have a standard jackplug so it could play from most devices, and I wanted it to have physical power and volume buttons.
After doing some (well, hours of) online browsing for parts, I settled on a parts list, with which I shall not bore you, and got to designing the shell parts. As my parts would have different dimensions and properties than the ones used in the Instructable, I had to design everything myself. Which of course is 90% of the fun. Even with the countless failed attempts.
(Okay I lie, only some initial designs were made at this point, somewhere along the line I changed them completely but I don't have screenshots of the earlier attempts. Also the button came after everything was done and built. But hey, what's a little temporal randomization among friends.)
The parts arrived and it was time to do some serious soldering, first the speaker parts.
And once that was done, I could test the amplifier and all components.
(this actually has music coming out of it but that's a bit hard to capture in an image)
Satisfied that it was working, I could assemble the main dodecahedron part:
And then it was time to make the big print, solder everything else together and shout and curse it all into one big shiny package:
It is awesome, if I say so myself, even though I did make a number of mistakes:
- I 'forgot' to ground it (so depending on what is connected, it can have background static)
- I only included simple speaker parts and forgot to add ones that are suitable for low sound waves, so it's not really suitable for loud music with a lot of bass (but yes, it can be VERY loud).
- I did not include a shiny "i'm on" led.
- The dial has no numbers, so it does not go to 11.
But hey damnit, I have built my own dodecaspeaker!
Next Page ยป