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

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

can you run this command and post output?

Synology run application very slowly (1-3 min).

it returns a 1

So, I guess Blynk server is running

I can still connect to blynk server with my browser if I run the line

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

and leave Putty connected. Otherwise, no luck.

@Xandr perhaps the user for the file watchdog.sh should be root instead of admin since crontab runs at root level?

UPDATE

I installed Blynk server onto my Raspberry pi 3 and worked at first but still having a problem with my Synology drive :face_with_symbols_over_mouth:

The following code

sudo java -Djava.net.preferIPv4Stack=true -jar /volume1/blynk/server-0.29.5-java8.jar -dataFolder /volume1/blynk/blynk_data &

starts the Blynk server when connected with Putty but it won’t run when the following code is scheduled via crontab or via DSM’s Task Scheduler and, when it’s executed manually, no errors are generated.

#!/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 
java -Djava.net.preferIPv4Stack=true -jar /volume1/blynk/$server -dataFolder /volume1/blynk/blynk_data & 
fi

I appreciated if someone can direct me to a possible solution.

TIA

Try with the full PATH to your Java, like before:

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

When you logout (exit Putty) your processes receives a stop signal and are terminated. To keep them running you have to add the nohup command so the HUP (hangup) signal is ignored.

sudo nohup /PathToJava/java -jar /.../ >>/PathToLogFile/blynk.log 2>&1 &

The somewhat cryptic 2>&1 sends any messages that normally would end up in the terminal to the log file. The & at the end starts the program in the background.

@distans Solved. Thank you much!!

2 Likes