@Dmytro as far as I know the D1 Mini doesn’t have a NodeJS implementation.
Set the Pi up as a client in addition to it being a server. Your D1 can use the Bridge widget to interface with the client on the Pi. The client can then call any child_process on the Pi that you can call as if you were issuing the commands via the console.
You could also look at shelljs as an alternative to child_process.
I understand that after installing Blynk library and Node JS to RPI, I need the file blynkclient.sh with this content:
#! /usr/bin/env node
var Blynk=require('/usr/lib/node_modules/blynk-library/');
const spawn=require('child_process').spawn;
var AUTH= 'my token';
var blynk= new Blynk.Blynk (AUTH, options={
connector : new.Blynk.TcpClient (options={ addr: "my server IP", port : "my server's port"})
});
var v1= new blynk.Virtual pin (1);
v1.on ('write', function (param) {
const sh=spawn('/bin/sh', ['/home/pi/player.sh']);
});
If you can get the data in text/string form, then you should be able to send it to the Widget with the normal lcd.print(x, y, "Your Message"); command. Note, that the LCD does not support scrolling or linefeed, so perhaps sending to the terminal instead.
That’s clear.
And what about “lcd. print” in Node JS? Is the code look different?
Obviously I can’t get what I want simply insert bash command in code.
Guess I need to take this song info into separate text file and then "lcd.print (x,y, “/home/pi/file with text.h”);
…or something else…
I know enough basic to build a semi decent project with a bit of interfacing to the underlying OS but really the coding is down to you from the examples available.