Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BMI160 tracker only working with extra invisible IMU #277

Open
backspacestud opened this issue Aug 19, 2023 · 8 comments
Open

BMI160 tracker only working with extra invisible IMU #277

backspacestud opened this issue Aug 19, 2023 · 8 comments

Comments

@backspacestud
Copy link

Hello,
I have been having issues getting my 2 IMU tracker to work, they are identified by slimeVR but the IMU's say working:false in the serial console. This is weird because my other tracker I got working yesterday was perfectly fine, but I decided to see if it was the firmware by changing the firmware of the working one. I could not remove the ghost IMU or else the actual one would not work at all, and the only defines.h i could get working was this:
image
(while this one would not work:)
image

When I tried to flash it to my second tracker It did not work at all, with or without the second IMU connected. My first question is why my 1st one only works with that specific defines.h and the second one does not work with anything at all (I triple checked the wiring though it may be a faulty sensor.)

Sorry for the confusing question, any help would be appreciated

@nekomona
Copy link
Contributor

nekomona commented Aug 20, 2023

Check the AD0 connection on the sensors, they need to match the address in the descriptor. For BMI160, PRIMARY_IMU_ADDRESS_ONE correspond to AD0 shorted to ground, while PRIMARY_IMU_ADDRESS_TWO correspond to AD0 floating.

You could reset the tracker with serial console open to see more detailed IMU initialization logs.

@backspacestud
Copy link
Author

could it be this?

[ERROR] [SensorManager] Can't find I2C device on provided addresses, scanning for all I2C devices and returning
[ERR] I2C: No I2C devices found

[INFO ] [SerialCommands] SlimeVR Tracker, board: 6, hardware: 1, build: 16, firmware: 0.3.3, address: 192.168.1.42, mac: 48:3F:DA:5F:B8:D4, status: 2, wifi state: 1
[INFO ] [SerialCommands] Sensor[0]: BMI160 (0.000 0.000 0.000 1.000) is working: false, had data: false
[INFO ] [SerialCommands] Sensor[1]: BMI160 (0.000 0.000 0.000 1.000) is working: false, had data: false

And im not sure what you mean by AD0 connection (sorry im still new to microcontrollers/sensors like this). I checked my wiring based off of this diagram:
image
and the wiring of the working one was technically incorrect (I did not ground SAO). and when I tried to replicate the same thing on my non working sensor nothing changed... i'm struggling to find a common point of failure and any info that I can provide thats actually useful. (when my tracker with an auxiliary sensor fully match the diagram the tracker showed up but the sensors did not track). I will try to ask the discord about these issues as they may be able to help me with the BMI160 issues I have been having but I will do that at a later date. I may update this thread if i find out anything but it might be a while.

@Muhammad-Hazimi-Yusri
Copy link

hi, thanks for this. I can confirm I am having same issue with BMI160 and Wemos D1 Mini, having both diode protection and battery level check resistor ast A0 (possibly the culprit),

using the defines.h code with non existant aux imu finally makes my imu working instad of error, while using only 1 imu without ghost aux imu, cause only error as if the IMU is broken.

thankfully i searched for related issue on github after anothr 2 of my imu isnt working which is too suspect.

@osman-rodriguez
Copy link

Hi! Could you solve it? I have exactly the same problem...

@unlogisch04
Copy link
Contributor

And im not sure what you mean by AD0 connection (sorry im still new to microcontrollers/sensors like this).

By AD0/SA0 he means the second ground wire on the main BMI160. This is the I2C Address selector for the BMI160.

@unlogisch04
Copy link
Contributor

unlogisch04 commented Nov 19, 2023

using the defines.h code with non existant aux imu finally makes my imu working instad of error, while using only 1 imu without ghost aux imu, cause only error as if the IMU is broken.

What setup do you have? (1x D1 mini 2xBMI160) or (1x D1 mini 1xBMI160)?
If you have (1x D1 mini 1xBMI160) then i can guess that the SA0 is not connected to ground. This changed not too long ago in the schematic (about 2 months i think).

On the firmware prior to 0.3.3 the firmware was less strict, and did not generate a ghost tracker when there was only 1 imu connected and that one did not have the correct i2c address. In the newer firmware it will create a ghost tracker for main and then assume that the other tracker is a extension.

If you have the sa0 grounded on the extension instead of the main, you need to change the following line in the defines.h:
from:

#ifndef IMU_DESC_LIST
#define IMU_DESC_LIST \
        IMU_DESC_ENTRY(IMU,        PRIMARY_IMU_ADDRESS_ONE,   IMU_ROTATION,        PIN_IMU_SCL, PIN_IMU_SDA, PRIMARY_IMU_OPTIONAL,   PIN_IMU_INT) \
        IMU_DESC_ENTRY(SECOND_IMU, SECONDARY_IMU_ADDRESS_TWO, SECOND_IMU_ROTATION, PIN_IMU_SCL, PIN_IMU_SDA, SECONDARY_IMU_OPTIONAL, PIN_IMU_INT_2)
#endif

to:

#ifndef IMU_DESC_LIST
#define IMU_DESC_LIST \
        IMU_DESC_ENTRY(IMU,        PRIMARY_IMU_ADDRESS_TWO,   IMU_ROTATION,        PIN_IMU_SCL, PIN_IMU_SDA, PRIMARY_IMU_OPTIONAL,   PIN_IMU_INT) \
        IMU_DESC_ENTRY(SECOND_IMU, SECONDARY_IMU_ADDRESS_ONE, SECOND_IMU_ROTATION, PIN_IMU_SCL, PIN_IMU_SDA, SECONDARY_IMU_OPTIONAL, PIN_IMU_INT_2)
#endif

Thanks for a replay in advance.

@hauveli
Copy link

hauveli commented Jan 10, 2024

Hello! I am writing because I had the exact same issue:
It connects to SlimeVR but shows "Error" with no description of why and no debug log (when connecting wirelessly).
Shorting SA0 to ground resolved the issue and I can now see it tracking.

I have also connected a BMM150 auxiliary magnetometer to it, but it is not picked up, should I open an issue for this?
Thank you for the messages above and for your time.

@ZRock35
Copy link

ZRock35 commented Jan 10, 2024

BMM-150s don't work properly with BMI-160s currently, someone needs to figure that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants