Latest Publications

Developing for a Jailbroken iPhone A to Z (iPhone 3.1.2)

Debugging on device. Freaking finally.

Debugging on device. Freaking finally.

So it’s been a while, but now that I’m on break again and have some time, I’m doing a bit of iPhone development again. That means I’m going to need to debug on-device (or at least load my app to it to have fun in the real world with my handiwork). This time, the procedure’s a little different though.

Vital stats:
iPhone OS 3.1.2
Xcode version 3.2.1, 64 bit
Mac OSX 10.6.2 Snow Leopard

Let’s do it.

UPDATE: Corrected a problem with the run script build phase: corrected the directory names for the new version and copied the new phase that doesn’t include “resource_rules.plist.”

(more…)

Climate Change and Electrical Engineering #BAD09

So I know if you’re reading this, you’re probably pissed with me for not posting about the iPhone re: the latest updates, but the comments on the old post seem to be doing the job, so for now, I’m going to shift topics a bit (I promise, I’ll write a new iPhone post soon. I want to do some dev myself anyway).

I’ve said before on this blog that I’m an electrical engineering student right now. Specifically I really enjoy designing power systems: things that require lots of volts but even more amps. I’ve also sort of been an environment enthusiast for a long time and being a techie in general, things like veggie oil buses and renewable energy systems come as natural interests to me. The nexus of all these things is very convenient for someone in my situation: I like electronics, and all of these things require electrical design.

More specifically, though, let’s talk about renewable energy. The principal problem right now with things like wind power and solar energy is that they’re unpredictable. Hydro power doesn’t so much have this problem because most hydro dams have a man-made reservoir behind them and locks can be opened and closed as needed, but most other renewable resources with enough capacity for mass production are, in terms of availability, at the mercy of the weather.

The reason this is a problem is that our current grid is dumb. It delivers power from one spot to another, more or less instantly, with no wiggle room. In other words, the input (power generated) has to be slightly greater than the mass usage on the grid at any given time. If it’s less, obviously there isn’t enough power and you get brownouts or grid shutoffs. If it’s too much more, you’re just wasting energy, and if it’s not enough more, you run the risk of brown or blackouts caused by momentary spikes.

Sidebar for a moment: What is a brown out and what is a black out? First, imagine your cordless drill. When the battery is dying, the drill doesn’t stop all of a sudden, it gets slower and slower. If you let it go long enough, it eventually it stops, but mostly it just goes too slow to be useful, and loses all power against whatever you’re screwing or drilling. This is because of how a voltage source (like a battery or a power plant) works. A voltage source tries to keep the potential across its terminals constant. Think of it like a bath tub full of water, with a guy sitting there turning the faucet on and off as necessary to keep the water level constant (to go into depth, the faucet is like the chemical source of energy – the coal being burned, the nuclear fuel being fizzed, or in a battery, the chemical reaction going on). The motor of the drill, though, is eating this power ravenously, but it can only eat so fast. Usually, the chemical reaction in the battery can outstrip the motor’s demand, keeping the voltage level all the time. When that reaction starts to use up all its reactants, though, and it starts going more slowly, it can’t convert energy fast enough to keep up with the motor’s demand. As a result, the voltage across the battery drops, and puts less power into the motor, which slows down and loses torque.

