Andrew Que Sites list Photos
Projects Contact

August 28, 2014

128 GB micro SD Problems

   Today my 128 GB micro SD card arrived for the Odroid.  This will serve as primary storage for the device.  Currently span 61.5 GB of space.  Most of that space (48.3 GB) is for the my photography and that grows steadily.  So 64 GB of storage wasn't going to be enough, and the next increment was 128 GB.  To be honest I was surprised micro SD came in a size this large, and the price not outrageous.
   After getting the device formatted I plugged it into the Odroid and... no.  After some investigation I found the Odroid refused to start with both the eMMC and the micro SD.  As the system boot, it would halt in the space place every time about 3 seconds into the boot sequence.  The device wasn't locked up.  The blue status LED continued to blink and I could even switch to other consoles (none of which were ready to do anything).  After trying a few things I figured this was a question for the Odroid team.  I was pretty sure that would be able to figure it out faster than I could.
   A few other parts also arrived.  I picked up a breadboard so I could start working on a current measurement circuit.  With an op amp and a 0.01 ohm shunt I went to work, only to conclude there was no way I could use this small of a resister.  The voltage across the resister for the power I was drawing was in the micro volts.  Time to consult was electrical engineers at work and figure out a better solution.

August 27, 2014

FFTW with threads

   In a continued attempt to stress the Odroid, I went back to trying to make FFTW work threaded.  My problem was I was using the old version of FFTW, and not version 3.  After installing the version 3 package the threaded functions were all available.  So after some more work I had a threaded version FFTW compiling.  Problem was, it wasn't running in parallel.  I had a single core running at 100% and the other cores running at a tinny load.  Thwarted again.
   Pictured is my bike after an 11 mile evening trip.  On the back is a solar battery I use to keep my cellphone alive on long bike rides.  The solar panel probably won't help much during the ride.  I only need the battery when the phone is tracking the trip or being used for navigation.  On multiday trips my phone won't run all of the time and the solar cell should help put energy back into the battery.  We'll see how well that works in practice.  I have yet to mount the battery on the back bag, but have some hook and loop fastener strips I plan to adhere to both. 
   From the bag a USB extension cable brings the power from the battery to the front of the bike and on the handle bars is a cellphone mount.  I've been making a lot of use of GPS tracking during my rides, and occasionally use the map for reference.  The clip does a pretty good job, but on rough trails the phone will slip.  I've never had the phone fall from the clip, but it does move around and need to be corrected.  The biggest problem is the placement of my volume and power buttons.  A good bump and the clip slides into them and can change volume or turn the phone off which is kind of irritating.  I have to keep the phone vertical because I found that if the screen rotation is on, the bumpy ride just rotates the screen constantly.  Aside from these issues, however, I like having the phone on my bike.
   Both the head light and tail lights on my bike are some of the brightest I could find.  My head light is 1400 lumens and produces an impressive amount of light, and the tail light has a 1 watt LED.  Both should help motorists know I am on the road, and I'd rather they notice me than not.

August 26, 2014

Ubuntu and VirtualBox

I've used VirtualBox for a few years now and I generally keep an Ubuntu virtual machine running in the background as a sandbox. Ubuntu 14.04.1 LTS is now out and I wanted to make the switch first with the sandbox before doing this with the server. Unfortunately the virtual machine didn't have enough disk space to do the upgrade. I tried doing some cleanup, but I couldn't free enough space.

VirtualBox has a method to resize the virtual drives assigned to a machine. It looks at through this is only a command line option. It's pretty easy to use and I found instructions here. However, after I did this, I found my drive wasn't actually extended. Turns out the snapshot I'm running is a different drive stored in an other location. Once I resized this drive, the partition was indeed larger.

I used a LiveCD and fired up Gparted. Very quickly I had the partition resized using the full new drive space. Reboot and done—more drive space. After updates I had a hard time getting the VirtualBox drivers to compile. It was missing the kernel header files for 3.2.0-54-generic and those were not found when I tried to install them. Turns out these are in a repository not normally in the list of software packages. I found this page to be useful which basically said I should add precise-security main to the repository list. Once I did I was able compiled the drivers. The awful interface Unity restored itself and I had to get rid of that was well.

