How to setup a VPN in China

A few days ago the Pax Instruments team arrived in Shenzhen to manufacture the T400. There are many challenges ahead and we look forward to handling each one successfully. One of the more frustrating challenges is circumventing the internet censorship the government inflicts on the people who live here. Without censorship circumvention the internet can be extremely slow for sites outside China and some are completely blocked. To connect with people on Facebook and Twitter it is necessary to take action.

In this how-to you will learn to create a virtual server, setup a VPN server on the virtual server, configure VPN access on OS X, and configure VPN access on Android.

Create a virtual server

Creating a virtual server on DigialOcean is simple. Once you have your account, go the create droplet page.

Name your vpn server. In this example we will use “vpn”, but any name will work just fine.
Screen Shot 2014-11-11 at 5.09.36 PM

Select the $5 option. You get 1000 GB/month transfer, which should be plenty for one person.
Screen Shot 2014-11-11 at 5.11.26 PM

Select Singapore. This will host your virtual server on DigitalOceans physical servers in Singapore. This will give you the fastest connection.
Screen Shot 2014-11-11 at 5.17.54 PM

Select Private Networking and IPv6. These settings may not matter, but it is how we have the Pax Instruments VPN setup and it works.
Screen Shot 2014-11-11 at 5.20.28 PM

Select Ubuntu. Other systems should works, but this this is what we use.
Screen Shot 2014-11-11 at 5.22.08 PM

Click Create Droplet.
Screen Shot 2014-11-11 at 5.31.55 PM

Your droplet will be created shortly. When we first tried to setup our droplet DigitalOcean was having a technical problem with the Singapore servers and the process would freeze after a few second. Everything was fixed when we tried ten minutes later.
Screen Shot 2014-11-11 at 5.32.46 PM

You should automatically be taken to your Droplets page. You will see listed all your droplets. You can see your droplet’s public IP address. Screen Shot 2014-11-11 at 7.15.42 PM

Setup a VPN server on the virtual server

You will receive an email with your droplet’s IP address and the root password. You will be automatically prompted to change this password the first time you log in via ssh.
Screen Shot 2014-11-11 at 7.19.57 PM

NOTE: In the code snippets below the entire command may not appear. You may need to scroll across the snippet window to highlight and copy the entire command.

Connect to your droplet and setup the VPN server.

bash-3.2$ ssh root@128.199.244.84

On your first connection you will be asked to add the server’s RSA key to your keychain. Type “yes”.

The authenticity of host '128.199.244.84 (128.199.244.84)' can't be established.
RSA key fingerprint is db:1e:78:fe:f1:bc:7d:7d:c6:e8:b1:37:ce:bb:7b:79.
Are you sure you want to continue connecting (yes/no)? yes

You will be asked for your password. Enter the password Digital Ocean sent you. You can type it in or copy and paste form the email.

root@128.199.244.84's password: 

On first login you will be prompted to change the password for the root user. You will have to enter the original password then type a new password twice. Keep this password secret as it protect the entire server.

Changing password for root.
(current) UNIX password: 
Enter new UNIX password: 
Retype new UNIX password: 
root@vpn:~#

At the command prompt use the wget command to download the VPN setup script from github.

root@vpn:~# wget https://raw.github.com/viljoviitanen/setup-simple-pptp-vpn/master/setup.sh

Execute the VPN setup script. Replace “vpnuser” and “vpnpass” with the user name and password with which you would like to log into your VPN.

root@vpn:~# sudo sh setup.sh -u vpnuser -p vpnpass

The script will give you your server’s IP address, the VPN user name you selected, and the VPN password you selected. Verify the IP address is identical to the one DigitalOcean emailed you.

Detected your server external ip address: 128.199.244.84

VPN username = vpnuser   password = vpnpass
============================================================
 * Restarting PoPToP Point to Point Tunneling Server pptpd                               [ OK ] 
root@vpn:~# 

Your personal VPN server is setup and ready to use.

Configure VPN access on OS X

OS X integrates VPN services, so there is no need for extra software.

