Monday, December 3, 2012

RTLSDR and High Altitude Ballooning

As I mentioned earlier, I have a vested interest in Amateur Radio and High Altitude Ballooning.  This past summer, I came across the existence of a new device called the RTLSDR, or RealTek Software Defined Radio.  It's a little USB device that you can plug a pigtail to an antenna into.  Mine came with a little magnet-mount antenna, but it's not very big, therefore it gets poor reception.  To remedy this, I acquired an MCX-to-SMA adapter, which I was able to link to an SMA-to-SO239 adapter, and finally onto a groundplane antenna that I built earlier this year and installed outside.  Reception increased significantly, as a result.  While it is not very efficient at picking up satellite transmissions, it's terrific for picking up AM/FM radio and Ham Radio transmissions.  Since APRS generally works in the area of 146Mhz, and that is what the groundplane antenna was built for, I was in luck.

A Groundplane antenna.  This is not mine, it belongs to KC8YVF.  This looks similar to mine.

Here is the completed groundplane antenna as I am holding it, before it was installed.

Recently, the California Near Space Project sent a high altitude balloon across the Atlantic Ocean.  It came to rest somewhere in the western portion of the Mediterranean Sea, breaking a world record.  Two days ago, they sent another long duration flight up.  Now that I knew about it, I was able to prepare.  I set GQRX to listen on the APRS frequency of 144.390Mhz.  Since we get some APRS traffic around, I was able to test it out to see how big of a window to set it to.  15khz seemed about right for the packets I was receiving, and since I wasn't getting any mangled packets, I figured it was a good place to keep it at.  Usually I run GQRX for a short amount of time - usually an hour or less.  I typically don't keep it running, as it is prone to the occasional crash.  However, since I was keeping it in one place, I didn't think that a crash was likely, so when CNSP-18 was over Colorado around 6:00AM CDT, I turned down my master volume after setting everything up, turned off the monitor and left for the day.  When I got home in the afternoon, I had a lot of traffic logged.  I didn't see K6RPT-12 right away, so I saved a copy of the log and searched it.  Sure enough, there were more than a few handfuls of telemetry!

Ubuntu 12.04 with Google Chrome running in the background and GQRX running in the foreground, complete with packet decoder window.  Enlightenment 17 is the window manager of choice.
Below is the traffic that I was able to collect.  It looks like there may have been some congestion on the APRS network since received packets were spaced apart about 10 minutes or so, while tracking via aprs.fi were generally about 2 minutes apart.  However, as the balloon got closer, the received signal grew, thus allowing less packet loss.  Conversely, as the balloon floated away toward Detroit, the number of packets decreased.  A lot of factors go into good and bad signals.  Distance is usually the key factor, but things such as wind gusts can throw some monkey wrenches into the works.


07:49:58$ fm N0AN-0 to APU25N-0 via W0ISU-0,WIDE2-1 UI^ PID=F0
          }KC8SFQ-14>APWW10,TCPIP,N0AN*::K6RPT-12 :?APRSP
07:50:29$ fm N0AN-0 to APU25N-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          }KC8SFQ-14>APRS,TCPIP,N0AN*::K6RPT-12 :?APRSP
07:50:42$ fm K6RPT-12 to APBL10-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          !4000.26N/09736.01WO082/150/A=103726V1D4    CNSP-18    CNSP-Inc.com.700
08:01:53$ fm K0SXY-0 to APU25N-0 via WA0ROI-1,W0ISU-0,WIDE2-0 UIv PID=F0
          }KC6VVT>APWW10,TCPIP,K0SXY*::K6RPT-12 :?APRSP
08:01:54$ fm N0AN-0 to APU25N-0 via W0ISU-0,WIDE2-1 UI^ PID=F0
          }KC6VVT>APWW10,TCPIP,N0AN*::K6RPT-12 :?APRSP
08:01:56$ fm N0AN-0 to APU25N-0 via W0ISU-0,WIDE2-1 UI^ PID=F0
          }KC6VVT>APRS,TCPIP,N0AN*::K6RPT-12 :?APRSP