The same thing happens on the electrical grid that serves your house. If the grid tries to pull energy out too fast, faster than power plants can supply it, the voltage on the whole grid drops accordingly, just like the tub draining faster than the guy working the faucet can fill it. Usually, when a situation like this is encountered, the grid fails before the power plants (that is, the grid’s wires would melt or burn or be otherwise damaged by so much transmission, and to keep everything safe, automatic shutoff switches kick in and some supply line is cut. Sometimes supply duty fails over to adjacent grids, keeping the lights on, but sometimes adjacent grids can’t supply enough so it doesn’t, or worse, it does fail over and the adjacent grid BECOMES overloaded and shuts off. In either case, the grid automatically shutting off results in zero voltage at your house, and it’s called a blackout (the lights turn off).

Sometimes, especially in California (they’re famous for brownouts), the grid doesn’t shut off. Instead, it stays on, and power plants simply can’t keep up. As a result of the tub draining faster than it fills, the mains voltage for affected areas drops outside of acceptable limits (in the US, mains voltage is 120v, but that is intended to safely vary within +-10% or so). This is called a brownout because the lights just dim instead of turning off (though other appliances may actually behave erratically or be damaged). There, now you know what a brownout is and why it might happen.

Since the output of both Wind and Solar plants depend intrinsically on the weather, this system isn’t very practical. That is, if supply=demand needs to stay true, and if demand varies with lots of factors, supply can’t also vary. We have to be able to control it. With wind and solar, we generally can’t. Basically, there are two options to achieve a grid powered entirely by abundant renewable resources. Either find a way to make those power sources variable (key aspect: increasable. We can always throw more coal on the fire, we need to be able to blow more wind on the turbine if we’re to replace the coal. We can always stop the turbine entirely, that’s not the problem), or instead, design some sort of grid where supply=demand doesn’t have to always hold true, only over the average across some period of time.

Seeing as how it’s generally impossible to conjure wind or move the clouds (not that either would be a good idea anyway), the only real option is to design a flexible power grid.

Enter the “Smart Grid”

The idea behind the smart grid is to build in storage and intelligent sensing such that the grid itself always knows how much power is needed and how much it has available to it in both original generation and storage. Designing components of such a system is one of my primary areas of interest as an electrical engineer. By converting to an electrical distribution system as intelligent as the internet, we stand to gain a LOT of leeway in the kinds of consumers and producers of energy available to us going forward. Just like a Prius reclaims lost energy by braking and saves energy by not using the motor when it doesn’t need all the energy it can provide, our new smart grid can sip energy over the long term from the ocean or earth below us (wave generation and geothermal heat exchange, respectively) for us to use when we really need it, maximizing our ability to generate energy and optimizing our usage of it, while acknowledging the fact that the general populous isn’t going to self-regulate demand on the whole.

And of course, it goes without saying that all of this is necessary if we are to do anything as a society about reversing or at least stopping our extremely unsustainable energy policies. It’s generally acknowledged that the atmosphere simply can’t support sinking any more carbon, which is the largest byproduct of our current energy generation techniques. Even assuming that we’re OK at this very moment, which we’re likely not, we’d have to basically shut off operations worldwide in order to reduce our carbon output to a level that the earth is naturally capable of dealing with. But that’s only the bad news. The good news is that if we pursue the strategy above, and if we do so quickly and successfully, we have much less to fear both immediately and going forward. The beauty of sustainability is that it’s sustainable, and that peace of mind doesn’t disappear after you’ve established sustainability the first time.

This post was written for Blog Action Day 2009, http://www.blogactionday.org/. The issue this year, climate change, happens to be both important and eminently relevant to me, so I chose to break my traditional content mold. Also, I’ll probably try to follow this up a bit later as there are some topics I feel I glanced over or didn’t cover deep enough.

The Question Post!

There have been a couple other posts involving literally hundreds of comments, so here’s a new one. The theme is simple. If you have off topic questions, ask them here!

Simulator Seem to be Stuck on 2.2.1?

ARG! It's stuck!

ARG! It's stuck!

So maybe this is the dumbest, easiest thing in the world and I’m the only one who didn’t know, but when I upgraded to the iPhone OS 3.0 SDK, I couldn’t for the life of me get the simulator to launch in ACTUAL OS 3.0 mode. You can change the version on the fly with the Hardware>Version menu, but every time I reran my app from Xcode, it’d revert back to 2.2.1. This finally became a problem when I needed to test an app with features unique to 3.0. Luckily, the fix isn’t all that hard. (more…)

Portland Pie Company Has the Best Gluten Free Pizza Ever

I just had lunch at Portland Pie Company in Portland, ME for the first time, and their gluten free pizza is absolutely phenominal. It’s expensive at $13 for a 9 or 10″ pizza, but it’s loaded with toppings and is actually filling, which can be a problem with GF crusts. It’s also got exactly the spongey flexible feel that most GF pizzas lack, which seats it comfortably as the best GF pizza I know of. If you live in the Portland area (or Scarborough or Westbrook) go there and buy lots so they keep it on the menu.

If You Are Gluten Free, Avoid Snickers

Snickers don’t contain any gluten in the ingredients, which is typically all I care about. I don’t have celiac disease, just a gluten sensitivity, so I typically don’t worry TOO much about cross contamination. I just had a Snickers, though, and my stomach hates me now which is fair warning that if you have even the mildest sensitivity, you should probably avoid them unless you don’t mind getting sick.

My Gmail/Google Voice Productivity Tip of the Day

Heavily redacted, mostly just because I like the Gaussian Blur filter.

Heavily redacted, mostly just because I like the Gaussian Blur filter.

No, I don’t actually plan to write a Gmail/Google Voice productivity tip every day. However, today I just happen to have one. Parts of this actually came from a good friend, @jamesconnors (his site).  He told me his system for inbox management: he has his inbox, a “follow up” folder, an I believe another folder for stuff he just wants to keep around. Anything in his inbox that he can’t quickly respond to in a minute or two when he sees it, he puts in his follow up folder. Every so often, maybe once every day or two, he goes through his follow up folder and takes care of everything he can.  (more…)

Gizmodo is dumb – ATT Visual Voicemail Fix

#gizmodofail

#gizmodofail

If you have an iPhone and have not had visual voicemail for weeks, it’s actually your fault, even if you didn’t know it. When you downloaded that little file to enable tethering, the maker actually messed up. The file from gizmodo had the Visual Voicemail APN set to wap.cingular, which is incorrect. It should be acds.voicemail. The fix is easy: go to settings>general>network>cellular data network and edit the Visual Voicemail APN as above to read acds.voicemail. Restart your phone and everything will work again.

NOTE: The fix above only works if you’re jailbroken and you have the package “APN Editing” installed. I think you can also expose this menu with unlockit.co.nz (but be careful, the normal profile they use for ATT US carrier, mms/tethering enabled has the wrong APN for vvm, reset it as above). I’m trying to modify the carrier profile from gizmodo to correct the issue in the first place.

Fix via http://www.everythingicafe.com/forum/iphone-software/updated-carrier-file-3-0-and-visual-voicemail-fix-48389.html

Using the Open Tool Chain in Xcode (for both OS 2.2 and 3.0)

OTC =/= Over the counter, but it WILL cure what ails ya.

OTC =/= Over the counter, but it WILL cure what ails ya.

The iPhone OS SDK from Apple is wonderful, and being able to develop and debug on-device even without paying the entry tax is even more wonderful. To really take Jailbreak development to the next level, though – to develop Apps that don’t play nicely in Apple’s SDK playground – you are going to need the open tool chain. Here’s how to rock Xcode OTC style. (more…)

ATX -> Bench Power Supply Mod

Yay bench power!

Yay bench power!

WARNING WARNING WARNING! Switching power supplies have many BACs (beefy-ass capacitors) that can hold lots of juice long after you’ve unplugged the unit. Do not crack one open like I did without knowing what you’re doing, it could seriously injure you or at least be really uncomfortable when you shock the crud out of yourself. I’m not responsible if you do just that, don’t say I didn’t warn you. I have a cable I made with a brush at the end that grounds everything it touches, I use it to brush the back of all power electronics before I work on them. You should too.

This is a pretty common one, but I like to add flair. I needed a bench power supply. Sadly, bench power supplies are very expensive, and I’m a poor college student. What I do have are computers. Lots of computers. In fact, I just brought to the recyclers about 100lbs of computer waste from machines that are too slow for even my standards. Luckily, one thing computers have going for them is very refined, VERY powerful power supplies. (more…)