嵌入式软件

服务创造价值、存在造就未来

当前位置:首页>嵌入式软件
全部 5 嵌入式系统基础与工具 0 STM32裸机项目 1 嵌入式系统-FreeRTOS 0 嵌入式系统-RT-Thread 1

jetson nano 开发:与主机共用一套键鼠设置

作者:雪域蓝天    时间:2021-07-24   访问量:1388
文章内容

用一套键盘和鼠标同时控制常用电脑和开发主机jetson nano, 最开始想的是使用ssh + vncviewer的方案,但配置了好久,vncviewer始终看不到界面,依次经历了界面为灰屏、花屏,只有一个打开的应用程序的界面等各种奇葩事件。


最后在网上找到一种比较合适的方案,使用synergy,用一套键盘鼠标控制。(这个ssh也能做到)


手里有HDMI高清采集卡,讲jetson nano 图像采集到win10主机,用虚拟显示器(或者OBS)显示。


1. 安装synergy


win10主机: 作为服务端


jetson nano 作为client端


2. 遇到问题:


jetson nano 为英伟达修改的ubuntu 18系统,某宝上买的1.10.3版的synergy安装包只能装在主机上,装不到jetson nano上。

最后使用命令:

sudo apt-get install synergy

安装的是1.8.8最新的免费版本。

经过一番折腾与配置终于成功运行起来。


需要设置synergy开机自动启动。ubuntu 18启动项增加方法参考下面的文章:

https://aiskylab.blog.csdn.net/article/details/104458991

在测试rc.local开机启动成功后要做两件事:

1) 关闭密码登录,启用 :ubunt18 automatic login

2) 在rc.local中增加: 

#!/bin/sh
OP=${1}
 
# put the synergy server IP here (at boot time name lookup does not work
# and synergyc will fail and exit, using the IP prevents the problem)
SERVER_IP=192.168.1.10
 
SYNERGYC=/usr/bin/synergyc
PS=/bin/ps
GREP=/bin/grep
WC=/usr/bin/wc
PIDOF=/sbin/pidof
SLEEP=/bin/sleep
 
# check synergyc is running
function sc_check
{
  N=`${PS} -ef | ${GREP} "${SYNERGYC}"  | ${GREP} -v "${GREP}" | ${WC} -l`
  return $N
}
 
# kill synergyc if running
function sc_kill
{
  SIG=""
  while true
  do
    sc_check
    if [ $? -eq 1 ]
    then
      PIDS=`${PIDOF} "${SYNERGYC}"`
      if [ ${PIDS} != "" ]
      then
        kill ${SIG} ${PIDS}
      fi
    else
      break
    fi
 
    ${SLEEP} 1
    SIG="-9"
  done
}
 
# start synergyc
function sc_start
{
  while true
  do
    ${SYNERGYC} "${SERVER_IP}"
 
    ${SLEEP} 2
 
    sc_check
    if [ $? -eq 1 ]
    then
      break
    fi
  done
}
 
case "${OP}" in
  start)
    sc_kill
    sc_start
  ;;
  stop)
    sc_kill
  ;;
  *)
    echo "usage: synergyc-ctl [start|stop]"
    exit 1
  ;;
esac
 
exit 0

之后就可以畅快的玩了。


上一篇:没有了!

下一篇:The repository 'xx‘ does not have a Release flie