User Tools

Site Tools


Access thru internet by BBB with VNC

If you want to communicate with arduino over internet one of almost “painless” solution is the use of in-between miniPC. It can be found a lot of linux distribution on miniPC whichp provide us a lot of useful tools which can make our goal easy-achievable.

In next few paragraphs there is a brief guide for realizing connection between arduino and PC over internet. As intermediator serves BeagleBone Black with Ubuntu. We will use VNC and VPN by Hamachi.

Guide has these steps:

  • Upload Ubuntu on SD card
  • Install and configurate VNC server and graphical interface
  • Install arduino IDE
  • Install Hamachi client
Upload Ubuntu on SD card

At first it is need to download required version of Ubuntu for ARM architecture. I use 13.04 Raring version, which can be found here.

File is archive image file. It first we must extract them and after that upload to SD card.


tar xvJf ubuntu-image-file-archive.img.xz
umount /dev/sdX
dd if=/path/to/yours/ubuntu-image-file.img.xz of=/dev/sdX 
# don't forget substitude sdX by yours SD card address 

Windows: For unpacking use the 7-zip or similar and for writing the image on SD card Win32 Disk Imager may serves.

After pluging SD to BBB and it's turn on will the system begin to boot from SD card.
*note. I found the information on the internet that if one want to boot from SD card one must press and hold BOOT button on BBB. If I do it it never boots. So maybe I do no understand it corectly or somethink has changed. My BBB is REV3B.

Install and configurating VNC server and graphic interface

If you successfully boot the worst is behind you. But before we can connect to arduino over interne it's necessary to install some packages and configurate VNC server and hamachi client.

If you have got microHDMI cabel, you can plug your BBB directly to your monitor and use usb keyboard. If you do not have HDMI cabel plug ethernet cabel to your BBB and connect it to your home net or directly to your PC. In Ubuntu it runs dhcp client so it won't be problem to put into operation communication and use SSH protocol to get in.
username: ubuntu
password: ubuntu
*note. If you have got problem with LDXE display manager and after logging it will stay just color of background on screen, you can disable the calling of display manager after logging by this command:$echo “false” | sudo tee /etc/X11/default-display-manager

You will need internet connection for next steps.
At the first update your system:

apt-get update
apt-get upgrade

In next step install VNC client with LDXE support. This solutin were taken from this pages:

apt-get install xorg lxde-core tightvncserver

Next run the VNC client. It will generate it's config file. After that you can turn it off.

tightvncserver :1
tightvncserver -kill :1  

Open the config file of VNC client:

nano ~/.vnc/xstartup

And apend this line there:

lxterminal &
/usr/bin/lxsession -s LXDE & 

This will provide you that after conecting to VNC server it will drop you right into LDXE graphical interface.

Now you can turn on VNC server again. And if you want you can add it to services run on start of the system (Guide is taken from this blog At the first you need to make a script turning on the VNC server in folder /etc/init.d/

nano /etc/init.d/vncserver

Put this lines into the file and save it:

#!/bin/sh -e
# Provides:          vncserver
# Required-Start:    networking
# Default-Start:     3 4 5
# Default-Stop:      0 6


# The Username:Group that will run VNC
export USER="ubuntu"

# The display that VNC will use

# Color depth (between 8 and 32)

# The Desktop geometry to use.

# The name that the VNC Desktop will have.

OPTIONS="-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"

. /lib/lsb/init-functions

case "$1" in
log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"

log_action_begin_msg "Stoping vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"

$0 stop
$0 start

exit 0

Now set the bootability flag to the file and add VNC server to services to services to run at startup.

chmod +x /etc/init.d/vncserver
update-rc.d vncserver defaults

So now it is possible ro connect to your BBB from another PC directly to graphical interface.

Instalalling arduino IDE

Arduino package can be found in ubuntu repository, so it's only one command to install it.

apt-get install arduino

After install and connecting arduino thru USB cabel to BBB there is in /dev folder ?can't remeber the name of this file type? file for your arduino /dev/ttyACM0.

If you want the access to this file without root permissions, you will have to add you into dialout group.

sudo usermod -a -G dialout ubuntu

So now you had got arduino IDE installed, so you can comminicate in program it as you do on your usual computer. But there is a problem (if you down have public IP address and you are shielded by your router before accessing from outside), that you can access your BBB in your local net. Solution will be in use of VPN, which makes an virtual private network. So you can connect any computer from outside which has an access to internet to your private network. For profit from advantage of VPN, without need of running VPN server on any of your computer, one can use hamachi.

Instaling and setting Hamachi client

Guide can be found on this pages Steps 9-19.

Nice tutorial video on setting the client:

en/remotecontrol.txt · Last modified: 2018/01/29 10:12 (external edit)