# How to execute program automatically in fx30

**URL:** <https://forum.legato.io/t/how-to-execute-program-automatically-in-fx30/6000>\
**Category:** Uncategorized\
**Created:** [October 15, 2021, 2:01am UTC](https://forum.legato.io/t/how-to-execute-program-automatically-in-fx30/6000 "2021-10-15T02:01:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![12214](https://avatars.discourse-cdn.com/v4/letter/1/a587f6/32.png) [@12214](https://forum.legato.io/u/12214)\
**Post date:** [October 15, 2021, 2:01am UTC](https://forum.legato.io/t/how-to-execute-program-automatically-in-fx30/6000/1 "2021-10-15T02:01:53Z")

</div>

Hi Sierra team,

We want to use fx30 as a router.  
We think below procedure.

1. fx30 power on
2. confirm to attach to the base station(like +CEREG:1)
3. app runProc modemDemo send --exe=send – 1234567 “Online”

We want to be executed #2 and #3 automatically if fx30 after #1.  
In other words, when control fx30 using command, we don’t use Host PC.

Could you tell us the way or command that confirm to attach to the base station without using the cm command? We plans to use fx30 in the field, so we can not use cm command for evaluation purposes.

> > [cm - Legato Docs](https://docs.legato.io/latest/toolsTarget_cm.html)

Please tell us the way execute #2 and #3 automatically in fx30.

Thank you.

---

<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:** [October 15, 2021, 2:35am UTC](https://forum.legato.io/t/how-to-execute-program-automatically-in-fx30/6000/2 "2021-10-15T02:35:24Z")

</div>

you can get the network registration status by :  
`app runProc modemDemo1 send --exe=send -- 1234567 "Status"`

So you should modify the modemDemo application

---

<div class="post-metadata">

**Author:** ![12214](https://avatars.discourse-cdn.com/v4/letter/1/a587f6/32.png) [@12214](https://forum.legato.io/u/12214)\
**Post date:** [October 15, 2021, 4:40am UTC](https://forum.legato.io/t/how-to-execute-program-automatically-in-fx30/6000/3 "2021-10-15T04:40:13Z")

</div>

Hi jyijyi,

Thank you for answering.

> > So you should modify the modemDemo application

Please tell us the specific procedure.  
We want to send “app runProc modemDemo1 send --exe=send – 1234567 “Status””.

Could you tell us how to write the code?

Thank you

---

<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:** [October 15, 2021, 5:13am UTC](https://forum.legato.io/t/how-to-execute-program-automatically-in-fx30/6000/4 "2021-10-15T05:13:29Z")

</div>

I think you need to modify the source file here:

> <https://github.com/legatoproject/legato-af/blob/master/apps/sample/modemDemo/demoComponent/demo.c>
