[SOLVED] Raspberry loop function


in my raspberry pi code i would check if an process is already running. If not the WidgetLED should not shine.
So is there a method like the loop method on arduino? Can i check this every time i open the app on my iphone?

The only functions in this direction is the following, is there a loop possible?:

blynk.on('connect', function() {
                        console.log("Blynk ready.");

Can anybody help? Do you need more information?

In one of my projects I wanted a ‘failsafe’ at the board end, and a re assurance that all was well on the app.
My method was crude but did want I wanted.

Basically I set a value display V30 to send a request every 500mS.
(At start out two variables ‘checkCount’ and ‘lastCheck’ are zero.)
A BLYNK_READ … // every 500mS
Increments a ‘checkCount’ variable (revolves through 0-255).
virtualWrites back ‘Wifi.RSSI()’ in my case, as a visual indicator.

A separate timed event in my program effectively (could be a separate timed event [SimpleTimer] ) performs a check every 3 seconds.
This compares a lastCheck variable against the present checkCount. If all is connected and running, these two variables will differ. If they do, lastCheck is set to the checkCount and all continues. At this time I send a blank line to the value display to get a ‘blink’.
If they are equal, the program is now aware that the app is not connected and a disconnect flag is raised, so that related actions can take place.

Maybe an adaption of this will do what you need? ( I do use a local server, so maybe your check timings etc may need to be increased)

I think you should look into setInterval and setTimeout Node.js functions.