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

[SOLVED] Blynk Server

Hi guys, i am Antonio and i’m working to Blynk Server for my Orange Pi PC (an ARM miniPc).
The operating system on it is Linux based, it is Armbian 5.10.
I have updated the Java JDK to the 1.8.0 version.
Following the docs.blynk.cc guide, i have downloaded the file “server-0.16.1.jar” and put in “/home/User/Blynk”, I have created the mail.properties and the server.properties files, after that i have launched the Blynk Server using the command java -jar /home/User/Blynk/server-0.16.1.jar -dataFolder /path and i can login on LAN using my phone without problems.
I wanted connect to my blynk server, also when i’m not at home, then i have created a www.noip.com account, then i have generated an host, after that i have make a static IP only for my OrangePi and opened port from 8441 to 8443 on my router for it. After that, i can connect by blynk app, to my blynk server, using “mynoiphost.ddns.net” and “8443” like port. Now there is a problem, reading the log file, i’m using embedded certificate and it suggest me to generate my own certificate. I have done several attempts without solution. I have used commands to “Create Key, Create new cert request, Generate self-signed request and Convert server.key to PKCS#8 private key file in PEM format” then inserted the server.csr and the server.pem into the “server.properties” file. But logs say me that are not valid and i have to generate my own certificates. Any suggestions? Thanks

Did you follow http://docs.blynk.cc/#blynk-server-advanced-local-server-setup-generate-ssl-certificates ? Because that works fine for me. There is also a thread somewhere about free certificates (Let’s Encrypt) and that works, after a bit of fiddling, too :slight_smile:

Hi Lichtsignaal and thanks for your time.
Do you mean execute this commands?
openssl genrsa -out server.key 2048
openssl req -new -out server.csr -key server.key
openssl x509 -req -days 1825 -in server.csr -signkey server.key -out server.crt
openssl pkcs8 -topk8 -inform PEM -outform PEM -in server.key -out server.pem

Yes i have done it. I have this certificates in the same folder of server-0.16.1.jar
But in the blynk.log file it say me that certificates are incorrect

It should be server.crt not server.csr

Yes, Sorry, my mistake. I have added server.crt in server.properties

On docs.blynk.cc, in “Advanced local server setup” paragraph, and in the row “See how to generate self-signed certificates here”, if i clic on “here” it do nothing? Can you try that?

@tannox91 you are right. Fixed.

With this command openssl pkcs8 -topk8 -inform PEM -outform PEM -in server.key -out server.pem it ask me an Encryption password, i have to use a new one password? Where i’ll have to use this password?

You have to put it in the server.properties file.

Ok, so i have used this command:

openssl req -x509 -nodes -days 1825 -newkey rsa:2048 -keyout server.key -out server.crt
openssl pkcs8 -topk8 -inform PEM -outform PEM -in server.key -out server.pem

In the last one command in encryption password i insert, for example “HelloWorld”
After that i have modified server.properties, now i have:

server.ssl.cert= ./server.crt
server.ssl.key= ./server.pem
server.ssl.key.pass= HelloWorld

Is that correct?

I have done everything from zero. And always the same problem, then i tried to use a older version of server.jar.
So, with 0.16.1 and 0.16.0 versions, the server start but blynk.log show that there are problem with certificates.
But with 0.15.4, 0.15.3, 0.15.1 and 0.9.1 everything is ok, and blynk.log show me one warning relative to client certificate.

This is the blynk.log of 0.16.* versions

15:27:19.556 INFO  - Using data dir '/path'
15:27:19.708 INFO  - Initializing mail transport. Username : myemail@gmail.com. SMTP host : smtp.gmail.com:587
15:27:20.218 INFO  - Plain tcp/ip hardware server port 8442.
15:27:21.118 INFO  - SSL hardware port 8441.
15:27:21.128 WARN  - Found server certificates but no client certificate for '/home/User/Blynk' path. Using one way ssl.
15:27:21.139 INFO  - Application server port 8443.
15:27:21.198 INFO  - HTTP API port 8080.
15:27:21.212 WARN  - ATTENTION. Certificate /home/User/Blynk and key /home/User/Blynk paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
15:27:21.448 INFO  - HTTPS API port 9443.
15:27:21.460 WARN  - ATTENTION. Certificate /home/User/Blynk and key /home/User/Blynk paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
15:27:21.623 INFO  - HTTPS admin UI port 7443.
15:27:21.624 INFO  - Web Sockets port 8082.
15:27:21.624 WARN  - ATTENTION. Certificate /home/User/Blynk and key /home/User/Blynk paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
15:27:21.719 INFO  - Web SSL Sockets port 8081.

This is the blynk.log of 0.15.* versions and 0.9.1

15:21:21.481 INFO  - Using data dir '/path'
15:21:21.633 INFO  - Initializing mail transport. Username : myemail@gmail.com. SMTP host : smtp.gmail.com:587
15:21:22.191 INFO  - Plain tcp/ip hardware server port 8442.
15:21:23.115 INFO  - SSL hardware port 8441.
15:21:23.119 WARN  - Found server certificates but no client certificate for '/home/User/Blynk' path. Using one way ssl.
15:21:23.132 INFO  - Application server port 8443.
15:21:23.155 INFO  - HTTP API port 8080.
15:21:23.166 INFO  - HTTPS API port 9443.
15:21:23.187 INFO  - HTTPS admin UI port 7443.
15:21:23.220 INFO  - HTTP reset pass port 7444.
15:21:23.221 INFO  - Web Sockets port 8082.
15:21:23.229 INFO  - Web SSL Sockets port 8081.

@tannox91 nice catch. You may ignore that for now. In next version it will be fixed.

So solution for who like me want your own certificate is to use older version of server.jar than 0.16.*

Another question, is it normal that energy balance is 2000 on local server, and 4000 on Blynk server?

Yes.

No. You can use 0.16.1. As I said you may ignore those warning.

Great! I misunderstood, I thought to skipping last version. So i change title of discussion.
However, can i know why there is this difference of energy balance between local server and Blynk server?
Thanks Dmitriy and thanks Lichtsignaal for your helps and time.

Because local server if fully local and not related in any way with Blynk Cloud :wink:?

Understand, thanks for everything Dmitriy :relaxed:

@Dmitriy are you sure it is 2K for local server and 4K for Blynk server as one of my contacts set up an account and they received 2K with the Blynk server, which is what I thought they should receive?

@Costas 2k is correct. I think @tannox91 either paid or get some bonus from us :wink: