I am making use of several expansion cards on my system. I would like my application (plain C, outside Legato) to know what is the expansion card inserted.
Looking at “/sys/class/i2c-adapter/i2c-0/” I see several elements which seems to be I2C devices… but which one is the EEPROM if the expansion card? This list does not change if I insert or not an expansion card.
Using IOT_Detect (GPIO25) I can see if there is a card connected or not.
How can I read the content (from Linux terminal) of the EEPROM to get information on the expansion card connected?
I have installed “i2c-tools” but it doesn’t help.
A simple read example using C or Python or Shell would be greatly appreciated.
Thanks for the answer but I do not observe new elements appearing in the /sys/class/i2c-adapter/i2c-0 folder when I connect an expansion card… even after a power cycle.
I have tested with all expansion cards I have: Renfell GPIO / Renfell RS485 / Talon Ethernet / Energiya Converter.
I am able to see the I2C address of the EEPROM in 0x53 (for all except the Renfell GPIO Card) using “i2cdetect -y -r 0”.
As suggested in the “5.2.2.1 Recommended EEPROM Schematic” of the " IoT Expansion Card Design Specification (Rev8) " of “http://mangoh.io” site, I see that by changing the output value to 1 of the CARD_DETECT (setting the expansion card to ACTIVE) The EEPROM address moves to 0x52.
Using the I2C dump command “i2cdump -y 0 0x52 c 0”, I can see the content of the EEPROM of Energiya Converter Expansion card, but I cannot see the EEPROM content of the other expansion cards.
I am a bit confused with this EEPROM reading and expansion card name that should appear in /sys/class/i2c-adapter/i2c-0 but does not. Could you check what’s going on.
Thanks, Christian.
P.S.: I have tested with several expansion cards and several Fx30 (including one with the reference firmware SWI9X15Y_07.11.22.00 r33729 CARMD-EV-FRMWR1 2017/01/11 18:04:06)
Yes, all cards I have up to now have an EEPROM… It’s a good thing to be able to differentiate the expansion card… if we can read them. Maybe is there something I am doing wrong… please keep me updated if you manage to have it working.