Real-Time Temperature Monitoring with ATmega2560, MCP9808, and Zephyr OS: Device Driver Not Found
hey guys who has implemented real-time temperature monitoring with an ATmega2560 microcontroller? I'm using a MCP9808 sensor, and Zephyr OS, and currently trying to fix the sensor initialization error. Despite configuring the I2C peripheral in Zephyr, integrating the MCP9808 sensor, and writing code to read sensor data, I encounter the error "Sensor: Device driver not found." Here's my code:
If the implementation is successful, the output should display the current temperature readings from the MCP9808 sensor.
Solution:Jump to solution
make sure you've enabled the MCP9808 driver in your Zephyr configuration. Add these lines to your prj.conf file:
CopyCONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_MCP9808=y...
7 Replies
Is that sensor defined in your board device tree?
Also I see you are passing in i2c1 into the node identifier, if I recall correctly you should be passing in your sensor definition.
Also
device_get_binding
fails if a device is not initialised successfully, you may want to check that.Oh alright I see 😊 @ZacckOsiemo I had worked it out earlier and I tried just what you recommended 😁
Hope it worked!
Solution
make sure you've enabled the MCP9808 driver in your Zephyr configuration. Add these lines to your prj.conf file:
CopyCONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_MCP9808=y
Thanks @wafa_ath I checked the driver again and was able to get a lead on it 😁