I’m playing with Blynk and NodeMCU dev board for a while.
As I own a Synology DS215J, I wanted to deploy a Blynk server on it.
Thanks to several posts by the community, I succeed to deploy and test it.
But I don’t really find a clear “How To”, so I decided provide a simple step-by-step guide.
I’m not a specialist but I hope this guide will help!
Don’t hesitate to add your comments or improve it.
Note : I’m facing a issue at the final step, for the one I don’t know how to fix it (see last point - 6)
1°) Setup and prepare your Synology
- Login to DSM as admin and activate SSH / Telnet (Control Panel --> Terminal & SNMP --> Terminal tab --> Activate Telnet & SSH)
- Install “Java8” package (Package Center --> Search “Java8” --> Install)
- Create a new directory “Home/Blynk” via “File Station”
2°) Prepare your files
- Via FTP, copy the 'server-x-x-x.jar" file into the new “Blynk” folder
- Copy “server.properties” and “mail.properties” into the same folder (optional)
3°) Starts the server
- On your local PC/MAC, connect to your Synology via SSH (For MAC : Terminal --> “ssh [useradmin]@[server_ip]” + input your password)
- Once connected, check if the Java version is correct (“java -version” should give you “1.8.xxx”)
- Start the Blynk server via the following command : “sudo java -jar server-0.16.4.jar” (more parameters available)
4°) Stops the server
- You can stop your Blynk server by closing the terminal window (or CTRL+C on MAC Terminal)
- If the process has been launch in a different way you can search the process ID of the Blynk server by using the following command when connected via SSH : “ps -ef | grep java” (ID = 2nd column)
- When you’ve identified the process ID, kill it via the following command : “sudo kill -9 [ID]”
5°) [Optional] : Access your Blynk server over internet
- If you need to access to your server outside your local network, you should activate and setup the “External access” (Control Panel)
- Then, you have to re-direct the ports used by Blynk server on your router
6°) [QUESTION] Launch the Blynk Server at Synology startup
Does anyone has an idea on how to schedule and launch automatically Blynk server at Synology startup ?
Since I launch the Bylnk server via SSH, when I close the terminal the Blynk server is shutting down, which is a bit painfull
- Update from @Lichtsignaal: If you start the blynk server followed by an “&” sign, it will continue to run in the background, not the best solution, but at least you can close your terminal
Thanks in advance for your inputs.
@MurrayB Hello. Cool! Thanks for sharing!
if you start the blynk server followed by an “&” sign, it will continue to run in the background, not the best solution, but at least you can close your terminal
java -jar blablabla datablabla &
@Lichtsignaal Thanks for the trick! Any idea to add the Blynk server process at the Synology startup?
I have no idea, the & trick comes from my Linux knowledge, but I have no idea about the Synology. I think there was someone else on the forum who also had this problem, but I’m not sure.
Maybe this: http://majikshoe.blogspot.nl/2014/12/starting-service-on-synology-dsm-5.html ? Not sure if it works on all Synology devices/
Have you considered using Docker in the DSM GUI? It’s very easy to setup once you know a few key steps.
Also auto restart, doesnt require SSH to start or configure.
Link to some instructions I wrote the other day: Blynk on Synology Diskstation
I have installed blynk on my synology 415+ using
the docker pinya/blynk install
provided in the above link
Things seems to be running, and I have the log files
/volume1/docker/blynk/logs$ ls -l
-rwxrwxrwx 1 root root 0 Aug 18 19:25 admin.log
-rwxrwxrwx 1 root root 1510 Aug 18 20:22 blynk.log
-rwxrwxrwx 1 root root 85 Aug 18 19:25 postgres.log
-rwxrwxrwx 1 root root 156160 Aug 18 21:32 stats.log
-rwxrwxrwx 1 root root 12544 Aug 18 21:32 worker.log
But I have no idea how to configure the users on my blynk server.
Please provide some help in a very elementary way.
Thanks, but the problem is that I dont know where is the
I am not familiar with docker, and I dont know where the install files are .
I see some @docker directory
drwx–x--x 9 root root 4096 Aug 18 14:40 @docker
but cannot access it
admin@plato:/volume1/@docker$ cd @docker
-sh: cd: @docker: No such file or directory
Sorry for that, but I need some additional help.
There is no need for accessing the server.jar file. You can access the webinterface via a browser. E.g. http://:7443/admin
I used simple watchdog script in cron (every 5 min) if it didn’t found working blynk server it will run it.
- ssh to synology as root
- create sh script
vi watchdog.sh (change java path and configs to yours, run
#Watchdog script for blynk server
stat=`/bin/ps -aux | /bin/grep -c “blynk”`
if [ $stat -lt “2” ]; then
/usr/local/bin/java -Djava.net.preferIPv4Stack=true -jar /volume1/homes/admin/$server -serverConfig /volume1/homes/admin/blynk_config/server.properties -dataFolder /volume1/homes/admin/blynk_data &
- add line to crontab
vi /etc/crontab (also change path to you watchdog script!) Be careful, use only TABs for delimiting (synology feature).
*/5 * * * * root /volume1/homes/admin/watchdog.sh >/dev/null 2>&1
p.s. - In vi for editing press
i for end press
ESC and for save and quit pres
Shift + : then write
@Xandr nice work.
Are you able to knock up a linux bash script to ping 184.108.40.206 and reboot if it fails?
Not all Synology NAS supports Docker…
You can use this one example. Only change line
echo “Host : $myHost is down (ping failed) at $(date)”
But be careful, if you have some problem with your ISP your NAS will be rebooted very often.
You need to build in some sanity checks of course. Check it maybe 10 times over 5 minutes or so and than reboot.
I cannot access https://IPSynology:7443/admin
Use port scanner all Blynk port is not open.
my Synology is DS216J (no Docker app)
running Blynk server from SSH term.