Open System Preferences and click on Network.
Screen Shot 2014-11-12 at 10.08.24 AM

In Network Preferences click the plus sign to add a new network interface.
Screen Shot 2014-11-12 at 10.05.20 AM

Select VPN as the interface.
Screen Shot 2014-11-12 at 10.17.44 AM

Select PPTP as the VPN type.
Screen Shot 2014-11-12 at 10.13.22 AM

Give the service any name you like. You can leave it as “VPN (PPTP)”.
Screen Shot 2014-11-12 at 10.18.18 AM

Enter your server IP address and VPN user name. Check “Show VPN status in menu bar.
Screen Shot 2014-11-12 at 10.20.05 AM

Click “Authentication settings…” and enter your VPN password.
Screen Shot 2014-11-12 at 10.19.39 AM

Click “Advanced” and check “Send all traffic over the VPN connection.”
Screen Shot 2014-11-12 at 10.20.26 AM

In the menu bar click the VPN icon and select “Connect VPN (PPTP).”
Screen Shot 2014-11-12 at 10.36.51 AM

Now you’re ready to rock! Google “what is my ip“. If you see your server’s IP address, everything is configured correctly. Within China you can confirm this by visiting Facebook, which is normally censored.
Screen Shot 2014-11-12 at 10.34.17 AM

Configure VPN access on Android

Setting up VPN on Android is about as simple as it gets.

Go to Settings. Under Wireless & Networks, click “More…”
Screenshot_2014-11-12-10-41-43

Click “VPN.”
Screenshot_2014-11-12-10-41-50

Click the plus sign to add a new VPN server configuration.
Screenshot_2014-11-12-10-42-04

Enter any name for the VPN, we’ll use “VPN (PPTP)”. Select “PPTP” as the type. Enter the server IP address. Check the encryption box. There is nothing in the advanced menu to configure. Click “Save.”
Screenshot_2014-11-12-10-43-04

Click on “VPN (PPTP)” to enter your credentials and connect to the server. Enter your VPN user name and VPN password. Check “Save account information.” Click “Connect.”
Screenshot_2014-11-12-10-44-08

Now you should be connected to the VPN server. There is a key icon in the upper left corner of your screen to indicate you are connected through the VPN.
Screenshot_2014-11-12-10-44-50

Now you should be able to use Skype, Facebook and all the other wonderful thinks that keep you connected. Enjoy 🙂

The T400 appears at MakerFaire NYC

Alasdair Allan wrote a wonderful article about the T400 and open source lab instruments at MakerFaire NYC.

It was a real treat speaking with Allasdair and everyone at MakerFaire who experienced the T400 and really get it when it comes to lab instrument access.

The main problem with lab equipment is that it’s expensive. Often the next model up from what you can actually afford is the one that does what you need…

Thank you, Kickstarter family

T400 Kickstarter update #1: Thank you, Kickstarter

Hello I’m Charles with Pax Instruments and I would just like to say thank you to all my family, friends, and wonderful people on kickstarter who have supported the T400 temperature logger campaign.

We’re just four days into the campaign and we’re now over 130% funded. Thank you! It’s been very exciting and I’m sure the next twenty-six days will be equally exciting.

I appreciate you continued support in getting the word out about the T400. If it were not for you, this this would not be possible. Please post about the T400 on Twitter, Facebook, and any related forums you use. And please contact any beer brewers, coffee roasters, or other people you think may be interested in logging temperatures. Thank you 🙂

Support the T400 on Kickstarter right now!

The Pax Instruments T400 temperature datalogger Kickstarter campaign is live!

The T400 can connect to four thermocouples simultaneously, and logs temperatures directly to an SD card, so it can operate independently or while connected to a computer.

I want to continue developing this product and expand the line to other instruments and I’d love your helping making it happen!

Here’s how you can help:

First, share the Kickstarter campaign on social media like Facebook and Twitter. Also contact any friends you think would be interested in the T400.

Second, if you can submit my project to the tip lines at sites you read, it’ll help my cause a lot. Tell them there’s a Kickstarter project you like trying to make Open Source lab instruments, so people with projects in mind don’t have to spend an arm and a leg.

