Communicating with an AX2550 in Linux
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 dev.roboteq.com/dev1/tech-support/applic...tes-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,
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 :)
To see if your converter uses an FTDI chip, on Linux, just type
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.
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..