Hi Blynkers,
We have done this little tutorial to be able to run the Local Blynk Server from Zero.
There’re lots of people without knowledge about Raspberry Pi, Raspbian or Lunix, so, I think it could be useful.
Keep in mind my own knowledge regarding Raspberry Pi and Linux is very limited, this tutorial is really basic but useful, at least for me…
Here we go:
1-Prepare the SD card (8Gb Minimum) to place the Pi operating system on it
The SD card MUST be formatted as FAT32, install SDFormatter 4.0 from here:
Run SDFormatter V4.0 as Admin User
Click on “options” and choose “Format size adjustment” ON
Your SD is ready to add the files for Raspbian…Good!
2-Noobs 1.9.2:
Go to https://www.raspberrypi.org/downloads/noobs/ and Download Noobs 1.9.2
Unzip NOOBS and copy the unzipped files to the SD card.
You should connect your Pi Zero like this example:
There’s a USB HUB with a Wi-Fi dongle and a Keyboard. Be aware, at the moment the Wi-Fi dongle WON’T work till next step.
(You can also use Ethernet to USB adaptor instead of Wi-Fi dongle)
3-Raspbian:
Turn ON your Pi Zero and install Raspbian.
There is a Vimeo of that here: https://vimeo.com/90518800
4-Wi-Fi dongle:
It’s time to prepare your Pi Zero to use the Wi-Fi dongle
Follow “Solution 3” from this great instructable.
update all the important stuff:
Open a Terminal and type:
-$ sudo apt-get update
-$ sudo apt-get upgrade
-$ sudo apt-get dist-upgrade
-$ sudo rpi-update
It takes a lot of time… be patient – it is checking for and getting the latest versions of everything…
Once your PI finishes updating, disconnect your Smartphone, restart your PI and connect the Wi-Fi Dongle and join your home WiFi network, you need your SSID and password for this.
If using Ethernet – it will just connect to your network.
5-Installing TightVNCserver:
This way you will be able to access to your Pi Zero from almost any computer.
Open Terminal and type:
-$ sudo apt-get install tightvncserver
After installation type:
-$ tightvncserver
First time the program will ask you for a password – enter your chosen password and remember it (even write it down!), after that it will ask you if it is “view only” mode, write N, for no - this is important!!!
If you want to run VNC Server automatically every time the Pi is started you should follow this process:
Open the Terminal and type:
-$ cd .config
-$ mkdir autostart
-$ cd autostart
-$ nano tightvnc.desktop
You should type the text as you can see in the picture:
[Desktop Entry]
Type=Application
Name=TightVNC
Exec=vncserver :1
StartupNotify=false
Press CTRL+X to exit and save changes!!
Restart your Pi Zero; from now on going you can use almost any computer to manage your Zero (the computer must have VNC Viewer installed!).
7-VNC at your computer:
Using your computer go to: https://chrome.google.com/webstore/category/apps
Add VNC Viewer:
Go to chrome://apps/ and click at VNC Viewer:
Alternatively, you can install and run VNC viewer as standalone software from:
https://www.realvnc.com/download/vnc/
Once you run the VNC Viewer in Chrome or standalone a new window will open. Type the IP address of your Pi Zero followed by :5901 (by default, TightVNC runs on a port 5901) and press Connect.
Now add the password from Step 5 and press OK
Congratulations, you can access to your Pi Zero from your computer. We are really close!
6-Preparing the Router to Blynk Local Server, fixing the Zero’s IP address:
As you want to access to your Zero through your computer using VNC, open your Router admin page and check your devices (maybe in the “MAC Address” list), you will find your Raspberry Pi and you will see the IP address it has been assigned.
Next find “Reserved IP Addresses” or something similar (exact section depends your router)It should be at “DHCPv4 Server” and set this IP to your Pi Zero.
After you set your Pi Zero IP address, go to your routers Port Forwarding section, here you will open 8442 and 8443 ports to access Local Server using 3G/4G:
Save changes and restart your router.
8-Installing Local Blynk Server:
Open a Terminal and Install/Check your Pi has the latest java:
-$ sudo apt-get install oracle-java8-jdk
Make sure you are using Java 8
-$ java –version
Output should be something as recent as: java version “1.8.0_40”
Download Blynk server jar file (or manually copy it to raspberry via ssh and scp command) :
wget https://github.com/blynkkk/blynk-server/releases/download/v0.18.3/server-0.18.3.jar
(or whichever is the latest server version!)
Move the Blynk Server .jar from “Downloads” to “home/pi”:
Create a New Folder “BlynkData”
To run the Blynk server on default ‘hardware port 8442’ and default ‘application port 8443’ (SSL port):
-$ sudo java -jar server-0.18.3.jar -dataFolder /home/pi/BlynkData &
(or adjust for the version you have)
That’s it! It should be running!
9-Enabling server auto restart using Crontab –e:
Open a Terminal:
-$ crontab -e
Add the following line at the end:
@reboot sudo java -jar server-0.18.3.jar -dataFolder /home/pi/BlynkData &
Save and exit.
10- Blynk App from 3G/4G and Create New Account:
Go to http://www.whatismypublicip.com/ and check and write down your Public IP (you need to have a static IP from your ISP).
Open Blynk APP and Create New Account:
11. create server.properties file:
Create a New Empty File at /home/pi and paste the code at:
Rename the file as server.properties
Read all items and be careful if you do changes here!
12. create mail.properties file:
Create a New Empty File at /home/pi and paste the code at:
Rename the file as mail.properties and change fields as per your details.
That’s all folkes!
Thanks to @Dave1829 reviewing this little tutorial before posting it and to @Costas.
@Dmitriy, @Pavel @vshymanskyy, please, let me know if you see mistakes and I’ll change it.
I hope you like it.
Kind regards!