Integrate SHT41 sensor using I2C with android application i.MX8MM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Integrate SHT41 sensor using I2C with android application i.MX8MM

569 Views
archana_verma
Contributor II

Hi,

I am trying to port custom android OS on i.MX8MM board with android 14(6.1.57 kernel). I have connected SHT41 temperature and humidity sensor through I2C interface. I want the sensor data to be displayed on an android application and run it on the board.

I have enabled the sensor from kernel and able to print the sensor data to console as there is one ASCII text file in /sys/class/hwmon/hwmon0/temp1_input. When trying to open the file I'm getting permission denied(error 13). I have enabled SeLinux policies permissive.


I also tried to open /dev/i2c-2, as the sensor driver is using I2C but again getting the same error.

So, Please help me with how can I access I2C driver and SHT41 sensor and I found on android website that we need to enable AIDL to interact with HAL layer. So how can I do it? I am a beginner to the android OS. 


https://developer.android.com/develop/background-work/services/aidl

0 Kudos
Reply
3 Replies

470 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Actually you're looking at the correct place, as developer.android webpage provides all documentation for android development on application level.

Even the link you have shared is spot on as it proivide examples of AIDL files and how it should be implemented.

Best regards/Saludos,
Aldo.

0 Kudos
Reply

445 Views
archana_verma
Contributor II
Hello @AldoG,

Thank you for you response. I'll move in the same direction but can you tell me like do we have to give some permission or enable AIDL from kernel side or just application level? Can you please give me a detailed description as I am new to this , I might me missing something ?
0 Kudos
Reply

351 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Please accept my apologize for the delayed response, please refer to the following post, I believe this does show exactly what needs to be done:
https://community.nxp.com/t5/i-MX-Processors/Adding-a-sensor-to-Android-but-HAL-doesn-t-seem-to-be/m...

Best regards/Saludos,
Aldo.

0 Kudos
Reply