Raspberry pi local server not working without internet connection

Hey masters
I made a blynk local server with my raspberry pi 3 B and so far though i have not tried any Sketch yet but as iam able to connect to it and able to add widget and all . The problem is … it is only working as long as my raspberry pi is connected to my home internet connection .as soon as i unplugged my internet ( thinking raspberry pi has now its own server capable to run my device and connect to app) iam not able to connect to the local server . On the app it shows that i cannot connect to the server . My android device has 4G LTE so not connected to the home router … What am i doing wrong ??? RPi is supposed to run its own server aka provide wireless connection to all the device connected to that server . Right?

You answered your own question :wink: … Your phone needs to connect to your Local Server… and if you disconnect the server from the internet, then your phone needs to connect via your routers WiFi, not your cell connection. You RPi also needs to connect to your router, via Ethernet or WiFi… Ethernet is more stable and since the RPi tends to just sit there, wireless is not necessary.

Now, it is possible to go a step further (but very tricky to implement and keep updated) where your RPi can ALSO act as a WiFi access point, This is more for truly portable Blynk setups. In which case your phone and devices connect directly to the RPis network… but again, via WiFi, not cell network. NOTE - this is getting into very advanced stuff and not really Blynk specific.

It sounds like you’re looking for something like this:

You’re comparing two totally different products which are aimed at different markets and which have different pricing and support models.
Having said that, Microsoft’s Powerpoint support team wouldn’t be interested in resolving issues with your home network and internet setup. They’d tell you it wasn’t a Powerpoint related issue.


1 Like

well i understand that my cell needs to connect to the server, and yes! that is what i assumed that my RPi will act as the access point to connect , but u made it clear that it is another process.

so if iam right, so far i have created just a local server on my RPi and i can connect the cell with that server as long as i put the ip and port correctly. what i do not get is this, the router at my place is providing the internet to all my devices. and if i have a server then i should be able to access that server regardless of the internet … RIGHT??? then if iam setting up my server on the RPi and giving power to it but i turn off my HOME WIFI ROUTER, why am i not able to connect to the server via app??? is it like the RPi is communicating with my home router to transmit that server wirelessly and asa i turn that off, i loose the wireless capability of the server via the router and hence iam nt able to connect to it??? and is it for that reason taht i should config my RPi to become the access point (just like my home router , transmitting its own wifi signal) and also to act as a server (as it is doing now) at the same time???

please rectify my silly doubts

iam not sure but i guess yes that might be it. well i have elaborated some doubts and confusions in my reply to @Gunner , can you please have a read and tell me if my issue and the link that u suggested are in correspondence?

Blynk needs three things connected via a common network to fully function… The App, The Server and The Device(s).

App <-- network / internet --> Server <-- network /internet --> Device(s)

The key here is common network… so, while your RPi is running a Blynk Server, the Server has no control over the network, it just uses whatever network the RPi is connected to… in this case your router.

So, if you want to have your phone (App) to connect to your Local Server, you need to do one of two things…

A) (prefered option) Setup port forwarding on your router so it will accept your phone connection via your 4G connection over the internet. Use a NoIP DNS type service to get a name instead of needing your router’s public IP in your App settings and then your phone should connect seamlessly from anywhere.

B) Or use your phone’s WiFi to connect to your router using your RPi’s local IP address in your App settings. Of course that option ONLY works when you are at home, in range of the router.

But basically YES you NEED your router to handle all the networking…

Or you can go down the other advanced rabbit hole called “Setting up your RPi as BOTH a Local Server and an Access point”. Then connect your phone (only via WiFi) and your Devices directly to your RPi. Of course, you will need to set them up with whatever unique address your RPi’s AP provides. NOTE: in this case, the phone and devices have NO connection to the internet (that may be also possible, but that is yet another ferret hole :stuck_out_tongue: ).

Under normal circumstances, your router is providing your Wi-Fi and local networking functions (allocating IP addresses to internal devices via DHCP etc).
In this situation, the Blynk local server is just another internal device, connected via the router to the other internal devices, and to the internet if the internet connection is up.

If you simply unplugged the internet connection from your router, but your router was still up and running - providing Wi-Fi, DHCP etc - then everything should continue to function correctly, provided your mobile phone is connected to your Wi-Fi and not to 3G/4G.

However, if you switch your router off then you’ve turned off the ‘glue’ that binds everything together.
If you want to be able to operate without a router then you need the solution I linkeded to where the RPI acts as both a wireless access point and a DHCP server. This type of solution isn’t really used to provide local networking when your router happens to be down, it’s really for a portable situation where there is no internet connectivity and you want to have a closed network.

