Hello every one, its me again with somekind of untypical question
You know, i got a PC with WOL function in my home network…
Always i use SSH client to connect to home server and execute WOL.sh(just to send magic packet) to launch PC
Is there any way to do it with blynk, runned on home server?
Some event triggered in app(for example button is pressed) and blynk server execute WOL.sh for me…
(any way it runs under root)
Hello. Yes. This is possible. There are few options :
WebHooks. You type something like “http://localhost:8080/doStuff” in widget. You need to have small http server that will accept this url and run your script;
Java/Javascript/python/c++ client. You run client that connects to Local Blynk server. When client gets message, client runs script.
First way is to make nginx… so its not desired cause i ran apache2 and even port 8080 busy with motionjpeg_streamer)))
So can you explain Please second vairant with client…
I have to download a blynk client similar to RPi variant and compile it with??? --target raspberry??? Or???
How can I find out that client got message?(something with cron???) and how can i told client to run script?
Is it long to explain or there is some kind of manual for client comands?
the only i know to read and write something to blynk server is to use API for it…
But i think its a bad solution to make
infinity cicle with button status read, to find out whatever it pressed or not!
so, everythink suppose to be fine,
i took a sample to connect a local blynk server, just clone it from here
but then im trying to execute .js i got this:
zara@carpi:~/blynk-library-js-master/examples/nodejs$ ./client-tcp-local.js
module.js:471
throw err;
^
Error: Cannot find module ‘blynk-library’
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/home/zara/blynk-library-js-master/examples/nodejs/client-tcp-local.js:3:13)
at Module._compile (module.js:570:32)
at Object.Module._extensions…js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
why??? module is exist in binary folder! what am i doing wrong?
Well, I’d love to help but I don’t know the first thing about JS. It’s so different from C++ in syntaxis (e.g. grammar). I can program well enough, but I’m having trouble with the JS grammar.
In the example you provided I think the script prints the date to something attached on Vpin 9 on your dashboard. Did you try making a labeled value widget on v9?