Difference between revisions of "CI20 Headless Setup"

From eLinux.org
Jump to: navigation, search
(Setting up SSH)
(A section on VNC)
Line 100: Line 100:
  
 
When it completes you should be able to connect to the CI20 with SSH.
 
When it completes you should be able to connect to the CI20 with SSH.
 +
 +
== Setting up VNC ==
 +
 +
If you want to use the graphical interface to the CI20 over the network you can use VNC. Setting it up is pretty standard.
 +
 +
Install tightvncserver as root:
 +
ci20@ci20:~$ su
 +
Password:
 +
root@ci20:/home/ci20# apt-get install tightvncserver
 +
 +
Exit back to the normal user and start the vnc server:
 +
root@ci20:/home/ci20# exit
 +
exit
 +
ci20@ci20:~$ vncserver
 +
 +
You will require a password to access your desktops.
 +
 +
Password:
 +
Verify: 
 +
Would you like to enter a view-only password (y/n)? n
 +
 +
New 'X' desktop is ci20:1
 +
 +
Creating default startup script /home/ci20/.vnc/xstartup
 +
Starting applications specified in /home/ci20/.vnc/xstartup
 +
Log file is /home/ci20/.vnc/ci20:1.log
 +
 +
You can now connect to the VNC server (as e.g. ci20:1) using your favourite VNC client. You may wish to connect through an SSH tunnel for extra security.
  
 
{{CI20}}
 
{{CI20}}
 
[[Category:CI20|Headless Setup]]
 
[[Category:CI20|Headless Setup]]

Revision as of 17:08, 17 August 2014

This page describes how to set up your CI20 board for headless operation. This is useful if you don't have an HDMI screen available or don't wish to use one.

Getting connected to the serial

The default NAND image uses the UART0 signals which are accessible from the main expansion header near the camera connector. Note that this header is compatible with the Raspberry Pi's expansion header, so much of the RPi Serial Connection article applies to the CI20.

The easiest approach is to purchase a USB to TTL UART adapter. Something like this would probably do (but don't connect the red VCC wire).

Connect the Ground, TXD and RXD wires to pins 6, 8 & 10 of the header. These are the 3rd, 4th and 5th pins on the row nearest the edge of the board:

+------------------------ +
| 2 4 [6   8   10] 12 ... |
| 1 3  5   7    9  11 ... |
| ^                       |

See RPi Serial Connection#Connection to a PC for help setting up the serial console.

Boot

When you plug in the CI20's power connector you will see text output on the serial console. This comes first from U-Boot, which offers you a chance to interrupt the autoboot in order to get to U-Boot's interactive prompt (from which you can load a different kernel).

If the autoboot is allowed to continue it will load and start the Linux kernel which will output its own boot log on the serial console.

Eventually Debian will present a login prompt:

Debian GNU/Linux 7 ci20 ttyS0

ci20 login:

The default username and password are both "ci20".

Setting up WiFi

One of the first things you may want to do is set up WiFi so that you can connect to the CI20 over SSH. However this is complicated by the fact you don't have access to the normal graphical interface.

The default Debian image has Network Manager set up, but unfortunately that version of the Network Manager command line tool (nmcli) cannot create a new WiFi connection, so you'll need to find another way.

You can scan for WiFi networks with nmcli, for example:

ci20@ci20:/etc$ nmcli dev wifi
SSID                              BSSID               MODE             FREQ        RATE       SIGNAL   SECURITY   ACTIVE  
'PlusnetWirelessXXXXXX'           XX:XX:XX:XX:XX:XX   Infrastructure   2412 MHz   54 MB/s    41       WPA WPA2   yes     

Network Manager stores system wide connection information in /etc/NetworkManager/system-connections. You'll need to become root to add one (the default password is "ci20"):

ci20@ci20:~$ su
Password:
root@ci20:/home/ci20# cd /etc/NetworkManager/system-connections/

Write a new text file for the WiFi network using your favourite text editor. For example:

root@ci20:/etc/NetworkManager/system-connections# nano PlusnetWirelessXXXXXX

If you already have a Linux machine connected to the WiFi network, the contents of the file can come directly from that machine. You will however need to delete any "mac-address=XX:XX:XX:XX:XX:XX" line to allow it to connect.

For example:

[connection]
id=PlusnetWirelessXXXXXX
uuid=68f0fd52-cbb4-4f64-bbbb-65d5c6da68d1
type=802-11-wireless

[802-11-wireless]
ssid=PlusnetWirelessXXXXXX
mode=infrastructure
security=802-11-wireless-security

[802-11-wireless-security]
key-mgmt=wpa-psk
psk=<the WPA passphrase>

[ipv4]
method=auto

[ipv6]
method=auto

Save the file and change the permissions so that only root can read it:

root@ci20:/etc/NetworkManager/system-connections# chmod 0666 PlusnetWirelessXXXXXX

Now restart Network Manager:

root@ci20:/etc/NetworkManager/system-connections# /etc/init.d/network-manager restart

You can check that the connection was valid by checking that nmcli can see it:

root@ci20:/etc/NetworkManager/system-connections# nmcli con list
NAME                      UUID                                   TYPE              TIMESTAMP-REAL                    
Wired connection 2        63f0b880-1003-414a-8798-95492d5b1e77   802-3-ethernet    Mon 18 Aug 2014 00:45:11 BST      
Wired connection 1        6fec7fea-803b-4112-ac6f-e24be941cd09   802-3-ethernet    Mon 18 Aug 2014 00:45:11 BST      
PlusnetWirelessXXXXXX     68f0fd52-cbb4-4f64-bbbb-65d5c6da68d1   802-11-wireless   Mon 18 Aug 2014 00:45:16 BST      

And if your configuration is correct it should automatically connect to the WiFi network:

root@ci20:/etc/NetworkManager/system-connections# nmcli dev
DEVICE     TYPE              STATE        
wlan0      802-11-wireless   connected    
usb0       802-3-ethernet    unavailable  
eth0       802-3-ethernet    unavailable  

You may be able to see the CI20 from other devices on your network. If not you can use /sbin/ifconfig to find its IP address.

Setting up SSH

How that you are connected to the internet you can install an SSH server. Switch to root (the default root password is "ci20"), and use apt-get:

ci20@ci20:~$ su
Password: 
root@ci20:/home/ci20# apt-get install ssh

When it completes you should be able to connect to the CI20 with SSH.

Setting up VNC

If you want to use the graphical interface to the CI20 over the network you can use VNC. Setting it up is pretty standard.

Install tightvncserver as root:

ci20@ci20:~$ su
Password: 
root@ci20:/home/ci20# apt-get install tightvncserver

Exit back to the normal user and start the vnc server:

root@ci20:/home/ci20# exit
exit
ci20@ci20:~$ vncserver

You will require a password to access your desktops.

Password: 
Verify:   
Would you like to enter a view-only password (y/n)? n

New 'X' desktop is ci20:1

Creating default startup script /home/ci20/.vnc/xstartup
Starting applications specified in /home/ci20/.vnc/xstartup
Log file is /home/ci20/.vnc/ci20:1.log

You can now connect to the VNC server (as e.g. ci20:1) using your favourite VNC client. You may wish to connect through an SSH tunnel for extra security.