I have built a homemade I2C hub by connecting four Grove connectors in parallel. This works fine if I connect, it to the ESP32 I2C pins (21-SDA, 22-SCL, Ground and 3.3V), and if I connect a I2C device, for instance a RC522 RFID, to my hub and run an i2cScan script I can see the I2C address of the RC522 device (0x28).
Now to the problem, if I then connect an Adafruit_SSD1306 OLED display to the hub it is also detected with the address 0x3c but I cannot use the OLED whilst connected to the hub. It works ok on its own connected directly. if I remove the RC522 RFID from the hub and run the i2cScan script the OLED screen is no longer detected.
Does anyone have an idea of what might be happeng here?
Edit: The problem was a bad Adafruit_SSD1306 OLED display. It always displayed its address for a scan but the display itself only worked intermittently.
Sorry for any confusion caused by my use of the term "hub" for a chain of Grove I2C connectors, I couldn't post a diagram as I was working from a mobile phone without a drawing app. Perhaps it might be worthwhile to actually define what a I2C Hub actually is, in my case it was simply using Grove connectors rather than connecting via a breadboard using Dupont cables.
I2C is a bus, and can theoretically have up to 127 devices (with different addresses)
Have you tried connecting RC522 RFID and SSD1306 OLED display directly to 21-SDA, 22-SCL (without the hub)?
I told you everything about its design, I wrote "I have built a homemade I2C hub by connecting four Grove connectors in parallel."
What more do you need to know?
I didn't think it necessary on this forum to exxplain in detail what "in parallel" means but If you don't know, it means pin1 on connector 1 to pin1 on connector 2 to pin1 on connector 3 to pin1 on connector 4 and the same with the other connector pins.
If you still don't know what the problem might be, please feel free not to answer the question.
Yes, there seems to be an issue with the I2C bus generally on my ESP32. Sometimes it works and sometimes it doesn't. I will experiment futher with a Uno and a few other devices when I get time.
A hub might be more than brain-dead parallel connections of a few signal lines.
Why do you need a "hub"?
Have you tried hooking up the two I2C devices in the traditional manner, that is to say just wire them to the bus w/o any mechanical or otherwise "hub"?
gfvalvo's reply to me was snippy. And I wrote in the OP that the "hub" was four Grove connectors in parallel. The only reason for using the term "hub" was to simplify the question by not repeating "four Grove connectors in parallel" instead of "hub" whilst refering to it in the question.
Have you tried hooking up the two I2C devices in the traditional manner, that is to say just wire them to the bus w/o any mechanical or otherwise "hub"?
No, I will do that. In the meantime here is a photo of the ESP32 and its Dev Board. I am using the the I2C pins in the bottom right (D22,D21,VCC,GND) above the power connector for the connection to my chain of Grove connectors (I have given up calling it a "Hub" image|375x500
As I wrote in the OP, I simply chained four Grove connectors in parallel and called it a "hub" as it was easier to explain the issue using the small word "hub" rather than "the four Grove connectors connected in parallel" five or six times in the explanation.
I certainly regret using the term "hub" now because some members here have got thoroughly confused and misled by the term, even though the term "hub" is not incorrect used in this way and there are many "hubs" available which are simply chains of connectors in parallel, for example GRV I2C HUB: Arduino - Grove I2C-Hub bei reichelt elektronik