August 25, 2014

A Battle with a Creature Controller by She Who Burrows

A Victory and Encounter

A Victory and Encounter

   Our group had been battling our was through a zombie hoard spewing from the hole left by the black house we destroyed.  After defeating the first wave of zombies, Annalis scouted ahead to see what else we had to battle.  It was an other wave of zombies and skeletons.  In preparation, Ellenoria and Aster climbed to the top of the buildings to remain out of harms way.  Ellenoria sang a Song Of Battle and soon the group was slugging it out on the ground.  Our previous town's guard help, after their disastrous defeat the last battle, ran away. 
   Marv had a fantastic opening, killing a zombie in a single stroke and ripping the arms of a second in a single stroke.  Ellenoria fumbled her third round and was knocked out the remainder of the encounter, but the group battled on.  After a lot of work this next lot of zombies and skeletons were gone.  We started attracting a crowd who were watching the battle from afar, including our two cowardly town's guard.
   However, it was after we defeated this next lot we noticed what we thought was a pile of rubble was actually in motion.  It was made of parts of bodies including the tops of heads, and quite large.  This mass was moving at us and it was clear an other round of combat was about to begin.
   Most of the group was in good shape.  Ellenoria regained conciseness and sang a Ballad of Bravery.  Along with an impressive defensive bonus, the song added resistance to all fear effects which would prove useful for this encounter.  The battle was fairly brutal.  This creature when flanked could counter attack.  Annalis, who always tries to flank, was constantly dodging the tail of this beast.  Luckily the increase to bonus defense helped her not to get hit.  We could all detect some kind of fear, but were not afraid.  Turns out the protection from the song kept us from wanting to run away.  However, that was the only useful thing Ellenoria did.  Most of her attacks hit nothing.  Aster stood on the wall with me casting fairly effective attacks.  Andal was on the ground doing damage, but her hawk Doobie had to flee after an attack reduced him to near death.
   After the monster was destroyed it fell apart and had little booty.  Before going to search the site, a creature whispered in Ellenoria's ear "That was fun.  We'll have to do it again" before disappearing.  Ellenoria noticed the creature had IX on her head.  It is clear this is She Who Burrows, the powerful Void Creature who escaped from the Solarian Labs. 
   The group had won a great victory with a large crowd witnessing, and our names will not soon be forgotten in Ashbourne.  There are many question we now have.  However this day was over.
   New power supply arrived today and it was time to check a couple of numbers for the Odroid setup.  The DC-DC converter I have is suppose to take an input voltage from between 20 to 8 VDC.  For my solar powered setup there is a chance the battery voltage will be too low to continue to run the Odroid.  In this case the Odroid will switch over to a 12 volt supply that comes from power over Ethernet.  The Ethernet cable is around 100 feet long and the 12 volts will likely drop as a result.  I wanted to be sure that despite the voltage drop the DC-DC converter would continue to supply clean voltage as sufficient current.  Knowing the actual power draw of the Odroid this isn't nearly as much of a concern, but I have the tools for this test and it was a good first project for the new power supply.
   To test, the power supply is set to 12 VDC and connected to the 12 to 5 volt converter.  Monitoring the power output on the oscilloscope, and giving the Odroid a full CPU load I began decreasing the 12 volt input.  I could get down to just over 6 volts before the 5 volts output began to sag.  Even then the power was clean.  So the converter passed this test just fine. 
   I have worked with a number of variable power supplies as part of my job.  I am pretty happy with this one so far.  I decided to build a shelve to hold both the supply and my oscilloscope.  The heights of my shelves make installing a secondary shelve very functional, and both the power supply and the scope are at a good operating height.  It also happens the LED lighting along the top shelve nicely illuminates the test equipment.  I also added a strip of LED light under the new shelve.  So far I'm pleased with the setup.
   I setup the Ordroid to mirror all of through the use of sub-sub-domains.  I added this mirror server functionality several months ago by adding CNAME records for each sub-domain of the site that are all routed to the Blue-Dragon.  Right now the Blue-Dragon hosts it's stats page, proxies ππ, and all the sub-sub-domain mirrors.  I switched the mirrors to the Odroid and verified all of the sites of are functional.
   There was one more stress test I wanted to give the Odroid, and that was a heavy floating-point load.  The Exynos processor contains VFP and NEON float-point hardware.  I wanted to make use of the SIMD instructions of the NEON hardware provides and looked into an FFT unit that would utilize this.  I found The Fastest Fourier Transform in the South (FFTS) but after a lot of work trying to get it to compile I couldn't get it to properly compute an FFT.  So I switched to using Fastest Fourier Transform in the West (FFTW) which I have used many times before.  I managed to get a single threaded version to work, but I didn't get the threads working.  So I ended up not completing the full test.  However, the single threaded version ran with out issue.  It just didn't increase power draw much, and barely increased CPU temperature.
   The total light for today was the lowest I have ever seen it, registering only 683 Wh/m2 for the entire day.  It has been close to overcast with high humidity and haze.  Although it rained a little off and on today was far darker than any rainy or cloudy day in my records. 

