Community
cancel
Showing results for 
Search instead for 
Did you mean: 
idata
Community Manager
1,919 Views

Using screen to acces NuttX shell, without mavlink

Jump to solution

Is there a way to directly access the NuttX shell (nsh) running on the Aero Flight Controller via the Aero Compute Board without using mavlink? While developing on a pixhawk I could do this with a USB connection and running from my laptop:

screen /dev/ttyUSB0 57600 8N1

(ref https://github.com/PX4/Devguide/blob/master/en/debug/system_console.md Devguide/system_console.md at master · PX4/Devguide · GitHub )

Which was useful because I could then kill the mavlink app running on the pixhawk and restart it without terminating my screen session. This was useful for debugging changes I was making to mavlink_reciever.cpp in px4.

As far as I can tell, it's not possible to do the equivalent using the mavlink_shell.py because that explicitly relies on mavlink connection being present (described here https://github.com/PX4/px4_user_guide/blob/master/en/flight_controller/intel_aero.md https://github.com/PX4/px4_user_guide/blob/master/en/flight_controller/intel_aero.md). I've tried using screen from the Aero Compute Board without any luck. For example

screen /dev/ttyS1 921600 8N1

returns garbage. I've tried all of the other baudrates I could think of (57600, 460800, 1500000,115200) without any luck.

Thanks!

0 Kudos
1 Solution
idata
Community Manager
244 Views

Hello Allen,

 

 

If your're doing this on the Aero RTF drone, you need to first install Ubuntu on it and you can access an NSH shell using Mavproxy.

 

 

First, a few pre-requisite packages need to be installed.sudo apt-get install python-dev python-opencv python-wxgtk3.0 python-pip python-matplotlib python-pygame python-lxml python-yaml

Then download and install MAVProxy via Pypi. Prerequisites will be automatically downloaded too. Note a sudo may be required in some circumstances if the install generates errors:

pip install MAVProxyNuttx Shellmodule load nsh

The nsh module allows direct access to the various serial ports on a Pixhawk, for both reading and writing data. In addition, the NuttX serial console can be accessed - negating the requirement for a specialised debugging cable.

Note

The nsh module can only talk to one serial port at a time.

Once loaded with module load nsh, The settings of the module can be shown and changed by entering nsh set port X or nsh set baudrate Y, where X is the desired port and Y the desired baudrate.

Then use nsh start and nsh stop to start and stop the serial port communication.

 

 

Hope this helps.

 

 

Regards,

 

Octavian

View solution in original post

4 Replies
idata
Community Manager
244 Views

Hello Allen,

 

 

Thank you for your interest in the Intel Aero drone.

 

 

Your request has been received and is currently being investigated.

 

We will get back to you as soon as possible.

 

 

Regards,

 

Octavian
idata
Community Manager
245 Views

Hello Allen,

 

 

If your're doing this on the Aero RTF drone, you need to first install Ubuntu on it and you can access an NSH shell using Mavproxy.

 

 

First, a few pre-requisite packages need to be installed.sudo apt-get install python-dev python-opencv python-wxgtk3.0 python-pip python-matplotlib python-pygame python-lxml python-yaml

Then download and install MAVProxy via Pypi. Prerequisites will be automatically downloaded too. Note a sudo may be required in some circumstances if the install generates errors:

pip install MAVProxyNuttx Shellmodule load nsh

The nsh module allows direct access to the various serial ports on a Pixhawk, for both reading and writing data. In addition, the NuttX serial console can be accessed - negating the requirement for a specialised debugging cable.

Note

The nsh module can only talk to one serial port at a time.

Once loaded with module load nsh, The settings of the module can be shown and changed by entering nsh set port X or nsh set baudrate Y, where X is the desired port and Y the desired baudrate.

Then use nsh start and nsh stop to start and stop the serial port communication.

 

 

Hope this helps.

 

 

Regards,

 

Octavian

View solution in original post

idata
Community Manager
244 Views

Hi Octavian,

Thank you for the response, but unfortunately this doesn't work (or I am doing something wrong that is preventing it from working). It appears that MAVProxy depends on mavlink to be running; without mavlink running, MAVProxy does not appear to work. Furthermore, MAVProxy appears to have some fundamental I/O problems; for example running `top` in nsh using MAVProxy fails to display anything so I can't see what processes are running.

Here is my workflow on the Aero Compute Board running Ubuntu 16.04 (note I am not ssh-ing into the board but using it as a stand-alone workstation with monitor, keyboard, mouse)

1. Access the Nuttx Shell using MAVProxy

```

mavproxy.py --master=tcp:127.0.0.1:5760 --quadcopter  

module load nsh

 

nsh start

 

```

2. from nsh, kill mavlink

```

mavlink stop-all

```

3. try to restart mavlink

```

mavlink start

```

but all I get is a regularly repeating message saying `no link` and it appears that I cannot interact with the AeroFC at all

Thank you for your time

idata
Community Manager
244 Views

Hello RossAllen,

 

 

Thank you for your response.

 

Could you please use the command ver all in NuttShell and provide us the outcome?

 

 

Thank you in advance,

 

Casandra
Reply