Search This Blog

Monday, September 24, 2012

DirecTV 5LNB Non-SWM and TiVo HD THR22 Hookup Odyssey

Posting this epic tale in hopes it helps someone else, and to keep track of what equipment I have installed.

It has been almost a year since I put up the HDTV dish, never got around to upgrading the receivers till now.  One of the SDTV TiVo's started having a lot of picture and sound break up on some channels it was time to make the plunge and upgrade to HDTV.    

I described installing the dish in this previous post.
http://blog.workingsi.com/2011/10/installing-directv-5lnb-dish.html


The reader might ask, why not just call DirecTV and say "make it work".   Basically besides having aftermarket upgraded DVR boxes with big disk drives, I have my own cabling through my attic and basement, and don't want a tech messing with it.  Plus this stuff is just too much fun to let somebody else do.  I believe it is possible to get DirecTV to just send you some of the bits and bobs needed and save yourself some $$.  

OK, mostly this was because it was my wife's SDTV TiVo that was failing that made it critical.  In the past, when this begins to happen it usually means a tuner is failing.   She had a highly upgraded box, a Philips DSR708 DirecTV Receiver TiVo DVR with a TB+ of disk space that I had already replaced once for the same problem and I didn't want to replace it with another 5 year old used unit.   You can get these off ebay for <$40, but it was time to move on.



The dish I put up is a NON-SWM, four output slimline 5 LNB dish with a built in 4 way multiswitch.   This is technically obsolete, Directv has moved on to installing the SWM dishes.  They cost a lot more and allow you to only drop one cable to each box.  However I already have two cables pulled throughout my house, plus the new dishes require a power supply if you want to use them with the older SDTV boxes.  I have several legacy SD boxes in the house that are staying for now.  So that's why I used the older style 5 LNB slimline.

Directv finally released the HDTV TiVo  THR22 in Jan 2012.  This retains the TiVo menu system but does HD.  I must say after using it a week or two I really like it.  It is just like the old TiVo system that does what I want when I want.
http://www.weaknees.com/hd-tivo-directv-thr22.php
http://www.directv.com/DTVAPP/content/technology/tivo_receiver
THR22

Ha ha. Maybe satellite TV is already obsolete, since internet TV is going to replace all this stuff.  Truth be known we are already watching lots of Netflix, Amazon Prime.  But I don't like paying by the show to watch TV.

I bought the upgraded unit from weaknees for the added capacity, we are used to lots of disk space.  Kinda pricey I admit.   I was also concerned about activating the modified Weaknees unit on Directv, but they are a n authorized dealer.

I also bought two BBand converters for too much money.
http://www.weaknees.com/directv-b-band-converter-sup-2400.php
Later I see you can find these on ebay and Amazon,   I was in a hurry.
I got Rev 3 DirecTV B Band Converter SUP 2400, which I hear are better than earlier versions.  Make sure you get that one, pay attention to the Rev number. There are Rev 1 and 2 out there for sale on Ebay.

Plugged the THR22 in, with the BBand converters, and I get no hdtv signals, no signal on 119, 103, or 99 satellites.  I swear 119 was there when I aligned it last year. Tried the old SD receiver.  No 119 either.  I'm using the receiver signal meter for all these steps.  I never got around to buying a standalone satellite signal meter.   Plenty of signal on 101 so I decided to forge ahead and activate the box.

I was able to activate it just fine, with zero problems by calling DirecTV.  Had to pay $10 a month more for the HD service, I was already paying for the TiVo DVRs.   The new box probably comes up as leased.  Oh well.  I'm not planning on reselling the box later so it really makes no difference to me.  I couldn't do this online because I had ordered it from Weaknees, but via phone it was OK.  Gave them the RID and card ID.

Still no HDTV signal.  I tried to re-align the dish in the dark.  No improvement.  A little signal on 99c at best.  TV says searching for signal on all the HDTV stations.   Fail.  The next day in daylight I decided to remount and level the dish, it was off vertical, thinking that was why I couldn't get any signal.  I followed the alignment procedure exactly.  http://manuals.solidsignal.com/Slimline_Dish_Installation_Manual.pdf  Still nothing on 99, 103 or 119.   Fail.

I learned that my multiswitch (Terk 3x4) doesn't pass the Ka band HDTV.  So that might be the problem.

