[SOLVED] Local Blynk Server on BeagleBone

Please find the solutions for the issues I’ve faced with the Blynk server running on BeagleBone. I hope this summary will help other users!

  • Blynk Server Launch Fails

Blynk server launch fails if one port is already used by another process. In my case, Apache was using port 8080.

To solve this, create on the Blynk folder a file called server.properties and add

http.port=8181

  • Connection to admin Website Fails

Connection to the admin page of the local Blynk server in a BeagleBone failed.

Like Chrome and Safari, Firefox first refused to connect but provided more information: The certificate is not trusted because it is self-signed and then asked me to add an exception.

If the browser suggests to add an exception, accept. Otherwise, generate a not self-signed certificate.

  • No Prompt on Client

​The Blynk client launched by java -jar client-0.15.3.jar -mode app -host 192.168.1.171 -port 8443 doesn’t display any prompt.


After my successful implementation of Private IoT with Blynk on Local Server also posted at Hackster.io with Blynk server-0.8.0 on a BeagleBone, I wanted to update to release server-0.15.3.

I’ve already gone through those threads

but I’m still facing an issue.

Server ports are busy. Most probably server already launched. See /root/Blynk/./logs for more info.

I’ve followed the same Quick local server setup on Raspberry PI procedure.

Here are some details.

root@beaglebonewhite:~ # uname -a
Linux beaglebonewhite 3.8.13-bone50 #1 SMP Tue May 13 13:24:52 UTC 2014 armv7l GNU/Linux

root@beaglebonewhite:~ # java -version
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) Client VM (build 25.77-b03, mixed mode)

root@beaglebonewhite:~ # cd Blynk

root@beaglebonewhite:~/Blynk # java -jar server-0.15.3.jar -dataFolder ~/Blynk 
Server ports are busy. Most probably server already launched. See /root/Blynk/./logs for more info.
^C

Log file

root@beaglebonewhite:~/Blynk # cat /root/Blynk/./logs/blynk.log 
15:56:42.254 INFO  - Using data dir '/root/Blynk'
15:56:46.599 ERROR - Error parsing file '/root/Blynk/server.properties'.
15:56:46.602 ERROR - Error parsing file '/root/Blynk/server-0.15.3.jar'.
15:56:46.609 ERROR - Error parsing file '/root/Blynk/client-0.15.3.jar'.
15:56:47.661 INFO  - Initializing mail transport. Username : example@gmail.com. SMTP host : smtp.gmail.com:587
15:56:52.773 INFO  - Plain tcp/ip hardware server port 8442.
15:56:52.806 WARN  - ATTENTION. Certificate /root/Blynk and key /root/Blynk paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
15:56:57.996 INFO  - SSL hardware port 8441.
15:56:58.045 WARN  - ATTENTION. Server certificate paths cert : '/root/Blynk', key : '/root/Blynk' - not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
15:56:59.759 INFO  - Application server port 8443.
15:57:00.055 INFO  - HTTP API port 8080.
15:57:00.121 WARN  - ATTENTION. Certificate /root/Blynk and key /root/Blynk paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
15:57:02.998 INFO  - HTTPS API port 9443.
15:57:03.214 WARN  - ATTENTION. Certificate /root/Blynk and key /root/Blynk paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
15:57:05.498 INFO  - HTTPS admin UI port 7443.
15:57:05.857 INFO  - HTTP reset pass port 7444.
15:57:05.867 INFO  - Web Sockets port 8082.
15:57:05.877 WARN  - ATTENTION. Certificate /root/Blynk and key /root/Blynk paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
15:57:07.633 INFO  - Web SSL Sockets port 8081.
15:57:08.576 ERROR - Error initializing HTTP API, port 8080
java.net.BindException: Address already in use
	at sun.nio.ch.Net.bind0(Native Method)
	at sun.nio.ch.Net.bind(Net.java:433)
	at sun.nio.ch.Net.bind(Net.java:425)
	at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
	at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
	at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:125)
	at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:498)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1271)
	at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:413)
	at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:399)
	at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:1019)
	at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:198)
	at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:349)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:374)
	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
	at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
	at java.lang.Thread.run(Thread.java:745)

