GL-MT300N-v2 and I2c

I have a GL-MT300N-v2 with 4.14.63 kernel and OpenWrt 18.06.1 r7258-5eb055306f, and I wish to attach a pair of GY-BME280-3.3 temperature/humidity/pressure sensors, using the i2c bus. Having searched and read each of the i2c-related posts that I could find, it is my impression that the only way to utilize the i2c pins for i2c, is to modify the .dts file and recompile from source. Is this understanding correct?
Thank you.
yxespotter

Edit: Note that the following comment does not apply to the MTK-based GL-MT300N-v2. My error.

The ar71xx platform is not DTS-based, so you should be able to access the GPIOs directly, with the proper kernel module (driver) installed. I haven’t tried to configure the GPIO driver for the ar71xx platform.

Thank you for your reply.
Perhaps it was intended for a different inquiry?

The I2C bus is generally a bit-bang, GPIO driver. While I’ve configured it with the DTS-based, ath79 platform, I haven’t tried to configure it on the “legacy” ar71xx platform.

There may be some hints at [OpenWrt Wiki] I2C

Thank you again for taking the time to reply.
Unless I’m mistaken, the GL-MT300N-v2 is based on the ramips/mt76x8 platform and not the ar71xx platform.
Is modifying the .dts file and compiling from source the only way to be able to utilize the i2c pins for i2c on the MT300n-v2?

I don’t know why Jeff was talking about the wrong platform, but here is some info that might help

1 Like

Thank you. The linked post is actually one of the posts at the source of my confusion. The poster appears to want to use the i2c pins for GPIO instead of for i2c, implying that the i2c pins are already usable for i2c. Further down in that thread he also refers to not wanting “…to break original i2c functionality of the pins.”
My problem is that I’m not seeing any i2c functionality on those pins.

Hmm… I don’t think Mango is on Device Tree - so it’s the machine file - but that only defines the i2c pins, rest is in userland (aka OpenWRT), as i2c can support more than one slave device.

In HW - defined the pins - in SW, define what the pins are used for…