This shows you the differences between two versions of the page.
icub:icubsrv_configuration [2012/11/12 16:44] – created ramirezk | icub:icubsrv_configuration [2012/11/12 16:46] (current) – ramirezk | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Icubsrv configuration previous to the installation ====== | ||
+ | Please follow this instructions if the laptop is going to be reformatted. | ||
+ | |||
+ | ===== Creation of iCub user ===== | ||
+ | You need to create the icub user. For nfs (see later) to work this user has to have the id 1000. | ||
+ | |||
+ | adduser icub --uid 1000 | ||
+ | in LINUX starting procedure, it is asked to create the first user. By default uid is set at 1000. | ||
+ | to make sure it is done do: | ||
+ | id -u icub | ||
+ | you should get 1000 if NOT, manage the possible different number uid (int he case you have more | ||
+ | than one user on your pc). In order to get it, use this following command to manage the uid of the | ||
+ | users | ||
+ | |||
+ | usermod -u [UID number] [username] | ||
+ | for example in our case: usermod -u 1000 icub | ||
+ | |||
+ | ===== Software Repository ===== | ||
+ | |||
+ | The laptop hosts two directories and export them using nfs. | ||
+ | One of these directories is mounted by the pc104 (/ | ||
+ | the other is mounted by the other machines on the network and by the laptop iteself (/ | ||
+ | |||
+ | For this to work you need: | ||
+ | |||
+ | 1) install nfs server on the laptop: | ||
+ | sudo apt-get install nfs-kernel-server nfs-common portmap | ||
+ | | ||
+ | 2) create the directories that will be exported: | ||
+ | mkdir -p / | ||
+ | mkdir -p / | ||
+ | | ||
+ | Respectively for the laptop/ | ||
+ | 4) Set appropriate permissions to the icub user: | ||
+ | |||
+ | sudo chown icub:icub -R / | ||
+ | sudo chown icub:icub -R / | ||
+ | | ||
+ | 5) Now configure the nfs-kernel-server: | ||
+ | Add these lines to / | ||
+ | |||
+ | / | ||
+ | / | ||
+ | |||
+ | You might need to restart the nfs server. | ||
+ | |||
+ | / | ||
+ | |||
+ | Or just reboot the machine. | ||
+ | |||
+ | 6) Now configure the laptop to mount / | ||
+ | Edit /etc/fstab and add: | ||
+ | |||
+ | / | ||
+ | Reboot or type: | ||
+ | |||
+ | sudo mount -a | ||
+ | | ||
+ | ===== Configuration of the icub user ===== | ||
+ | |||
+ | Install the ssh keys for password-less login, on the laptop: | ||
+ | Log in as icub and create an ssh key. | ||
+ | |||
+ | ssh-keygen -t rsa | ||
+ | copy this key as default key on your own system (used mainly for yarpserver and iCubCluster | ||
+ | programs) | ||
+ | |||
+ | cp / | ||
+ | give this key file to pc104 | ||
+ | |||
+ | mkdir / | ||
+ | cp / | ||
+ | | ||
+ | Configure bashrc. Add these lines in / | ||
+ | export ICUB_ROOT=/ | ||
+ | export ICUB_DIR=$ICUB_ROOT/ | ||
+ | export YARP_ROOT=/ | ||
+ | export YARP_DIR=$YARP_ROOT/ | ||
+ | export ICUB_ROBOTNAME=iCubMunich01 | ||
+ | export PATH=$PATH: | ||
+ | | ||
+ | ===== Network configurations ===== | ||
+ | |||
+ | This step is important, because the laptop (icubsrv) will connect to the pc104 through ssh | ||
+ | * Install ssh-server package: | ||
+ | apt-get install openssh-server | ||
+ | * Install python-tk package: | ||
+ | apt-get install python-tk | ||
+ | * It is handy to enable icub user to the sudoers | ||
+ | edit / | ||
+ | icub ALL=(ALL) ALL | ||
+ | | ||
+ | * Enable NAT and port forwarding so that the pc104 (and other machines on the network) have | ||
+ | internet access (using wlan0 as external network interface). | ||
+ | |||
+ | Add these lines in / | ||
+ | iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE | ||
+ | echo 1 > / | ||
+ | where wlan0 is the name of your system wireless communication so check if it is correct on the file / | ||
+ | # PCI device 0x14e4: | ||
+ | SUBSYSTEM==" | ||
+ | | ||
+ | * Fix IP and Gateway | ||
+ | On the same file as prior you should see another PCI device, it is the ethernet port, it looks like that | ||
+ | # PCI device 0x8086: | ||
+ | SUBSYSTEM==" | ||
+ | where eth0 is the number given by the system for the PCI board, use this number to set the file / | ||
+ | allow-hotplug eth0 | ||
+ | iface eth0 inet static | ||
+ | address 10.0.0.1 | ||
+ | netmask 255.255.255.0 | ||
+ | gateway 10.0.0.1 | ||
+ | #dns config - example for IIT configuration | ||
+ | #dns-search humanoids.iit.it | ||
+ | dns-nameservers 8.8.8.8 | ||
+ | auto eth0 | ||
+ | | ||
+ | * Clock synchronization: | ||
+ | Download the ntp package | ||
+ | sudo apt-get install ntp | ||
+ | Your Laptop has to be the clock of the connection with the pc104 in case of no internet access so replace those lines from the file / | ||
+ | |||
+ | server 0.ubuntu.pool.ntp.org | ||
+ | server 1.ubuntu.pool.ntp.org | ||
+ | server 2.ubuntu.pool.ntp.org | ||
+ | server 3.ubuntu.pool.ntp.org | ||
+ | or comment them by adding a # in front each lines and add those lines instead | ||
+ | server 127.127.1.1 | ||
+ | fudge 127.127.1.1 stratum 8 refid NIST | ||
+ | The internal clock of the pc104 resets every time the pc104 is restarted. It is important you configure your local network so that the pc104 has the correct time. In general it is a good idea if all the machines on the iCub network have synchronized clock. | ||
+ | This page explains how to do this: [[http:// | ||
+ | |||
+ | If your network does not have a dns it is a good idea to add the pc104 to /etc/hosts by adding the line: | ||
+ | 10.0.0.10 | ||
+ | (note that in the past the pc104 ip address was 10.0.0.2. This it has been recently changed) |