Install synergy in pcDuino (add PART2)

Source: Internet
Author: User
The first thing for PART1 to start with pcgy is to install synergy. synergy is used to share the keyboard and mouse. Since pcipc is a miniPC, you must connect it to the monitor, you have already modified the HDMI output method on the Internet, but you haven't tried it yet (www. the-greathouses.netblog201303setting-pcduino

The first thing to start with pcgy in PART 1 is to install synergy, which is used to share the keyboard and mouse. Since pcipc is a miniPC, you must connect it to the monitor, HDMI output online almost already have modified the method, but temporarily did not try successfully (http://www.the-greathouses.net/blog/2013/03/setting-pcduino

PART 1

The first thing to do with pcgy is to install synergy, which is used to share the keyboard and mouse. Since pcipc is a miniPC, you must connect it to the monitor, HDMI output online seems to have been modified method, but not trial successful (http://www.the-greathouses.net/blog/2013/03/setting-pcduino-display-resolution/comment-page-1/#comment-601), connected to the display, power, USB mouse, boot it, the ubuntu system is pre-installed on pcsag. I don't know what desktop environment is installed because I have no research on the desktop. I personally think this desktop environment is very poor, if you think it is similar to ubuntu on PC, you will be wrong, but it is still playable.

First, you need to download the relevant source code on the synergy official website and the windows client (http://synergy-foss.org/zh-cn/download? List). I downloaded the 32-bit and source code for windows 1.4.10.

After the download, use the USB flash drive to copy to the/home/ubuntu directory of pcsag (PS: the default user is ubuntu and the password is also ubuntu)

Decompress the package to the current directory, go to the synergy-1.4.10-Source directory, and run./configure. If no cmake is reported, view the configure file.

Configure:

     cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .

We know that you need to compile and install synergy need to use cmake, now to download the source code of cmake for compilation and installation, address: http://www.cmake.org/cmake/resources/software.html

The download version is: cmake-2.8.10.2.tar.gz (I downloaded on another PC and then use U disk copy in the past, if your pcDuino connection is the Internet, directly download it on pcDuino, I only run pcDuino on the LAN)

Decompress the package to the/home/ubuntu directory and go to the cmake-2.8.10.2 directory and run./configure, make, sudo make install.

After installing cmake, go to the synergy source code directory again and run./configure. the following error occurs:

    ./configure    ...    CMake Error at CMakeLists.txt:196 (message):      Missing header: X11/Xlib.hX11/XKBlib.h    -- Configuring incomplete, errors occurred!
Because synergy needs to use libx11-dev, many library file tools are missing by default on pcloud.

If your pcDuino is connected to the Internet, you can directly use the following command to download and install it (convenient and easy to install, and the dependencies are resolved for you ):

Apt-get install libx11-dev

But I am LAN network, you can download the corresponding deb package installation on the http://www.debian.org/distrib/packages: libx11-6_1.5.0-1_armhf.deb (download is armhf Architecture)

However, when downloading the deb package and installing it, you will find that there are still a lot of dependency packages missing. I have downloaded them one by one (in fact, the download and installation are still very fast, and there are dependency instructions on the debian Software Package website)

The downloaded deb package and source code are as follows (as long as you are not installing the package online, you need to install the package which is missing during the installation process, but these are all necessary)

cmake-2.8.10.2.tar.gz                     libxcb1-dev_1.8.1-2_armhf.deb   libxi6_1.6.1-1_armhf.deb            x11proto-kb-dev_1.0.6-2_all.deblibpthread-stubs0-dev_0.3-3+b1_armhf.deb  libxcb1_1.8.1-2_armhf.deb       libxtst-dev_1.2.1-1_armhf.deb       x11proto-record-dev_1.14.2-1_all.deblibpthread-stubs0_0.3-3+b1_armhf.deb      libxdmcp-dev_1.1.1-1_armhf.deb  libxtst6_1.2.1-1_armhf.deb          x11proto-xext-dev_7.2.1-1_all.deblibx11-6_1.5.0-1_armhf.deb                libxdmcp6_1.1.1-1_armhf.deb     synergy-1.4.10-Source.tar.gz        xorg-sgml-doctools_1.10-1_all.deblibx11-dev_1.5.0-1_armhf.deb              libxext-dev_1.3.1-2_armhf.deb   x11-common_7.7+2_all.deb            xtrans-dev_1.2.7-1_all.deblibxau-dev_1.0.7-1_armhf.deb              libxext6_1.3.1-2_armhf.deb      x11proto-core-dev_7.0.23-1_all.deblibxau6_1.0.7-1_armhf.deb                 libxi-dev_1.6.1-1_armhf.deb     x11proto-input-dev_2.2-1_all.deb
After the libX11-dev is installed, run it to the synergy source code directory and run./configure. The error is returned because the include directory configured on cmakelists.txt is incorrect.

You need to modify it as follows:

    177                 set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}:/usr/include")^M    178 ^M    179                 set(XKBlib "X11/Xlib.h;X11/XKBlib.h")^M

At the same time to delete the source code directory cmakecache.txt run again./configure, this error is gone (in fact, this error is recorded, can refer to: http://synergy-foss.org/spit/issues/details/3365)

However, a new error occurs as follows:

   mv CMakeCache.txt OldCache.txt   ./configure   ...   CMake Error at CMakeLists.txt:222 (message):     Missing library: Xtst   -- Configuring incomplete, errors occurred!
The error message is that the Xtst library is missing and the libxtst-dev_1.2.1-1_armhf.deb continues to be installed, you can find this package and related dependent packages in all the packages downloaded earlier (if you connect to the Internet directly, sudo apt-get install libxtst-dev)

After libxtst-dev is installed, delete cmakecache.txt in the same sample code and run./configure in the source code directory again. The config is normal this time (the same error is recorded: http://synergy-foss.org/spit/issues/details/3150)

Continue to install synergy. make install is not required after make. The compiled binary file can be found in the bin directory of the directory.

At this time, synergy has been compiled and can be directly run in the bin directory.

    ./synergyc --daemon --name pcduino --restart 172.19.148.42
-- Daemon indicates that synergy runs in the background in the form of a client. The client name is pcduino, and -- restart indicates that synergy will automatically reconnect to the server.

Now I have shared my PC's keyboard and mouse to the pcDuino, and a set of mouse keys controls two PCs.

However, it still does not work. You still need to set the synergy to start when starting the system. Otherwise, you still need to re-insert the keyboard and mouse to start synergy after the pcgy restarts.

In addition, because my PC is connected to the Intranet, while the PC is connected to both the Internet and the Intranet, the IP address of my PC needs to change at any time, therefore, the startup parameters of synergy are configurable. You can modify the name and IP address before starting the instance.

Add the following code on/etc/rc. local:

    /usr/bin/check_synergy.sh
PcDuino will run the check_synergy.sh script at startup (pay attention to permission issues and pay attention to subsequent scripts)

Check_synergy.sh

    #!/bin/bash    interval=3    count=40    i=0      while [ $i -lt $count ]; do            if [ -f /media/E9FE-18F0/synergy.sh ]; then                    bash /media/E9FE-18F0/synergy.sh                    break            fi            sleep $interval            i=`expr $i + 1`            if [ $i -gt $count ]; then                    break;            fi     done
First, check whether the configuration file on the sd card exists, or if the sd file exists, run synergy. sh on the sd card.

Synergy. sh

    #!/bin/bash    echo `date` : hello synergy >> /home/ubuntu/synergy.log    if [ -f /media/E9FE-18F0/synergy ]; then            cp /media/E9FE-18F0/synergy /etc/init.d/synergy            chmod 777 /etc/init.d/synergy   fi   /bin/bash /etc/init.d/synergy start
Check whether the synergy file in the SD card exists. copy the file to the/etc/init. d/directory, modify its permissions, and run synergy.

Synergy

    #! bin/sh    # /etc/init.d/synergy   case "$1" in      start)        cd /home/ubuntu/synergy-1.4.10-Source/bin/        su ubuntu -c './synergyc --daemon --name pcduino --restart 172.19.148.42'        echo "Starting synergy client..."        ;;     stop)        pkill synergyc        echo "Attempting to kill synergy client"        ;;     *)        echo "Usage: /etc/init.d/synergy (start/stop)"        exit 1        ;;    esac    exit 0
Copy to/etc/init. d/is used to modify this file. I modified the file on the SD card. The file will be modified when pcDuino is started again, and the parameters will also be modified when synergy is started, put it in/etc/init. d For more convenient settings

After setting up/etc/init. d/synergy, run

    sudo update-rc.d synergy defaults    sudo update-rc.d-insserv synergy
Run the following command to start and stop synergy.
    /etc/init.d/synergy start    /etc/init.d/synergy stop    service synergy start    service synergy stop

So far, synergy can be configured and used and run on the pcDuino. There are other problems on the way, if the rc. the command to directly start and run synergy on the local server will be invalid or sometimes the boot is successful, but sometimes it will not work. It may be more relevant to my configuration, and I will find out the cause later.

For more information, see tutorial (http://www.rootusers.com/compiling-synergy-from-source-on-the-raspberry-pi/) for configuring synergy on Rpi)

PART 2


PART1 explains how to install and use synergy on pcduino, and uses the SD card to modify the startup parameters when synergy is enabled, the above is convenient for developers who do not have a serial port or do not have ssh or telnet installed on pcsag.

PART2 supplements the issues left over from PART1 and adds:

(1) Add synergy to init in PART1. d and set to after boot (update-rc.d synergy ults and update-rc.d-insserv synergy), from the serial port can view the information that is printed when synergy is running at boot, however, no process is found after the startup.

Boot information:

    [    6.585562] list-records used greatest stack depth: 5504 bytes left    Last login: Sat Jan  2 07:39:36 CST 2010 on tty1    Welcome to Linaro 12.07 (GNU/Linux 3.0.8+ armv7l)    * Documentation:  https://wiki.linaro.org/    INFO: Synergy 1.4.10 Client on Linux 3.0.8+ #20 PREEMPT Fri Feb 1 22:19:20 CST 2013 armv7l    Starting synergy client...    root@ubuntu:~# [   13.095493] android_usb: already disabled
View process:
    root@ubuntu:~# ps -ef |grep sy    root        10     2  0 07:47 ?        00:00:00 [sync_supers]    102        172     1  0 07:47 ?        00:00:00 dbus-daemon --system --fork --activation=upstart    syslog     196     1  0 07:47 ?        00:00:00 rsyslogd -c5    root       813   504  0 07:51 ttyS0    00:00:00 grep --color=auto sy
The problem cannot be located yet.


(2) modifying the synergy startup parameters through the SD card is only one of the methods. If you have a serial port on your hand, you must do so. You only need. add the following code to local (I have moved the file system to the SD card and do not know whether it will take effect on the nand) and delete the previous/usr/bin/check_synergy.sh section.

     service synergy start
Boot information:
    [    6.607514] list-records used greatest stack depth: 5504 bytes left    Last login: Sat Jan  2 07:47:34 CST 2010 on tty1    Welcome to Linaro 12.07 (GNU/Linux 3.0.8+ armv7l)    * Documentation:  https://wiki.linaro.org/    INFO: Synergy 1.4.10 Client on Linux 3.0.8+ #20 PREEMPT Fri Feb 1 22:19:20 CST 2013 armv7l    Starting synergy client...    root@ubuntu:~# [   13.092226] android_usb: already disabled    2 Jan 07:57:11 ntpdate[551]: no servers can be used, exiting    INFO: Synergy 1.4.10 Client on Linux 3.0.8+ #20 PREEMPT Fri Feb 1 22:19:20 CST 2013 armv7l    Starting synergy client...
View process:
    root@ubuntu:~# ps -ef |grep sy    root        10     2  0 07:56 ?        00:00:00 [sync_supers]    102        173     1  1 07:57 ?        00:00:00 dbus-daemon --system --fork --activation=upstart    syslog     184     1  0 07:57 ?        00:00:00 rsyslogd -c5    ubuntu     641     1  0 07:57 ?        00:00:00 ./synergyc --daemon --name pcduino --restart 172.19.133.192    root       772   509  0 07:58 ttyS0    00:00:00 grep --color=auto sy
It can be seen that synergy is successfully started and the startup parameters need to be modified. You only need to use the serial port to modify the/etc/init. d/synergy file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.