Saturday, February 18, 2017

Adding a JST serial connector to the PogoPlug Mobile

Embedded ARM is a very popular platform for building appliances these days, everything from NAS, Wi-Fi access points, and media players, to tablets, smartphones, and smartmeters.

Not all ideas are as successful as others, which means that once in a while you can get yourself an ARM board for pennies on the dollar. One such case is the PogoPlug. Originally sold for $50 and up as a cloud-connected storage appliance, they can now be acquired for as little as $7.50.

Of course, to make any use of these devices you'll need to access and replace the operating system. And the cheapest version of the device has no serial connector, no external shell access, and is not supported by the company that manufactured it.

The older versions of the PogoPlug have a nice JST header that offers serial access to the bootloader and Linux shell. Those can be found for as little as $10. But why spend $2.50 more when you can just attach your own JST connector to the cheaper model? I know, I know, it will cost much more in supplies and tools to do that...but it's also a little more fun.

First, here are a few before pictures of my PogoPlug Mobile. As you can see, this is the version that offers SD, SATA, and USB connection options. Network connectivity is Ethernet, no Wi-Fi.




My goal is to show an option for adding a serial console with a JST connector. That way you can use an audio cable and a USB-to-TTL adapter to connect it to your computer. This board makes this a little tricky, hence the post.

I aim to make this so clear that even a software engineer (like myself) with a soldering iron can do it successfully.

First, the tools you'll need (I'll provide links for these at the end of the post):
  • Solder paste
  • Wire cutters
  • Flux
  • Solder wick
  • Solder
  • Soldering iron
  • Screwdriver
  • Scraper
  • Soldering iron tip cleaner
  • JST female connectors
  • Audio cable with JST male connector and H4PL connector
  • USB-to-TTL adapter



So, go buy all this stuff so that you can save $2.50. Got it? Good.

Now we disassemble the PogoPlug. Flip it over and remove the two bottom rubber feet, exposing two screws. Remove the screws and work the scraper tool into the slot between the top and bottom covers. As you move the tool toward the front of the PogoPlug, push inward to separate the tabs that hold the top and bottom together. There is a tab on each side and two more on the front. If you snap one or two tabs, don't sweat it -- the screws will hold it together when you're finished.





Remove the four small screws that hold the board to the bottom plate and you'll have a bare board, ready for modification.

On the bottom right side of the board, just below the SD card socket there are four pads in a straight vertical line with a white box drawn around them. This is where our JST connector will be soldered in place. From the top to the bottom, they are ground, transmit, and receive. We won't use the bottom one, it supplies voltage that isn't needed for serial console.

Here's a picture of the bottom of the board. The four pads are on the bottom left.



Here we can see a little problem. The pad for ground (farthest right) looks different from the others, like there's a ball of solder sitting on the board. As far as I can tell, that's exactly what it is. What appears to be a hole on the top of the board is not a hole at all.



So, how do we attach a JST connector with four pins to a board with three holes?

Let's not get too far ahead of ourselves here. First, we should clean up the other three pads, which actually are holes through the board. Using the solder wick, flux, the soldering iron, we can remove all the solder from those holes pretty easily.

If you are already experienced using a soldering iron, perhaps an electrical engineer, please:
  1. Don't laugh at the next part.
  2. Feel free to skip this next bit.
  3. Realize that this is a remedial soldering lesson for the hardware-impaired.
  4. Leave constructive feedback in the comments section.
My solder wick was much more effective when I added some flux to it. The wick was supposed to already have flux in it, but it didn't soak up any solder for me until I added a healthy amount of flux to it.



Get your iron hot, clean the tip, and add a bit of solder to the tip (this is called "tinning"). Dab the tip to the pad to add some solder to it. This might seem counter-intuitive, since we're trying to remove the solder. However, a little more solder helps to transfer the heat to the solder inside the hole, melt it, and remove it.

Put the solder wick on top of the pad and press the soldering iron tip on the wick directly above the pad. The solder on the tip should be absorbed into the top side of the wick, and the solder on the pad should absorb the heat, melt, and be absorbed into the bottom side of the wick.

This might not work 100% the first, second, or even the third time you try. You might have to do it on the top and the bottom of the board. When you do it right, the holes will be clean and pretty. Note that I didn't clean up the ground pad much -- I did remove what I could with minimal effort, but nothing more.


So, back to the question -- how do we attach a JST connector with four pins to a board with three holes?

I let the smoke out of one board trying to figure that out, but I eventually found a way that worked for me.

The pad looks like a surface mount, so I clipped the pin on the JST and used solder paste to connect it to the surface of the pad. Solder paste melts at a lower temperature, so it's easier to use it than it would be to use regular solder.


You have to leave enough pin to be able to make the connection, but remove enough to let the connector sit close to the board. Here's how mine ended up.


This is also a good time to make sure you got enough solder removed from the other three holes. Put the connector in the board, making sure the pins go through easily and that it sits close to the board.




Now we add a little ball of solder paste to the pin and ground pad. Not too much -- you want the paste to stay only on the ground pad without leaking somewhere else when it melts. Apply heat on the bottom of the pad and the top of the pin with the soldering iron.






I don't recommend moving or pulling on the connector at this point. All you need is a decent electrical connection, not a solid mechanical one. The other three will hold it in place.

Put a litte flux on the other three pads and solder the remaining three pins from the bottom side. Here's how it looked when the soldering was done. Not terribly pretty, but functional (and prettier than some of the others I've seen).





The hard part is done! Now all we have to do is modify the cable to put ground, transmit, and receive on the right wires.

Use a push pin, thumb tack, or the scraper to lift the covers that secure the wires to the H4PL connector and pull the wires out one-by-one.


Since I wanted a permanent serial console available without disassembling the PogoPlug, I melted a hole in the cover and inserted the audio cable through it.



Then I connected the pins to the H4PL connector again, this time in the order that works with the USB-to-TTL adapter I bought. Pretty simple: ground-to-ground, transmit-to-receive, receive-to-transmit.

Before:

After:





Plug in both sides of the audio (now serial) cable, plug it into USB on your computer, and fire up your favorite serial communication program. I prefer minicom.





U-boot, shell, woot!








At this point you'll want to enable remote shell and disable the PogoPlug software. To do that, remount the root filesystem read-write:

mount -oremount,rw /

Then edit /etc/init.d/rcS, commented the last line, and added two lines to allow remote shell access. The last line used to look like this:

/etc/init.d/hbmgr.sh start

Now it looks like this:


#/etc/init.d/hbmgr.sh start
telnetd
/usr/sbin/dropbear

Execute "poweroff" and unplug the unit. Now button it all back up and start hacking away. Sites that provide guidance for replacing u-boot and running your own customized Linux can be found in the section at the end.

Here's my final product. Again, not the prettiest, but very functional.



Credits:
Moustafa Hassan
Qui's techNOLOGY Blog
Discovering solder paste
Jeff Doozan Linux Device Hacking Forum


Links to supplies and tools (all sellers based in USA, because I'm impatient):
PogoPlug on the cheap:

No comments: