• SMBus startup time, is there a way to check it?

    From Chris Green@[email protected] to comp.sys.raspberry-pi on Sat Sep 6 11:11:02 2025
    From Newsgroup: comp.sys.raspberry-pi

    I use I2C extensively on a Pi 4B on our little boat. To do all the
    I2C stuff I use the smbus package (the standard python3-smbus that is).

    Currently I have a 120 second delay after booting the system before
    actually using the I2C bus, I can't quite remember when I did this or
    quite why it's so long. It's likely much longer than necessary as
    this was originally implemented on a much older Pi than the current 4B.

    So, the best way to reduce the delay would be to have some definite
    way of telling if the SMBus/I2C is up and running. Does anyone know
    how one might do this? Alternatively does anyone here use smbus on a
    Pi 4B with a much shorter delay?
    --
    Chris Green
    ยท
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Michael Schwingen@[email protected] to comp.sys.raspberry-pi on Sat Sep 6 11:34:08 2025
    From Newsgroup: comp.sys.raspberry-pi

    On 2025-09-06, Chris Green <[email protected]> wrote:
    So, the best way to reduce the delay would be to have some definite
    way of telling if the SMBus/I2C is up and running. Does anyone know
    how one might do this? Alternatively does anyone here use smbus on a
    Pi 4B with a much shorter delay?

    There is nothing on I2C/SMBUS that needs "starting up". As soon as power is
    up, the pullup resistors pull the bus lines to idle state, and the bus is
    ready for transactions.

    Slave devices may need some time after power-up to initialize, but this is typically milliseconds unless specified otherwise.

    I have used I2C on a Pi 1 for INA219 and I2V-connected LCD/OLED displays,
    and I did not need any delays after start - my guess is that you are looking
    at driver/library problems.

    cu
    Michael
    --
    Some people have no respect of age unless it is bottled.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From druck@[email protected] to comp.sys.raspberry-pi on Wed Sep 10 07:51:57 2025
    From Newsgroup: comp.sys.raspberry-pi

    On 06/09/2025 11:11, Chris Green wrote:
    I use I2C extensively on a Pi 4B on our little boat. To do all the
    I2C stuff I use the smbus package (the standard python3-smbus that is).

    Currently I have a 120 second delay after booting the system before
    actually using the I2C bus, I can't quite remember when I did this or
    quite why it's so long. It's likely much longer than necessary as
    this was originally implemented on a much older Pi than the current 4B

    I2C should work immediately after boot.

    I'm thinking you may have delayed starting until the clock has been synchronised to avoid incorrect logging timestamps. You can reduce this
    delay by enabling systemd-time-wait-sync.service and making the After of
    your service set to

    After=After=time-sync.target

    Alternatively get a RTC for the Pi.

    ---druck

    --- Synchronet 3.21a-Linux NewsLink 1.2