Hi, I’m running the Blynk server on a “headless” raspberry Pi 4, works like a dream and I have cloned my apps across, but I have the old problem that when I close the ssh terminal on my Mac the server also stops working. I can see old threads of adding “ &’ into a file somewhere and using crontab but this isn’t supported on the Pi 4. It comes with the “nano” editor.
I have no clue how to find the file and edit it. (I’ve tried find but it finds nothing!)
Also do I need “Docker” the RaspPi server set up instructions are not very clear on what is needed.
Hi Khoih,
Thanks for rapid reply, I am very new to RPi and local servers as you can gather. I followed the instructions in the Blynk doc.
On my Pi If I do “ls” I can see :- Blynk logs server-0.41.12-java8.jar static
If I start the server with the ampersand & and then close my terminal the server stops immediately.
/home/pi
ls -la
total 18556
drwxr-xr-x 7 pi pi 4096 Jan 15 12:50 .
drwxr-xr-x 3 root root 4096 Sep 26 01:09 ..
-rw------- 1 pi pi 821 Jan 15 14:17 .bash_history
-rw-r--r-- 1 pi pi 220 Sep 26 01:09 .bash_logout
-rw-r--r-- 1 pi pi 3523 Sep 26 01:09 .bashrc
drwxr-xr-x 6 pi pi 4096 Jan 13 14:02 Blynk
drwx------ 3 pi pi 4096 Jan 12 07:01 .gnupg
drwxr-xr-x 3 pi pi 4096 Jan 15 12:50 .local
drwxr-xr-x 3 pi pi 4096 Jan 15 09:27 logs
-rw-r--r-- 1 pi pi 807 Sep 26 01:09 .profile
-rw-r--r-- 1 pi pi 66 Jan 15 12:50 .selected_editor
-rw-r--r-- 1 pi pi 18944356 Dec 6 08:27 server-0.41.12-java8.jar
drwxr-xr-x 6 pi pi 4096 Jan 15 14:40 static
-rw-r--r-- 1 pi pi 165 Jan 12 07:55 .wget-hsts
uname -a
Linux raspberrypi 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux
find . -name server-0.41.12-java8.jar -print
./server-0.41.12-java8.jar
java -jar server-0.41.12-java8.jar -dataFolder /home/pi/Blynk &
[2] 932
**pi@raspberrypi** : **~ $** Server ports are busy. Most probably server already launched. See /home/pi/./logs for more info.
cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
java -jar /home/pi/Blynk/server-0.41.12-java8.jar -dataFolder /home/pi/Blynk &
exit 0
I didn’t update to java 11 because all the docs say use java 8
I downloaded the raspberry pi system that was recommended on the RPi site.
Hi Khoih,
again thanks for your reply, I guessed there was a mismatch from the “find . -name server-0.41.12-java8.jar -print” answer, but had no clue doing the move, RPi is like going back to pre dos days! (yes I can remember those days!)
OK so I did the move as you suggest and now the system starts and I don’t need to invoke ssh to get the server running!
Thank you so much!
My last issue is getting the Blynk apps to work when I’m outside of network. Ive done port forwarding on my network router, but this sits behind another router which connects to my ASDL internet connection. I guess I need to look at that too.
Oh my! There’s a lot to take in there GCG. I’ve just got my local server running ok, thanks to Khoih there are just a few minor things to fix like getting webhooks and external access to work and then I’m happy, but thanks for the info.
Hi all,
Just in case it’s of use to others, I adopted a hardware solution. I now have two NodeMCU minis running back to back. One is connected to the blynk server and can accept webhooks etc and one is connected to my local server. I use the RX Tx lines of the two minis (rx to tx and tx to rx) so they can communicate and on the local server side I use the bridge widget to send / receive data. As I use the virtual ports the data that can be sent is virtually limit less and of course I preserve data security as there is still no direct link between my local server and the outside world. After an afternoon of build hardware and software it works a dream!
Again thank you all for your help.