Random header image... Refresh for more!

Category — Uncategorized

heli_ewII “No Menu! Just Quit.”

I’m in the process of setting up a seismometer and Winston and Earthworm for a personal seismometer station.  I’m trying to get everything set up to run on startup, so that the system can reboot and continue, without manual intervention.

I’ve got Winston working.

I’ve got my data acquisition script working.

I even have Earthworm working.

The problem is that heli_ewII (which is the only reason I have earthwrom running right now) refuses to play along.  It’ll say it’s starting, then throw a temper tantrum, scream “No Menu!  Just quit.”, and exit.  Whatever it’s doing, statmgr isn’t happy about it, and refuses to retry starting it.  It’ll say that the module needs human intervention.  Later, when I manually restart heli_ewII, everything works fine.  It looks like what’s happening is that the heli_ewII module starts too quickly and is impatient.  I don’t think Winston has had a change to start up and begin serving the menu correctly.  So, heli_ewII thinks it’s talking to a bad server, and instead of gracefully trying again or terminating in a way that statmgr will restart it 30 seconds later, it just explodes.

Clearly not what I want.

Fortunately, Earthworm is open source!  So, why not just fix the code?  This is what I did in Earthworm 7.7.  It’s untested and should probably make the options configurable and might, in fact, do very very bad things.  But hey, it’s free!