08:10:44$ fm K6RPT-12 to APBL10-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          !4007.27N/09633.39WO072/158/A=107579V1E5    CNSP-18    CNSP-Inc.com.700
08:27:06$ fm K6RPT-12 to APBL10-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          !4016.34N/09553.40WO066/204/A=000095V1F6    CNSP-18    CNSP-Inc.com.700
08:50:42$ fm K6RPT-12 to APBL10-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          !4024.13N/09412.49WO050/142/A=000101V200    CNSP-18    CNSP-Inc.com.700
08:52:34$ fm K6RPT-12 to APBL10-0 via WIDE2-1 UI^ PID=F0
          !4047.54N/09409.75WO069/174/A=110837V211    CNSP-18    CNSP-Inc.com.700
08:54:34$ fm K6RPT-12 to APBL10-0 via WIDE2-1 UI^ PID=F0
          !4031.37N/09405.15WO068/159/A=000101V211    CNSP-18    CNSP-Inc.com.700
08:56:34$ fm K6RPT-12 to APBL10-0 via WIDE2-1 UI^ PID=F0
          !4051.56N/09355.87WO070/171/A=109987V211    CNSP-18    CNSP-Inc.com.700
08:56:37$ fm K6RPT-12 to APBL10-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          !4051.56N/09355.87WO070/171/A=109987V211    CNSP-18    CNSP-Inc.com.700
09:02:58$ fm K0SXY-0 to APU25N-0 via WA0ROI-1,W0ISU-0,WIDE2-0 UIv PID=F0
          }W7BOZ-10>APWW10,TCPIP,K0SXY*::K6RPT-12 :?APRSP
09:06:54$ fm K6RPT-12 to APBL10-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          !4101.42N/09320.35WO071/176/A=110673V211    CNSP-18    CNSP-Inc.com.700
09:24:33$ fm K6RPT-12 to APBL10-0 via WIDE2-1 UI^ PID=F0
          !4118.17N/09214.06WO067/184/A=111368V211    CNSP-18    CNSP-Inc.com.700
09:24:36$ fm K6RPT-12 to APBL10-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          !4118.17N/09214.06WO067/184/A=111368V211    CNSP-18    CNSP-Inc.com.700
09:26:33$ fm K6RPT-12 to APBL10-0 via WIDE2-1 UI^ PID=F0
          !4113.38N/09206.77WO068/175/A=000108V200    CNSP-18    CNSP-Inc.com.700
09:28:28$ fm N0AN-0 to APU25N-0 via W0ISU-0,WIDE2-1 UI^ PID=F0
          }N8NJ>APWW10,TCPIP,N0AN*::K6RPT-12 :?APRSP
09:28:33$ fm K6RPT-12 to APBL10-0 via WIDE2-1 UI^ PID=F0
          !4122.91N/09158.98WO069/182/A=111736V200    CNSP-18    CNSP-Inc.com.700
09:32:33$ fm K6RPT-12 to APBL10-0 via WIDE2-1 UI^ PID=F0
          !4127.01N/09143.91WO070/181/A=111516V200    CNSP-18    CNSP-Inc.com.700
09:34:33$ fm K6RPT-12 to APBL10-0 via WIDE2-1 UI^ PID=F0
          !4128.87N/09136.29WO072/182/A=111647V200    CNSP-18    CNSP-Inc.com.700
09:34:40$ fm K6RPT-12 to APBL10-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          !4128.87N/09136.29WO072/182/A=111647V200    CNSP-18    CNSP-Inc.com.700
09:44:36$ fm K6RPT-12 to APBL10-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          !4138.14N/09057.43WO072/185/A=111277V211    CNSP-18    CNSP-Inc.com.700
09:46:41$ fm K6RPT-12 to APBL10-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          !4140.04N/09049.68WO072/181/A=111011V200    CNSP-18    CNSP-Inc.com.700
09:52:37$ fm K6RPT-12 to APBL10-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          !4144.76N/09015.04WO072/198/A=000111V211    CNSP-18    CNSP-Inc.com.700
09:58:49$ fm K6RPT-12 to APBL10-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          !4149.69N/09001.80WO076/191/A=110889V200    CNSP-18    CNSP-Inc.com.700
10:12:35$ fm K6RPT-12 to APBL10-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          !4145.27N/08910.26WO080/187/A=000111V200    CNSP-18    CNSP-Inc.com.700
10:15:48$ fm K6RPT-12 to APBL10-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          !4200.16N/08856.54WO078/182/A=111047V200    CNSP-18    CNSP-Inc.com.700
10:19:41$ fm N0AN-0 to APU25N-0 via W0ISU-0,WIDE2-1 UI^ PID=F0
          }VE3PWD-1>APRS,TCPIP,N0AN*::K6RPT-12 :?APRSP
10:26:35$ fm K6RPT-12 to APBL10-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          !4154.51N/08812.68WO075/179/A=000111V200    CNSP-18    CNSP-Inc.com.700
10:34:37$ fm K6RPT-12 to APBL10-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          !4159.33N/08741.31WO078/171/A=000114V211    CNSP-18    CNSP-Inc.com.700
10:36:39$ fm K6RPT-12 to APBL10-0 via W0ISU-0,WIDE2-0 UI^ PID=F0
          !4216.55N/08732.04WO075/168/A=109908V211    CNSP-18    CNSP-Inc.com.700
10:51:53$ fm K0SXY-0 to APU25N-0 via W0ISU-0,WIDE2-0 UIv PID=F0
          }DL2SCH>APRS,TCPIP,K0SXY*::K6RPT-12 :?APRSP

Thursday, November 1, 2012

Using Linux to Find Bad Sector Data

Most of us have probably encountered the dreaded NTFS monster.  It's usually easy to fix with chkdsk /f /r or chkntfs.  However, there is one thing that these utilities can NOT fix: bad sectors.

Enter Linux.

If you have a Windows boot disk or WinRE partition, there's a good chance that you can restore a system to full working order if your hard drive doesn't have bad sectors.  However, if you start seeing things like this during a chkdsk:



...then there's a very good chance that you're looking at some hardware level corruption.  In addition to the Blue Screen Of Death (BSOD), I noticed that plugging the HDD into another computer generated a S.M.A.R.T. error!  I could still access data on the drive by mounting it in Linux:



If you don't have the ability to just arbitrarily connect a random HDD to your computer, you could always opt to create a backup over the network.  To accomplish this, Clonezilla is a solid contender.  But, to do it over the network, you'll need a method.  PartedMagic comes out on top by packaging Clonezilla, along with a variety of backup and restore methods.  There are a number of ways you can backup and restore on the network: SSH, CIFS, NFS are just a few to name.  I prefer SSH since it's secure connection is bar-none and the encryption overhead doesn't drag the speed of the connection down too far.  If I was on a firewalled LAN, I'd probably go with CIFS.  However, SSH is ideal for internet-based backup and restores.  It also plays nice with Windows and BSD systems.

Of course, with all backups comes with it the risk of data corruption:



So, what to do?  Well, that's why I have decided to open my case up and hook it up to a free SATA port.  Thankfully, I'm not watching any movies at the moment, so I can disconnect my DVD drive and hook it up that way:



This allows the aforementioned ability to directly mount it.  Now, with that setup, let's see if we can actually find out WHAT files are sitting on WHICH bad sectors, shall we?  First of all, let's see what there is to work with and see what's actually taking up space.  Then, let's look at some important directories:



Hmmm, well the Boot directory looks okay.  The others seem to be doing okay up through MSOCache.  What about ProgramData?



OH!  What's this?  Core dumped?!  When was the last time you saw the du command dump a core?  And did it flush...?  Well, there seems to be some kind of irony to all of this... There appears to be 9 of the original 11 reported bad sectors here.  That means that there are 2 more bad sectors elsewhere on the disk.  I think it's safe to say that the restoration process won't be losing any seriously important data this time around!  Of course, there's more than one way to break a window:



After manually checking the rest of the disk, I could not find the other 2 bad sectors.  It's entirely possible that they were remapped at some point.  Perhaps the failing of S.M.A.R.T. had something to do with it.  Perhaps I just don't know.  That's the risk of backup and recovery, you just never know what's going to happen.  In all likelihood, they are probably buried in the ProgramData directory, but du bottomed out before it got to them.  It would take some digging around to find out the exact spots... that's really beyond the scope of this article.

Of course, if you really wanted to get fancy, you could install smartmontools and get some diagnostic information straight from the drive:



