Communicating with an AX2550 in Linux

10 years 3 months ago #29525188 by jgirata
Hi All,

I posted this in the old forum (not realizing this one existed), so I\'m posting it again to see if anyone can help me out.

I have an AX2550 that I am trying to control through Linux. I\'m using Python\'s pySerial library, but it seems like it\'s having issues handling the parity.

Does anyone have any experience communicating with an AX2550 in Linux? I did a search on these forums and came across this post a while back that mentioned a C++ library for doing just that. The website has since been taken down, so if anyone knows of a mirror of it or has a copy of the library that they\'d be willing to send me, that would be even better.


cosma pointed me to http://dev.roboteq.com/dev1/tech-support/application-notes-source-code.html , but that seems to only be for PCs, and I\'m really looking for something in Linux. If anyone can help me out, I\'d really appreciate it.

Thanks in advance,
John

Please Log in or Create an account to join the conversation.

10 years 1 month ago #29525224 by lindsayb37
Are you trying to communicate for setting up the controller? If so I would think somnething as simple as minicom would be satisfactory. Or are you trying to write a program to interface with it?

Please Log in or Create an account to join the conversation.

10 years 1 month ago #29525225 by ibwood
Hey I\'m doing this right now actually:

You need a USB-serial cable connecting to your motor controller.

Also you need these libraries:
 #include <sys/ioctl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <stdio.h>
 #include <limits.h>
 #include <string.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <termios.h>
 #include <unistd.h>

To initialize settings for the port you are using this:
system(\"stty -F /dev/ttyUSB0 9600 cs8 -cstopb -parity -icanon hupcl -crtscts min 1 time 1\");

To open the port accessible for communication:
int fd = open(\"/dev/ttyUSB0\",O_RDWR | O_NOCTTY | O_NDELAY);

To send commands to the ax2550:
numSent = sprintf(\"!%c%2X\\r\", character_direction, hex_speed);  //followed by a carriage return

Look in the user manual for details under chapter 13.
Hope this helps :)

Ian

Please Log in or Create an account to join the conversation.

10 years 3 weeks ago #29525227 by talgball
John,

Did you figure this out? I\'m using python with an ax500 and am likely having similar issues..

Thanks,
Tal

Please Log in or Create an account to join the conversation.

10 years 3 weeks ago #29525228 by jgirata
Yeah, it actually turned out to be a problem with my USB-to-Serial converter. It turns out that most converters don\'t support anything more advanced than a simple mouse or keyboard. After talking to people smarter than me, I\'ve discovered that the best bet is to go with a converter that uses a chip made by FTDI (I think - it\'s something like that).

To see if your converter uses an FTDI chip, on Linux, just type
lsusb
at the command line and your converter should be listed as an FTDI device.

From what I\'ve heard, having a non-FTDI device does not necessarily mean it won\'t work, but having an FTDI device would guarantee it.

Disclaimer: This isn\'t my area of expertise; this is what I was told, to the best of my memory, several months ago.

Good luck!
John

Please Log in or Create an account to join the conversation.

10 years 2 weeks ago #29525229 by talgball
Thanks, John.

As it turns out, my issue was a bit brain dead. I wasn\'t sending the 0x0d character at the end of the commands. Duh.

I did actually RTFM - cover to cover, and it is the first sentence on sending commands. However, it didn\'t make the bold type club, and I just missed it..

Take care,
Tal

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.242 seconds