Hi guys,
i wrote a small app to communicate to a Beckhoff buscoupler via TCP/IP. This device will set outputs and read inputs.
That app works nicely if i logon to the router and start it. It will run in an infinity loop (request input state, do logic, send TCP/IP string to set the outputs) and then i sleep(1) before i jump back to the beginning of the loop to start again.
At the beginning i used a cron-job (without the infinity loop), but the problem is, the cronjob can only run every 1 min.
So now, i thought about to make a script that calls the program during start.
like this:
root@OpenWrt:/etc/init.d# vi helloworld
#!/bin/sh /etc/rc.common
START=50
STOP=50
EXTRA_COMMANDS="custom"
EXTRA_HELP="TEST TEST START/STOP HELLOWORLD"
start() {
echo START
cd /bin
/bin/helloworld
}
stop(){
echo stop
kill helloworld
}
custom(){
echo custom funtion
}
~
But i am scared now, because the MY programm will run in that loop and will never come out of it again. Will the router still boot up?
That is the last piece in the puzzle for me
thanks a lot in advance
Stefan