Between the lines “Build_Menu (&BStruct);” and “if(!BStruct.got_a_menu) {“, just after the “/* See what our wave servers have to offer */” comment, insert this code.  It should make heli_ewII retry several times before giving up.  Hopefully, this is enough time for Winston to get its act together.

int noMenuCount = 0;
while(noMenuCount < 10 && !BStruct.got_a_menu){
  logit("e", "%s No Menu!  Try again.\n", whoami);
  for(j=0; j<BStruct.nServer; j++)
  Build_Menu (&BStruct);

March 9, 2014   No Comments

Firing Assembly


Set up the firing tube and the motors and…
It doesn’t work.
The ball barely moves out of the tube.
Since it’s probably a lack of motor power, there’s not much I can do about it.
Oh well.

February 15, 2014   No Comments

Slider, Round 1


The motor fits fine, but it’ll slide right out if I don’t secure it using the screw holes.  So I’ll need to stick them in the model.
The slide rail, however…  The slider is way too loose.  I’ll need to shrink the hole just a bit.

February 15, 2014   No Comments

Hot Off The Presses!


I don’t know how far apart the wheels will need to be.  So instead of printing out something with exact (and incorrect) measurements, why not make something adjustable?  This will let the motors slide, then get locked into place when I find the right spacing.

February 15, 2014   No Comments

Perfect Fit


The 3D printed tube is a perfect match.  Time to get working on the other components.

February 15, 2014   No Comments

Soldering On


The motors didn’t come with wires attached.  Took care of that.

February 15, 2014   No Comments

Overwriting Anomalous Data in Graphite

Recently, I’ve been setting up a home sensor array using Arduino modules, which feed data into a Graphite instance running on a Raspberry Pi.  Along the way, through faulty wiring, faulty coding, or the effects of sunspots, I’ve ended up with some bad data ending up in Graphite.

And by bad data, I mean that my living room sensor once reported that it was 289,268 degrees C one day.  Since my house and the surrounding neighborhood show no signs of having been vaporized, I am forced to believe that reading is incorrect.

Since having a temperature reading of several hundred thousand degrees throws off the range of the graph somewhat, I wanted to get rid of that errant data point.  I looked around for a Whisper DB editor, but didn’t find anything.  Graphite’s all open source, so I probably could build one myself, but I really didn’t feel like going that far.  Then I remembered the “Feeding in Your Data” page in the Graphite docs, where it talks about using the command line to send data values.  Maybe if you can write datapoints using this method, you can overwrite datapoints using this method, too.  So, I figured I’d give it a shot.

The example they gave on the page is this:

echo "local.random.diceroll 4 `date +%s`" | nc ${SERVER} ${PORT};

The “local.random.diceroll” part is your counter name.

The “4” part is the data you want to write.

And the “date +%s” is just a fancy way of saying the Unix Epoch Timestamp of Now.

So, in my case, I’d overwrite the counter “stats.gauges.Temperature.LivingRoom” with a comfortable room temparature value of somewhere between 20 and 25.  But what about the timestamp?  I can’t just go in and hope I get the timestamp.  I can guess from that graph that it happened sometime around 00:32:30, but who knows if I’m right.  And what timezone is Whisper using?  Local time?  UTC?  And if it’s UTC, is that + 8 hours or +7 hours this time of year…?  I needed a better way to get the exact timestamp.

Fortunately, Graphite makes that relatively easy.  You see, you can get the data in json format if you want.  While it’s not as pretty as the graph, it does have the exact values of the timestamp you’re looking for.  Getting the json is fairly straightforward.  First, you go to the Graphite Browser and find the data you want to fix.  Once you have it in the window, right click and open the graph in a new tab (Or copy/paste the graph URL, either way works).  From there, edit the URL of the graph, by adding “&format=json” to the end.  Load that page and your screen will fill with json datapoints.  Like so:

In that sea of numbers, find the value you want to replace.  In my case, it’s easy to find, because it’s the one claiming that my living room jumped up to 6 times hotter than the surface of the sun for a moment.  The second value in that datapoint is the timestamp I need to wipe out the errant temperature spike.  Now that I have it, I can run the following command to put things right:

echo "stats.gauges.Temperature.LivingRoom 22.8 1373614500" | nc localhost 2003

And now my living room is back to a comfortable 22.8 degrees.

July 13, 2013   No Comments

Dear Bastards:

Thank you for ruining my site.
Thank you for ruining my week.
I hope you are enjoying the two whole cents you got for hacking my site.

P.S.:  May you be mauled by a bear.

July 6, 2011   No Comments

How To Put Non-3DS 3D Pictures On Your 3DS.

So, the Nintendo 3DS has been out for a while now, and you’ve probably all been amazed by the glasses-free 3D screen1.  If you’re like me, your first thought after holding it was “Wow, the 3D camera on this thing sucks, I wonder how I can go about getting pictures from my twinned 7.1 MP Canon A570 CHDK/StereoDataMaker rig on this screen?”  Well, today, I bring you the answer.

First, you need to turn your 3D images into MPO files.  MPO is the relatively new defacto standard image type for 3D cameras.  It’s what the Fuji Real3D series used and what the 3DS uses.  As I understand it, MPO stands for “Multiple Picture O”2, and the file is essentially just two JPEGs glued together.  This file format was created because apparently simply using a standard side-by-side JPEG format stereo pair that could be opened and viewed and edited by any image manipulation software package made since 1996 and that stereo enthusiasts have been using for years was just too limiting.  Anyway, the tool I’d recommend for converting your images to MPOs is Stereo Photo Maker.  SPM is a bundle of complete awesomeness in a zip file, and if you want to do anything involving 3D photography, you want SPM. 3

This tool can do a lot of things, but one thing you’ll want it to do for you is resize the MPO images to 640×480.  Yeah, that’s tiny, but that’s the native resolution of the 3DS cameras, so it’s the size that the 3DS is used to dealing with.  The 3DS currently does not have any kind of zooming support, so even if you go with a higher resolution, it’s not going to do you any good at all.  All it’ll do is waste a lot of space on your SD card.  When you look at your pictures on the 3DS, everything will look just fine.

Anyway, once you’ve turned your traditional stereo pairs and turn them into these newfangled MPO files, you’ll quickly discover that you can’t actually see what’s in the file.  That’s because Windows doesn’t understand what an MPO file is, so it refuses to render thumbnails.  As always, someone on the Internet has already solved the problem for you:  This guy has created some registry files which tell Windows Explorer that .MPO files are really JPGs, so Windows Explorer will happily render thumbnails for you, and you’ll no longer be blind.

Okay, so, you’ve got a ton of MPO files, now you need to get them onto the 3DS to view them.  You have to put your images in a certain directory and name your images a certain way or the 3DS will get confused and refuse to show them.  I’m not exactly sure what the rules are, but I’ve had fairly good luck with the DCF Standard for naming files and folders.

Files:CCCC####.mpo“, where C is an alphanumeric character (including “_”), and #### is a four digit number between “0001” and “9999”.  “0000” cannot be used.


  • Valid: ABCD1234.mpo, 12341234.mpo, HNI_0001.mpo, ZLDA6502.mpo, YOSE0032.mpo, IMG_1234.mpo
  • Invalid: Picture.mpo, 3D.mpo, 1234ABCD.mpo, ABCD0000.mpo

Directories:###CCCCC“, where C is an alphanumeric character (including “_”) and ### is a three digit number between “100” and “999”.  “000”-“099” cannot be used.


  • Valid: 123ABCDE, 12345678, 100NIN03, 128MARIO, 2600YOSE
  • Invalid: Pictures, 3D, ABCDE123, 065ABCDE

If that naming doesn’t work, take a picture with the 3DS and mimic its file naming scheme exactly.

By now, you’ve given your files an approved name and stuck them in a directory with an approved name.  You’re almost there.  Take that directory and copy it to an SD card, under the “DCIM” folder.  I’d recommend using a spare SD card that you’re not afraid to wipe clean, rather than the card you typically use for the 3DS. 4 I’d do this step with just a handful of images to start with, just in case it doesn’t work the first time.  Your files should now be on the SD card, under a path similar this:  \DCIM\2600YOSE\IMG_1234.mpo.  Take that card, pop it into the 3DS, open up the Nintendo 3DS Camera app…

And wait.

And wait…

Every time I do this, the 3DS has to figure out what in the hell I’ve just done to it.  I think it’s reading the directory and producing thumbnail images or something like that.  I don’t really know what sort of craziness is going on behind the scenes, I just know that when you give it over a thousand files, it takes a while to get ready.  First, it’ll say “Preparing…”, then it will have to “Update the Management File”, and both of those stages can take upwards of several minutes to complete.  Just be patient and it’ll eventually work. 

(Or not…  Have I mentioned that everything you do with this information, you do at your own risk?  I haven’t had any problems with this, nor with the testing and exploring I did prior to finding something that worked, but that doesn’t mean you won’t run into issues that I didn’t have.  And if you do, those problems are between you and your local Nintendo Authorized Service Center.  If Nintendo had wanted us to put our own 3D images from other sources on the 3DS, they would have, you know, made it easy to do.  I make no claims as to the safety or accuracy of the method described above.)

Anyway, now you have your non-3DS images on the 3DS.  The first thing you’ll notice is how much the built in camera really does suck, now that you can compare your outside images on the same screen.  Your images will look sharp and clear, while the images taken by the 3DS are grainy, full of artifacts, and generally look like they were taken using a 1997 model Logitech Quick Cam.  The next thing you’ll notice is how other people are actually willing to look at all those 3D pictures you go around taking, now that they don’t have to wear those stupid glasses all the time.  Every single person I’ve shown it to has remarked how much nicer it is to look at my 3D pictures on the 3DS than any other way.

Of course, now I have to share my 3D pictures with you, in case you don’t have any of your own:

Yosemite:  https://mathpirate.net/hold/3DS/Yosemite3DS.zip 27 pictures of Yosemite National Park, including Glacier Point, the Ahwahnee, Tioga Road, and the Sentinel Dome trail.

Central California: https://mathpirate.net/hold/3DS/CentralCalifornia3DS.zip  56 pictures, including Old Sacramento, Monterey, San Juan Bautista, Pinnacles National Monument, the Big Sur Coast, and Sequoia and Kings Canyon National Parks.

Zion National Park: https://mathpirate.net/hold/3DS/ZionNationalPark3DS.zip 19 pictures of Zion National Park.

  1. As long as you’re DIRECTLY in front of it and the right distance away. []
  2. The “O” is like David O Selznick’s middle initial:  It doesn’t stand for anything, it’s just there and no one really knows why. []
  3. I’m not going to give instructions on using SPM if you haven’t already.  The tool is fairly easy to figure out and there are tons of how-tos on the site and elsewhere on the IntarWebz.  One point of advice:  Use the Auto-Align feature, which will do an amazing job of merging your pairs. []
  4. I’ve had to delete the phtcache.bin file somewhere under the “Nintendo 3DS” directory a couple of times to sort things out and force the system to refresh all of the pictures.  Plus, if anything goes wrong, you don’t want it going wrong on your main card. []

April 9, 2011   8 Comments

Time Is An Illusion, Anyway

This week has been rough.

I’ve been working through a new strategy that promises to make our company’s deployments to production at least ten times faster than our current process.  While it’s going to make things easier for us in the end, getting there is anything but easy.

I’ve gotten permission errors.

I’ve hit ACL problems.

I’ve come across registry access violations.

I’ve had writeable UNC shares turn read-only.

I’ve seen application pools die and IIS refuse to start.

I watched installers fail to run remotely, successfully run locally, then fail to run locally under the exact same circumstances two minutes later.

I even had UAC end up locking my account because it decided that I’m not trustworthy enough to enter a password for a installation tool from an unelevated command prompt.

It’s been a never ending stream of failure and frustration.

I thought I’d seen it all.  Then today happened.

I left the office last night feeling really good about where things were at.  I finally worked through all of the permission problems, all of the path access issues.  Everything was running under the right accounts, and stuff was flowing through the system and installing flawlessly.

Put a checkmark on the list, I’m done!

I planned on coming in this morning, updating some release instructions, then moving on to the second piece of the process.  The second piece is very similar to the first, so I figured I’d breeze through the day and have everything up and running in time to leave work during rush hour.  I want to preface the release instructions with a link to the progress I made, so I go to the site that installed flawlessly last night and try to pull it up.

IIS Yellow Screen Of Death

Ah crap.  That sucks.  I sort of expected something like that, though.  We’re doing things that are wild and new for our company, and most of the problems we’re seeing are the result of inexperience with the technology.  I figured the site would have died sometime in the middle of the night for some reason or another.  I figured that it would be something we’d just overlooked, something easy to fix.

I didn’t figure on getting an error message that was last seen in 1997.

An error occurred loading a configuration file: Failed to start monitoring changes to ‘[filename]’ because the network BIOS command limit has been reached.

The network BIOS command limit has been reached…?  WTF?

Am I running low on “System Resources” now, too?

What in the hell does that mean?  Network BIOS command limit…

I do a search and immediately find many other people with the same problem, all of whom are saying that the KB article the error message points at is completely useless.  Instead, they say you have to pull a registry setting out of thin air, and that’ll solve your problems. 1  Turns out that the way IIS monitors file system changes on UNC shares can clog the tubes, and that magical reg key tries to unclog them.  Eventually, I get it to work and carry on with the tasks of the day.

It all goes fairly well and smoothly.  As I had hoped, the experience from setting up the first piece of the deployment process translated very closely to setting up the second piece.  It only took two hours to get through the same amount of the process that had taken three days the first go around.  And most of that two hours was spent keeping detailed instructions so that next time only takes half an hour and the time after that can be fully automated.

All is well.

In the very last part of the setup, I had to install a Windows component, then reboot the box. 2  I give the box a minute, then try to remote back in.  Terminal Services Client blinks at me, but does nothing.  I try again and again it blinks.  A third time, and I get a failed to connect message.  Fine, maybe it’s still rebooting.  I give it another minute and try again.

Remote Desktop cannot connect to the remote computer because the authentication certificate received from the remote computer is expired or invalid.  In some cases, this error might also be caused by a large time discrepancy between the client and server computers.

Uh, okay…  Never seen that error before.  Did the network flip out, is the server confused?  Maybe I just have to give it a bit more time before trying to connect again.

So I give it another minute.  It gives me the error again.

The second sentence intrigues me.  A large time discrepancy, eh?  Hmmm…

Last year, during a brief foray into temporal mechanics, I learned all about how Windows deals with time and time synchronization.  One of the things I found was a command line tool in Windows called “w32tm”.  That program has a command line switch, “/stripchart”, which can show you how far off your system’s clock is from that of another system.  Normally, when dealing with a pair of computers on a corporate network, tied to a domain, you’ll find that the clocks will only differ by a few seconds at most.  You can run w32tm /stripchart and watch as the two machines drift around in time, speeding up, slowing down, and dancing around the time synchronization point.  Try, for instance, “w32tm /stripchart /computer:time.windows.com”, and see where you are in comparison to the Windows time server.

Anyway, w32tm’s stripchart seemed like the perfect tool to investigate this potential “large time discrepancy”.  What would it be, an hour, two hours, maybe even a day?

The current time is 3/3/2011 4:52:43 PM.
16:52:43 d:+00.0020000s o:-31607977.8967224s  [@                          |                         ]

The current time is correct.  I ran it at 4:52 PM on March 3rd, 2011.  “d:” is, I believe, the “delay”, the round trip time between the servers.  2 ms response time.  Not bad.  And “o:” is the time offset, in seconds, between your computer and the remote computer.

o:, in this case, is -31.6 million seconds.

In case you don’t feel like doing the math, 31.6 million seconds is one year, 19 hours, 59 minutes, and 37 seconds.

The computer rebooted and came back one year, 19 hours, 59 minutes, and 37 seconds in the past.  I think I’d agree with the error’s assessment of a “large time discrepancy”.

The computer now believes that it is March 2nd, 2010, at around 8:50 PM.  And I can’t convince it otherwise.  If I go on the box and try to change the time manually, it immediately corrects itself to March 2nd, 2010.

Now, ordinarily, I’d say that such an error was the result of time synchronization service gone awry, or maybe some failing system hardware.  However, given the events of this past week and all of the strange behavior that I’ve seen, I believe it is equally likely that that particular computer has actually travelled back in time and is running in our datacenter exactly one year, 19 hours, 59 minutes and 37 seconds ago.

Now, if you’ll excuse me, I have a hole in time to exploit and profit from.

  1. Under HKLM\Software\Microsoft\ASP.NET, create a new value called “FCNMode” and set it to 2 to change the way IIS monitors file change notifications, or set it to 1 to disable the notifications altogether.  Other sites suggest the same value, but under the HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\ASP.NET key instead.  Try both.  Then reboot. []
  2. Why they haven’t figured out the whole rebooting thing for the case where I just installed a minor application, I don’t know, but whatever… []

March 3, 2011   No Comments