Linkit Smart 7688 OpenWRT 18.06 and I2C

The I2C bus is a bus is used to interface with small sensor devices in a system. Recently I needed to collect data from an MCP3424 ADC using the Linkit Smart 7688. The Linkit ships with the OpenWRT CC 15.05 firmware which now is 3+ years old, so I wanted to use a more updated system. Lucky for me, OpenWRT just released 18.06 this month, the first release where OpenWRT and LEDE re-aligned. I installed the 18.06 firmware on the Linkit, however the default build doesn’t have the I2C drivers. Here are the steps to get the I2C bus working on OpenWRT 18.06 on the Linkit Smart 7688.

opkg update
opkg install kmod-i2c-code kmod-i2c-mt7628
lsmod (Ensure the new modules are is loaded)
ls /dev/ (List the devices in /dev)

After running the ‘ls /dev/’ command you should see the i2c-0 device listed. This device file controls the hardware connected to the SCL and SDA pins. Use the fopen, ioctl commands in C to control the port. WARNING: The Linkit I2C driver appears to always respond with a valid return integer. This is different than other drivers, which will respond with success for an ACK message and failure integers for a NACK message. Take a look at the elinux info on I2C here: https://elinux.org/Interfacing_with_I2C_Devices

Leave a Reply

Your email address will not be published. Required fields are marked *