Mission Planner not connecting with Pixhawk 2.1 over UDP


I am trying to connect my Pixhawk 2.1 to mission planner on my laptop through raspberry pi using Wifi. I ran the command
mavproxy.py --master=/dev/ttyAMA0 --out --baudrate 57600 --aircraft MyCopter

on my SSH and on the command window it does connect properly and I can even change the modes and arm the copter. But when I try to connect it to mission planner over UDP using the same baudrate, it is just stuck on “Mavlink Connecting…” popup window. It doesn’t read the parameters. The pixhawk does work over USB using COM13 Port.

Kindly help me resolve this issue. Thank you

Sohaib AJ