August 22, 2014

Measuring Loaded Odroid Power Draw

   I have some time before the parts arrive for my next part of the experiment, so I thought I'd make the Odroid sweat a little.  The purpose was to put a full CPU load on the system and see what the power draw was like.  I wrote an article in 2010 about using threads to search for prime numbers.  This test will saturate the CPU with integer operations for more than an hour and will be a good test. 
   The primes test will keep the CPU busy.  In addition, I wanted to load the network.  So I copied a 60+ GB file from the Blue-Dragon and sent it to /dev/null.  Using iftop I could see the Ethernet port holding about 92 Mbits/sec.  And htop showed all four cores holding a 100% load.  Using my amp meter I could saw power draw sustaining about 4.4 watts.  What I also noticed was the CPU temperature climbing to 70 °C.  The Odroid ships with no fan and I've found it generally operates about 50 °C.  Climbing to 70 °C is a bit much, so I put fan on it for the remainder of the test.
   As a web server, our low traffic and the low CPU requirements of being a web server means 4.4 watts will probably never take place.  Nonetheless, I have a number for the highest power draw.  The Odroid U3 is rated for 10 watts.  However, I run the device without anything plugged into USB, and no monitor.  I assume these devices could require the extra power.
   Pictured is the church in the town of Ashton.  I've biked by this large Gothic revival several times and I've been meaning to find a context to shoot it.  Today was hot and muggy and I put off my ride until the evening.  While it hadn't cooled off much I at least didn't have the sun beating down on me.  I took a tripod and spent about a half hour doing long exposures of the church.  I had hopped there would have been stars visible, but between the cloud cover and haze none were visible.  Nonetheless, I got a few good pictures and did some HDR mixes with a couple sets.

August 21, 2014

