Additional response bytes received

General discussion of using Roboclaw motor controllers
woko1754
Posts: 20
Joined: Sun Feb 21, 2021 3:16 am
Re: Additional response bytes received

Post by woko1754 »

The problem starts, if using command "74 - Set S3, S4 and S5 Modes". The command is acknowledged, but after some movement the module starts to send data without request. In my case it is sending the version-string instead of the ACK for an encoder-request.
woko1754
Posts: 20
Joined: Sun Feb 21, 2021 3:16 am
Re: Additional response bytes received

Post by woko1754 »

Is this forum still maintained ? The last answer was nearly 4 weeks ago.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Additional response bytes received

Post by Basicmicro Support »

As I said in my last post, I will need to see your code to determine the problem. If you can, post a simplified version that just has enough code to show the problem. Anything that requires special hardware will prevent me from being able to run the code so try to remove anything like that from your example.
woko1754
Posts: 20
Joined: Sun Feb 21, 2021 3:16 am
Re: Additional response bytes received

Post by woko1754 »

I can't get command 74 working. Here is my code:

int CRoboclaw::encode_set_S3S4S5(uint8_t* buffer, uint8_t S3mode, uint8_t S4mode, uint8_t S5mode) const
{
int bytes = 0;
buffer[bytes++] = m_address;
buffer[bytes++] = 74;
buffer[bytes++] = S3mode;
buffer[bytes++] = S4mode;
buffer[bytes++] = S5mode;
return bytes;
}
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Additional response bytes received

Post by Basicmicro Support »

command 74 is SETPINFUNCTIONS.

Your code only sends the address, command and settings for S3, S4 and S5 mode. That command also requires a CRC16 checksum as do all commands that send data. Since the packet is invalid you wont get any ack byte back.

Based on your previous post you are getting an ack so I can assume this command is not all your code.

As I said, I will need to see your code(all of it) to determine why you are getting other data back(or seem to be).

Post Reply