Results 1 to 9 of 9

Thread: Dynamixel SDK linux: COMM_RXTIMEOUT error

  1. #1

    Dynamixel SDK linux: COMM_RXTIMEOUT error

    Hi,

    I've been having some issues getting the dynamixel SDK working with my USB2AX, and I have no idea what could be going wrong . I've tried this on both my laptop running Arch and my BBB running Angstrom, with the same results:

    - Download dynamixel sdk for linux here: http://support.robotis.com/en/softwa...2dxl_linux.htm

    - Change line 25 of dxl_hal.c from "/dev/ttyUSB%d" to "/dev/ttyACM%d", because the USB2AX shows up on ttyACM not ttyUSB.

    - Compile library, then "ReadWrite" example using included makefiles

    - Run the example; it returns "Succeed to open USB2Dynamixel, press enter to continue" or something along those lines

    - Press enter, it returns "COMM_RXTIMEOUT" (which I believe means that it isn't receiving a status packet), and connected AX-12 doesn't move.

    I've checked the servos using Roboplus and the same USB2AX. The dynamixel wizard shows both ID and Baud rate set to 1. The servos work fine using the power supply (12v 5A). I tried changing the ID of the servo in the example to broadcast, and it stops complaining about the lack of status packets (I'd assume because the servos don't return a status packet off of a broadcast), but still no movement.

    I tried using an FTDI to listen in on the dynamixel bus, and it seems as though the USB2AX is sending nothing at all (I was able to read packets sent from an Arbotix). I'll probably have to try this again, to make sure.

    Unfortunately I do not have a logic analyzer or scope, so debugging these kinds of issues is a little more difficult .

    So, any ideas about what I might be doing wrong? Anything I can do to try to locate the issue?

  2. #2
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    858
    Images
    25
    Rep Power
    88

    Re: Dynamixel SDK linux: COMM_RXTIMEOUT error

    Correct me if I'm wrong but you need to change more than line 25 in the dxl_hal I believe. It's been a while since I've had that open but I thought there was a couple of sections that are commented out. Xevel had a new version you could download off his site. https://paranoidstudio.assembla.com/...er/usb2ax/soft Though glancing at, it seems just a bit of clean up.

    You could always increase the wait time of the dxl_set_timeout to give it more time to respond.

  3. #3
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    858
    Images
    25
    Rep Power
    88

    Re: Dynamixel SDK linux: COMM_RXTIMEOUT error

    There is also the possibility your login isn't part of the dialout group. By default you are not added usually, at least with Ubuntu you are not. (5 bucks this is it!)
    Last edited by KevinO; 01-15-2014 at 07:40 PM.

  4. #4

    Re: Dynamixel SDK linux: COMM_RXTIMEOUT error

    I've fixed the dxl_hal.c file, and will test it out in a bit (note to self: read Xevel's guide on using the SDK before using the SDK ).

  5. #5
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    858
    Images
    25
    Rep Power
    88

    Re: Dynamixel SDK linux: COMM_RXTIMEOUT error

    If you haven't added yourself to the dialout group go ahead and do it. I've forgotten every single time I've built a new project based off Linux and draw a blank for a few seconds when it doesn't send out any commands. :P

  6. #6
    Join Date
    Sep 2010
    Location
    ಠ_ಠ
    Posts
    2,313
    Images
    27
    Rep Power
    278

    Re: Dynamixel SDK linux: COMM_RXTIMEOUT error

    I seem to remember there being a common problem with the very short timeout period in the linux version of the dxl library from Robotis.


    Line 154 has the timeout equation and it would not hurt to change that from:
    Code:
        gfRcvWaitTime = (float)(gfByteTransTime*(float)NumRcvByte + 5.0f);
    to the windows version of:
    Code:
        gfRcvWaitTime = (float)(gfByteTransTime*(float)NumRcvByte + 2*LATENCY_TIME + 2.0f);
    and insert at ~line 12:
    Code:
    #define LATENCY_TIME        (16)
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    [git][mech][hack]
    gives free advice only on public threads

  7. #7
    Join Date
    Sep 2008
    Location
    Toronto, Ontario
    Posts
    171
    Images
    43
    Rep Power
    40

    Re: Dynamixel SDK linux: COMM_RXTIMEOUT error

    Here's what I did to get the basic functionality working. The howto docs on Xevel's site miss a few changes.

    Code:
    $ diff -b robotis/src/dxl_hal.c robotis/xevel_src/dxl_hal.c 22c22
    <     struct serial_struct serinfo;
    ---
    >     //struct serial_struct serinfo;
    25c25
    <     sprintf(dev_name, "/dev/ttyUSB%d", deviceIndex);
    ---
    >     sprintf(dev_name, "/dev/ttyACM%d", deviceIndex); // USB2AX is ttyACM
    36c36
    <     newtio.c_cflag        = B38400|CS8|CLOCAL|CREAD;
    ---
    >     newtio.c_cflag        = B1000000|CS8|CLOCAL|CREAD;
    48a49,50
    >     //USB2AX uses the CDC ACM driver for which these settings do not exist.
    >     /*
    61c63
    <     }
    ---
    >     }*/
    76c78
    <     newtio.c_cflag        = B38400|CS8|CLOCAL|CREAD;
    ---
    >     newtio.c_cflag        = B1000000|CS8|CLOCAL|CREAD;
    106a109,110
    >     //USB2AX uses the CDC ACM driver for which these settings do not exist.
    >     /*
    120c124
    <     
    ---
    >     */
    I never got the sync read feature working. It appears to require further changes within dynamixel.c which I have never completely figured out. dxl_tx_packet validates the instruction packet and requires something more than simply adding INST_SYNC_READ to dynamixel.h and
    Code:
    && gbInstructionPacket[INSTRUCTION] != INST_SYNC_READ
    in the if statement with the rest.

  8. #8

    Re: Dynamixel SDK linux: COMM_RXTIMEOUT error

    Works great with those changes! Thanks for your help!

    Quote Originally Posted by KevinO
    There is also the possibility your login isn't part of the dialout group. By default you are not added usually, at least with Ubuntu you are not. (5 bucks this is it!)
    I'm assuming that is the same as the uucp group an Arch (Gives access to "serial and USB devices such as modems, handhelds, RS-232/serial ports."). If so, then I ran into that problem when setting up the arduino IDE and I fixed it a while ago .

    And thanks for the tip Tician, your suggested code hasn't broken anything so I'm going to assume it's helping .

    Are you sure Xevel's code doesn't include all the necessary changes Kamondelious? This seems to work, and all I did was add in Xevel's changes.
    Last edited by Deimos; 01-15-2014 at 08:36 PM.

  9. Re: Dynamixel SDK linux: COMM_RXTIMEOUT error

    Quote Originally Posted by KevinO View Post
    There is also the possibility your login isn't part of the dialout group. By default you are not added usually, at least with Ubuntu you are not. (5 bucks this is it!)
    A good addition to the doc, thanks!
    I always forget these kind of things too :/


    Quote Originally Posted by tician View Post
    I seem to remember there being a common problem with the very short timeout period in the linux version of the dxl library from Robotis.


    Line 154 has the timeout equation and it would not hurt to change that from:
    Code:
        gfRcvWaitTime = (float)(gfByteTransTime*(float)NumRcvByte + 5.0f);
    to the windows version of:
    Code:
        gfRcvWaitTime = (float)(gfByteTransTime*(float)NumRcvByte + 2*LATENCY_TIME + 2.0f);
    and insert at ~line 12:
    Code:
    #define LATENCY_TIME        (16)

    The LATENCY_TIME thing seems to me to be designed specifically to take into account the default latency setting of the FTDI driver... Anyway, that's an interesting fix, and i will add it to the documentation too, just in case.


    Quote Originally Posted by kamondelious View Post
    Here's what I did to get the basic functionality working. The howto docs on Xevel's site miss a few changes.

    Code:
    $ diff -b robotis/src/dxl_hal.c robotis/xevel_src/dxl_hal.c 22c22
    <     struct serial_struct serinfo;
    ---
    >     //struct serial_struct serinfo;
    25c25
    <     sprintf(dev_name, "/dev/ttyUSB%d", deviceIndex);
    ---
    >     sprintf(dev_name, "/dev/ttyACM%d", deviceIndex); // USB2AX is ttyACM
    36c36
    <     newtio.c_cflag        = B38400|CS8|CLOCAL|CREAD;
    ---
    >     newtio.c_cflag        = B1000000|CS8|CLOCAL|CREAD;
    48a49,50
    >     //USB2AX uses the CDC ACM driver for which these settings do not exist.
    >     /*
    61c63
    <     }
    ---
    >     }*/
    76c78
    <     newtio.c_cflag        = B38400|CS8|CLOCAL|CREAD;
    ---
    >     newtio.c_cflag        = B1000000|CS8|CLOCAL|CREAD;
    106a109,110
    >     //USB2AX uses the CDC ACM driver for which these settings do not exist.
    >     /*
    120c124
    <     
    ---
    >     */
    I fail to see the difference with what is on my website, could you point it out please?


    Quote Originally Posted by kamondelious View Post
    I never got the sync read feature working. It appears to require further changes within dynamixel.c which I have never completely figured out. dxl_tx_packet validates the instruction packet and requires something more than simply adding INST_SYNC_READ to dynamixel.h and
    Code:
    && gbInstructionPacket[INSTRUCTION] != INST_SYNC_READ
    in the if statement with the rest.
    Sync_Read is indeed different from the rest of the Dynamixel commands and necessitates some develpment to include in the SDK. The structure is detailed here : http://www.xevelabs.com/doku.php?id=...d_instructions
    ---
    Personal blog: http://xevel.org
    USB2AX documentation: http://xevelabs.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Question(s) Compiling Error with Arduin IDE / Pypose : could not read servo error
    By lweydert in forum Software and Programming
    Replies: 3
    Last Post: 03-27-2013, 08:16 AM
  2. Question(s) Dynamixel Linux SDK
    By Ctank02 in forum DYNAMIXEL & Robot Actuators
    Replies: 13
    Last Post: 03-10-2013, 11:50 AM
  3. Dynamixel RX-24F and RS-485 Communication on Linux/Ubuntu
    By robot in forum Software and Programming
    Replies: 2
    Last Post: 09-06-2012, 04:25 AM
  4. error - not available
    By cillaelery in forum Garage Sale
    Replies: 0
    Last Post: 05-05-2012, 11:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •