I2C Sniffer/spy or reading I2C bus with no regards to address

I'm making an ethernet enabled sports weight, and one part of it involves reading an 24c02 eeprom to get the stored data.

The problem is that the microcontroller in the weight is a I2C master and thus inteferes with the bus. I am not able to read the eeprom as per the usual approach with the wire library.
As i am only interested in reading and not writing, i thought that it would be best, just to sniff the data when the weight stores them.

So my question is: Is it possible to modify the wire library to listen for all communication on the I2c bus or have someone else already created a I2C sniffer?

Other ideas are also welcome :slight_smile:

  • Christian

Is it possible to modify the wire library to listen for all communication on the I2c bus or have someone else already created a I2C sniffer?

Yes, I2C sends an address to identify the device that should listen. When a device is reading this address it is checked with the internal address and if there is a match it listens to the command otherwise it ignores the rest of the data.

I would start here - http://arduino.cc/en/Tutorial/MasterWriter - with the slave code and change the device id to the EEPROM device id.

your turn :wink:

I tried using the arduino as a slave and it worked.. sort of... The arduino intercepts the data and prints them, but it is veeery slow and the weight shows an error related to the eeprom. I'm thinking its because the arduino ACK´s the requests and it messes up when the eeprom also tries to do that...
I had a quick look in the wire library but couldnt find something related to ACK´ing.. - I will try to look more closely when i have more time...

The soft2IC sounds promising, i will have to look more into it before i can determine which of the libraries are the best...

Thanks :slight_smile:

If I understand correctly, when trying to spy on the i2c, the spy must not put any data on the lines.
So you need to create a softi2cspy library where you listen for all data and synch on the ACK's sent by the true destination.