And if you ask it REALLY nicely, it will give you some human-readable content:



Whoops, less than 24 hours left!  I better get a move on...

Addendum: It should be noted that, if you had bad sectors but the S.M.A.R.T. tools says that your disk is fine, then perhaps you should look into shrinking the NTFS partition(s) to avoid the bad sectors.

Welcome!

Welcome to my first blog post!

I know, it's a shocker.  Of all of the social media blogs that I've had, in addition to my own domains (may they R.I.P.), why bother with another?

Well, as you can see, this is my tech blog.  Basically, anything that I do that relates to technology that I wish to share with the world will simply go here.  Howtos, ideas, methods, stuff that I'm working on... it'll all go here.  Computers, electronics, radios, all that fun sort of stuff.  Here.

As this is the first time I've used a blog site that creates everything for me and I just have to add data to it by typing it or adding links and other things, I'm going to go ahead and say that, so far, I like Blogger.  The fact that Google acquired Blogger awhile ago wasn't too surprising, but since they've gone and integrated it into everything else (Gmail, G+, Youtube, Maps, Drive, Calendar, etc etc etc...), I felt that the time came that I wanted to write more than a quick update to G+ or, God forbid, Facebook.  While FB makes me feel things that I wish I couldn't feel, it has a certain usefulness to itself.  Myspace was an interesting theory, as was Yahoo! 360, but it was certainly time to move up and move on.

So here, and now, this blog shall encompass all about me that is geeky, nerdy or otherwise just downright technical.

I won't promise how often I'll update and I won't promise what sort of trends I'll go along.  However, I CAN tell you what my current interests revolve around inside of my head:

  • Computers.  Mostly hardware.  I was into computers for over a decade, taking them apart, cleaning them, putting them back together, adding new parts, making them run faster... that sort of thing.  I did the software thing too, but not to the level of engineering degree that I was able to do with hardware.  Eventually, I went on to get an Associates Degree in Information Technology.  So yeah, I self-educated and then went after the real deal.  I suppose you could say I'm an oddball that way.  Yes, yes I am, and damn proud of it.  I worked more than a handful of paid jobs using such insight and had fun at each and every one of them.  I met a lot of interesting people along the way and learned a lot of things about life while I was at it.  It was worth it.
  • Radio.  So, eventually, I got my Ham Radio license.  My callsign is KD0FHS.  I found the unique randomness of having such a callsign assigned to me by a computer very difficult to fathom.  Honestly, it was totally random, but to have the suffix, FHS, match up as the same initials of the high school that I attended, Fairport High School, I began to wonder if anyone back there would wonder if I went out of my to get it as a vanity call.  Well, no one's ever really said anything about it, although I have seen a few eyebrows arched.  Well, enough about that, my interest in radio frequencies and other such topics is quite varied.  I enjoy local communication as well as long-range HF stuff.  The ability to talk to and listen to satellites, along with the International Space Station is among some of the fun things that I've always aspired to do.  Being a Ham allows me to explore these things.  Of course, the people that I've met that have taken the time to help me along the way are some of the nicest people I've ever met.  The Amateur Radio community is quite eclectic, but without each other, there wouldn't be a community!
  • Electronics.  My interest in general electronics dates back to the late 90's when I got into CB radio.  There really wasn't much to it, but it was fun to tinker around with flashlights and other basic devices.  I even took a class in basic electronics.  Sadly, my interests gravitated toward computers and their operation and less on the electronic side of things.  It would be nearly a decade until I realized the importance of electronics.  That is why I am pursuing my Bachelor's Degree in Electrical Engineering.
  • High Altitude Balloons.  Even before I arrived at Uni, I knew that I would never realize my childhood dream of becoming an astronaut.  However, it was many years until I realized that I could help others achieve that dream.  Even if I could not, what right would I have to prevent others from doing so?  There is so much in our own Solar System to explore, and it's just something that I know will happen.  It's already happening with unmanned missions, but in order to test theories and find new facts, it's helpful to go up, WAY up!

So, that's pretty much it in a nutshell.  Right now, I'm finishing up my mathematics and about to delve into the wonderful world of physics.  I have discovered that LaPlace Transforms are easier than I thought they could be.  So, sometimes I might even blog about math.

-Scott