I'm unable connect raspberry pi client to local server

I’m really confused on this one. I’ve got the local server running on my Raspberry pi which I’ve tested successfully with a NodeMCU ESP8266. My Raspberry pi client is setup to connect to the blynk cloud server and all works well but I just can’t figure out how to have it connect to my local server instead.

I keep trying to understand the steps below and have no idea where to change that option.

   Change your rasp PI javascript from

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

I have been going at it for many hours but I just can’t figure it out. Any help will be greatly appreciated.

@Gunner do you have the “secret” syntax to hand?

I’m sorry but I don’t understand your question?

@malvar the question was directed to @Gunner as I know he does quite a bit of work with Pi’s. I haven’t used mine for a couple of months but if he doesn’t provide the fix I’ll dig out my notes.

1 Like

@malvar I use this in my JS client sketch.

var AUTH = '05efcb6a6xxxxxxxxxx9eab9612';

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

Thank you Gunner but where do I incorporate or add those lines of code to? Which file do I modify?

Umm, Well then, that was a strange question to ask in the OP if you didn’t know what to do with the answer :stuck_out_tongue_winking_eye:

Those commands go in your main JavaScript sketch. In the Blynk example, it is called index.js

http://help.blynk.cc/how-to-connect-different-hardware-with-blynk/raspberry-pi/how-to-install-nodejs-library-on-linux

I’m sorry I’m still having a hard time wrapping my head around all this and that makes it difficult to ask the right questions. Thank you I’ll try this tonight.
Thank you for the quick replies.

After a few hours I finally got it to work thanks to your help also now I understand so much more on how Java, Blynk, and Raspberry Pi work together.
Thank you again.

2 Likes