[SOLVED] Connection between Dobot Magician and Linux


#1

Hi !
I have a Dobot Magician and Linux. I want to control the dobot with my own code.
First, I discover the DLL for Linux is for Linux 32bits so I install a Ubuntu 32bits VM on my computer.

I wrote in Python this :
api = dTypes.load()

result = dType.ConnectDobot(api, “”, 115200)
and the result is always 2 (occupied).

When I use :
dTypes.SearchDobot(),
I have u’ttyUSB0’

I tried to put result = dType.ConnectDobot(api, “ttyUSB0”, 115200),
I have the same result.

What can I do to connect the dobot with my program.

Thanks

PS : The /dev/ttyUSB0 is only for the root. You have to change the permission.


#2

Hi, may I know how do you solve your problem?


#3

Hey
What version of Ubuntu are you using?
I’m having problems linking the .so files while running the python script provided.


#4

This is how I get connection working between Dobot magician and PC (Linux Mint 17.3).

Open Terminal
write lsusb
Connect Dobot and power-on.
write lsusb again

There is a new row looking like:
Bus 007 Device 003: ID 1a86:7523 QinHeng Electronics HL-340 USB serial adapter

1a86 is idVendor and 7523 is idProduct

Create a file /etc/udev/rules.d/01-opendobot.rules with one row looking like this:
ATTRS{idVendor}==“1a86”, ATTRS{idProduct}==“7523”, SYMLINK+=“dobot”

Save file. You might have to change idVendor and idProduct according to your lsusb-listing.
Change permission of the file so your user can access it (chmod 777 /etc/udev … I think)
Restart udev with: sudo udevadm trigger

Start cutecom (download from Software Center if not installed).
Change to Hex output and Hex input
In the box where you choose serial port change to /dev/dobot
Click OpenDevice

In the Input frame write:
aa aa 02 14 00 ec
followed by ENTER
The dobot should answer something like aa aa 12 14 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 eb

Refer to the Dobot Communication Protocol (you can download it from dobot.cc

Now write
aa aa 03 1f 00 00 e1
and watch the dobot make a homing move.

All commands start with aa aa followed by the length of the command (id + parameter), the command ID, command parameters and lastly a checksum. The checksum is 256-the sum of command ID and command parameter.
Be aware of that the command ID in the Dobot Communication Protocol is in decimal but you need to convert it to hex before sending it i cutecom.


#5

Hi @Kylo_Entro… I have the similar issue… Could you please describe the solution for us here, if you have managed to resolve the issue


#6

Hi,

There is some issue with Virtual Box. So i ran my python script on my Windows native system.
Virtual Box manage very badly USB.


#7

The Dobot magician is work on ROS but it only work on ubuntu 16.0 only for control you can get ROS Demo from Dobot Website


#8

Where to download the SDK for Linux?