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

Raspberry Pi Zero (W) as Blynk Local Server

#Install dependencies
sudo apt-get install oracle-java8-jdk
sudo apt-get install openssl

#Create a directory for the server called Blynk
mkdir /home/pi/Blynk

#Move into the working directory
cd Blynk

#Download the server (Change the server version to the latest version)
wget "https://github.com/blynkkk/blynk-server/releases/download/v0.24.1/server-0.24.1.jar"

#Generate self-signed certificates
openssl req -x509 -nodes -days 1825 -newkey rsa:2048 -keyout server.key -out server.crt

#Convert key to pem
openssl pkcs8 -topk8 -inform PEM -outform PEM -in server.key -out server.pem

#Copy the contents from the site
https://raw.githubusercontent.com/blynkkk/blynk-server/master/server/core/src/main/resources/server.properties

#And paste it in
sudo nano server.properties

#Change the following lines
server.ssl.cert=./server.crt
server.ssl.key=./server.pem
server.ssl.key.pass=PASSWORD_USED_IN_ABOVE_STEP

#Copy the contents from the site
https://raw.githubusercontent.com/blynkkk/blynk-server/master/server/notifications/email/src/main/resources/mail.properties

Paste it in

sudo nano mail.properties
#Set Gmail id and password. If you are using two step verification, generate app specific password from google account.
cd ..

#For Autostart on reboot
sudo nano /etc/rc.local

Add the following command mentioned before “exit”

java -jar /home/pi/Blynk/server-0.24.1.jar -dataFolder /home/pi/Blynk -serverConfig /home/pi/Blynk/server.properties -mailConfig /home/pi/Blynk/mail.properties &

#Now You can start the server
java -jar /home/pi/Blynk/server-0.24.1.jar -dataFolder /home/pi/Blynk -serverConfig /home/pi/Blynk/server.properties -mailConfig /home/pi/Blynk/mail.properties

9 Likes

Nice! Thanks for sharing. I almost finished free cert generation. So soon steps with certificates will be not necessary.

That is great…:slight_smile: Kindly update me once that is done. I shall update my posts and video to save some confusion.

1 Like

via Imgflip Meme Generator

Nice post btw

Hello,
And how is it connected to internet, as it has no wifi or ethernet card?

It’s a W so it does have WiFi.

Hi,
It is the raspberry pi zero W. It has on-board wifi

Talking of Pi internet connectivity I received a couple of these in the post today:
https://www.aliexpress.com/item/White-15CM-Micro-USB-2-0-Male-To-RJ-45-Female-5-Pin-10-100Mbps-Ethernet/32794290936.html

Micro USB connectors so plug straight into the Zero’s and they provide a plug and play Ethernet connection. Pretty good for less than $1.80 each including delivery

So when using the Pi as a local server WiFi AP (tutorial elsewhere on this site) on 192.168.42.xx it’s simply a case of disabling the WiFi via SSH on your main Ethernet subnet (not WiFi to the AP) with sudo ifdown wlan0 and the Pi has internet access.

1 Like

Thank you, don’t know well yet the rasp family…

Great, I’ll try soon!

Hi Dmitry!, Great news. Where can I follow your progress on free cert? Thanks for your time.

@espagnol01 it was released the day after @Dmitriy said he was almost finished in early May, see Automated Free Certificates with Let's Encrypt

so you don’t talk about Zero worked good or … for blynk
it seem we can use pi zero for server without any reduce speed and …

Cool

I can run Blynk server on an old RPi model B… the newer RPis have absolutely no problem.

Hey! Im running local server on Opi0 even!

@zara has pi zero wifi or lan?

Its orange pi zero… it has lan and wifi.

Hi -thanks for the walk through… as its almost a year on and Blynk has certainly moved forward do I need to do anything different?
I’ve managed to run the local server on several laptops at work but not managed to work with the network security and our IT team are loath to mess with settings.

So I’ve got a rapberry pi zero w and got it up and running. When I run the local server I get an error msg- stating that the ServerLauncher has been complied by a more recent version of Java runtime (class file version 53.0) tthis version only recognises versions up to 52.0.

So my question is- can I update the rpi zero W (I thought I had) Java or should I install an erlier version of the local server, and if so which one?
My plan is to run the rpi zero from my mobile phone hotspot… anytips for this would be appreciated too!