07/11/2016 at 13:37 •
I've decided that I need to post any progress I make on anything as soon as I do it or it'll get buried in the mounting terabytes of stuff I wanna post and make, so here's a little something from today and everything you've missed.
First, I added a fan. Quite some time ago too, probably a week after it was "Done".
The orange pi inside got pretty hot, to the point where, despite a massive airgap, whatever the box was sitting on got very warm. A RPi heatsink and a fan on the back fixed this.
(I think I'll just call this whole thing a box from now on. (OOOOOHHH, awesome idea for a case to add to the list: A black jiffy box with a blinking red LED on the top. Probs gotta have built in battery then. I really should just rename this project to "All the things I'm shoving orange pi's in")).
The fan just runs off the 12v booster, I put it on the side with a little cover so the saliva of people standing around it salivating doesn't get inside. I've bathed this entire unit in Isopropyl once already...
There's no output for the air, there's enough gaps in the lid already.
The second little tweak, something I did today after getting back from work and not having my little RCA power plug, was say bother it and give it power from a 12v PCIe connector.
Let me explain; I've become pretty fond of powering stuff through standard power supply connectors recently, the four pin molex or sata for a nice mix of 12 and 5v, or a pcie connector when you just want umph. I would have rathered put this on sata but I didn't have a spare cable at hand.
Anyway, I've basically just been buying up female/male sata/molex/pcie to female/male sata/molex/pcie cables to give me a tonne of different options, male and female for all my projects (like a little algae bioreactor I'll be posting soon). It lets me run stuff off my solar system at work, and when I bring stuff home I can just plug it into one of the spare connectors on my PSU (Seasonics work as great makeshift bench power supplies).
It kinda suits that it's 12V only, as this box only needs 12v in anyway, that's the beauty of it. No regreats.
Speaking of ragrets, here's one:
Of the two RCA eyes on the thing, one's had its cables snapped off on the inside for quite a while now. Naturally, I decided the best way to route the pcie power connector was just do drill a hole in the lid, slide the cable through, and solder it, permanently affixing the lid to the box. It would have been much wiser to just unscrew one of the eyes and run it out there. Lid free, no stressed cables. Yay me.
Oh, and one last thing:
This little box is just too unclean and looks like garbage compared to the other stuff I'm working on. I just wanna start from scratch. Actually, because it's at work, and, at work, I'm taking up desk space with algae growing equipment, I wanna integrate it all into the base of one of my algae bioreactors, so I might just gut this little thing (the router and the pi, I'll just buy more of the rest).
Oh, what I was actually gonna say was I made this case for the orange pi one a week back. It's cute and I like it, but maybe not for work. I might make a scaled up version that holds everything in soma box thing #1 sometime.
05/25/2016 at 11:35 •
Just throwing a few things down that might be important.
So the H3's in the Orange Pi range are apparently notorious for getting bloody hot, something I had not found when using the device uncontained.
I did, however, notice that the base of my little box (now dubbed a SPS) was incredibly warm after being on for an hour.
Luckily enough, I ordered a couple Pi heatsink kits not long ago, actually for the voltage regs on the step down, but it looks like they might come in handy here.
Just checked the post, half hoping they'd show up, the orders being local, but it was just some clothing. No fun.
Anyway, I'm now thinking cooling will be a semi serious issue, and you definitely will see some more logs when the fans/heatsink shows up.
Also, I threw two power plugs on the front just coz, but it might actually be pretty handy if you need to move it around.
There isn't enough internal space to put in an internal battery, but that was very much something I wanted to do. Perhaps you could just use an external one instead?
3.7v li-ion, stepped up to 5V for usb, use a 5-12v step up to get it into the SPS, stepped down to 5v for the oppai, and back up to 12v for the LED's. Say it with me, efficiency!
Other than that, for those curious as to how the software on the inside works (and how one might boss-proof the system), here's the basic layout.
I have it working in tandem with a VPS from cloudatcost (not paid to say that, they've been good to me for years now, you just have to fix your own problems, which is fine for me), it sits somewhere in canada and has a 20GB SSD that's about as fast as a 5 year old SD card (guttural snort laughing).
Once powered on, my little boxy thing (SPS, this project) does very little itself. I'm not running anything at boot, because meh.
Once the SPS is all up, the internal router should connect out to the external ethernet port, set up its own little internal network, nat and all, and the oppai is connected to it. I can then connect to the box's wifi network with my laptop, ssh in to the pi, and start what I want.
First thing is to run tmux, I want this running always. Then I run a command that does a handful of things.
First, it's a while loop. It will always run and restart, no matter what inside happens. It then launches autossh, essentially SSH but that reconnects to dropped connections, and autossh connects to my VPS and sets up reverse port forwarding. There is no need to run port forwarding on the router in my box or on any network it's plugged in to, so long as it has IP level access everything's fine (Good for all those living with proxies).
Anyway, once autossh connects in to the VPS it clears a certain mountpoint (you'll understand in a bit) then it uses sshfs, a tool to mount folders from remote machines using ssh, to go back through the ssh tunnel we created earlier, and mount a folder from the orange pi locally on the VPS.
On paper, autossh should be able to reconnect if anything ever drops, but it doesn't. On a graceful exit, autossh closed. Restarting the VPS is considered a graceful exit, and we can't have that, can we?
It also hardens it against tones of thing. Basically you can unplug the thing (keeping it on batteries), plug it in to a completely different network and it seems to pick back up rather smoothly. Once reconnected to the VPS it clears the mount point in case something went bad when disconnecting, and all is dandy.
Now, on my VPS I have a nice little application called MegaFuse, it mounts your storage from mega.nz as a local folder. Nice stuff. (Also, you can be signed into multiple accounts just by using different instances. Again, tmux is your friend)
I could just rsync it over, on my vps, from the folder that has mega mounted to the folder that has the disk in my oppai, but that's not fun, is it?
Instead, why not make a disk image on the oppai folder, encrypt it, mount the encrypted disk on my VPS, not ever on the pi, and then rsync to that?
Much better. Now not only is traffic going through an encrypted tunnel, inside encrypted with SSHFS, but then even the files being transferred are all encrypted. FUN!
(Starting to realize why my little orange pi was heating up so much. Heh.)
If I have any further thoughts I'll throw them in here, not make a new entry. Or I could just make a FAQ. I wonder if that's what the pages section is for?
05/25/2016 at 10:09 •
So the last component I needed, the female to male ethernet cable, showed up, so I was ready to start building!
Well, better do some layout testing first (I actually did this long before this log but gotta throw it in somewhere (Well, all the logs so far were posted after the project was completed but you get the point. This was out of order. See: Lack of box mutilation. (After this log anything I post will be live, but who knows what else there is to do. More cases?))).
This looks good
Ditto. Looks like it'll be dead easy to fit all this in however I needed to.
Also this because I think it's cute. CUTE.
So, time to start gluing!
I told myself I wouldn't use hot glue in this project, but because I couldn't/didn't want to screw the ethernet jack in properly as the plastic of the box wasn't exactly pleasant to work with, I needed to compromise, so super glue it was!
Okay, maybe buying the cheapest homebrand glue I could find wasn't a great idea, on reflection the packet didn't even say it did plastics. It took forever to dry and was cloudy, so I doused it in hot glue. I'd already lowered myself when I used the plastic box, I figured this wasn't all that much worse.
Cloudy and garbage.
There. Hotglue hides everything.
Now, let's get those USB ports ready.
Purely for the sake of charging, there's no need to have the data pins connected to anything, so I shorted them. Tales from the riverside say this can tell devices it's okay to draw more current than spec. I really need to test that some day.
All jumped up.
Both ports being stacked and already broken out meant that it could be a little hard to wire them up, so I'll just try my best.
Semi wired up.
All wired up.
Time for the power button.
I cut off the unneeded pins, all I was left with was Common and NO pins for the 12v input, two pins for the LED, and Common and NO for switching the LED.
I decided not to put the LED on the main power in, as on solar it could range from 10-15V.
Instead, I stepped the voltage down to 5V, then back up to 12V. Gotta be safe.
Anyway, I soldered onto C and NO for the main input, + for the LED's positive, jumped the LED's - to the second common, and soldered a wire onto the second NO to go to negative 12v filtered.
Switch wired up.
Not much to say here, just connected the switch up to the step down. Spare switching the negative, not positive, se eh. Also the switch goes through the front of the case, so double eh.
I know it's DC and not switching positive's not as much of a deal as with AC, but I still like to. I fixed that all up later.
See also: the little board on the side. That's the 5-12v step up.
It had a micro USB plug on it, so that's nice. I'd rather have used one without, as they're cheaper, but they still haven't shown up yet.
And all working!
Tested on the oppai, and it seems to power up like a dream! The oppai had been sitting in the box for a fair while, I didn't know if any of the traces had been scratched or anything, so if it actually works, and if enough currents provided (or if my 50w step down's just junk), well, that comes later.
USB ports wired up.
Starting to take shape.
Now, for the USB to sata adaptor.
There wasn't the space to just plug it into the oppai, or to use a regular usb extension cable, so it's improv time.
I took one of these little things:
(Little thing, big image)
...and shoved it in the female usb port on my oppai.
It's designed to snugly fit into a MALE usb plug, so it was pretty loose in there.
Notice the visible connectors between the tabs.
Electrical tape to the rescue!
It still has a little slop, but only forwards and backwards (which was a problem later, but nothing worth noting). All good.
The same type of OTG connector would fit snuggly into the USB to SATA board, and with a breakout I could join them pretty easily.
(Not the sata adaptor, a micro SD card reader, but whatever. Didn't have pics of the SATA)
Now, time to connect it up.
I took the two little female micro USB breakout boards and simply soldered some wires directly over. GND to GND, VCC to VCC, D+ to D+, and D- to D-.
There's the cable.
Best of all, it actually works on my laptop. Yay!.
One last thing I forgot to take a picture of before we're done, how I powered the router.
Again, it uses the ever handy USB OTG thingy, but slightly differently.
This time I soldered two wires onto the male end to turn it into a tiny micro USB power cable.
I don't have a clear pic, and there;s no way I'm taking my box apart now, so you'll have to do with these:
(Full picture later, you'll know which one it is)
(They're very clearly wires, duh!)
Anyway, that's all there is, now just J-J-J-JAM IT IN!
What's so hard about that? Expensive legos...
Whoops, forgot to plug it in.
At this point I turned it on ("it" kinda makes it sound like some collective abomination at this point), and I connected up to the access point, but the oppai was nowhere in sight.
Taken home for some serious diagnostics.
I checked every part piece by piece, and the flat ethernet cord seemed to be unhappy about being wrapped so tightly.
Tied it up not so tight, and all was well.
Commencing image dump.
All gooOH WHAT NOW?
Lemme clean up that SATA cable then...
05/25/2016 at 07:58 •
So most of the planning was done, bits had almost all showed up in the post, and I'd decided on a case. Time to start cutting.
I designed up a rough faceplate for the box in inkscape, allowing holes for the RCA jacks, the power button, two female usb ports and a female RJ45 port.
I sent it to my laser cutter to cut out on paper, decided I was happy with the sizing, and after a few small tweaks was ready to cut.
I looked on the underside of the box to work out what the material was, to check that throwing it in the laser wouldn't give out hydrochloric acid like some other materials.
A small "PP" on the bottom told me it was polypropylene, and a google search told me it was just dandy to cut with a laser.
So I threw it in, hit repeat cut, then instantly regretted it as I hadn't taken out the border cut line from when I was doing the paper.
Luckily, the cut didn't go all the way through, I was just left with a mark around the face.
Unluckily, three more passes on a higher setting (border cut line removed) didn't get through either.
I broke one of my rules and took the thing out of the laser and started at it with a drill and file. Big mistake.
Basically if the accidental cut line didn't make it look horrible than this did.
Either way, I didn't want to make it any worse so I threw, well, incredibly carefully aligned it back in the laser cutter, something doubly hard since I was propping it up at an angle and had a block of wood inside the thing to catch any stray beams.
By some miracle I managed to line it up perfectly, repeat the cut on the highest power, lowest speed cut with 10 passes, and everything turned out dandy.
- Don't take something out of a laser cutter if you think there's the smallest chance it won't go back in.
- Avoid unfamiliar materials if you've only got one shot at something
- Should have just made the box entirely myself
05/25/2016 at 07:45 •
So, time to decide on what to house this all in.
Originally I was thinking it'd be a box maybe 300x300x200mm in size, somewhat similar to a case I made for my mac mini (pictured below).
(Ignore the finished project in the background, you don't wanna cause a error in spacetime, do you?)
Then, I looked down at my desk and saw this:
Basically everything I needed for my project would fit in a 100x100x200mm storage box, so I felt it lazy to waste so much space.
So perhaps just a plain small laser cut box to hold everything in?
I was tossing up internal layouts in my head and just couldn't seem to reach anything I was comfortable with.
I thought perhaps a long flat box, only ever one component high, a giant tube with a fan on the front and ports on the back. Then, why not twist it around a bit? Fold the whole thing in half! Why have a small box with bits just thrown in when I could have a nice long guided path for airflow?
Still wasn't feeling it.
I somehow reminded myself of a little replica of GLaDOS's head I built nearly 5 years ago with a Raspberry Pi, pico projector, and router in it. Wait a minute, that's nearly exactly what I'm doing now!
Wish I could dig up a photo, but those drives are in storage now.
Anyway, I couldn't dig up any orthographical shots of GLaDOS's head, and portal 2's a 10GB download where I am (That's like 12 hours for the non-aussies here), so bleh.
THEN I went and played SOMA and promptly forgot about the project for a month.
Anyway, throw another casing possibility into the mix:
So cute, just like a puppy.
(Also "soma"s a really nice word. Suits this project well. See also: Calling my headless servers "Mami")
Eventually all of a sudden I started liking each and every case idea so far and was at an utter standstill.
I decided this was taking so long and that I'll just make the quickest case I can and be done with it, so the freaking plastic box I'd been carting the bits around in it was!
Edit: Long story short I now completely regret this for many reasons. Even a completely plain plywood box the same size as the plastic one would have been preferable, but eh.
Now that the project's basically working as I want it to be I'm really tempted to bash out all of the housing ideas I've had so far. I have 4 orange pi's on order so who knows when they'll show up, but I might also order the supporting gear in bulk as well.
I feel horrible for putting all this thought and effort into the case only to scrap it and do the sort of thing I would have done and thought was garbage back when I was twelve.
Really dropping the ball here. That aside, the device is functional and the internet's not gonna scrape itself, so bleh.
(Edit: Also the finished product does kinda remind me of some of the visuals in soma, so I'm not all that upset (even if it isn't a direct mirror of the robopuppy). SHODAN on some tubed cables on the outside and you're golden! But what to put in those cables so it's not just faffy showoff? The overly long SATA cables? Coolant? I dunno, I'll work something out.)
05/25/2016 at 07:17 •
Blah blah read the description.
Step one was getting all the bits together I wanted, then working out all the bits I needed. So Orange Pi, router, step down and usb-sata. Then to work out what I needed to get these all nice and together.
To power the router, and break out the USB ports on the Oppai, I decided on these little USB OTG adaptors
They're designed to go into a male plug of a USB device, essentially turning it into an OTG device you can plug into a phone, but paired with female microUSB breakouts I found it to be much more useful.
A male to female ethernet cable would allow me to pass through the routers connections to the front of the housing, so throw one of those on the shopping list.
A DIY male SATA power connector also helps out. Other things I added where a pretty button, some male and female RCA connectors for power, a fan or two, and various other bits and bobs.
Depending on your needs, if you end up making something similar you'll probably have a completely different list of parts. This was just mine.
Anyway, nearly ready to go!