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

[Solved] Setting up Local Server on Synology NAS - port problems?

Hi,

These are the steps I followed with no avail:

  • Installed Java module using Diskstation´s Package Center
  • Created a blynk folder using Diskstation’s File Station
  • Downloaded latest Blynk server (server-0.29.5-java8.jar) and stored it into the blynk folder
  • Via PuTTY, ran the cmd: sudo java -jar /volume1/blynk/server-0.29.5-java8.jar -dataFolder /volume1/blynk/
    From which I got the following response:

“Blynk Server 0.29.6-SNAPSHOT successfully started.
All server output is stored in folder ‘/logs’ file.
Your Admin login email is admin@blynk.cc
Your Admin password is admin”

In Diskstation Firewall opened ports 8441, 8442 and 8443 and associated them to ALL protocols as destination.

But http://192.168.0.250:8443 (8441 or 8442) on local network won’t connect to the server.

I which step I went wrong?
TIA

8443 is the app port and not the http port.

Ok so, is it 7443? because it does not respond either.

If you have an Intel based Diskstation, then you can run Docker and use my Blynk Server image.

@Dmitriy Thanks for the link. Indeed it’s 9443 and being a SSL protocol needs to use https so, worked.

@Jamin Unfortunately, mine has an ARM71

@Xandr Your suggestion to modify crontab to auto start Blynk server did not work in my case. Is there a way to test the crontab file? I’m not too keen in Linux

Did you change path to your Blynk server? Also check path to java. Did you see some errors when run watchdog.sh? And be careful, sudo doesn’t work in cron/scripts when you don’t use sudo without password.

@Xandr thanks for getting back to me.

sudo java -jar /volume1/blynk/server-0.29.5-java8.jar -dataFolder /volume1/blynk/ [works]

this code fails with a command error (all my files are in the blynk folder):

#!/bin/sh
#
#Watchdog script for blynk server
#
stat=`/bin/ps -aux | /bin/grep -c "blynk"`
server="server-0.29.6.jar"
if [ $stat -lt "2" ]; then
/usr/local/bin/java -Djava.net.preferIPv4Stack=true -jar /volume1/blynk/$server -serverConfig /volume1/blynk/server.properties -dataFolder /volume1/blynk/ &
fi

How do I foud out java’s path?

Type: which java at the console

Thanks. which java returns
/var/packages/Java8/target/j2sdk-image/bin/java

So, I replaced the line in watchdog.sh from

/usr/local/bin/java -Djava.net.preferIPv4Stack=true -jar /volume1/blynk/$server -serverConfig

to

/var/packages/Java8/target/j2sdk-image/bin/java -Djava.net.preferIPv4Stack=true -jar /volume1/blynk/$server -serverConfig

but now I get a command not found error

Path you can find with command

admin@nas:~$ which java
/usr/local/bin/java

I see in your script server=“server-0.29.6.jar” for you it should be server=“server-0.29.5-java8.jar” and if you don’t use config file for your server delete -serverConfig /volume1/blynk/server.properties.

Ooops, late reply)

try /var/packages/Java8/target/j2sdk-image/bin/java -version

what do you get on screen?

openjdk version “1.8.0_151”
OpenJDK Runtime Environment (IcedTea 3.6.0) (linux-gnu build 1.8.0_151-b12)
OpenJDK Client VM (build 25.151-b12, mixed mode)

So, should the file be like this

#!/bin/sh
#
#Watchdog script for blynk server
#
stat=`/bin/ps -aux | /bin/grep -c "blynk"`
server="server-0.29.5-java8.jar"
if [ $stat -lt "2" ]; then
/var/packages/Java8/target/j2sdk-image/bin/java -Djava.net.preferIPv4Stack=true -jar /volume1/blynk/$server -dataFolder /volume1/blynk/ &
fi

because it still gives me the error.

Please provide me additional information:

  1. ls -lah /volume1/blynk/
  2. console screen with error (did you run script sudo watchdog.sh?)
  1. ls -lah /volume1/blynk/

    total 18M
    drwxrwxrwx+ 9 root root 4.0K Jan 12 12:16 .
    drwxr-xr-x 21 root root 4.0K Jan 10 14:36 …
    -rwxrwxrwx+ 1 root root 308 Jan 10 13:33 admin@blynk.cc.Blynk.user
    drwxrwxrwx+ 2 root root 4.0K Jan 10 13:33 backup
    drwxrwxrwx+ 2 Emilio users 4.0K Jan 11 19:56 blynk_data
    drwxrwxrwx+ 2 root root 4.0K Jan 10 13:32 clone
    drwxrwxrwx+ 2 root root 4.0K Jan 10 13:32 deleted
    drwxrwxrwx+ 4 root root 4.0K Jan 10 14:36 @eaDir
    -rwxrwxrwx+ 1 Emilio users 176 Jan 10 14:02 mail.properties
    drwxrwxrwx+ 3 root root 4.0K Jan 11 21:02 #recycle
    -rwxrwxrwx+ 1 admin users 17M Jan 10 12:25 server-0.29.5-java8.jar
    -rwxrwxrwx+ 1 Emilio users 4.7K Jan 11 20:10 server.properties
    drwxrwxrwx+ 6 root root 4.0K Jan 11 21:19 static
    ---------- 1 admin users 291 Jan 12 12:16 watchdog.sh

  2. console screen with error (did you run script sudo watchdog.sh?) yes

1 Like

Something strange with access rights for file watchdog.sh. Run command sudo chmod 755 watchdog.sh

chmod: cannot access ‘watchdog.sh’: No such file or directory

If you are not in dir /volume1/blynk you should cd to it or run command with full path sudo chmod 755 /volume1/blynk/watchdog.sh

:grinning: I realized a bit late I needed to put the full path.

No errors when executing sudo /volume1/blynk/watchdog.sh

but cannot get in using https://192.168.0.250:9443/admin