I bypassed the multiswitch temporarily and ordered a new one from Amazon that is compatible with HDTV. The Zinwell unpowered 6x8 Multiswitch MS6X8WB-Z


For some reason Weaknees wanted $79 for this, and it was $20 including shipping on Amazon.  Go figure.  This time I bought it off Amazon for $20.

Guess what.  It STILL doesn't work.   Fail.   No signal on 119, 103,99 and HDTV channels all say searching for signal.   Times like this make be want to sit in my chair and call the 800 number.  But I soldier on.

Took the receiver outside and plugged it in directly to the dish.  No multiswitch at all.  Note that I do have the Bband converters installed.  Same result.  Nothing.  I'm really confused.  Spent and hour tweaking the dish.  No signal.  I drag out the old SD receiver and plug it direct to the dish.  No 119 on this one either.  I align until I'm blue and nothing.   It's not the receiver, its not the multiswitch, it's not the cable.  I can't believe it's my alignment, it's dead nuts on.   Fail parade continues.

No other conclusion than the LNB is bad.  Hard to believe, but there is no other conclusion.  I bought it used on Ebay, maybe it was a dud somebody pawned off on me.  All I need is the LNB, not a whole new dish.  So I bought a new Rev 2 5LNB.  The one I had was Rev 1.    They look a bit different, the Rev 2 has clear LNB covers, the Rev 1 has solid white covers.  The Rev 2 has more lumps.   There is a label on it telling you the rev.  Make note that it has four outputs and is cheaper than the SWM version, which will only have one COAX output.   I bought it new on Amazon for $61.94 including shipping.   I didn't want to mess with another used one after all this.



New LNB came.  I climbed up and connected it.  Bingo!  99 and 103 birds came in loud and clear without moving alignment.  So the old 5LNB WAS BAD!!  Hard to believe.  Still no signal on 119.  Rotated the dish, tweaked, no 119.  Whaaa?  However I connected the receiver and now I'm getting "Channel not purchased, call extension 721" on all the HDTV stations instead of searching for signal.  Seems none of the channels I get are even on 119 so I've decided to leave it be.   I finally just peak the 99 and 103 and forget about the 119.   Hooked back up the new multiswitch to send HD to all the boxes in the house.   No problems, signal levels still look good.   Win!

Called Directv, got passed to tech support.  I tell them I just activated and get this "not purchased, ext 721" message only on the HD channels.  The others are fine.  The tech flails around and in the process resends the authorization codes to my box, and <insert happy dance here> the HDTV channels pop up.  What must have happened is that the HD birds weren't visible at the time it was first activated, so it didn't get the message.  Either that or the original tech activated it, then added HD service.  Who knows.   Turns out you can resend the authorization yourself from the online account management page.  So you can avoid calling if this happens to you.

Along the way bought some RG6 patch cables from Monoprice.   They are so cheap they beat buying cable and connectors and making them yourself.  
http://www.monoprice.com/products/product.asp?c_id=102&cp_id=10216&cs_id=1021603&p_id=3031&seq=1&format=2
I also have some 125 foot runs, with some short sections of RG59, that came with the house, and it works fine.   HDTV spoils the family, and they will soon ask for me to upgrade the rest of the units.  Win or Fail?

Friday, September 14, 2012

ISP Programming an Atmel AVR

Bought an Atmel AVR programmer from Digikey.  I'm working on a project where I need to be able to directly program the Microcontroller in situ that is embedded in a project.   In the past I've always used the Arduino IDE and USB programming, but the developer of this machine is using WinAVR and the ISP setting.  This post is just my notes on how to set it up.

This is what I bought:
Manufacturer

Atmel

Manufacturer Part Number

ATAVRISP2

DescriptionPROGRAMMER AVR IN SYSTEM


PROGRAMMER AVR IN SYSTEM | ATAVRISP2 | ATAVRISP2-ND | Digi-Key Corp.
http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=ATAVRISP2-ND&x=4&y=16&cur=USD

WinAVR and Eclipse was recommended to me over the Atmel provided suite.  Since I use eclipse for Java programing, I'm game.

Downloaded here:
http://sourceforge.net/projects/winavr/files/
Looks like this hasn't been updated since 2010.   Picked the latest version
 http://sourceforge.net/projects/winavr/files/WinAVR/20100110/WinAVR-20100110-install.exe/download

