BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

I can't connect my raspberry with blynk by server local

I can connect my raspberry with blynk on cloud server with this :
export PATH=$PATH:/opt/nodejs/bin/
unset NODE_PATH
blynk-client YourAuthToken

BUT I CAN’T WITH LOCAL SERVER

Looks like you are using NodeJS?

To connect on your local server with node.js use this code :

var AUTH = 'xxxxxxxxxxxxxxxxxxxx';    
var blynk = new Blynk.Blynk(AUTH, options = {
    connector: new Blynk.TcpClient(options = {
        addr: "127.0.0.1",
        port: 8080
      })
  });

** Change the “addr” to your local IP !!

1 Like

And where i put this code pls ?

In your RPi’s NodeJS sketch of course… :stuck_out_tongue_winking_eye:

Perhaps you should check out that link I provided above, which contains various examples, including the Local Server one… And then follow those internal links to the NodeJS library and look at those examples as well.

Unless you are NOT using NodeJS… in which case you answer my question with what you are using instead.

A post was split to a new topic: Every time i loose internet connection the door goes up