I was tasked to program the Dobot Magician robot to perform tasks that could be repeated multiple times. I decided to use java for this and spent about a month and a half writing a program to do so. However, after I updated my java on Friday, it no longer would connect to the Dobot through the serial port.
I’ve tried reverting back to the older version of java/reverting to an older version of my program and unfortunately neither of these seem to work. When I use the C++ demo provided, it will connect successfully though.
To start the program I followed the demo for Java. It needs to create an instance of the class by loading the DLL.
DobotDll instance = (DobotDll) Native.loadLibrary("DobotDll", DobotDll.class);
It then attempts to connect the robot through the API function.
//Parameters are the port name and baud rate. DobotResult ret = DobotResult.values() [DobotDll.instance.ConnectDobot((char)0, 115200)];
This is where the problem occurs.
If the dobot is connected to something else, it will tell you that it is connected.
If the dobot isn’t connect to the computer, it will tell you that it cannot find the dobot.
But if neither of these problems exist, it will just terminate the program after a few seconds when it tries to connect.
Spying on the port, this is all that happens:
0A 4D 31 30 0A 4D 31 30 0A 4D 31 30 0A 4D 31 30 0A 4D 31 30 0A
I have even tried it on a different lap top with a freshly downloaded demo, it still doesn’t work.
It will connect with other languages and the dobot program but not java.
I am not sure why it stopped working after a month and a half just because I updated java.