Double click on win avr install.   Run it from start menu.  Something comes up.  No idea what to do with it.



Also downloaded the AVR plugin
http://sourceforge.net/projects/avr-eclipse/?source=recommended
http://sourceforge.net/projects/avr-eclipse/files/latest/download?source=recommended

I will need Eclipse on this machine, it is new and I haven't used it on this machine

Downloaded Eclipse for C programming from here:
http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/juno/R/eclipse-cpp-juno-win32-x86_64.zip
Unzipped and clicked on eclipse.  Tool comes up just fine.  Hmmm.  Now what.

Opened the AVR plugin I previously unzipeed and downloaded from here:
http://sourceforge.net/projects/avr-eclipse/files/latest/download

Maybe the manual will help.  No idea how to install it
http://avr-eclipse.sourceforge.net/wiki/index.php/Documentation
OK I should have used Eclipse->Help->Install New Software.  I guess I knew that, learned that here:
http://avr-eclipse.sourceforge.net/wiki/index.php/Plugin_Download
Point to this site and click add in the install new software menu in eclipse
http://avr-eclipse.sourceforge.net/updatesite
Select and hit next a couple times

It says:
If the installation was successful you should see the entries AVR Cross Target Application and AVR Cross Target Static Library in the "New C Project" wizard.
Turns out you have to go one click into creating the C project before you see these choices.  On the first project creation you just see C project.  Pick it and the next screen you see the AVR options.
AVR->Upload to target device is also now on the menu across the top


I'll publish my notes at this point, and update the post again when I've succeeded in programming the AVR














Without using all this software, I tried using the AVR ISP Mk2 to program an Arduino, using the supplied Arduino software, version 1.0.

It worked perfectly.     You hook up the MK2 via usb,  hook the 6 pin connector to the Arduino ISP header.  Leave the USB off the Arduiono.   The bump on the ISP header goes towards the inside of the Arduino board.  Power the Arduino from an external 12V supply since it can't get power from the USB.     You hit shift before clicking on the upload button and the function changes to upload from programmer.  There are also menu buttons to do it in the pulldowns, as well as an options menu to pick which programmer you have.    Now that you are set up this way, you can also reburn the bootloader as well as program sketches a little faster than the USB method.  This is no harder than the USB method.

I had to install drivers for the MK2, which turned out to be nothing more than the standard libusb0.dll file.

I was able to rescue two old Arduino boards that wouldn't talk to the USB by reburning their bootloaders.  This worked on an Uno and an older Duelmanove.  


Thursday, July 12, 2012

Suicide for the strobe/flashlight app on Google

I decided to pull the silicon fish blinky app off the market.  At the bottom are the comments I was getting.  I can't handle the shame.  I wasn't able to test the app on other platforms because I didn't have any extra phones.  I've since got a motorola droid 4 and the LG doubleplay that I found and repaired.   If I get some spare time I'll get the app working on those and republish it.  Fun while it lasted.  Lesson learned, don't do a flashlight app unless you have access to a lot of phones because the LEDs work differently on different devices.    I gave it away free and still got trashed.  I put a disclaimer.  Oh well.

At the end I had over 2900 installs, but as near as I can tell only 300 active users after 6 months on the market.  And in case you were wondering, never made $0.01 on it.  The only way to make money is to put ads or charge for the app, neither was I willing to do.  It was a project for fun, not for public abuse.

You can still download it direct to your phone from my download page, as long as you check the box in your settings->applications->unknown sources menu on your android device.  That allows you to install apps from other than the google market.  Just navigate your phone to
http://code.google.com/p/arduino-java-xyzcnc/downloads/list and then click on SiFishBlinky.apk


or go directly to:
http://arduino-java-xyzcnc.googlecode.com/files/SiFishBlinky.apk

Here is my wall of shame  :-#


      David on Sunday, July 8, 2012 at 22:23 Huawei M865C (hwm865c) Version 1.9.16
Crap Learn to finish and test drive before Publishing
      Ben on Monday, June 4, 2012 at 22:59 Samsung Droid Charge (SCH-I510) Version 1.9.16
Does not work for Droid Charge Does not activate LED on the Droid Charge, thus making this a useless app for that device.
      George on Sunday, June 3, 2012 at 22:42 Samsung SAMSUNG-SGH-I777 (SGH-I777)