Third, With a Kickstarter campaign, a lot of the success seems to come from attention at the very beginning. So it would be amazing if you could back this, at least for $1, and then share the campaign to your networks.

Thanks so much for helping me make this a reality.

Pax Instruments is heading to MakerFaire NYC

New York Maker Faire Web Badge
I am excited to announce that Pax Instruments will be at MakerFaire NYC on September 20 & 21, 2014. Come visit exhibit #42316 “Pax Instruments T400 Temperature Datalogger” and play with working prototype hardware. I hope to see you there.

While you’re waiting, learn about the T400 or follow Pax Instruments on Twitter, Facebook, YouTube, Github, and Thingiverse.

T400 thermal debugging

When analyzing or debugging your electronics project one of the easiest places to start is with the finger test. Simply touch your finger to each of the components on your board to which component is misbehaving and heating up.

When you need quantitative answers, a thermal camera, like the $1000 Flir E4, is a great tool. At $350 the Flir One is bringing down the price of this technology, but it is still out of reach for most home labs. You can use the T400 thermocouple datalogger to achieve adequate results without the need for expensive hardware.

Let’s use the T400 board as an example. In this setup a thermocouple is connected to the ATmega32U4 using thermally conductive silicone potting compound. This is the same compound used to pot thermocouples into stainless steel tubes.

Screen Shot 2014-08-19 at 7.41.59

We can use the Flir E4 to view our board and compare results to the T400. In this image you can see the ATmega32U4 is the warmest component followed by the MCP5219-3.3V regulator. The Flir E4 and T400 give the same readings of approximately 35 C. This does not indicate the E4 and T400 will always give the same temperature or that either temperature is accurate to the true temperature in this case. The E4 has an accuracy of +/-2 C while the T400 has a yet undetermined accuracy.
Screen Shot 2014-08-19 at 7.53.10

With four thermocouple channels the T400 can monitor four parts of your board while recording that data for later graphing. I hope this gives you a few ideas of how you can use the T400 in your own lab. Please sign up below to be notified when the Pax Instruments T400 Kickstarter campaign launches in September.

Assembling T400 version 0.7

The T400 v0.7 PCBs arrived this morning, so I got straight to work assembling a board. I am pleased with the results.

I recommend ordering your PCBs through DirtyPCB.com. I do not have a place I can recommend for stencils, but I do recommend them for surface mount boards.

This is my setup. Eagle file for placement reference, PCB, a kit of parts in part organizer modules. Solder paste, and a solder paste squeegee (I had to live with a scraper). I ordered my stencil with both the top and bottom solder mask. I have clear packing tape sealing the holes of the bottom solder mask.
IMG_20140814_132202

My parts kit does have the 1 MOhm resistors I added to this revision. Fortunately, I have several SMT parts books on hand.
IMG_20140814_132726

Here is the board with all the components placed. Some are a bit off kilter. Those will straighten out when the solder paste melts.
IMG_20140814_140701

Here is the off-kilterness up close. Also note the pressure sensor. Given the limited programming space available on the ATmega32U4, the code required to operate the pressure sensor may not fit. Either way, the footprint will stay on the board for anyone who wants to hack around though the component will likely not be populated.
IMG_20140814_140819

You can see the difference in this after photo.
IMG_20140814_184102

A key update on this board is the use of a standard BL-5C battery. Using an off-the-shelf battery will reduce any battery supply issues. This is the connector.
IMG_20140814_140753

Now stick it in the oven and press GO! Hmm… nice graph.
IMG_20140814_141744

Here’s the complete board with LCD. I flashed the Arduino bootloader then a sketch. No problems at all!
IMG_20140814_183836

Sign up below to be notified when the Kickstarter campaign launches early September.

T400 repositories

You can now find repositories for the T400 on Github. The design files are being migrated from the monolithic development repository to Github, so it will be at least a few days until everything is uploaded.

You can find links to the repositories and other downloads on the T400 product page.

Sign up below to be notified when the Kickstarter campaign launches early September.