Execute external bash script on server with blynk))

Yeah, I’m getting that too. Running same sketch here on a local server. So therefor it must be our coding skills. I have no idea how to proceed with this. V1 works fine when pushing a button, not nothing on V9. Sorry …

For my clock from the RPi server it shows 23:28:07 using getHours(), getMinutes(), getSeconds() and some formatting for minutes and seconds less than 10 etc.

We are using a Labeled Value display widget with a frequency of 1 sec and label /pin/

There’s a bug in the server that’s recently been fixed that actually updates the seconds at 2 second intervals.

You are correct. The Label should be /pin/ it works too now here :slight_smile:

Its me again…
Did you manage to do blynk autostart via rc.local?

Hello again… Did you manage to launch blynk in rc.local?

I put it to detached screen and it works
but then script stops to launch(((

const spawn = require(‘child_process’).spawn;
maybe some full path requed here?

@zara are you referring to a Blynk server or a Blynk client?

my OPiZero is a blynk client i use a code above to launch client and to execute script in homefolder

Id like to launch client automaticly via rc.local

I use your code lines to execute my script… and it runs via V1 widget in APP, but only if i start blynk client manualy
(not via rc.local on boot)

My script is simple now - just to detect workability
echo 111 >> try.txt


/bin/su root -c /bin/bash /home/zara/blynk.sh
OnOff mode
Connecting to TCP: 8442
Blynk ready.
V1: [ ‘1’ ]
V1: [ ‘0’ ]
V1: [ ‘1’ ]
V1: [ ‘0’ ]
V1: [ ‘1’ ]
V1: [ ‘0’ ]
V1: [ ‘1’ ]
V1: [ ‘0’ ]

I’m getting confused.

Are you wanting to use a bash script to run the Blynk client or run a bash script from the Blynk client?

He wants to auto start the blynk script I think. No idea how to fix that with NodeJS. I think in the regular way.

But what you can do @zara is put a & behind the command line, e.g.:

/home/zara/try.sh &

This will spawn the proces to the background. If you press enter you can continue the work and the script will still be running. I’m not sure if it will be running when you logout the terminal session, but you can check that quick enough :slight_smile:

The only way to reliably start a node js file, i.e. the Blynk client, on bootup is with the forever and forever-service utilities.

I just want running by default on boot blynk-client… which can execute external script)))

You have both now.

Pleace))))) can you provide some
forver-service utilities usage)))

forever-service just google it.

That one?

That’s the one.

But i managed to start it via rc.local and detached screen with 5 seconds sleep, as u can see in rc.local log
Its only did not launch external script…
just to make it launch /home/zara/try.sh

Please explain this in full as I have no idea what a detached screen is.

screen is a linux utility to emulate different virtual desktops, but then with terminals. E.g. you can start a program on screen 1 when you are at home and you can take over that terminal at work :slight_smile: