(SOLVED) Connect to local blynk server on raspberry

Hi all,

I read a lot and get well done with the introductions and community. So I managed to installe blynk on my raspberry and connect to the cloud. After that I installed local server on raspberry and this works as well quite well.
Thanks for this at all.

In the instruction of local server under APP and Sketch changes is written:
"Change your rasp PI javascript from

var blynk = new Blynk.Blynk(AUTH, options = {connector : new Blynk.TcpClient()});


var blynk = new Blynk.Blynk(AUTH, options= {addr:"xxx.xxx.xxx.xxx"});

But I do not really know in which file I have to do the changes, so I think I have to do the changes in the file I call when I open client like discriped in the instruction of Raspberry client on Blynk homepage under docs:

Raspberry Pi
4. Run Blynk test script (put your auth token):

blynk-client 715f8cafe95f4a91bae319d0376caa8c

So I opened blynk-client.js and see that ther is written:

var blynk = new Blynk.Blynk(process.argv[2]);

It is not as written in the instruction but I changed it into line above with IP from my local server but it did not work.

So can anyone please give me a hint which file I have to change. Or do I already had the right file what schould I change to connect to local server?

I hope I have done everythink right in posting, it’s my first post at all. So please let me knwo if I have to change something.

Thanks and best

Hello and welcome to Blynk.

Having often struggled to get Blynk working on RPi, I am not really the most knowledgeable on the topic, but here i go :slight_smile:

Using @vshymanskyy excellent instructions >here<, I installed the Node based Client, however, I was unable to run Blynk using the Global install method… so I went with the alternative method, wherein I use this command, to connect to my Local Server via TCP, within each actual script that I would create: var blynk = new Blynk.Blynk(AUTH, options = { connector : new Blynk.TcpClient( options = { addr:"xxx.xxx.xxx.xxx", port:8442 } ) });

An example of this is here: (SOLVED - but still open for suggestions) Java + Blynk questions regarding my test script on RPi (Node.js) - Includes real buttons and LEDs

The other method you asked about, in which you would enter the start command in the CLI: blynk-client AUTH I believe requires changes to the blynk-node.js script, wherever that resides in the Global install method.

For example, in the file there are at least two places that look like this (at least one for TCP and one for SSL):

exports.TcpClient = function(options) {
  var self = this;

  var options = options || {};
  self.addr = options.addr || "blynk-cloud.com";
  self.port = options.port || 8442;

I “think” this is where you would replace blynk-cloud.com with your server IP.

I suspect there is a way of adding options to the CLI command… something like blynk-client --IP --port etc. but someone else will have to confirm this and show proper syntax, if it is even possible.

Hi Gunner,

thanks for quick reply. I will try and let you know. For the first view there are a lot of new informations/ views for me, thanks for this.

Best Alex

Hi Gunner,

just to let you know. It works fine with your help. Thanks a lot. Great to have you here.

So this topic could be closed. Or should I have to do something for closing?


I have marked it as Solved. Glad to have helped!