I2c Clock Speed Change for Navigator

Hi All,

I am trying to get a smart battery BMS to communicate with the navigator board. I am able to successfully poll the battery for information using an esp32 MCU and communication is reliable. However when I hook it up the navigator board it is intermittent and will eventually drop out.

My theory is that the BMS cannot at operate at the fast i2c rate of 400kHz, as the esp32 is using 100kHz, eventually it will drop out and pull the clock line low indicating a locked I2c bus.

I am trying find how to reduce the i2c bus clock speed for the navigator to 100kHz. I have already attempted changing ‘/boot/config.txt’ with the line ‘dtparam=i2c_arm=on,i2c_arm_baudrate=100000’, however afterwards the navigator will not boot.

Any advice on this would be greatly appreciated.

Cheers,

Lewis

@williangalvani - any help would be appreciated Will.

1 Like

Hi @Lewis_Miles, welcome to the forum :slight_smile:

I asked about this internally and was told BlueOS already specifies baudrates for the different I2C ports in /boot/config.txt, and you should be able to change those lines as relevant. I2C6 is the one that’s exposed externally via the Navigator connectors, and is configured with the line

dtoverlay=i2c6,pins_22_23,baudrate=400000
4 Likes

Eliot,

Sorry to butt in here, but I have an issue with the /boot/config.txt file.
I made the change you suggested to modify the one line:
dtoverlay=i2c6,pins_22_23,baudrate=400000

I changed it to :
dtoverlay=i2c6,pins_22_23,baudrate=100000

After a little bit of time, I noticed that my I2C peripheral was failing to communicate, and I found that the subject line was changed back to 400000.

My line was removed and a new 400000 line was added.
What performed this modification.
And, can it be turned off?

ADDITION:
It looks like i2c6 overlay is changing this parameter.
Can I stop this from happening?
Can I set the parameter to the i2c6 overlay to 100000 (which is the default?)
IGNORE THE ABOVE.
I see that the config.txt does this.
So, what is changing the file
FROM: config.txt
TO: config.txt.before_update_navigator_overlays.bak

Thanks for your help,

Mark K

1 Like

I am having the same issue here. Would love for this to get some attention

Apologies that this seems to have gotten lost in the works.

From other comments in that thread, BlueOS will still add the original line back to the file if it gets removed, but it will avoid restoring/removing lines that are directly followed by # CUSTOM.

I believe the last configuration of a variable in the file is the one which is applied, so hopefully it will work if you specify it at the bottom of the [pi4] block :slight_smile:

Hi Eliot,

I figured a way around this, but it didn’t fix my issue unfortunately. But for anyone trying to decrease the baudrate, the blueOS-core docker container runs a sh script upon boot which overwrites the values in /boot/config.txt.

To change this, I simply edited this value in this file BlueOS/core/tools/blueos_startup_update/blueos_startup_update.py at master · bluerobotics/BlueOS · GitHub, line 315.

Then built the docker file using docker build, pushed it to docker hub and pulled it from blueOS. If you restart your vehicle now, that i2c-6 value should be whatever you changed it to in the blueos_startup_update.py now

Not a permanent fix as any new versions of blueOS will put it back to 400,000, but good to test if it’s your problem