[SOLVED] How to configure Blynk server?

Hi guys, I recently met this app and I was reading the guide on github to run the server, but I can not make it work, I do not understand what to do, I give me a hand? I downloaded the source code…and now? Thank you for help :smile:

2 Likes

@IstuffMilano

Hi, you don’t have to download a source code in order to run server. We provide ready builds. You need to download server-0.6.jar. And just run it in your envirnoment.

java -jar server-0.6.jar

Let me know if you have some troubles here.

I did the test, but I get this error:

Exception in thread “main” java.lang.NullPointerException
at java.net.URI$Parser.parse(Unknown Source)
at java.net.URI.(Unknown Source)
at java.net.URI.create(Unknown Source)
at cc.blynk.server.notifications.GCMWrapper.(GCMWrapper.java:33)
at cc.blynk.server.workers.notifications.NotificationsProcessor.(N
otificationsProcessor.java:43)
at cc.blynk.server.ServerLauncher.(ServerLauncher.java:70)
at cc.blynk.server.ServerLauncher.main(ServerLauncher.java:95)

How do you solve?

@IstuffMilano

Oops, it is a bug. I just fixed it. Please download it again and repeat.

java -jar server-0.6.1.jar

This will help. And thank you for reporting!

Ok, now when I run it gives no error, but it is normal that once you press enter remains the blinking cursor?

C:\Users\xxx\Desktop>java -jar server-0.6.1.jar
_

How do I see if it works?
I have another question, I downloaded the Blynk app on iPhone, I logged on, created a new project and copied the auth code in the Arduino project, when executed the code when I click “Play” from the iPhone tells me that Arduino is offline, why? What is wrong? (Arduino is connected via USB). I get on the terminal of Arduino code Auth loop, I think is correct. Can you help me, please? Thanks :smile:

@IstuffMilano

but it is normal that once you press enter remains the blinking cursor?

Yes, all output is in logs folder in blynk.log file in same folder where jar file is. But you could change this if needed. See “advanced” section of github documentation.

I logged on

To local server?

I logged on

No, to Blynk app on iPhone.
How to connect to local server with Blynk app?

@IstuffMilano

You have to press on that icon :

And in sketch :

Blynk.begin(auth, “you_host”);

or

Blynk.begin(auth, IPAddress(xxx,xxx,xxx,xxx));

or in case of USB when running blynk-ser.sh

./blynk-ser.sh -s server_address

I also updated doc on github.

Regarding

iPhone tells me that Arduino is offline, why

Most probably you did something wrong during USB setup and you board is not online.

> And in sketch :

>     Blynk.begin(auth, "you_host");

> or

>     Blynk.begin(auth, IPAddress(xxx,xxx,xxx,xxx));

This I have to use even though it is connected plot usb? because if I compile it always fails.
The IP address to be entered is that of the local server or the iPhone?

Most probably you did something wrong during USB setup and you board is not online.

But it has to be connected via WiFi or eth?

This I have to use even though it is connected plot usb?

No, I edited my comment.

or in case of USB when running blynk-ser.sh
./blynk-ser.sh -s server_address

Regarding

The IP address to be entered is that of the local server or the iPhone?

Local server.

But it has to be connected via WiFi or eth?

USB also ok.

I get this on terminal:

[0] Blynk v0.2.2
[0] Getting IP…

it’s normal?

If I wanted to use instead cloud.blynk.cc? how should I do? I need to sign the app?

Yeap.

Sorry, I didn’t understand what do you mean. Could you please more specific?

Sorry, I didn’t understand what do you mean. Could you please more specific?

If instead of using the local server I want to use your server? I think cloud.blynk.cc, or not it?

@IstuffMilano

Yeap, exactly.

Nothing I can not make it work

To recap:

  • The Port Arduino is COM 3
  1. fill Arduino this code:

    #define BLYNK_PRINT Serial // Enables Serial Monitor
    #include <SPI.h>
    #include <Ethernet.h>
    #include <BlynkSimpleEthernet.h>

    char auth = “My TOKEN”;

    void setup()
    {
    Serial.begin(9600);
    Blynk.begin(auth);
    }

    void loop()
    {
    Blynk.run();
    }

  2. The end returns:

[0] Blynk v0.2.2-beta
[0] Getting IP…
[63415] DHCP Failed!
[1] Blynk v0.2.2-beta
[1] Getting IP…

without finding IP, go in loop

  1. I run “java -jar server-0.6.1.jar”

  2. I run “blink-ser.bat” and return:

Connecting device at COM1 to cloud.blynk.cc:8442…
OpenC0C(“\.\COM1”, baud=9600, data=8, parity=no, stop=1) - OK
Connect(“cloud.blynk.cc”, “8442”) - OK
InOut() START
DSR is OFF

  1. I open the app, I click on Play, but returns Arduino is offline

What is wrong?

Those exception says your router not able to give an IP address for your arduino. Maybe you have some IP limit or your router not allowed to give IP for new devices or DCHP disabled. Please check your router settings or try to give a static IP for your arduino.

DHCP is enabled and there is no limitation to, do not understand why not get the ip address.
how do I assign an IP address via a USB connection?

Ok, I finally solved :slight_smile: I just wanted to know if it dispobile guidance of the various commands and how to use them :slight_smile: thanks

@IstuffMilano

Could you please tell what did you do in order to resolve your issue?

guidance of the various commands and how to use them smile thanks

Do you mean server commands?

Im having a stupid moment, what devices IP do you use in:
Blynk.begin(auth, IPAddress(x,x,x,x))