Doesn't work
      Jason on Thursday, May 24, 2012 at 01:19 Motorola DROID4 (cdma_maserati)
Does not work for droid 4
      Jon on Sunday, May 6, 2012 at 21:02 Motorola XT910 (umts_spyder)
Bad Doesnt work
      Austin on Monday, April 23, 2012 at 12:17 Motorola DROID RAZR (cdma_spyder)
Gay Doesn't turn on. There is no zero star option by the way.
      Joel on Wednesday, April 4, 2012 at 07:25 Acer Picasso (picasso) French
Acer A500 N'a pas fonctionné.
      Nahuel on Tuesday, March 27, 2012 at 21:49 Samsung Sidekick 4G (SGH-T839) Version 1.9.16
Jo Ho
      Brendan on Saturday, March 17, 2012 at 21:04 LGE Bryce (bryce) Version 1.9.16
:( Wont even turn on
      on Sunday, February 19, 2012 at 18:29 Samsung Galaxy Exhibit (SGH-T679) Version 1.9.15
GREAT Idea and no stinking ads NO ads or tracking but it just dosent work for my phone. Thanks, wish all app developers had your attitude.
      Lemuel on Saturday, February 18, 2012 at 23:58 Motorola Droid X (cdma_shadow) Version 1.9.15
A+ Can you change the background to plain black? to save battery.
      Ari on Friday, February 17, 2012 at 01:45 Motorola Droid X (cdma_shadow) Version 1.9.15
Cool app Works well, I like the fact that you can create custom patters. I also like the strobe light
      on Friday, February 10, 2012 at 19:24 Samsung Galaxy Ace (GT-S5830) Version 1.9.15 Czech
Nefunguje Naprosto nefunkční
      Daniel on Wednesday, February 8, 2012 at 01:14 LGE Optimus 2X (p999) Version 1.9.14
Sucks Doesn't work on my phone waste of time
      Zeneth on Sunday, February 5, 2012 at 12:52 Motorola Droid X (cdma_shadow) Version 1.9.14
Thanks A+

Monday, July 9, 2012

XFX 4890 Graphics card fan replacement - Shameful hack

Because of my sense of humor, I'll share my fix for a bad fan on my XFX Radeon 4890 graphics card, otherwise known as a VGA cooling fan.  Why did I do something this lame?... here is the story.




The fan began making noise, which my son ignored for many months.  Eventually the machine started randomly rebooting.   Finally it started rebooting after about every 1 minute of operation and I had to give in and figure out what was wrong.    The card was smokin' hot and the fan was not turning.  Obvious.   Here is what the card looks like with the factory fan.



I went online, and searched for a replacement fan.  Not much out there, and most of the fans did not have dimensions, or the reviews said they didn't fit.  Really hard to figure out what to buy.  I finally bought this one.  It looked like the one I had from the picture:



Doh.  Total fail.   It came in a tiny envelope and here it is next to the fan from the 4890.   WAYYYY to small.


I had no confidence that any of the other fans out there were the right size either.   I could play dialing for donuts and keep buying fans until one fit.  Nahhhhh.

Measuring the fan against a standard case fan, I saw that they were the same size.   Originally I thought I'd hack something together and ordered this case fan.



You may be able to see that the fan has three plastic spokes that attach it to the case, that could easily be clipped to remove the fan, which appears to be exactly the same size as the fan I'm replacing.  However i'd be stuck trying to figure out how to attach it to the metal heat sink with no screw holes.  Glue wouldn't work here, it would be too hot.




Since the computer case is fairly empty, and the PCI slot next door is open, I had room to simply glue the case fan over the hole to the VGA card.   I spliced the red and black wires into the old fan's connector since the case fan's connector wasn't the same size.



As soon as the glue dries it's going into the machine.  I'll update the post with how it works out.  Crossing my fingers.



Turned out if you look, the video card had a plastic film still on it from the factory, that I never had peeled off.  So my glued-on fan fell off immediately.  If you look you can see that the sticker on the top of the card is a bit hazy.  Duh.  I peeled off the protective film and used some JB weld epoxy this time.  I didn't drill holes in the black cover, because there is a metal heat sink directly underneath it.

Now I'll try again when the new glue is dry....

Success!  Here it is back in the computer.  You can see the case fan glommed on the side of the video card. Luckily that slot is not used, and the fan is away from the CPU side where it might have collided with the motherboard chipset cooler.





The computer is up and running and seems fine under normal load.  W00t!  $6 case fan saves the day.

Tom

Tuesday, June 19, 2012

Windows Security Suite virus - The most concentrated evil juice there is

My son somehow picked up Windows Protection Suite
on his PC.  It started with a a pop up, and ended up hijacking all the browsers and making
them non functional, shut off the firewall and disabled the antivirus.   It had tricked him into
clicking a dialog that downloaded the software.  Then it pretends to be a security suite and asks you for your credit card number to upgrade it to save you from all these threats it is pretending to have detected (which it caused).  Reasonable attempts to kill processes and remove files were useless, it repaired itself on reboot.   I was able to temporarily restore Chrome by renaming the file back, but that only lasted about a minute before it was swapped back. It disables virus scanner anew every time you attempt to re-install it from USB.    I was unable to do a system restore either.  I don't know how they managed  to hose that up too.  msconfig of the startup sequence didn't help either. I advocate extreme violence  against the authors of this program.


This is not my screenshot, because my PC was dead, but it looked pretty much like this.

Windows Security Suite snapshot


Some links I found.
http://www.geek.com/articles/chips/dealing-with-the-windows-security-suite-2009113/
http://www.bleepingcomputer.com/virus-removal/remove-windows-protection-suite
http://www.2-viruses.com/remove-windows-protection-suite
http://virus.geeksailor.com/how-to-uninstall-remove-security-suite-virus-removal-guide-2/
Some web searches recommended Malwarebytes and rkill.   I think they are written by Malwarebytes, to sell their software.    After initial resistance I tried Malwarebytes and rkill and it didn't work at all.  After giving in and following their directions,  I ended up with a PC that would not boot at all.   I could not even boot it from the CD or USB stick with either windows or Linux.  I've never seen this before, I've always been able to boot from linux USB, but this time, halfway through the boot, the PC goes black and reboots. A windows install from CDROM also stops after the initial load and the PC reboots.  Holy crap.

Don't waste your time if this happens to you.  This is the most evil virus I've ever seen.  I doubt that you will ever be able to clean it out.

Now I'm buying a new hard drive and starting from scratch.   My plan is to take the old hard drive out to a Linux machine and extract some of the data I want from it then reformat it.  It will never touch a windows machine again.   I will update the post once the hard drive is replaced.    Hopefully it has not done hardware damage or screwed with the BIOS too.  I will dedicate my life to tracking these people down if it has.


Update... the computer is back up and running.
The computer hard drive and all the data was a total loss.   Started over with a new drive.  However it turned out a bad fan on the video card was the true cause of the constant rebooting, and the reason even loading ubuntu didn't work.  <Red Faced>.  Odd how this problem popped up just as the computer got this crippling virus, maybe something about the virus caused the video card to work extra hard and fail, or just plain coincidence.  However when you have two problems at once, debugging and fixing become 10 times as difficult.   I solved the problem by pulling memory modules and cards one at a time until the machine was stable, since I knew the virus was gone when I replaced the hard drive.


I still think this virus is one of the worst I've ever seen, but it's not conclusive that it caused hardware damage as well.

Sunday, June 17, 2012

Telemetry logger android app


In order to make some augmented reality apps, and some other cool robot and telemetry apps, I decided to make a small app that reads out all the accelerometer, gyroscope, compass, etc sensors and logs the values to the SD card.   From there I can analyze the data and see what sort of performance to expect.

Here are some links with information I found,
http://www.sensorplatforms.com/native-sampling
http://www.sensorplatforms.com/smartphone-performance-fundamentals-sensor-sampling
http://developer.android.com/reference/android/hardware/SensorManager.html

Hard to tell what are real sensors and what are virtual.  this was the best article I found on what is actually in the phone.
http://www.mobiledevmag.com/2011/07/using-available-sensors-in-the-android-platform-current-limitations-and-expected-improvements%E2%80%A8/

Here is how to dump the sensors on the phone


SensorManager myManager = (SensorManager)getSystemService(SENSOR_SERVICE);
        List<Sensor> sensorList = myManager.getSensorList(Sensor.TYPE_ALL);
        StringBuilder sensorString = new StringBuilder("");
        for(int i=0; i<sensorList.size(); i++) {
            sensorString.append("Type: "+sensorList.get(i).getType()).append(" ---------\n");
            sensorString.append(sensorList.get(i).getVendor()).append("\n");
            sensorString.append(sensorList.get(i).getName()).append("\nResolution: ");
            sensorString.append(sensorList.get(i).getResolution() ).append("\n");
        }


That gives me this data on my motorola droid 2 global


SiFish Android Sensor Log
Android Sensors Found:
Type: 1 ---------
Kionix
KXTF9 3-axis Accelerometer
Resolution: 0.009810001
Type: 2 ---------
Asahi Kasei
AK8975 3-axis Magnetic field sensor
Resolution: 0.0625
Type: 8 ---------
Intersil
ISL29030 Proximity sensor
Resolution: 100.0
Type: 3 ---------
Asahi Kasei
AK8975 Orientation sensor
Resolution: 0.015625
Type: 5 ---------
Intersil
ISL29030 Light sensor
Resolution: 1.0
Type: 9 ---------
Google Inc.
Gravity Sensor
Resolution: 0.009810001
Type: 10 ---------
Google Inc.
Linear Acceleration Sensor
Resolution: 0.009810001
Type: 11 ---------
Google Inc.
Rotation Vector Sensor
Resolution: 5.9604645E-8

The key code is pretty simple to access the sensors.  This may not be the most efficient or fastest code yet, it is my starting point

In your onCreate do this:


mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);       mSensorManager.registerListener(mSensorListener1, mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_FASTEST);  
private final SensorEventListener mSensorListener1 = new SensorEventListener() {
   public void onSensorChanged(SensorEvent se) {
     text1.setText(se.sensor.getName());      Ax = se.values[0];      Ay = se.values[1];      Az = se.values[2];      long timestamp = se.timestamp;      aXProgress.setProgress((int) Ax + 50);      aYProgress.setProgress((int) Ay + 50);      aZProgress.setProgress((int) Az + 50);
                            if (sdcard.sd_ok & logging) {     sdlog(timestamp);     }    }
 public void onAccuracyChanged(Sensor sensor, int accuracy) {  }};



