Jump to content

[C/C++] IMU Brick Timeout


Recommended Posts

First of all, hello everybody! I am new to this board and hope my question hasn't been asked a hundred times already (I did search).

 

I have a problem with a newly arrived IMU brick. Simply: Brickv shows the data, but if I try to use the C example, I don't get any data.

 

More specifically, after turning on the return codes (imu_set_response_expected_all), I seem to know that I get timeouts.

 

Any ideas what could be wrong? (I already flashed a new firmware, etc.)

 

Bests

Boris

 

Code:

    // Enable debugging, i.e. turn on return codes
    imu_set_response_expected_all(&imu, true);

    // Set period for quaternion callback to 1s
    ret = imu_set_quaternion_period(&imu, 10);
    if (ret != E_OK)
    {
        fprintf(stderr,"Error: imu_set_quaternion_period (%d)\n",ret);
        exit(ret);
    }

Returns:

Error: imu_set_quaternion_period (-1)

 

Link to comment
Share on other sites

imu_set_response_expected_all is new in protocol v2, so you're using the C bindings for protocol v2 here. Did you do this on purpose, or accidently by getting the latest code from git?

 

You need to use brickd, brickv, firmwares and bindings in either for protocol v1 or v2, you cannot mix them. Currently v2 is still in beta.

 

If you got the C bindings in v2 by accident then just get the latest v1 version from here: http://www.tinkerforge.com/doc/Downloads.html

 

If you decided to use v2 on purpose then ensure that brickd, brickv and the firmware flashed on the IMU Brick is v2.

 

If that's already the case then you might be using the wrong UID, ensure that you use the UID shown for the IMU Brick in brickv.

Link to comment
Share on other sites

Ah, thanks. I thought about trying the 2.0 beta, but I didn't expect it to be the master of the regular trunk (I used the GIT code in combination with the .deb of brickd). I have looked for version information in the code and only found the API version information in imu_create, which was set to 1.0.1 (afterwards I was just assuming that it would be related to the version of brickd/brickv). Same version information is also in the "old" code that you pointed me to, maybe it would be nice to have some kind of "general" version match/check/information.

 

Thanks for the fast help, now it works like a charm,

Boris

Link to comment
Share on other sites

The 1.0.1 is the API version of the IMU Brick. We have plenty of version numbers: the API version, the bindings version, the firmware version, etc :)

 

We should raise the API version to v2 too, thanks for reporting this.

 

You can still use git to get the bindings for protocol v1 you just need to switch to the v1.x.y branch using 'git checkout v1.x.y'.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...