# How to use "modprobe" command in app?

**URL:** <https://forum.legato.io/t/how-to-use-modprobe-command-in-app/6141>\
**Category:** Uncategorized\
**Created:** [March 17, 2022, 1:41am UTC](https://forum.legato.io/t/how-to-use-modprobe-command-in-app/6141 "2022-03-17T01:41:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanaporn\_y](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@tanaporn\_y](https://forum.legato.io/u/tanaporn_y)\
**Post date:** [March 17, 2022, 1:41am UTC](https://forum.legato.io/t/how-to-use-modprobe-command-in-app/6141/1 "2022-03-17T01:41:12Z")

</div>

I want to modprobe mac80211 by using app but it was error.

```auto
    system("/home/root/wf200.sh &");
	sleep(2);
    system("ifconfig wlan0 up");

```

```auto
Mar 17 10:36:54 swi-mdm9x28-wp user.err Legato: =ERR= | NAD[2034] | /home/root/wf200.sh: 
Mar 17 10:36:54 swi-mdm9x28-wp user.err Legato: =ERR= | NAD[2034] | line 1: 
Mar 17 10:36:54 swi-mdm9x28-wp user.err Legato: =ERR= | NAD[2034] | modprobe: not found
Mar 17 10:36:54 swi-mdm9x28-wp user.err Legato: =ERR= | NAD[2034] | 
Mar 17 10:36:54 swi-mdm9x28-wp user.err Legato: =ERR= | NAD[2034] | /home/root/wf200.sh: 
Mar 17 10:36:54 swi-mdm9x28-wp user.err Legato: =ERR= | NAD[2034] | line 2: 
Mar 17 10:36:54 swi-mdm9x28-wp user.err Legato: =ERR= | NAD[2034] | insmod: not found
Mar 17 10:36:54 swi-mdm9x28-wp user.err Legato: =ERR= | NAD[2034] | 
Mar 17 10:36:54 swi-mdm9x28-wp user.err Legato: =ERR= | NAD[2034] | ash: write error: Device or resource busy
Mar 17 10:36:54 swi-mdm9x28-wp user.err Legato: =ERR= | NAD[2034] | ash: write error: Device or resource busy
Mar 17 10:36:56 swi-mdm9x28-wp user.err Legato: =ERR= | NAD[2034] | sh: 
Mar 17 10:36:56 swi-mdm9x28-wp user.err Legato: =ERR= | NAD[2034] | ifconfig: not found
Mar 17 10:36:56 swi-mdm9x28-wp user.err Legato: =ERR= | NAD[2034] | 

```

How to use command in the app c file?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [March 17, 2022, 1:52am UTC](https://forum.legato.io/t/how-to-use-modprobe-command-in-app/6141/2 "2022-03-17T01:52:08Z")

</div>

how abut you change your wf200.sh to use absolute path like /sbin/modprobe?

---

<div class="post-metadata">

**Author:** ![tanaporn\_y](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@tanaporn\_y](https://forum.legato.io/u/tanaporn_y)\
**Post date:** [March 17, 2022, 2:07am UTC](https://forum.legato.io/t/how-to-use-modprobe-command-in-app/6141/3 "2022-03-17T02:07:18Z")

</div>

I had wrote it right this.

```auto
#!/bin/sh
modprobe mac80211
insmod wfx.ko
echo 13 > /sys/class/gpio/export

```

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [March 17, 2022, 2:09am UTC](https://forum.legato.io/t/how-to-use-modprobe-command-in-app/6141/4 "2022-03-17T02:09:55Z")

</div>

how about changing it to " /sbin/modprobe mac80211" and re-run the legato app?

---

<div class="post-metadata">

**Author:** ![tanaporn\_y](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@tanaporn\_y](https://forum.legato.io/u/tanaporn_y)\
**Post date:** [March 17, 2022, 2:27am UTC](https://forum.legato.io/t/how-to-use-modprobe-command-in-app/6141/5 "2022-03-17T02:27:24Z")

</div>

got this:

 ![Screenshot from 2022-03-17 11-24-59](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/2X/1/10e19cbebaf728dcc1c6a6a2673a14095c975e7e.png)

I have added this line and got this

```auto
PATH=/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin;

```

 ![Screenshot from 2022-03-17 11-25-16](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/2X/2/2c45c331b5262a5ee7345d224392ce4c08aa49ef.png)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [March 17, 2022, 2:30am UTC](https://forum.legato.io/t/how-to-use-modprobe-command-in-app/6141/6 "2022-03-17T02:30:54Z")

</div>

ok, it is better, at least there is no modprobe problem