Ports used

root@beaglebonewhite:~/Blynk # netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      862/sshd        
tcp        0      0 127.0.0.1:3350          0.0.0.0:*               LISTEN      850/xrdp-sesman 
tcp        0      0 0.0.0.0:3389            0.0.0.0:*               LISTEN      830/xrdp        
tcp6       0      0 :::22                   :::*                    LISTEN      862/sshd        
tcp6       0      0 :::3000                 :::*                    LISTEN      1/systemd       
tcp6       0      0 :::8080                 :::*                    LISTEN      896/apache2     
tcp6       0      0 :::80                   :::*                    LISTEN      1/systemd       
udp        0      0 0.0.0.0:57818           0.0.0.0:*                           598/avahi-daemon: r
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           598/avahi-daemon: r
udp        0      0 0.0.0.0:67              0.0.0.0:*                           1017/udhcpd     
udp        0      0 0.0.0.0:68              0.0.0.0:*                           1152/dhclient   
udp        0      0 0.0.0.0:24682           0.0.0.0:*                           1152/dhclient   
udp6       0      0 :::5353                 :::*                                598/avahi-daemon: r
udp6       0      0 :::13804                :::*                                1152/dhclient   
udp6       0      0 :::33009                :::*                                598/avahi-daemon: r

root@beaglebonewhite:~/Blynk # fuser 8080/tcp
8080/tcp:              896   901   902

root@beaglebonewhite:~/Blynk # ls -l /proc/896/exe
lrwxrwxrwx 1 root root 0 Apr 12 16:04 /proc/896/exe -> /usr/lib/apache2/mpm-worker/apache2

root@beaglebonewhite:~/Blynk # grep 8080 /etc/services
http-alt	8080/tcp	webcache	# WWW caching service
http-alt	8080/udp

What’s I’m going wrong? Thank you for your help!

Looks like you already have running Apache on port 8080. The simplest solution would be just to change this port in server.properties file to something else. Like 8181.

http.port=8181

Thank you for the suggestion.

Ports used are distinct now.

root@BeagleBoneWhite:~/Blynk/logs# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      751/sshd        
tcp        0      0 127.0.0.1:3350          0.0.0.0:*               LISTEN      740/xrdp-sesman 
tcp        0      0 0.0.0.0:3389            0.0.0.0:*               LISTEN      715/xrdp        
tcp6       0      0 :::8080                 :::*                    LISTEN      792/apache2     
tcp6       0      0 :::8081                 :::*                    LISTEN      1370/java       
tcp6       0      0 :::8082                 :::*                    LISTEN      1370/java       
tcp6       0      0 :::7443                 :::*                    LISTEN      1370/java       
tcp6       0      0 :::7444                 :::*                    LISTEN      1370/java       
tcp6       0      0 :::8181                 :::*                    LISTEN      1370/java       
tcp6       0      0 :::22                   :::*                    LISTEN      751/sshd        
tcp6       0      0 :::3000                 :::*                    LISTEN      1/systemd       
tcp6       0      0 :::8441                 :::*                    LISTEN      1370/java       
tcp6       0      0 :::8442                 :::*                    LISTEN      1370/java       
tcp6       0      0 :::8443                 :::*                    LISTEN      1370/java       
tcp6       0      0 :::9443                 :::*                    LISTEN      1370/java       
udp        0      0 0.0.0.0:18699           0.0.0.0:*                           1112/dhclient   
udp        0      0 0.0.0.0:67              0.0.0.0:*                           997/udhcpd      
udp        0      0 0.0.0.0:68              0.0.0.0:*                           1112/dhclient   
udp6       0      0 :::34923                :::*                                1112/dhclient   

However, connection fails, even with java -jar client-0.15.3.jar -mode app -host 192.168.1.171 -port 8443. Same for https://http://192.169.1.171:7443/admin.

Here are the logs.

  • admin.log

This log is empty.

  • blynk.log
