I bought a V186 drone. There’s not technical information about it. Comes with a controller and a QR code that point to the “Wifi UAV” smartphone app. The app is not working with this drone. I want to develop a java app to get the video from the drone.
I got the drone’s IP (192.160.80.1) after connecting my computer (192.168.80.2) to the drone’s wifi and scanned all ports. I got answer on ports 3333 and 8080. A telnet connects to both ports.
I tried with the Tello SDK with no success (I already expected that). I tried some simple TCP and UDP connecting programs with an AT command to both ports with no success (they connect but nothing more than that). Both programs ends for timeout: java.net.SocketTimeoutException: Receive timed out
Can someone give me an idea on how to control the drone? How to know the commands without open it and find the drone brain´s brand and model?
Thanks!
These are the simple programs I tried
Socket socket;
InputStream input;
OutputStream output;
byte[] data;
String line;
final String cmd = "AT*LED=1,0,1056964608,4<LF>";
try {
System.out.println("Program starts");
socket = new Socket("192.168.80.1", 8080); // 3333
socket.setSoTimeout(1000);
input = socket.getInputStream();
/* BufferedReader reader = new BufferedReader(new InputStreamReader(input));
line = reader.readLine();
System.out.println("--- ANSWER ----------------------------");
System.out.println(line);
input.close();
*/
output = socket.getOutputStream();
data = cmd.getBytes();
output.write(data);
socket.close();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("Program ends");
The UDP program
int port = 3333; // 8080; // 3333;
String answer;
final String cmd = "AT*LED=1,0,1056964608,4<LF>";
try {
InetAddress address = InetAddress.getByName("192.168.80.1");
DatagramSocket socket = new DatagramSocket();
socket.setSoTimeout(1000);
byte[] buffer = cmd.getBytes(); // new byte[512];
DatagramPacket request = new DatagramPacket(buffer, buffer.length, address, port);
socket.send(request);
DatagramPacket response = new DatagramPacket(buffer, buffer.length);
socket.receive(response);
answer = new String(buffer, 0, response.getLength());
System.out.println("Answer length: " + response.getLength());
System.out.println("-- ANSWER --------------------------------------");
System.out.println(answer);
System.out.println("nProgram ends");
} catch (IOException e) {
e.printStackTrace();
}