# WP7608 Legato Application: Invoking shell script with i2ctools

**URL:** <https://forum.legato.io/t/wp7608-legato-application-invoking-shell-script-with-i2ctools/3845>\
**Category:** Legato Application Framework\
**Created:** [November 5, 2018, 1:26pm UTC](https://forum.legato.io/t/wp7608-legato-application-invoking-shell-script-with-i2ctools/3845 "2018-11-05T13:26:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![karthikR](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@karthikR](https://forum.legato.io/u/karthikR)\
**Post date:** [November 5, 2018, 1:26pm UTC](https://forum.legato.io/t/wp7608-legato-application-invoking-shell-script-with-i2ctools/3845/1 "2018-11-05T13:26:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Manukumar](https://avatars.discourse-cdn.com/v4/letter/m/eada6e/32.png) [@Manukumar](https://forum.legato.io/u/Manukumar)\
**Post date:** [November 14, 2018, 12:19pm UTC](https://forum.legato.io/t/wp7608-legato-application-invoking-shell-script-with-i2ctools/3845/2 "2018-11-14T12:19:12Z")

</div>

Not able to find the script. please share the script and also legato application that you have executed with that script?

---

<div class="post-metadata">

**Author:** ![CoRfr](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/corfr/32/69_2.png) [@CoRfr](https://forum.legato.io/u/CoRfr)\
**Post date:** [November 14, 2018, 4:12pm UTC](https://forum.legato.io/t/wp7608-legato-application-invoking-shell-script-with-i2ctools/3845/3 "2018-11-14T16:12:52Z")

</div>

Hi @karthikR, I wonder if you’re running your application sandboxed.

In this case you would need to mount i2cget, eventual dependencies (libs and devices) to be able to run it.

---

<div class="post-metadata">

**Author:** ![Manukumar](https://avatars.discourse-cdn.com/v4/letter/m/eada6e/32.png) [@Manukumar](https://forum.legato.io/u/Manukumar)\
**Post date:** [November 15, 2018, 10:48am UTC](https://forum.legato.io/t/wp7608-legato-application-invoking-shell-script-with-i2ctools/3845/4 "2018-11-15T10:48:33Z")

</div>

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

With which firmware version you are trying?