21:38:32.293 INFO  - Using data dir '/root/Blynk'
21:38:36.624 ERROR - Error parsing file '/root/Blynk/client-0.15.3.jar'.
21:38:36.628 ERROR - Error parsing file '/root/Blynk/start_Blynk.sh'.
21:38:36.631 ERROR - Error parsing file '/root/Blynk/server-0.15.3.jar'.
21:38:36.635 ERROR - Error parsing file '/root/Blynk/server.properties'.
21:38:37.648 INFO  - Initializing mail transport. Username : example@gmail.com. SMTP host : smtp.gmail.com:587
21:38:41.229 INFO  - Plain tcp/ip hardware server port 8442.
21:38:41.258 WARN  - ATTENTION. Certificate /root/Blynk and key /root/Blynk paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
21:38:48.324 INFO  - SSL hardware port 8441.
21:38:48.374 WARN  - ATTENTION. Server certificate paths cert : '/root/Blynk', key : '/root/Blynk' - not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
21:38:50.231 INFO  - Application server port 8443.
21:38:50.501 INFO  - HTTP API port 8181.
21:38:50.574 WARN  - ATTENTION. Certificate /root/Blynk and key /root/Blynk paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
21:38:53.572 INFO  - HTTPS API port 9443.
21:38:53.775 WARN  - ATTENTION. Certificate /root/Blynk and key /root/Blynk paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
21:38:56.496 INFO  - HTTPS admin UI port 7443.
21:38:56.885 INFO  - HTTP reset pass port 7444.
21:38:56.901 INFO  - Web Sockets port 8082.
21:38:56.912 WARN  - ATTENTION. Certificate /root/Blynk and key /root/Blynk paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
21:38:59.372 INFO  - Web SSL Sockets port 8081.
  • postgres.log
2016-04-12 21:38:40.938 - No db.properties file found. Separate DB storage disabled.
  • stats.log
{
  "messages" : {
  },
}

with everything =0.

  • worker.log
21:39:01.440 - Starting saving user db.
21:39:01.446 - Saving user db finished. Modified 0 users.
21:40:01.418 - Starting saving user db.
21:40:01.419 - Saving user db finished. Modified 0 users.
21:41:01.419 - Starting saving user db.
21:41:01.423 - Saving user db finished. Modified 0 users.
21:42:01.419 - Starting saving user db.
21:42:01.423 - Saving user db finished. Modified 0 users.
21:43:01.419 - Starting saving user db.
21:43:01.422 - Saving user db finished. Modified 0 users.
21:44:01.419 - Starting saving user db.
21:44:01.422 - Saving user db finished. Modified 0 users.

Any other successful user of the local server on a BeagleBone?

Where do you run client from? If you run it from BeagleBone IP should be 127.0.0.1 I think.

I’m running the client from a PC.

In that case some firewall? Does your ports opened for outside?

No firewall.
No ports open for outside.

So you need to open them :slight_smile:. Aren’t you?

By No ports open for outside, I mean the ports aren’t available from outside the LAN, for example from Internet.

Within the LAN, the ports are available.

What I don’t understand about Blynk server is, why release 0.8.0 worked fine and newer release 0.15.3 no longer works.

Are there any major changes on the way the Blynk server operates?

No. Did you try to connect from real app, not client? Do you have latest app?

Yes, I tried from the Android app, to no avail.

The Android app is release 1.11.0.

Latest tests with the Android app throws an error on blynk.log.

Trying to reach the admin webpage at https://192.168.1.171:7443/admin fails.

Could you please post this error?

Sorry!

10:59:03.169 INFO  - GET : /
10:59:03.172 ERROR - Error resolving url. No path found. GET : /

And for the admin webpage

Same for Chrome.

This is correct =). You have to type https://192.168.1.171:7443/admin as stated in docs. Also by default admin page access is allowed only for localhost. Did you add appropriate ip to server.properties?

Thank you for your help. I checked allowed.administrator.ips=0.0.0.0/0 was included in server.properties and tried another browser, Firefox.

As with Chrome and Safari, Firefox first refused to connect but provided more information: The certificate is not trusted because it is self-signed and then asked me to add an exception.

The trick is, self-signed certificates are considered as unsafe and refused. Some browsers provide information, others not. Adding this case to the procedure would save long search for other users.

In any case, thank you very much for your help!

1 Like