Writing to the SD card turned out to be more work than I thought.  It really is pretty easy, but I got hung up on a couple things.
  • AndroidManifest.xml has to have this line in it, or it will not throw errors, it just won't work.     android:name="android.permission.WRITE_EXTERNAL_STORAGE"
  • File names should avoid  "." and ":"    I was trying to time stamp the file names and put in a ":".  Failed.
  • When the phone is plugged into the PC, the SD card is shared and you can't write to it.  You have to load your app, then unplug, and run it again to make it work.
  • I used buffered stream to keep the app from waiting for the SD card, but if you don't do a flush() it doesn't write until the buffer is full.
  • If you get exceptions like "Permission Denied"  you have to collect them and find a way to view them or display them back to the user


This is the class I wrote to handle the SD card communication


public class SDcard { File sdCard = Environment.getExternalStorageDirectory(); File dir = new File (sdCard.getAbsolutePath() + "/sifish"); File destinationFile; BufferedOutputStream buffer; public String messages; public boolean sd_ok = false; public boolean checkSD() { sd_ok = false; messages = "SD card is ".concat(Environment.getExternalStorageState()).concat("\n"); if (Environment.getExternalStorageState().equalsIgnoreCase("mounted")) { sd_ok = true; } return sd_ok; } public boolean openSDFile(String filename) { boolean success = true; //messages = "SD card is ".concat(Environment.getExternalStorageState()).concat("\n"); sdCard = Environment.getExternalStorageDirectory(); dir = new File (sdCard.getAbsolutePath() + "/sifish");  dir.mkdirs(); success = dir.canWrite(); sd_ok = success; if (!success) { messages = messages.concat("Error - Can't write to "+dir.getAbsolutePath()+" directory on SD card\n"); sd_ok=false; }
try { destinationFile = new File(dir, filename.concat((String) android.text.format.DateFormat.format("_yyyyMMdd_hhmmss", new java.util.Date())).concat(".csv")); buffer = new BufferedOutputStream(new FileOutputStream(destinationFile)); messages = messages.concat("Opened "+destinationFile.getName()+"\n"); } catch (Exception e) {   messages = messages.concat("Error - Can't open file "+destinationFile.getName()+" on SD card\n");   //messages = messages.concat(e.getMessage());   messages = messages.concat(e.toString()).concat("\n");   success = false;   sd_ok = false; } return success; } public boolean closeSDFile() { boolean success = true; try { buffer.flush(); //buffer.close(); } catch (Exception e) {   messages = messages.concat("Error - Can't close file on SD card\n");   messages = messages.concat(e.toString()).concat("\n");   //messages = messages.concat(e.getMessage());   success = false; } sd_ok = false; return success;
//destinationFile.close(); } public boolean writeSDFile(String data) { boolean success = true; try { //byte[] dataByte = Base64.decode(data, Base64.DEFAULT); char[] dataChar = data.toCharArray(); for (int i=0; i<data.length(); i++) { buffer.write(dataChar[i]);   } //buffer.flush();   //doesn't write until buffer is flushed } catch (Exception e) { messages = messages.concat("Error - Can't write to SD card file "); messages = messages.concat(e.toString()).concat("\n"); success = false; sd_ok = false; } return success; } public void dirSD() { sdCard.listFiles(); }

I'm going to clean this up and publish it to android market, but meanwhile I posted the apk file to my download page.   The data is saved to your sdcard when you run a log, under the "sifish" directory.  It creates a csv file with all the data from all the sensors on the phone.

The screenshots from the emulator don't do it justice, since the emulator has no sensors and no data shows up.




Just surf your android phone to this page:
http://code.google.com/p/arduino-java-xyzcnc/downloads/list

and download
AccelerationLogger.apk

Then look on your SD card for the output files.








Thursday, June 7, 2012

Found/Fixed an LG C729 android phone with broken screen




I found this on the street in front of my house.   It is a nice android phone that had been
run over by a car.   I couldn't believe my luck.  The screen is broken badly. This is the most fantastic thing I ever found.    The screen is splintered and I got some shards in my finger trying to see if the touch pad works.  It doesn't at all.  That is the biggest problem.  The back won't stay on and the battery is pretty roughed up too.




I set out to find out what data I could pull off the phone and what functionality I could use.  I'm a hardware experimenter, and I'd like to use it for telemetry, robot control, etc.  For that I don't need a screen, the sensors, camera, GPS and USB interface alone make it very powerful.    It has an SD card it in, a SIM card too.   Who does it belong to?   If it were an iPhone, I'd buy a screen replacement kit, but this is a fairly obscure LG C729 .
http://www.globaldirectparts.com/OEM-LG-DoublePlay-C729-Main-LCD-Screen-p/lg977470.htm
This looks like a very dicey site.  But it led me to a part number, then
http://www.ebay.com/itm/US-OEM-Tmobile-LG-Double-Play-C729-Big-Outter-LCD-Display-Screen-Part-Tools-/221039061735


Looked up model, it is an LG Doubleplay from T Mobile.  Runs Android 2.3.4  It is a practically new phone. I can't imagine why whoever dropped it and ran it over didn't come back for it.




I found the SD card was unformatted and had no data on it.  I guess the phone was pretty new.
The SIM card from Tmobile... is it still active?   I can see that the phone is saying no signal, emergency calls only, so it's cancelled as I'd expect it to be.   The phone sat around for a couple weeks before I got a chance to play with it.

A little fiddling and I was able to put the battery in, and connect the USB and power it up.   The backlight comes on and with the battery in in actually boots.   It makes sounds.  This phone seems good except for the screen.  For some reason it didn't work the first time I tried, but later it did boot.   Plug it into the USB and screen lights up but is pretty bad shape.    I think the screen lock is on, and since the touch pad is smashed, I can't unlock it with a swipe.



Another lucky part is this wacky phone has a second touch screen inside the keyboard.  That touch screen actually works still and is not broken.  However it doesn't fully run the phone.  I can open text messaging but not the contact list to see who's phone it is.



When it first booted, I was able to operate the phone.  After a while it went to screen lock due to inactivity and I can't see a way to get it out of that mode.   It is hard to turn the phone off again, because long button hold brings up a menu that I can't operate to do a shutdown.  I did find the physical keyboard space and return allow me to navigate the power down menu.  W00t!   Any other phone and I'd be nowhere, but this oddball has a physical keyboard.

Android Java SDK talks to the phone, it seems to load apps I program in, when the power is off!  When turned on I can't go through the menus to set the phone menu option to allow Settings->Applications->developement which allows USB loading of programs.   When powered on I can't talk to it with eclipse.  Very strange.  This is a major obstacle to using the phone as a hobby robot.

I thought I would need to write an app to unlock the screen when the touch swipe won't work
http://stackoverflow.com/questions/2891337/turning-on-screen-programmatically
newKeyguardLock = km.newKeyguardLock(HANDSFREE); newKeyguardLock.disableKeyguard();
However I found that opening the phone keyboard unlocks the screen.  Awesome.  That doesn't work with my droid.


At this point I'm a little stalled.  I can't program the phone with custom apps, because it isn't in developer mode.   A simple menu option that I can't get to without the touch screen.  I can't use WiFi because I can't get to the settings page.  Maybe I can program it through the USB, if only I could get to developer mode.


I may go back and buy a new screen.  Bad news is I need a screen AND a touchpad/glass to fully fix this thing.  I don't want to order direct from China.  That usually works, would save $10, but takes forever.

It would take $60 to completely repair this phone.  After that it could be unlocked and used as a phone.  If I only replaced the touch screen/glass, it would be $30.  Does that make sense if I've got it open should I go for 100% fixed?

I was curious is the ESN was good.   How you do it appears to vary with company.  Can't find much on Tmobile.  I don't plan to activate it, but it would be nice to know in case I do.
http://www.checkesn.com/how-it-works/

I opted to repair the screen and digitizer.  Partially for practice, part because I wanted a GSM phone for a trip to Europe coming up, and part because I'm finding I'm pretty stuck without any touch input.   I could have just replaced the digitizer and glass, but while I was in there, I decided to go for it.  I bought the parts from Ebay on the links above from "gadgetFix" because they shipped from the US.  It took about 4 days to get here.

Here is what I got.  Came in a little envelope.  No instructions :(



I took the battery out of the phone first

I hate instruction videos because you have to watch them slowly and waste time finding out if they are any good.  Just write instructions people!!
http://www.youtube.com/watch?v=jsspvoCF1Jg
This doesn't seem to apply very well because this is a slider phone, and taking the back off is pointless.  They do use a heat gun to melt the adhesive.   This may be necessary.
http://www.repairsuniverse.com/lg-take-apart-repair-guides.html

This is a little closer to the mark
http://www.repairsuniverse.com/lg-ally-screen-replacement-take-apart-repair-guide.html
This does show you have to start at the back, remove the motherboard, etc until you get to removing the screen.  No heat on this one at least.

I pried off the rubber bumps on the back of the screen and removed the two philips head screws.
I can pry up one side of the screen, but I can't get in. 


close up of the screw once the rubber bump is off







 I guess I have to take the screws out of the back and start prying up the mother board.
I'm not showing the photo of the back, because the photo has the MEID in the picture.  Just take out all the small phillips head screws you see.


Pryed off the back and pulled out the keypads from each side.  This allows you to wedge a screw driver in sideways and access the other two screws on the back of the sliding screen.   You have to pry up the circuit board a bit and slide the screen around until you can just wedge in the screwdriver and remove the two screws opposite the ones that are easily available under the rubber bumps.



Couldn't photo that step because it took both hands :).



Prying open the screen section.  There is a flex circuit board wiring that ties it all together.  it is taped to the back of the LCD.  Peeling it off the old LDC was scary stuff.  The connectors are the silver rectangles.  They pop off with a tiny bit of prying.  There is one for the LCD and one for the digitizer.  Just look at the new parts and you'll see where they connect.



Old screen was glued in and was a mess of broken glass.  Easy to get cut.



Peeled it out, but it's not all out yet.  Need to save the plastic bezel.  Too bad, it's pretty messy.



Plugged it back together, put back the back part of the phone so I could power it up.  Holy crap! It's alive!!!


The touch screen works, the LCD lights, the home button works.  The physical keys still work. This thing is fully functional.   Removing the sim was a mistake, when it was put back in, it wiped the phone.  No worries, I had already read the email when the screen was broken and it was totally lame stuff.



Still need to figure out how to put the front panel back together and scrape out all the old broken glass.
I'm kind of surprised the thing works, it took a ton of prying and poking to get to this point.

If you want to do this on your own phone, that you want to be good as new, geez, good luck.   I only had the nerve to do this because the phone was junk and I had wasted $$ on replacement parts and didn't want to let them go to waste.   I may never get it all back together good as new.