Preparing to make a current measuring circuit

   The next part of the solar power web server project for me to consider is power measurement.  I need to be able to monitor the voltage of the main battery so that if the power gets too low the server can switched to a wired power source.  So I at least need a analog input for voltage, and a relay output.  In addition, I would like to be able to measure voltage and current of all three pieces: solar panel, battery, and server.  Both the Raspberry Pi and Odroid have I/O so this can be accomplished, but it will require I build a circuit for scaling voltages.  The solar panel can range from 0 to over 20 volts.  This needs to be stepped down to 0-5 volts.  Measuring current involves running the power through a very small resister and measuring the voltage across the resister.  This voltage is not much and will require an op amp circuit to bring the voltage up to a useable range.  I know how this work theoretically, but I need to put this to practice.  So today I placed an other order for some bread boarding equipment.  The plan is to make and test a current measuring circuit, and then integrate this into the Odroid inputs. 
   Now that the Odroid is running, it is time to get some more performance information.  The device is specified to draw no more than 10 watts, but I wanted to see what was typical.  I found the Micro Dragon was speced for 22 watts, but never draws more than 20 watts and usually idles at 18 watts.  I was expecting something similar for the Odroid.  So I broke out my substandard volt meter (you can see the camp pressing the screen down so the top half of the screen functions) and began measuring amperage.  My initial tests showed the system drawing no more then 2.4 watts, and idling around 2.25 watts.  When I unplugged the keyboard, mouse, and monitor (which will not normally be connected) the power draw dropped even more.
   More parts showed up today as well, including my Power over Ethernet (PoE) adapter, and 12 VDC to 5 VDC switching power converter.  The plan for the solar project is to run Ethernet to the solar powered server, including PoE.  If the system is not getting enough light energy to keep the battery charged, it will be able to switch to PoE.  Since the solar panel is setup to charge a 12 VDC battery, the system power needs to be converted from 12 to 5 volts.  So I planned on the PoE injecting 12 VDC into the Ethernet wire.  The Ethernet cable to the roof is 100 feet long, which will result in voltage drop.  But by feeding in 12 volts and stepping that down to 5 volts, the loss won't matter as the switcher will compensate up for the voltage sag—it can do the step-down on any voltage between 20 and 8 VDC.
  I wanted to verify this system would work, and since I was taking current measurements to get an idea of total system load I decided to include the DC/DC converter.  There will be some amount of loss introduced by the DC/DC converter, but because it is a switching power supply it shouldn't be too much.  I measured the power draw with no other input devices but Ethernet and saw the Odroid peaking at 1.8 watts, and idling at 1.5 watts.  The picture shows the amp meter reading 0.275 amps, which at 5 VDC is 1.375 watts.  I took the picture before moving the measurement to the supply side of the converter.  These numbers are welcome news and significantly less than I had planned for.  A much smaller solar panel and battery will be required.  In addition, the PoE adapters work just fine.  I had read concerns they could interfere with data transmission due to not using twisted pairs in the 6" leads, but so far this hasn't not been an issue.  We'll see what happens when I move it to the 100 foot cable going to the roof.
Odroid U3

Odroid U3

   At long last, my Odroid U3 has arrived. Experements with the Raspberry Pi as a web server reviled some short comings.  While it is a great computer, it just doesn't have the processing power to be a good replacement for the Micro Dragon.  The 700 MHz ARM processor is no match for the 1.6 GHz Intel Atom I indent to replace.  So I began looking at alternatives.  What I wanted was a Raspberry Pi on steroids, and what I found was the Odroid.  It has a 1.7 GHz quad-core ARM processor, 2 GB of RAM, and about the same size as the Pi.  The peak power draw is significantly higher registering in at 10 watts vs. the Pi's 3.5 watts.  Despite this, the system has specs that make it just as feasible to run from solar power.
   One thing to note for anyone looking at buying an Odroid is the price.  As of this writing, the U3 lists for $65, which is a great price for a machine this powerful.  However, unless you are in Korea or Germany shipping is expansive and cost an additional $25.  In addition you will need a 10 watt, 5 VDC power supply, and some boot media.  Still, this is a pretty good price for the power.
   The first order of business was getting the system software setup.  I ordered an 8 GB eMMC card to start my observations.  This left the microSD card open for holding the storage I will need if it becomes a web server.  It came preinstalled with some flavor of Ubuntu compiled for the Exynos 4412 processor.  That works fine for me, and other than removing the GUI (which I don't need) I think I'll keep the OS as-is.  In short order I had a LAMP stack operating, and using SSHFS quickly had the computer serving a mirror of my website. 
   How did it preform?  Insane.  Using some of my math demos as tests, I compared the rendering speeds of the Odroid to the Micro Dragon.  My Gibbs Phenomenon demo that includes an FFT takes the Micro Dragon about 2.5 seconds to render.  With the Odroid, it takes 0.3 seconds.  Initial tests all show this device quite capable of taking over server operations.