After buying the budget RTL-SDR I decided that I needed to go lower. The Nooelect upconvertor was just a bare board though, and the adapters and cables started to piss me off almost immediately.

USB->RTL->upconvertor->antenna, plus another USB to power the upconvertor. Just didn’t seem right. Also it was obvious running the setup anywhere near my computer resulted in tons of wideband noise being picked up.

So I bought a Hammond project box and stuffed it all in there.

20130517_164033

As you can see, instead of using connectors, I pulled the RTL USB connector off, as well as the SMA connectors on the upconvertor board and wired it up directly. Instead of an SMA antenna input, I switched to BNC which matches more of my stuff, and wired a panel mount to the upconverter board.

20130517_162222

 

The USB connection was the uglyest:

20130517_16223320130517_163445

I originally intended to solder directly to the leads on the RTL USB connector, but that didn’t work out very well, so I pulled the connector off completely. You’ll also see a small toroidal choke that I ran the cable through which was recommended to limit the harmonics from the digital signal I assume. I put it inside to be clean, but I’m wondering if it would work better if I kept it outside the case. I can use a clamp on choke outside as well I suppose.

20130517_151620

Since the RTL board didn’t have any mounting holes I just used half of the clamshell case to cradle it, and mounted that to the case with a single standoff.

20130517_16405420130517_162142

 

Overall I think it looks okay, and is much more functional. I’ll post some screenshots of spectrum once I test it connected to an antenna.

References:

Hammond Box: 1550B I think. 

Choke: http://www.amazon.com/dp/B009N83WFK/ref=pe_175190_21431760_3p_M3T1_ST1_dp_1

BNC Panel Mount: http://www.amazon.com/gp/product/B00AUB5X2Y/ref=oh_details_o09_s00_i00?ie=UTF8&psc=1

USB Pinout: http://pinouts.ru/Slots/USB_pinout.shtml

 

 

 

Scanners

Recently I ran across a neat hack. If you buy one of the low priced HDTV tuners that plug into your USB port, there are drivers that can use the internal sampler which runs at above 2.4Ghz to sample RF. Boom, software controlled radio.
dongle

The best part is that these only cost on the order of about $20, so you can start scanning the airwaves with a few different software packages:

sdrsharp

SDR# - This is a C# program and runs great in windows, but you can run it using Mono in Linux (and perhaps Mac?)

 

Gqrx receiving NOAA-15 weather satellite

 

GQRX is powered by gnuradio, and provides a good interface in Linux. Gnuradio is very powerful with routing features, many filters, and decoding possiblities, but if you’re not used to the Linux environment, it can be a little intimidating.

Because the sampler chip only will go down to about 50Mhz, I purchased a $50 upconverter from Nooelec, which provides an IF mode 100Mhz higher than the receive frequency. Simply put, it boosts everything by 100Mhz. So now I can listen to AM radio for example, that was 820Khz, far too low for the dongle to receive  at 100,820Khz. Something well within the band of the dongle. This makes CB, Shortwave, and other HF and VHF bands available as well. Shortwave is very interesting. Lots of extreme paranoia emanating from Nashville these days.

The other thing that’s lots of fun is decoding the digital transmissions you’ll find. PSK, FSK, RTTY and even pager transmissions can be decoded.

Since the bandwidth is so huge, I purchased a discone antenna which works well so far. Soon I’m going to combine the dongle and upconvertor into a single box, which makes it easier and may improve performance as well.

FTC tournament

On the 8th, I volunteered at a robotics competition put on by FTC out in Palm Springs.. was pretty neat. The kids were great, and the robots were really creative. Here’s some video:

I think it’s awesome that people spend as much time that they do helping our youth become creative problem solvers and critical thinkers. I wish it happened more.

Cellphone…Booster..Wifi..SIP….VoIP….MADNESS

Okay.. So I live in a hilly area, in kind of a nook and even there’s a Sprint cell tower only about 2 miles from my house, I get terrible reception. Like really bad. I have to climb the steps up to the hill behind my house to really make sure the call isn’t dropped.

Almost more annoyingly, I miss calls constantly.

There’s a few solutions to this. I’ve played with a cellphone signal booster, which works, but really requires a line up to the roof, and with my roof access currently blocked by a blooming acacia tree filled with bees, I decided to go another route.

I was thinking that it would be nice if while I was at home, my android phone could switch into WIFI mode, and send/receive called over VoIP, and then switch back to CDMA mode when I leave and go elsewhere. Easy right?

Well. No. Not easy. But possible. Here’s how I did it.

Prerequisites:

Overview:

The idea is that you have two endpoints for calls, your normal cell phone #, and your SIP/VoIP number. Google Voice will then route incoming calls on your voice number to the proper endpoint based on how you configure it.

Then Google Voice Locations app will use the location awareness of the phone to dynamically reconfigure google voice based on where you’re at.

For Sprint users your voice # can be the same as your cell number, resulting in some routing magic akin to lifting yourself by your own bootstraps.

Outgoing calls are handled by Voice+, for VoIP calls.

Steps:

  1. First create the necessary accounts for your Voice, SIP and your new VoIP #.
  2. Connect your VoIP # to the sip account. No tricks there.
  3. Setup Google voice with this new VoIP # as a forwarding number.
  4. Install the recommended Apps on your phone. I had no issues with these, csipsimple is sip2sip.info aware, and makes it easy.
  5. Setup Voice Locations to route based on your location.

Voila.. try calling out (You may have to buy some calling credits on sip2sip.info, but it’s like 2 cents a minute.. $20 would last me a year..)

Have a friend call you. Should route through voip.

You may also route manually using Google voice settings, or have it setup to just route to the VoIP endpoint if your normal number doesn’t pick up after a couple of rings.

Since I do get some service at home, I set my phone to airplane mode, and then manually turn on just WIFI – this will (at least on my HTC EVO) turn off the CDMA modem, so my phone is essantially just an IP phone at that point.

This is all working on my HTC EVO 4G phone, rooted and running the Nitrous ROM (great for the EVO BTW.. really fast) - but there’s nothing here you shouldn’t be able to do on a non-rooted phone.

If anyone has any questions.. hit me up.

Email Deluge…

The other day I recieved about 250,000 emails from a script I wrote.. I was in a hurry and didn’t properly log the output like I should of, or limit by quantity, or use any one of the 1000 better methods in my app. I simply sent out an email when it hit an error at a certain point to let me know.

This has worked fine for some time, but an external team is responsible for writing plugins to the application, and their plugin hit a service that was throwing an error..
so yeah.. IMAP4 with 250K emails to download and delete. Thunderbird croaked under the pressure.
I fired up an instance of Roundcube which is a web-based client, and in my experience performs REALLY well under large email load hoping I could take care of it, but I ran into an unfortunate fact that I could only delete groups of 100 emails or so with it.
So yeah – that won’t work.
After googling around for a bit, I ran across an old post on http://lukecyca.com/ that had a nice Python recipe to solve my problem. Observe the power of Python:
import imaplib
from getpass import getpass

imap = imaplib.IMAP4_SSL('mail.example.com')
imap.login('luke',getpass())

imap.select()
typ, data = imap.search(None, '(FROM "zabbix@example.com")')
for num in data[0].split():
    imap.store(num, '+FLAGS', '\Deleted')

imap.expunge()
imap.close()
imap.logout()

This obviously filters by ‘From’ address, but you can easily filter by other stuff. Look here for more info.

This took a while, but it was automatic and saved me a lot of time. Thought I’d pass it along.

Easy LDAP

After spending hours wrapping my head around OpenLDAP and creating a single instance of it, getting 5 test servers to authenticate against it, and seeing it work I had to stop and think to myself, “Why the hell is this so hard?”

LDAP or Lightweight Directory Access Protocol is a way to store and access data. It’s usually used for storing contact information and passwords so that you can have a single source of this information for the many services a network provides. Makes updating passwords much easier.

OpenLDAP is essentially just a database. A hierarchical key/value store with search and indexing capabilities. It seems to be engineered to be difficult on purpose, but always comes up first in Google searches, so I assume it’s the leader in it’s field.

If that’s what I need to do to figure out LDAP, fine I’ll do it, and honestly after a bit, it did get easier once I saw how the server was architected.  Then I tried to slave another backup LDAP server to it.

Bad move. I mean.. I assume it’s possible, and there’s probably lots of smart people who can set it up in seconds, or minutes or something faster than the hours I spent before I gave up trying to get it to work.

Typically in the linux world, the documentation isn’t super great. It makes perfect sense to the person who’s already familiar with the system, but a little worse for learners. And I have to admit, I didn’t hop on my neighborhood IRC channel to ask for help, or mail list.

After poking around a while I found OpenDJ. A Java based LDAP server. Keep in mind that I’m not a fan of Java’s typical memory-hogging meager performance, but I was a little desperate to find something to vindicate my strategy of using LDAP in the first place.

Surprisingly it was a pleasant experience, not unlike my surprise when first using Jenkins.

Go check out their quickstart guide!

We’re fallible, but it works.

Reading over the posts here it seems to me that I might beat the same drum a little too much – yeah okay, we don’t realize everything that goes on around us, our perspective limits us, most of the time we’re wrong, blah blah..

The reason that I keep coming back to this, and subjectify it in the blog is that we know this, yet we still get it wrong. Our brains almost seem to be wired to ignore this. In many ways I believe (IANADOR) that belief in this illusion is a building block to the way our brain has evolved to work.

