Both I2C interfaces are connected to pins via GPIO matrix, so you can select arbitrary IO pins for SDA and SCL. You just need to observe the constraints of each pin such as I/O capability (GPIO34 – 39 are input only so not suited!), bootstrapping function. See the series datasheet for your device to confirm.
Pull up resistors
The ESP32 has internal pull up resistors which can be enabled. External may still be better though to allow a more exact resistance to be selected best suited for I2C?
We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.