Udp connection

Hello

I can't seem to connect to my vehicle via udp/wifi connection. I can connect with both mission planner and qcg with my setup

My setup is as follows

pix2

raspberry pi 3 (handles networking and mav proxy)

quad plane running arduplane 3.7

futaba t8fg super with futaba receiver

I have mavproxy stream the telemetry through the pix2's telem1 port to the uart on the pi. The pi is a dhcp server and i use a separate wifi device at the ground station. I have tried several ways of getting the remote port, and i really think i got it right. I use tcpdump on the pi to get the remote port, and i have also used the gcs's firewall to try and get it. My wifi signal is strong, and data rate is high, and i am able ssh to the pi with the current wifi setup. Fire wall on gcs is set to allow all connections on all modules and ugcs itself (client, server, and all vsm's). 

Here is my config file:

# Initial VSM configuration file.
# Format corresponds to Java-properties text representation -
# http://docs.oracle.com/javase/6/docs/api/java/util/Properties.html

log.file_path = ${UGCS_INSTALLED_LOG_FILE_PATH}
log.single_max_size=10Mb
log.level=debug

#ucs.transport_detector_on_when_diconnected

# File to dump all generated missions to. Timestamp suffix is appended to the
# name. Leave the value empty (or delete the entry) to disable mission dumping.
vehicle.ardupilot.mission_dump_path = ${UGCS_INSTALLED_LOG_DIR}/mission

# Local address for listening connections from UCS.
ucs.local_listening_address = 0.0.0.0

# Local port for listening connections from UCS.
ucs.local_listening_port = 5556

# Uncomment this to disable serial port access arbitration across
# different processes.
#vehicle.ardupilot.serial_port.use_serial_arbiter = no

vehicle.ardupilot.serial_port.exclude.1 = /dev/ttyS.*
# name matching in Windows is case insensitive
vehicle.ardupilot.serial_port.1.name = /dev/ttyUSB[0-9]+|com[0-9]+
# 57600 is default 3DR radio speed
vehicle.ardupilot.serial_port.1.baud.1 = 57600
#
vehicle.ardupilot.serial_port.2.name = /dev/ttyACM[0-9]+|com[0-9]+
# 115200 is default Ardupilot USB serial rate
vehicle.ardupilot.serial_port.2.baud.1 = 115200

# Connect to proxy (e.g. ZigBee proxy)
#vehicle.ardupilot.tcp.1.proxy = 127.0.0.1
#vehicle.ardupilot.tcp.1.port = 5566

# Vehicle can be connected via UDP.
# Three parameters are mandatory and one optional.

# 1. UDP port which will listen for incoming mavlink messages.
vehicle.ardupilot.udp.1.udp_local_port = 14550

# 2. IP address of the vehicle to connect to.
vehicle.ardupilot.udp.1.udp_address = 192.168.42.1

# 2. UDP port of the vehicle to connect to.
vehicle.ardupilot.udp.1.udp_port = 51694

# 4. Local IP address to listen on. (Optional)
# UDP listener will bind on all local addresses unless
# udp_local_address is specified.
# Can be used to bind to only one specific interface.
#vehicle.ardupilot.udp.1.udp_local_address = 192.168.42.11

# Custom vehicles can be defined to override default model name and
# serial number
#vehicle.ardupilot.custom.my_drone.system_id = 2
#vehicle.ardupilot.custom.my_drone.model_name = My model name
#vehicle.ardupilot.custom.my_drone.serial_number = My serial number

# Index of servo to use for camera trigger.
#vehicle.ardupilot.camera_servo_idx = 8
# PWM value to set for camera trigger.
#vehicle.ardupilot.camera_servo_pwm = 1900
# Time to hold camera servo at the specified PWM when triggering single photo in seconds.
#vehicle.ardupilot.camera_servo_time = 1.0

# Service discovery configuration
# (Uncomment next line to enable automatic discovery of this VSM.)
service_discovery.vsm_name = Ardupilot VSM

# By default plane control via joystick is disabled due to safety.
# Uncomment this to enable direct vehicle control for fixed wing frames.
#vehicle.ardupilot.enable_joystick_control_for_fixed_wing = yes

# Uncomment the line below to disable relative altitude reporting
# Should be used it if vehicle uses RTK GPS.
#vehicle.ardupilot.report_relative_altitude = no

#vehicle.ardupilot.detector.1.udp_local_port = 14550
#vehicle.ardupilot.detector.1.udp_address = 192.168.42.1
#vehicle.ardupilot.detector.1.udp_port = 51694

This is my mavproxy command running on /etc/rc.local

(
date
echo $PATH
PATH=$PATH:/bin:/sbin:/usr/bin:/usr/local/bin
export PATH
cd /home/pi
screen -d -m -s /bin/bash mavproxy.py --master=/dev/ttyAMA0 --baudrate 57600 --aircraft MyCopter --out 192.168.42.11:14550
) > /tmp/rc.log 2>&1

Now my mavlink comes through a different connection on my gcs than my internet. I was thinking maybe i needed option 4 in the udp, but that didn't seem to help (ip of gcs mavlink wifi adapter). The adapter ip domain is totally different than my main internet connect and completely separate. I have read the instructions on how to do this like 6 times, and googling doesn't seem to get me much further than the instructions. I tried redownloading the file, tried using my home wifi network to connect, and nothing seems to work. 

I found somewhere about the detector lines at the bottom of the config file, but they didn't do anything

Also like i said, using mission planner or qgc work without a hitch with my wifi setup.

I don't know if there are any logs for ugcs, if there are, that would be helpfull in diagnosing the issue.

Im thinking about maybe running ROS and seeing if i can get ros to fix the remote port,to allow for a seemless connection process(i will be trying this in the very near future.)

Im very interested in using ugcs as it has some killer features. I don't really want to use a TCP connection, as a udp connection is better suited for this purpose. I am a UAV developer and i really want this to work so any help would be great. Ideally i don't want to be dealing with having to open the config file every time. Its not a good end user solution.

Sorry for the long post.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Dear Richard,

    UgCS Beta version is published UgCS 2.12 Beta. Please try to connect your setup using it.

    Kind regards,

    Sergey Kucenko.

    UgCS team.

  • Dear Richard,

    In a few days will be available for downloading UgCS 2.12 beta version with changed Ardupilot UDP connection algorithm. Could you please wait and then test it. If the result will be the same, we could check VSM log files and your configuration.

    Thank you.

    Kind regards,

    Sergey Kucenko.

  • I am going to try re downloading a new config file and making sure there isn't a syntax error in mine somewhere. 

    I am aware of how the remote port thing works. I will probably be using ROS in the mean time to see if i can get ROS to fix the remote port, as my clients don't have any interest in editing a config file and digging through network settings prior to starting the drone every time(which would almost be daily). 

    I may also try a TCP connection if the udp does't work, though this is not ideal. The wifi would deal with any bad packets anyways, and tcp would just add overhead and lag. 

    I am going to try a different windows machine, as my main computer has pretty thick security software, and i think it may also be part of the problem. 

    Thanks for the feedback. Hopefully I can get this figured out. If i can't i will probably end up buying the software to try and get some more advanced support. 

  • Hi Richard, see my reply here http://diydrones.com/forum/topics/ugcs-with-3dr-solo?groupUrl=ugcs&.... my first reply on this shows how I have this working on my end. the biggest issue is the UDP Dest port will change, so you will always need to validate which port is being used when you want to connect and update the conf fil. hope this helps.

  • Hey

    I ran wireshark and it told me the same thing everythign else did.

    9621 88.621924 source: 192.168.42.1 destination: 192.168.42.11 UDP 70 Ports: 40473 → 14550 Len=28

    I input the remote port as 40473, the local port as 14550, and the ip as 192.168.42.1

    here is the section of the vsm-ardupilot.conf:

    # Vehicle can be connected via UDP.
    # Three parameters are mandatory and one optional.

    # 1. UDP port which will listen for incoming mavlink messages.
    vehicle.ardupilot.udp.1.udp_local_port = 14550

    # 2. IP address of the vehicle to connect to.
    vehicle.ardupilot.udp.1.udp_address = 192.168.42.1

    # 2. UDP port of the vehicle to connect to.
    vehicle.ardupilot.udp.1.udp_port = 40473

    Still no connection.

    As an extra precaution, this is with my security software fully disabled. i also double checked that the applications were in windows firewall and allowed to access(client, sever, vstreamer, vsm ardupilot), and they are. As usual, mission planner has no issues connecting so mavlink is live on that connection. 

  • Hi,

    At our next release you will be able also to use only one port for UDP connection to the vehicle. Could you please trace you connection with Wireshark. In your case instead of 14502 should be 14550 

    Could you please trace your network connection with Wireshark. In your case instead of 14502 should be 14550 and instead of 14555 should be 51694 (mostly it differ and cause connection issue).

    3702388182?profile=original

    Kind regards,

    Sergey Kucenko.

    UgCS team

  • Hey

    Thanks for the reply.

    Mavproxy simply handles the mavlink connection on the pi(in the drone). Its allows me to transfer it from the uart port to the network interface. Its functioning correctly. 

    The pi's ip is 192.168.42.1 and is the default gateway for the network. It is running a dhcp server and access point software.

    The gcs gets a separate wifi adapter(separate from its internet connection) that has been configured to connect as ip 192.168.42.11. That ip is the ip that mavlink is transmitting too via mavproxy. 

    The default mavlink port for mission planner and QGC is 14550. This is my local port. 

    The remote port i use tcpdump on the pi (which dumps all the active network connections) and i use my firewall network connection monitor on the gcs (windows machine) to get this remote port. It changes every time i boot the pi. However it is the same on the pi as it is on the windows machine. Shows up clear as day, so i know that my windows machine is receiving the connection. I can also see that UGCS is looking for udp connections from any address. When i copied this file, the connection was listed as 192.168.42.1:51694 to 192.168.42.11:14550. Like i said though, the remote port changes every time i boot the pi. I will address this issue if i can get ugcs to connect, otherwise other software doesn't need this remote port.

    Mission planner connects without issue with the ip 192.168.42.1 port 14550(that's all i need to enter). No need to enter a remote port. Being that the pi is the access point, there are no other devices in between on this network. The pi is the router, and the second wifi adapter (whatever its plugged into) is a client. 

    I can also easily SSH into the pi using putty with the ip 192.168.42.1. So i know the wifi connection is functioning as it should. This ssh connection shows up in the tcpdump command as well, so the command is doing what it is supposed to. The Client wifi device has the ip setting manually configured in just in case so it always gets the same ip. 

    The only other thing i can think of is maybe i need a tcp trigger port? something to tell ugcs to listen on udp port 14550 from 192.168.42.1. Im wondering that because its not the ground stations default network device(Ethernet connection, default gateway of 192.168.1.1), its not looking at the correct network interface. Im thinking maybe its just automatically defaulting to the device that's connected to the internet, which is not the device that is connected to the drone(pi). 

    My goal is to establish a full data connection with the drone, so pictures for mapping can be downloaded to the gcs on the spot. It also simplifies the radio setup as i can run all my interfaces(video, mavlink, FTP) through one radio. 

  • Hello,

    Needed parameters are:

    # 1. UDP port which will listen for incoming mavlink messages.
    vehicle.ardupilot.udp.1.udp_local_port = 14550

    # 2. IP address of the vehicle to connect to.
    vehicle.ardupilot.udp.1.udp_address = 192.168.42.1

    # 2. UDP port of the vehicle to connect to.
    vehicle.ardupilot.udp.1.udp_port = 51694

    Where:

    vehicle.ardupilot.udp.1.udp_local_port =  #WIFI_UDP_HPORT
    vehicle.ardupilot.udp.1.udp_port =  #WIFI_UDP_CPORT

    I am not familiar with mavproxy.py but are sure about IP address correctness at configuration 192.168.42.1 (not 11?). 

    Which UDP port was used for Mission Planner connection?

    Kind regards,

    Sergey Kucenko.

    UgCS team

This reply was deleted.