原文链接:http://dev.ardupilot.com/wiki/interfacing-with-pixhawk-using-the-nsh/

Overview

The Pixhawk runs the NuttX real-time operating system which includes the NuttX Shell terminal “NSH”. This allows running some Unix style commands including “top” and “ls”.

NSH is very useful for diagnosing low level issues. Some of the things you can do with it include:

  • Display performance counters with the perf command
  • Display px4io status information
  • Diagnose microSD errors
  • Diagnose sensor failures
  • Assist in debugging new drivers

This topic explains how to connect and send NSH commands from MAVProxy via remote and serial connections.

Running NSH using Debug Cable and Serial5

To use the NSH while Copter or Plane is running you can connect using Serial 4/5. To do this you will need anFTDI 3.3V cable and then modify a DF13 6 Position cable so that it can be connected to the FTDI cable.

You should then be able to plug the FTDI cable into your computer and connect with any Serial program including the Mission Planner’s Terminal screen. Ensure to select the FTDI cable’s COM port and set the Baud rate to 57600. You will need to press return for the “nsh>” prompt to appear.

Remote NSH over MAVLink

ArduPilot also includes support to run nsh commands remotely via MAVLink over a USB, telemetry or WiFi link (this is an extension of the SERIAL_CONTROL protocol used for controlling a GPS or radio UART over MAVLink).

Note:
At time of writing Rover doesn’t support NSH over MAVLink (because it doesn’t support arming).
Tip:
This can be used for nsh debugging when you don’t have a serial5 cable setup.

Instructions to use with Mission Planner:

  • Connect Pixhawk to PC using a USB cable
  • Go to the Flight Data screen, select the correct COM port and baud (probalby 115200) and press the connect button
  • Go to the Terminal screen, set the left-most drop down to “NSH” and push Connect.

Setup instructions to access using MAVProxy:

  1. Load latest master onto a Pixhawk
  2. Grab the latest MAVProxy
    • If on Linux use:

      sudo pip install mavproxy
    • If on Windows grab it here.
      Note:
      If you are on Windows you will need to delete any old version of MAVProxy in c:\Program Files (x86)\MAVProxy first, as the installer does not properly cleanup old versions.

  3. Start MAVProxy as usual
  4. Load the nsh module in MAVProxy with
    module load nsh
  5. start the nsh shell with
    nsh start
  6. Now run nsh commands as usual. Note that MAVLink is still running,
    so the map, MAPVproxy console, graphs etc all keep updating while in
    the nsh shell.

    Tip:
    A blank response to an NSH command may indicate low RAM memory on the autopilot board. Free up memory if possible. For example, on master you can save about 20Kb by disabling terrain following (setTERRAIN_ENABLE=0).

  7. To drop back to the normal MAVProxy prompt type a single “.” on a
    line by itself

You can only start a shell when the system is disarmed. Once the shell is started you can arm if you like.

Warning:
In theory you could fly while doing nsh commands, but we don’t recommend it.

This also works over a 3DR Radio link, although it is of course slower in output than when on a USB connection.


Questions, issues, and suggestions about this page can be raised on the APM Forum. Issues and suggestions may be posted on the forums or the Github Issue Tracker.

