Sunday, June 5, 2016

Conquering the PINE64 Android LCD

Got my Pine64 and LCD Screen Last week, and it was a rough start. Once I made all or most mistakes, I finally got a fully working Android running on the Touchscreen LCD.

The TL;DR List of things I did to get things running:
  1. Made sure to use the Android Phoenix LCD Image
  2. Made sure the Phoenix Image is correct on the SD Card
  3. Made sure I used a legit 5V\2A power supply
  4. The ribbon connections are finicky. If you are afraid to ask like I was, pins side down. 
  5. Sanity check with a Linux build on HDMI
  6. The LCD Android build seems to work on HDMI or on the LCD, but not both. If the LCD is connected correctly, HDMI doesn't appear to work. 
  7. First boot takes a while, successive boots are very fast

2016-July Update. Instead of the link in Step #1, bookmark the Android releases link and scroll down to the LCD version. This way, you will always get to the latest. 
As of the 2016-06-03 release, "dd" images for the Android LCD Builds are available! You don't have to use Phoenix Imager (though there is still an image for that), you can use something like Win32DiskImager, or the dd utility on OSX or Linux. 

The Image
If you don't have 2 SD Cards yet, just do it, you will want to test your sanity on other builds and having to rewrite back and forth over the same card takes forever. For the LCD to work you have to use Android 5.1.1 LCD PANEL  . Phoenix Card images are specifically for setting up Android images on SD Cards, and as far as I can tell, you can't do these with Linux dd or Win32DiskImager, you need to use this specific burner. The only one I was able to get working for me was the Windows version, the Mac LiveSuit didn't seem to work the same way. While the Phoenix application is straightforward enough, I did have a couple of inexplicable failures, as well as at least one run that said it worked but did not do anything but make one 50MB partition. It should take a few minutes, but it was a lot faster than a linux image, because it writes a lot less. This was what my working Android image looked like when it was done:

For my first Android Image failure, nothing at all seemed to work. I verified I had a 5V\2A supply (yes, of course I first tried on the nearest free micro USB plug I saw). No HDMI, LCD, anything. I started thinking I had a bad board. To ease my mind, I disconnected everything, and burned an the Arch Linux distro using reliable old Win32DiskImager. On HDMI, everything came up fine. At least I knew the board was good! With a little renewed confidence I popped out my latest SD Card burned from Phoenix Image, and got ready to reconnect the LCD. In my initial haste of receiving the board, I just tried connecting everything, but the ribbon cables make it tricky to get to the board while testing the LCD. In the laziest and most cost effective solution available, requiring only some masking tape and 4 small self-threading screws (which you should have somewhere if you just got a Pine64), I hacked this together:








  1. Cut the top off the Pine64 Box
  2. Flipped over the box
  3. Mounted the Board onto the box top + bottom with 4 threading screws
  4. Applied a loop of masking tape to the front of the box
  5. Stuck the LCD to the masking tape

No, not a great permanent solution, and sure, I can see the fire hazard, but for tweaking and testing it worked for me! This put the LCD in a good position that it could reach both the DSI and TS ports without getting stretched, and the weight of everything made the touch screen usable and sturdy enough for swiping and typing and tapping.

On my first try, the LCD didn't come up. I figured I would try HDMI. There it was! Not usable, as the touch screen did work (on the blank LCD, halfway there), but it wasn't really usable against my monitor of a different resolution. Finally I re-seated all of the LCD connections. I found that the easiest way to go is to connect the bus to the LCD ribbon, then the long ribbon to the bus, and finally the ribbon to the port. If you were wondering, the ribbon side with the pins faces down on all of the ports - when you close them they sort of look like they could be upside-down, but I definitely have everything pins-down. I guess in the end I just didn't have a completely clean connection, after a few reboots, it all started to work!

On one of my reboots, this just hung. Every other time, the above screen was around 5s. If this is up for more than 30 seconds, reset or power cycle. After this screen, you will see:

The first time I got this running on the LCD, it sat here for about 10 minutes. I was just about to power cycle when the Android screen came up and said updating apps. After all of that finished, successive reboots were well under 1m, it was just the first boot that required a lot of patience. After that, however, everything was quite fast! The touchscreen is responsive and accurate (though I felt like at first it was a little off, after some movement it seemed to get itself aligned),



Next, I'll give the camera a try, and see what I can do with the temp\humidity and light sensors. The buses on the sensors don't fit anything directly, so will need to do a little hacking. 

This is certainly more challenging than a Raspberry Pi build, I have always run Linux on my Udoo so I don't know if you run into the same Android problems with that, but this seems to be a great first release which can only improve with time. 

13 comments:

  1. Great info. I was able to get my unit to boot. Touch screen worked, however once I would enable wifi, the device eventually crashes and boots to the same crash. RemixOS seems to be the most stable by far but the LCD port doesn't work.

    ReplyDelete
  2. Thank You! I have seen a lot of reports of stability issues with the Wifi module, I didn't order my board with Wifi, so that might be why I haven't seen any crashes. Hopefully soon they get a *nix distro that supports the LCD...

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Added an update to the post with a link to the generic Android releases, a new Android LCD Build as of June 2016 and non-Phoenix images available!

    ReplyDelete
  5. dd did work for me on Mac MBP writing to /dev/rdisk2. Insert card into adapter and into SD slot. Unmount it (not sure if this step is necessary, I saw another fellow post this step): diskutil unmountDisk /dev/disk2. Then call dd such as: sudo dd if=android-rooted-ver5.1.1-lcd-version-20160603-pine64-64GB.img of=/dev/rdisk2 bs=1m

    ReplyDelete
    Replies
    1. Excellent! It must have been right after I finished this blog post when they released the 20160603 images, which included the dd ones. Prior to that there was only a Phoenix image available for the LCD build, which I learned didn't work with regular old dd. But your instructions for the dd are spot-on, how has this build been working for you?

      Delete
  6. I have the LCD hooked up and the touch function seems to work but I have not figured out how to bring up the touch Keyboard.

    ReplyDelete
  7. Right after I posted this I unplugged the USB KB and it worked just like it should.

    ReplyDelete
  8. I still can not get the image to boot.

    ReplyDelete
  9. Think you for sharing your info. I had the standard Android image at first and this article prompted me to go and check for the LCD version. Kudos

    ReplyDelete
  10. I just got the Pine64 touchscreen. I was planning on running it with Ubuntu, but do I understand correctly that only that one Android image supports the touchscreen? Does anyone know when there will be support for it under Linux?

    ReplyDelete
  11. I just got the Pine64 touchscreen. I was planning on running it with Ubuntu, but do I understand correctly that only that one Android image supports the touchscreen? Does anyone know when there will be support for it under Linux?

    ReplyDelete
  12. I bought the Pine64 and LCD touchscreen to use with Linux. I don't care so much about the touch screen but I would really like to be able to use the LCD screen. What is required to get the LCD to work with Linux???

    ReplyDelete