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

[Tutorial] Blynking offline using esp8266 and WI-FI hotspot

Hi, Blynkers
First of all, we have to thank, @PeteKnight, for his availability at any given time I mention his name.
If you want to use Blynk offline and without any internet access using your phone that is running out of credits, then you are in the right place.
I tried to make this guide as simple as possible.
This tutorial is originally made as a troubleshooting guide of this issue: Using Blynk offline
If this tutorial needs some edits, Just point out and I’ll add and remove as per your request.
We will separate this tutorial into 4 parts so anyone can easily handle with it:

Part 1: Create a WI-FI Hotspot from your phone.
Part 2: Setup the Blynk server on your PC
1-Java instalation
2-Set Java as a user variable
3-Download Blynk server
4-Run the server
5-Change IPv4 settings
Part 3: Connect your Blynk app to the server.
Part 4: Upload the sketch to your Esp8266 and enjoy blynking offline.
Common issues and troubleshooting.
Bear in mind that these steps were applied on a PC running Windows 10x64, so I don’t guarantee that it will work in other Operating systems versions.

Part 1: Create a WI-FI Hotspot from your phone.

Creating a new Wi-Fi hotspot
I’m an android user so the following steps would be for Android OS, and I’m pretty sure that isn’t difficult for IOS users though.
I named the WI-FI hotspot as: “AP no internet access”:


Ps: We haven’t set any password, but it’s up to your preferences.

Part 2: Setup the Blynk server on your PC
1-Java instalation

  1. Download and install Java 11.0.7

Download and install Java 11.0.7 from their official website below:
java 11.0.7

  1. Set Java as a user variable

After that, you have to set Java as a system path. Just type in the search box of windows “path”, and click on “Edit the system…” as follow:


A new window will pop-up. bypass all things and go to “Environment variables”, then create a new user variable as follow:

BTW, The variable value it’s where the Java bin folder located. That’s completely related to where you’ve installed the Java file.
So the full scheme would be: Start>Edit the system environment variables>Environment variables>New(under user variables)>Write down Your Java bin folder location and the name as well.
3. Download Blynk server

  1. Download server-0.41.13.jar (for my case) from:
    Blynk server

  2. Steps to run the server:
    1-First of all, you should confirm that Java is already installed by the following command in the CMD: java -version
    And as a result you should get :


    2-Put the downloaded server file into a new folder named as per you preferences. I named it “MyBlynkServer”.

We are all set to start the server, yet, you should check out the server.properties file if it looks like mine. You can access to the file by opening the server file with an archive software “Winrar my case”, then double click on the file.


If you want to change it, you can extract the file from the archive, edit it and then reimport it inside the archive.
4-Run the server
-Now you can start the server by entering this CMD command: java -jar server-0.41.13.jar -dataFolder E:\MyBlynkServer\MyPath
This part “E:\MyBlynkServer\MyPath” means where do you want to output the results of the Blynk app actions like who has logged in …etc
In my case I’ve created a new folder inside the first one and named it: MyPath.
If a firewall window pops-up, just grant the access. if not, then try to disable your firewall or add the Java to the allowed apps list.
For a successful start of the blynk server, you should obtain:

or even some other lines that tell you your default login credentials.
Now your local server is running.

  • Connect your PC to the WI-FI hotspot named: “AP no internet access” that we’ve created it already in Unit 1.
  1. Change your IPv4 settings:
    Before you make changes, you have to figure out you local IPv4 address from CMD command as follow: ipconfig

    mine is: 192.168.43.108 from: Control Panel>Network and Internet>Network and Sharing Center>Left click on your Wi-Fi name:

    It will appear a new window, go to properties and continue you procedures same as the image bellow.


Ps: Ip address should be the same as your Ipv4 address.

Part 3: Connect your Blynk app to the server.
1- Connect your device to the WI-FI hotspot named “AP no internet access”
2-Now, within the app you have two options, either creating a new account or logging in:
Lets create a new account and configure the server:


As you can see in the picture above, the Ip address is same as the one we’ve extracted it from ipconfig command.

-Find your Auth token:
You can copy it manually. Click on devices section and selected required device :

And you’ll see token :

Now, everything seems to be in order.

Part 4: Upload the sketch to your Esp8266 and enjoy blynking offline.
Changing the sketch:
You have to do two changes as far as I know:
1- The first one is in the declaration field of the cpp file:

char auth[] = "ukvdPk5XW*******************2nXrIdNK6ef";
char ssidblynk[] = "AP no internet connection";
char passblynk[] = "";

2- The second one in Void setup():

  //Blynk.begin(auth, ssidblynk, passblynk);
  Blynk.begin(auth, ssidblynk, passblynk, "192.168.43.108",8080);

Ps: Change “192.168.43.108” to your IPv4 address.
Upload the sketch and enjoy Blynking offline.

Common issues and troubleshooting:
I’ll keep updating this field with common issues related to the post.

Hey, Hi I am also using the same Configuration as you are using for Running Blynk Local Server.

I am having some trouble.
If you can help me, it will be very helpful.

  1. I cannot create SSL Certificate for the Local Server
  2. I cannot change the admin credentials like Username & Password. I have tried to edit the Server properties files and the save it, but when I try to login using the same credentials, it does not get logged in.

Thanks in advance.
Prathamesh

I can’t get my head around your first question.
For the second question, are you using the same version of the server like me?

May be it’s due to a server update.
try and extract the server.properties file from the zip file, scroll down to the end and change the credentials as you want. Then import the file again. Rerun the server and write down the email-pass on the app.
This should work.

First question is Security Certificates for local server.
I already tried that, but it’s not working

Why do you need to use SSL if your server isn’t connected to the internet?

Are you trying to install the certificate with your server offline? Which certificate generation method are you using? (The Github page lists two).

Pete.

Sorry my bad. It thought it will need a SSL Certificate.
Sorry again.
Thanks

I find that if you edit the server properties file via the admin screen then the changes aren’t saved.
You need to manually create a server.properties file and place it in the correct location, which is the same directory as the server.jar file, or specify the path to the location in the command you use to launch the Blynk server.
The file also needs to have the correct permissions/ownership.

Pete.