I am trying to invoke the shell script into one of the my legato application which includes i2ctools commands i.e i2cget and i2cset .
if i run the script independently on the board it is working fine and giving the results but i am unable to invoke and execute same script into my legato application. It gives an error stating that i2cget not found . Kindly let me know the necessary steps to be taken care in order to make this work.
using popen()
please find the attached script which is being used for the application.
We have verified in Firmware release 10.1(legato version 18.06.3) by running the i2cget command by using “popen”, command is working fine without any issues. We have used existing “wifiWebApp” application where sandboxed is false.
Below are the logs for your reference:
Jan 6 04:15:33 swi-mdm9x28-wp user.info Legato: INFO | wifiWebAp[1719]/wifiWebApComponent T=main | wifiWebAp.c StartWebServer() 205 | popen : i2cget -y 4 4
Jan 6 04:15:33 swi-mdm9x28-wp user.info Legato: INFO | wifiWebAp[1719]/wifiWebApComponent T=main | wifiWebAp.c StartWebServer() 208 | AFTER (command did not hang) 0x7f5827a8
Jan 6 04:15:33 swi-mdm9x28-wp user.info Legato: INFO | wifiWebAp[1719]/wifiWebApComponent T=main | wifiWebAp.c StartWebServer() 209 | I2C AFTER (command did not hang) 0x7f582868