Interfacing with Pixhawk using the NSH相关推荐

  1. pixhawk之NSH调试

    一 ardupilot固件 windows环境 前期准备 1:pix烧录程序,Arducopter或者library中的example都可以实现. 2:拔掉SD卡(脚本中提到的没有SD卡进入nsh,有 ...

  2. Pixhawk代码分析-启动代码及入口函数

    启动代码及入口函数 基础知识 关于坐标系 1)GeographicCoordinate System Represents position on earth with alongitude and ...

  3. pixhawk/px4如何获取及使用传感器数据

    pixhawk/px4如何获取及使用传感器数据 第一步:读取传感器数据 上一篇博文已经介绍了如何给pixhawk/px4创建一个应用程序,现在我们在上一个应用程序的基础上使用传感器数据. 应用程序为了 ...

  4. Pixhawk原生固件PX4之串口添加读取传感器实现

    本博客承接前一篇,对FreeApe的串口添加超声波传感器博文后半部分进行学习. 为什么叫前奏呢,因为用了伪传感器,把单片机用串口发送的有规律的数据当作了传感器读取到的数据.但是无碍的. 开发环境:Ub ...

  5. Pixhawk---基于NSH的Firmware开发与调试

     版权声明:本文为博主[原创]文章,未经博主允许可以转载,注明博客出处:[http://blog.csdn.net/FreeApe] 目录(?)[+] 相关知识了解 1 Nuttx系统 2 NSH ...

  6. Pixhawk原生固件PX4之常用函数解读

    PX4Firmware 经常有人将Pixhawk.PX4.APM还有ArduPilot弄混.这里首先还是简要说明一下: Pixhawk是飞控硬件平台,PX4和ArduPilot都是开源的可以烧写到Pi ...

  7. Pixhawk系统架构介绍

    前段时间导师叫我做扑翼无人机,工程上需要实现的,能够通过程控飞起来,感觉难度挺大.先从研究PX4开始,打算一步步理解透整个PX4的框架,机型的适配.旋翼.固定翼的姿态控制,新机型的添加等等.不知道能不 ...

  8. Pixhawk原生固件PX4之添外置传感器MPU6500

    欢迎交流~ 个人 Gitter 交流平台,点击直达: 成功的在Pixhawk上添加了一个自定义的传感器MPU6500. Pixhawk飞控板上空余出一个SPI4接口 提示: 多出来的GPIO_EXT引 ...

  9. pixhawk 自定义uart的应用

    pixhawk + uart串口 新建一个uart.msg文件 新建一个文件读取串口的数据 使其在程序中传递串口数据,并进行运算 读取串口数据(坐标信息) 准备工作 准备一个uart设备,能够发送数据 ...

最新文章

  1. AOP切入点表达式 ——within表达式 、execution()表达式
  2. python教程:datetime与字符串互转
  3. python中strip是什么意思啊_Python中的strip()的理解
  4. 《看聊天记录都学不会C#?太菜了吧》(6)多晦涩的专业术语原来都会那么简单
  5. html怎么把一段文字设置为连接到下一个网页的按钮,网页设计三合一模拟试题(一)...
  6. oracle删除universal,Oracle自带的Universal Installer卸载存在问题
  7. freeMarker(十二)——模板语言补充知识
  8. 超级备份还原v2.3.05_新手如何一键还原电脑系统(图文教程)
  9. Win8.1激活方法
  10. Python 图像处理 OpenCV (13): Scharr 算子和 LOG 算子边缘检测技术
  11. 关于安卓脚本打包apk
  12. linux搭建代理服务器
  13. 关于grldr is missing
  14. ASUS C302C Chromebook Windows声卡驱动
  15. XP IIS下配置.net的问题总结与简单解决方法
  16. 2021强网杯 ezmath writeup
  17. Blender 置换生成地形模型
  18. Maven环境配置(本文以“apache-maven-3.8.2”的安装配置为例)
  19. Android使用百度地图sdk,实现微信发送位置功能
  20. 电力变电站三维可视化

热门文章

  1. js将数字转换成中文大写
  2. from __future__ import unicode_literals
  3. 科技圈的“三座大山”正在崩塌中。。。
  4. 我的世界服务器无限开号,我的世界开挂指令大全表一览!39条命令无限可能性
  5. hread first html5,(完整版)2017届上海市徐汇区高三英语二模卷(含听力文本和答案)...
  6. Error: illegal invocation in <execute> or <revert> phase (action: element.updateProperties或Laber)
  7. (译)快速指南:用UIViewPropertyAnimator做动画
  8. Chapter5.1:频率响应法
  9. 合理利用“泛在式” - 手机促使人群分化
  10. R配对样本t检验(PAIRED T-TEST​​​​​​​)