Sunday, September 16, 2012

Getting Heimdall to work with the SGH-T989

Apparently the version of the Samsung Galaxy S II used by T-Mobile is closely related to the Samsung Galaxy Tab 10.1, because I was able to use a forked version of Heimdall (the open-source Linux equivalent of the closed-source, binary-only, leaked-from-Samsung Odin) designed for the Galaxy Tab to get a copy of ClockWorkMod Touch Recovery loaded onto my phone.

The regular version of Heimdall (1.3.2 as of this writing) doesn't work with the T-Mobile SGSII (also known by the model number SGH-T989), but there is a bug report on the main Heimdall project's GitHub site which points at a forked version that will work if you massage it properly.

Within the forked version is a piece of code that checks a numeric device type ID. A few IDs are already allowed, but the program will bail on you if the device isn't in the list. Well, the SGH-T989 comes up as a number "30", which wasn't on the list. Here's a patch to fix it (assuming Blogger doesn't mangle things):

diff --git a/heimdall/source/BridgeManager.cpp b/heimdall/source/BridgeManager.cpp
index 1faa626..7359a0d 100644
--- a/heimdall/source/BridgeManager.cpp
+++ b/heimdall/source/BridgeManager.cpp
@@ -1621,10 +1621,15 @@ bool BridgeManager::BeginSession(void)

int deviceType = setupSessionResponse.GetUnknown();

- // TODO: Work out what this value is... it has been either 180 or 0 for Galaxy S phones, 3 on the Galaxy Tab, 190 for SHW-M110S.
- if (deviceType != 180 && deviceType != 0 && deviceType != 3 && deviceType != 190)
+ /* TODO: Work out what this value is...
+ * it has been either 180 or 0 for Galaxy S phones,
+ * 3 on the Galaxy Tab,
+ * 30 on T-Mobile Galaxy S II (SGH-T989),
+ * 190 for SHW-M110S. */
+
+ if (deviceType != 180 && deviceType != 0 && deviceType != 3 && deviceType != 30 && deviceType != 190)
{
- Interface::PrintError("Unexpected device info response!\nExpected: 180, 0 or 3\nReceived:%d\n", deviceType);
+ Interface::PrintError("Unexpected device info response!\nExpected: 180, 0, 3, 30, or 190\nReceived:%d\n", deviceType);
return (false);
}
else


You really only need to add "&& deviceType != 30" into the right spot.