Most people aim to ensure that they still have control over their connected devices when the internet fails (because of a problem with their ISP, or because someone accidentally dug-up the road and took out the local fibre optics). In those situations, the router will still be running, but it can’t talk to the outside world.
If you’re concerned about a situation where the power fails then you should look at a battery backup for your router, local server and your MCUs (and of course any mains powered devices that the MCUs control.


ok now iam confused, specially as u said this will be the prefered option… 1. how do i setup port forwarding, what name? as in my router’s name that i have kept? and MY CELL CAN CONNECT TO THAT SERVER WITHOUT INTERNET (NEAR RPi) JUST WITH4G ON MY CELL FROM ANYWHERE???

so in this case i have my router powered on but has no internet cable connected so it can only act as a transponder and my RPi connects to it having a local server which then will be broadcasted via my router within the range that my router can cover, so in order to make it portable i will have to carry my router and raspberry pi with me to whichever place i want my device and app to bet connected to my local server( again all of this is without internet)

am i correct on the concept B??? or am i getting it wrong>>??

i guess @PeteKnight mentioned that same thing in that link am i right? n my RPi 3B has its own wireless LAN and BLE, so it should support that idea? but y is it so hard that u suggested i try the other two ideas first.

BTW: this community is so f*****ng great man!!! i mean seriously, its noless than some distance learning course . and thanx to you guys iam progressing on such a good pace that my fellow mates along with my teachers and the head of the department had a jaw dropping expression to the things iam making with your help and advice.

thanx a lot guys
specially @Gunner, u have been in constant touch with me man!! really appreciate

Depends on your router make and model

NO. If your cell is using 4G then you are using the internet (via your cell provider)… thus your Local Server must also be connected to the internet.

As for all the whole portable bit… that is getting into advanced stuff… you MUST understand the basics before we can reliably explain the advanced :stuck_out_tongue_winking_eye:

ok @Gunner, so here is what i want in short. (although u knw the gist )

i want to make my blynk project (iot farm health monitoring system) available to the rural parts of banlalore (india). Local farmers are facing many problems there, and i think i can present them with a solution. But they have no concept of internet or 4G or even 2G connection over there. So what i want is
A) i want my raspberry pi to transmit a WIFI sig with which my cellphone can connect and also act as a local server for my app to connect to. (i understand that the distance covered will be limited by the range my RPi’s patch antenna can provide)

B) i can connect my DNS router there near a power supply port and i want my wifi to connect to that router which can handle the transmission and providing with the wireless connection part , and RPi will have a local server . so as long as iam in range of the router i can connect to the server which is there near the router in my RPi.

now u tell which idea should i go with. i dont want to get into too mant diff streams , i wd rather kike you experts to suggest me the way. i will then focus there

OKAY!!! yea so basically i just remover the router plug from the wall and like a goof i was expecting it to still work.

so basically if i repeat the whole procedure again and instead of unplugging it from the wall if i just remove the internet cable from the back , everything should still function normally… and if i take that router anywhere in the world and plug it to the power and do the whole thing again , i should be able to use the blynk app on my cell as long as iam in the range of my router .


also please read my exact situation which i have replied to @Gunner

Yes, you’ve got it now.

If the RPI was set-up as the ultra portable system then a router wouldn’t be needed. However, as you’re talking about a rural setting where distances may be involved you might be better using a router, and an Ethernet connection between the RPI and the router. You may also need to have one or more Wi-Fi repeaters, which would be better if they were wired to the router using long(ish) Ethernet cables.


hey,thnx alot @PeteKnight , i am at my frnz place and i have my rpi and an Ethernet cable here with me, iam gonna try to do it again here right now… just one doubt … without the router connected to the internet cable and just powered on, i will connect my ethernet cable btwn my router and rpi? thats it? is there any thing else needed to be done? in rpi terminal or anything anywhere? because by what u have told me , i think iam really close to completion , and i can visit the village this weekend.

If your Pi was previously connected to the router using Wi-Fi then you don’t need to use the Ethernet cable, it should connect using Wi-Fi okay.
It’s just that out in the wild it may make more sense to go for a wired connection to keep everything neat and tidy.


just a quick doubt… i think i forgot my admin password for the dashboard access… what to do? @PeteKnight

No idea, I don’t use local server.


just did a reset … removed the admin@blynk.cc from the data folder and now iam f9

hey @Gunner @PeteKnight
i just tried doing the local server setup, only this time i removed the internet cable from the router and not the power supply. and i was able to access my local server .

so i think if i get a better router with longer range i should be able to access my local server till that range now… am i correct? i guess iam 99% done. and ready to mark this post as SOLVED

I’ve changed the topic to Solved.

It depends on what you’re looking for from a router, and what’s available in the second-hand market in your country.
As ESP8266’s and ESP32s can only use 2.4Ghz, there’s no point in using a dual-band router. In the UK, you can pick-up second-hand routers very cheaply at car boot sales, flea markets etc. Provided you get one where you can do a factory reset and log-in with a default password you’ll have all the features you want.
If you manage to get a router that can be re-flashed with DD-WRT firmware then even better.
I’m not sure what sort of sensors you’ll be using on these farms, and what sport of distances you’ll be looking at, but you may end-up wanting to add Wi-Fi repeaters, in which case the same routers may be suitable for this, provided you only have one DHCP server on your network. As I said earlier, it would be better to have hard-wired connections between your router and any repeaters. You should use the same SSID and password on all for the repeaters that you use, so that devices can connect with the same credentials to the nearest/strongest signal.


BTW i have a router laying around without use ( provider: D-Link model : DIR-600L

can i use this solely for the it to be used as a router just for my RPi server?