Simply put, we are built to believe in ourselves, regardless of the facts. Some people are more egotistical than others, but we all are this way to some degree.

This harms us and helps us, and this is why it fascinates me so much. As an engineer, I say, “That’s a mistake! You must build on facts.” But there are so many examples in history that show me that the things that happened were only possibly through ignoring the facts and facing the likely prospect of bitter defeat with a optimistic eye.

I think this is one aspect of what it is to be human. To see that we’re wrong, and to go on in the face of wrongness, and sometimes win.

Decentralization for better perspective

If you’re looking at a problem, trying to understand a situation, or living in general, one of the big things you should keep in mind is that you have a point of view.

This may be painfully obvious, but they key in consciously recognizing this is to know that this viewpoint is limited. And by limited, I mean probably wrong in some way, and by wrong I mean incomplete at best.

You can’t fix this. But you can plan for it in many ways, one of which is by capitalizing on the idea that different people or groups have different perspectives. I believe this is one of the strengths of the original idea of the United States.

We see this in action today by watching the states deal with the recession. Illinois has decided to try and meet the needs of it’s people by increasing taxes greatly. South Carolina’s governor has been pitching the opposite idea. This is how it’s supposed to work. One of them might be wrong, maybe both ways work.. do we know?

By giving the power to smaller pieces of our country to try out ideas, we can all benefit from the answers they find. More so than democracy, or liberty, this is what it means to be a United Statesein. Unfortunately incidents in our history have limited our ability to pursue this goal, but still we see it at work.

Perspectives on numbers.

As with most things, as I’ve stated many times on this blog already, you can look at things in various ways and walk away with different conclusions as a result. Also these conclusions can offer various degrees of ‘helpfulness’ – Sometimes they’re plain wrong even, and ‘right’ conclusions are often hard to come by.

Another example of this is the numbers we see regarding human prosperity. I think most people would agree, regardless of your politics, that increasing prosperity is a good thing. You can define prosperity in lots of ways, in this case, let’s use Health and Wealth. I won’t argue this is the best, but it’s one way.

You can look at the world and today we have a much larger disparity between the richest and healthiest people on the planet and the poorest and sickest people on the planet.  The statistics show us this, and it’s commonly regarded as a bad thing.

Watch this video, keeping it in mind and then think about whether or not this is a bad thing. By observing the trends, I think you’ll perhaps have a different opinion simply because you now have a different way of looking at the same numbers.

Troubleshooting the wrong thing.

Today I had an interesting experience. At about noon the two main webservers of a major client went down under massive load. We immediately assembled a team to address the issue.

Our system is based on web scripts with data in a database. As the application designers we immediately attacked those two variables. The database seemed to be operating normally, and no queries were funking things up there. That seemed fine.

Second we attacked the code. It had to be the code because it wasn’t the database. Also we had moved a version of code to the production servers barely 30 minutes before the problem occurred.  We spent almost 6 hours troubleshooting this, convinced we had a coding problem. It turned out it wasn’t a code problem at all, an affiliate had increased their load on the server by over 1000% – were being D0S’d in effect and because of the nature of the requests, our normal rate limiting system hadn’t kicked in.

I saw this affiliate hitting the server very often early on in the process of working the problem, but I ignored the evidence and went on trying to find a problem in the code. Why? Several reasons:

  • We had recently updated the code. Correlation is causation, right?
  • Some of my code was questioned from the start. My ego was defending my skills, so I was invested in working a ‘code’ angle of the problem so I could find another problem with the code other than mine to redeem myself.
  • Everyone else thought it was a code problem. Group influence. No one else had any alternatives to a ‘busted code’ explanation. This also corresponded with my ego problem, so they reinforced each other.
  • We have a stigma as a group writing code. We usually have problems with code and database, those are the big variables in the system and we had eliminated the database as a possibility, so it must be the code. No one could think of other variables.

So analyzing this situation, what could I of done better? Probably a lot of things. Primarily I fell into the trap of first impressions. As someone experienced with the technology I often have pretty accurate first impressions on what is wrong with this system. In this case though the as-always brief set of data I had to go on was misleading, and I bought into what it suggested.

This shaped my perspective which literally blocked out competing information – I even saw the evidence of an affiliate hitting the system really hard. Much harder than anyone should be doing anything.

I even showed this to another engineer who was involved with the affiliate system – Both of us agreed with little thought or evidence that this was unlikely the problem. We both were already convinced of another source of the problem, even though we hadn’t found it.

Lesson learned: Beware of snap judgements. They are ALWAYS formed on insufficient data. Those that are experts in an area are seem more likely to make mistakes than beginners simply because beginners don’t know enough to make the snap judgements yet. They question themselves more inherently. Maybe this is a good thing.

When approaching a problem like this, keep a young mind. Look at it as a newb would.