So, the basic basics:

  1. Download the forked version of Heimdall with "git clone git://github.com/marshray/Heimdall.git"
  2. Compile and install Heimdall:
    1. Enter the new "Heimdall" directory with "cd Heimdall"
    2. Read through the various README files, including the "Linux/README" one.
    3. Change into the "libpit" directory and run "./configure && make", then exit the directory upon success.
    4. Change into the "heimdall" directory and run "./configure && make". Upon a successful compile, run "sudo make install", then exit the directory.
    5. Change into the "heimdall-frontend" directory and run "qmake && make". Upon a successful compile, run "sudo make install", then exit the directory.
  3. Download a ClockWorkMod Touch Recovery image by visiting the ClockWorkMod ROM Manager site and finding the "Samsung T-Mobile Galaxy S2". Click on the download link in the second column ("6.0.1.2" as of this writing). For me, this saved as "recovery-clockwork-touch-6.0.1.2-hercules.img"
  4. Reboot your phone into Download Mode with the following procedure:
    1. Plug the USB cable into your phone if it isn't already connected.
    2. Press and hold down both volume keys, followed by holding down the power button. Keep holding down the power button until the phone reboots (a brief vibration happens)
    3. Release the power button but keep holding down the volume buttons (it's okay if you accidentally release the volume buttons momentarily)
    4. The phone will come up, and you can release the buttons.
    5. There will be a prompt saying you're about to enter Download Mode. Press the Volume Up button once to continue.
    6. At this point, you should be in "Odin Mode". (Note that there's a big warning not to reboot the phone when it's in this mode -- as far as I know, it's okay to reboot here unless you're actually transferring data. But, the phone will restart itself after a few minutes if it isn't told to do anything.)
  5. Now, go back to the command line on your Linux box, and run the command "heimdall detect" just to see if the phone is communicating with the computer.
  6. Note: Ideally, there would be a step here where we would dump the recovery image from the phone to make a backup, but apparently that isn't working. The phone is structured in a way that even a screwed up recovery image shouldn't cause insurmountable problems (it shouldn't affect the Download Mode, for instance), but if you're wary, don't proceed.
  7. Upload the recovery image by running "heimdall flash --recovery recovery-clockwork-touch-6.0.1.2-hercules.img". It should only take a few seconds, and the phone should reboot.
  8. To test the recovery image, you can either follow the same steps as outlined in step 4, but with the USB cable removed, or run the command "adb reboot recovery" from the Android SDK with the USB cable plugged in.

Thursday, May 10, 2012

Political irrelevance

There's exactly zero chance I'll vote for Mitt Romney this year, though I think there are criticisms of him floating around which are completely irrelevant. I tend to like MSNBC, though some of the hosts tend to rag on their opposition a bit too much in my opinion. I'm not a confrontational person, though.

Anyway, I like Rachel Maddow and Chris Hayes more than Ed Schultz or Lawrence O'Donnell because the former pair tends to be more accepting of outside positions. However, tonight Rachel Maddow went on at length about the Washington Post story about Mitt Romney's bullying of a (presumed) gay and nonconformist student at boarding school.

Now, clearly this bullying was wrong, but teenage years are often about stepping up to and beyond the line of what's reasonable in order for a person to form their moral sense. Many of the students who saw it or were involved now express regret, and that's more or less exactly how things should go. It's very unfortunate that someone was victimized in the process, but clearly it had a lasting effect. Presumably many of the aggressors acted with greater restraint in subsequent periods of their lives.

Bullying has gotten a lot of well-deserved attention these days, and it should be stamped out to the extent possible, but it's going too far to say that there should be absolutely zero tolerance. The ideal is probably to catch bullying early so that it doesn't get out of hand—Avoiding the escalation that could result in permanent damage.

According to at least one of Romney's classmates, there actually was an expectation that the students would be punished for their actions, but it ended up not happening for whatever reason. Inasmuch as Romney and his cohorts were responsible for their actions with their hormone-addled teenage brains, a certain level of responsibility also falls to the faculty and staff of Cranbrook.

Now, there does seem to be a fair amount of mess to be found if Romney does not distance himself from his teenage indiscretions appropriately. Everyone makes mistakes in their adolescent years, so the script is not hard to put together.


The other thing that has bugged me is the criticism that Romney and his wife own a whopping four cars at their bi-coastal residences. My mind reeled as even Jay Leno joked about it (remember, he owns dozens automobiles, many or most of which are completely impractical).  Considering the immense wealth of the Romney family, you'd practically expect them to own a fleet of 40 cars rather than 4.  My own family owned 4 cars for a brief period while I was in college and my brother wasn't far behind.  Granted, at least two of the cars were beaters, but our family was probably 100 times less wealthy than the Romneys at the time.


Anyway, let's forego the juvenile and usual things and get on to more interesting stuff.

Tuesday, October 18, 2011

Sunday, October 31, 2010

Jonathan vs. Clover Field

Look at that! An actual alley in Chaska, of all places.


View Larger Map

Chaska is known to urban planners for the New Town of Jonathan that was started around 1970. However, that project pretty much failed as originally designed and was annexed by Chaska in 1979. What was originally developed by a private company became a neighborhood association.

Today, what's seen in the map is something fairly different, one that appears to be designed based on New Urbanist principles: Small homes, densely packed, with alleys to hide garages. This appears to be the Clover Field development, which seems to date to around 2008 (the fact that a monster movie of the same name came out that year didn't seem to deter them). The homes themselves seem a bit expensive for me and not all that varied in price (a bit above the $200k mark), but I guess that page only shows the single-family options. These things take decades to mature, so we'll see how it goes.

In this spot, the single-family homes are packed tightly enough to have 9 or 10 units per acre. There are also some townhomes and condominiums nearby that boost the ratio even higher. In order to support a good transit system and have a sustainable community, you really want to be up at around 15 units per acre or higher (roughly 25 people per acre and up). That translates to 16,000 people per square mile—this spot in Chaska is denser than most of Minneapolis.

Thursday, October 28, 2010

Farmington

An unusual neighborhood layout I found in Farmington, Minnesota:


View Larger Map

Unlike most of the city, the setback for homes here is fairly small. Many of the city blocks also appear to have curving walkways running somewhat diagonally through them. Basically, each block has a park in the center. I was thinking this might be some vaguely New Urbanist community, though the homes all appear to have driveways in the front, which is a New Urbanist no-no. However, it does seem that these blocks could easily become converted into European-style apartment blocks, which often have apartments running around the edge of the block and an open area in the center (not that I'd expect it to happen anytime in the next century, mind you...). For an idea of what I was thinking of, look at these blocks from Copenhagen, for instance:


View Larger Map

Thursday, August 5, 2010

QR codes at Metro Transit stops


I have been a fan of Metro Transit's NexTrip system, which receives data from Global Positioning System sensors installed on buses in the Twin Cities and tries to calculate bus arrival times for stops along each route. It can be accessed from a computer or a mobile phone that has a web browser built in (generally smartphones, but it should work with many not-so-smart phones too). It has its problems, but when it works correctly, it gives a transit rider much more confidence in the region's bus and train system.

In recent months, I've been wondering if the NexTrip system could be made easier to use. I have had problems when I've wanted to just get a quick idea of when the next bus will arrive, since I usually have to navigate to the NexTrip main page, then select the bus route, followed by a bus direction -- and then I have to choose the stop. With the way it's currently designed, each one of these actions requires talking to a web server -- and while the NexTrip website is relatively stripped-down, it does transfer a lot more data than it really needs to, which makes it fairly slow.

It would be much better if there was a shortcut. In fact, I have created a few bookmarks on my phone so I can cut out the action of selecting the bus route number, but do I really want to go through and make a bookmark for each individual bus stop that I use regularly? Not really.

My best thoughts have revolved around the use of QR codes. These could be generated for each bus stop and put on a sign at each stop.

To demonstrate this a little, I'll use a URL that the NexTrip site generates for me if I make a bookmark. The following URL is for bus route 3, eastbound, at the intersection of Hamline and Como Ave: http://www.metrotransit.org/Mobile/Nextrip.aspx?route=3&direction=2&stop=HLCO

That's kind of a mess, isn't it? And here's the QR code you'd get if you used that long URL:

Okay, that's alright, but it's bigger than it needs to be. Also, if anyone wanted to type in the URL themselves, you wouldn't be able to fit the original URL onto a sign. The amount of information you need is very small -- simply the route number, the direction it's going (north, east, south, or west), and the 4-letter code of the bus stop ("HLCO" in the case above).

Metro Transit could really make use of URL shortening. They could probably start a site named something like "mt.mn" (the ".mn" top-level domain is owned by Mongolia, but several things in Minnesota use it, like the state senate and the Star Tribune's Vita.mn). I'd envision shortening the URL something like this: http://mt.mn/3-E-HLCO for the earlier stop I looked at. And here's what the corresponding QR code would look like:

Well, I suppose that doesn't look a whole lot different, but I figure that the lower amount of data encoded in that image will make it easier for cameraphones to read, especially after signs get dirtied up from living in the real world.

Now, there are several problems with this idea:
  1. Will riders know what these things are? Who knows. This is a commonly-used technology in Japan, but it hasn't really caught on in the U.S. One good thing about QR codes is they are pretty easy to identify after you've seen them a few times -- they've got three distinctive squares along the left and the top two corners and in the bottom left -- but educating people about them might prove challenging.

  2. Will riders have phones that can interpret these symbols? Another open question. iPhones, Android phones, and (I presume) Blackberry phones should be able to handle these codes just fine. Other phones will probably be hit-and-miss.

  3. Will riders be able to use the website? I wish I knew. Considering that transit riders often can't afford more expensive phones or the data plans to go along with them, it would probably only benefit a modest percentage of riders. However, smartphones are becoming more and more popular each year.

  4. How likely is it that signs will be where people need them? Unfortunately, my gut feeling is that getting signs deployed to bus stops would be the biggest challenge. I think if Metro Transit had the money for something like this, we would have seen bus stops with signs for the routes they serve a long time ago. However, I think the public would get behind this idea -- if someone came up with a way to buy or make the signs cheaply, I think there would be many community members willing to put their time or money into acquiring the signs and having them put up.

  5. If all that stuff happens, will this thing actually work? Unfortunately, my results with using the NexTrip site have been mixed. Sometimes there isn't any data for the bus I want to take, so it may appear that the bus is not running at all. Also just because a bus is late now doesn't mean it will be late five minutes from now (or vice-versa). If people trust the site too much, they will probably become disappointed in the concept. (However, the only way to get around that, in my estimation, is to run buses much more frequently so that the schedule basically doesn't matter. Unless a magic source of funding appears, that's not likely to happen, so I think it's best to make the best use of what we've got until things get better).

Friday, May 28, 2010

Pondering rural public transit

This article at The Transport Politic started talking about public transportation in suburban and rural areas, and got me thinking about public transportation in my hometown of Byron, Minnesota. The town was founded back in 1873, and had basically started for the express purpose of supplying the trains that went by on what soon became Chicago and North Western Railway line (now owned by Canadian Pacific subsidiary DM&E).

The town stayed small for several decades, with between 200 and 400 residents until the 1950s. Passenger trains continued to go through town until 1963, though I doubt they'd actually stopped in Byron for a long time before then. The uptick in residents starting in the latter half of the 20th century was probably spurred by IBM building a plant in nearby Rochester, though the general postwar boom probably had something to do with it too. IBM still exists today, but the biggest employer in town these days is the Mayo Clinic.

Anyway, Byron is still rapidly growing, and will probably hit 5,000 residents soon. That got me thinking—when should a city start up a bus service? Of course, it's had at least one bus as long as I can remember: Rochester City Lines has operated a commuter route into Rochester for decades. Today, the buses make three roundtrips through the city. I mentioned Byron's situation a bit in a comment on the article, and other comments seemed to push the idea of actually using the railroad. I'm somewhat doubtful it could work, but let me just ponder that a bit. I've had it as a pie-in-the-sky idea a few times, but could it be practical?

One link in a comment pointed at this page describing how a small line could be built and operated with single-unit diesel railcars (kind of a big bus on rails).

Looking at Mn/DOT's rail map, it looks like the line only sees 4 trains per day—so more trains could probably be added—but segments of it only support 10 mph traffic. Could it be upgraded to handle 60 mph trains or faster? (60 would probably be a bare minimum for reasonable service, since the adjacent highway has a speed limit of 55 to 65 mph.) I'd probably plan for a train that would shuttle back and forth across southern Minnesota, at least going from Rochester west to Owatonna, but a link east to Winona and La Crosse would also be good.

I believe the track is "dark territory" today, without any signals for the trains themselves. While the traditional method of signaling passenger trains has been centralized traffic control (CTC), the federal government has recently been pushing positive traffic control (PTC) which is based on GPS technology and is fairly cheap to install (in theory, anyway). Assuming there are enough sidings for trains to pass each other, dozens of trains could go on the track each day (well, probably just two or so shoving back and forth).

That would be really nice to see. The key would be to get it running often enough that people wouldn't have to think about it. People reiterated in several comments that the key to getting people using transit is making it frequent enough to be a real alternative to a car. There were also a few mentions of Federal Railroad Administration regulations that make these sorts of arrangements nearly impossible. One big issue is that the crash regulations for American trains are much stricter than those for European railroads. Trains in the U.S. have to weigh a lot more in order to meet "buff strength" requirements, which make our trains less efficient, more costly, and harder to manufacture.

Add that to Americans' persistent inability to consider public transportation as something worthy of our tax dollars, and it looks like it will never happen. Kind of sad, since I think one or two European-style railcars running at high frequencies might carry as many or more people into and out of Rochester than the Northstar Line brings in and out of Minneapolis each day with its commuter-oriented schedule.

Unfortunately, I worry that this hope breaks down a lot when we look at the target city. Once you get into Rochester, how do you get around? There's the city bus network, but it seems fairly poor. If you wanted this idea to work, there'd have to be changes to intracity transit to help people get around, and I think trains would have to stop at three or more places in Rochester so people wouldn't have to hit downtown before being able to reach a bus that goes where they need.