Navio 2 + DroneKit

Hi!

I am trying to make work dronekit with navio 2.

I was trying to make work the examples that are in the web with navio. They seem to work fine but only when i connect the raspberry and my labtop to the same wifi. But when i try to make the connection with temeletry of 3DR, it seem to have problems.

The problem I am having now, it is when i launch one example of dronekit, it only shows the first three lines of code, like this: (i change the baud rate to 57600 in order to make it works)

Connecting to vehicle on: /dev/ttyUSB0

APM:Copter V3.5.2 (62a12357)
Frame: QUAD

Maybe this is not the correct forum for asking problems of dronekit, but i just post it in case some one have also experienced this problem or it is related to navio2.

Thanks in advance! (and sorry for my english)

Hello there!

Could you please share a little more? A code snippet would be welcome. How exactly do you launch it, etc.

hi!!

I am trying to launch one example they put on their web it is call vehicle_example.py.

Vehicle_state on github

when i launch it, i put this command line:

python vehicle_state.py --connect 192.168.1.3

This way, it works fine, by connecting to the raspberry with wifi.

When i try to connect by telemetry, i put this line:
python vehicle_state.py --connect /dev/ttyUSB0

Also, I modified the vehicle_state.py file, by adding the baudrate of the 3DR telemetry:
vehicle = connect(connection_string, wait_ready=True, baud=57600

And with this line, it only seem to print in the command line, only 2 lines

Could you please post the output of /etc/default/ardu<vehicle> where <vehicle> is the vehicle you use?

Also I’m curious whether you try to launch it on the Raspberry itself or on another computer?

I post it like a photograph

I am launching dronekit in my PC with ubuntu and connecting with raspberry.

Could i install dronekit in the same raspberry i am using for navio2? Or it would be a lot of cpu usage?

Also, could i install opencv in that raspberry? (i am thinking of connect another raspberry with opencv + dronekit to the raspberry with navio) But before doing that, i am trying to make it work with my pc.

Also, i am connecting the telemetry to the UART port in navio2, thats why i put /dev/ttyAMA0

EDIT:

And also, i try to connect to QGroundControl and MissionPlanner (on windows missionplanner) and in both of them, with the telemetry systems seems to work fine

Just a hint. You can use sed to get an output that looks like this

 TELEM1="-A udp:192.168.100.147:14550"

This command outputs the content of the file with added spaces in the beginning of each row, so you dont have to attach pictures.
ssh pi@navio.local 'sed -e "s/^/ /" /etc/default/arducopter'

Is the python-script the only system connecting via /dev/ttyUSB0

Yes, i close QgroundControl when trying to launch the script

Yep. In case of local a UDP connection, there’s no difference with a remote machine whatsoever. Just use 127.0.0.1 as an address.

Sure. There’s even a POC on our forum. Take a look! I find it pretty awesome.

You should take it into account but I for most of the application you’ll be fine. You can always switch over to C++ or any other language which Mavlink has bindings to.

Could you please try launching mavproxy like this mavproxy.py --master /dev/ttyUSB0 and see if connection succeeds?

mmm where I can find mavproxy.py? Is it directly on the raspberry?

EDIT.

I find it: it connect and gives this:

Connect /dev/ttyUSB0 source_system=255
Log Directory:
Telemetry log: mav.tlog
Waiting for heartbeat from /dev/ttyUSB0
MAV> online system 1
RTL> Mode RTL
mdUINS_GYR_CAL>DmdTmLlLV$LlLw @G?h,)@B;V;B<
#''1;H|C{;ERIAL1_PROTOCOLt 5
~DzX?^]0@;1o~;]2co-=v?YM;@?~(@<;n<

And what about mavproxy.py --master=/dev/ttyUSB0,57600?

I’m concerned with the noise like this

sorry for the delay of the response…

It seems to each time i execute it, it shows something diferent:

first time:

0
Connect /dev/ttyUSB0,57600 source_system=255
Log Directory:
Telemetry log: mav.tlog
Waiting for heartbeat from /dev/ttyUSB0
MAV> online system 1
ALT_HOLD> Mode ALT_HOLD
fence breach
GPS lock at 1 meters
SYSID_MYGCSqd)d?

Second time:

Connect /dev/ttyUSB0,57600 source_system=255
Log Directory:
Telemetry log: mav.tlog
Waiting for heartbeat from /dev/ttyUSB0
MAV> online system 1
ALT_HOLD> Mode ALT_HOLD
fence breach
GPS lock at 1 meters
APM: APM:Copter V3.5.2 (62a12357)
APM: Frame: QUAD
;,SR3_EXT_STAT

EDIT:

Could it be something wrong instaled from the serial port in ubuntu?

I finally found what was happening, I link here where i found how to solve my problem:

SCTaylor stackoverflow solution

“Turns out the issue was that because we were connected over serial telemetry at a baud rate of 57600 it takes ~2 minutes to download the parameters and Dronekit times out after 30 seconds.”

Just have to modify _ _ init _ _.py" from Dronekit and change the timeout parameter to 180 secs or longer.