first at all, I list the environment below.
Hardware : Raspberry Pi Zero 2w
OS:Raspberry Pi OS (Legacy) Lite
USED Interface : UART, I2C
The scenario is I wrote a UART server in C to receive commands for executing some outer C program which will access the I2C bus device.
The issue is the outer program can be successfully executed alone for access I2C device, this means there’s nothing wrong on my hardware, or Linux device file permission. However, what weird is if the outer program is triggered from UART server, it can’t work as well.
In UART server, the key trigger outer C program part is written as
system( "shell script" )
What I ever tried includes pull out the outer program line from shell script, the code is like below, but still wrong reaction.
system( "full outer program path" )
Following points are also checked
- UART Server is started with the account which I executed the outer program successfully (permission issue)
- In UART Server, there is no access about I2C device file, only few file descriptor are opened for log.
- I’m sure either shell script or outer command was ever triggered well, because I saw the error message on the terminal.
Anyone has any clues or suggestions that I can check ? Appreciate
Kindly Regards.
Min
Min from TW is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.