Blynk Local server on Pi with a static IP address

Hello folks :slight_smile:

I assigned a static IP address to my raspberry Pi.
The Blynk local server is running on RPi. However, when I am using custom and adding my static ip add for rpi it’s not opening the app. Although, it was opening before assigning the static ip.
Before using the IP address the code was

Blynk.config(auth, IPAddress(192,168,100,183), 8080);

Is it suppose to be the same for the case of using the static ip add?
Thanks

Is the phone/tablet running the app connected to the same network via WiFi, or is it using a cellular data network?

Pete.

Yes, it is connected to the same network.
We never can control the app from different ssid? Because if the local server?

In that case, are you able to ping the Blynk local server from another device on your network?

It’s possible to use your local server from outside of your network, provided your ISP does not use double NAT addressing.
To do this you’d use a Dynamic DNS service (assuming your public (WAN) IP isn’t static) and in your router you’d map the relevant ports to the Blynk server so that inbound traffic meant for the Blynk local server is correctly routed.

Pete.

If I have a local Blynk server and I can access it from different ssid, could you please tell how? Can you elaborate more in this point? If there are articles or YouTube videos, please don’t hesitate to write them here. Thank you.

You should read this (all of it, especially the info about checking if your ISP does double NAT addressing and test this first)…

Obviously you’ll need to get the problem that you originally posted about in this topic fixed, otherwise you’ll never get an external connection working.

Pete.

Alright. Many thanks to you.
So, first If I am having a static IP address I should normally be able to connect to my Blynk app because i am using the same ssid.
So, secand I should start with your last answer to know how to acess my local server from different ssid.
Right?

Get your local server with static IP working from within your own network, then do the tests about double NAT to see if external access is a possibility.

Pete.

As I work my way through setting up a local server, I’ve noticed that when I have a dynamicIP address on my raspberry pi zero w that when the IP address changes (which it occassionally does) it appears to that it totally changes the server IP so that any info (like users) are gone, so I have to set up the server from scratch and subsequently the IP address for the android app for login. (or am I missing something). The only solution I can think of is setting up a static IP address for the raspberry pi. There are several good tutorials online how to do this and it doesn’t appear to be too difficult. HOWEVER I read above that I might encounter problems connecting to the local server once I’ve changed to the static IP. I thought I’d reach out and see what other people’s experience is with using a static IP address on the Blynk server before I switch.

It sounds like you are, but it’s difficult to say based on the info you’ve provided.

For a local server to work correctly it needs it’s internal IP address (the IP address within your home network) to be static, otherwise you would need to keep re-flashing your devices with updated information each time your router assigned a new IP address to the Pi.

Also, if you want to use your app when your phone is connected to a different WiFi or mobile network, then you’ll need to to tell your router where to send the incoming data packets that are intended for your local server. This is known as Port Forwarding.
In addition, if your Public IP address is dynamic (your ISP sometimes allocates a different external IP address to your router when it is rebooted, or at random intervals) then you’ll need to use a DDNS service.
DDNS gives you a fixed URL that you point the Blynk app on your phone at, and it routes the data to your router’s current public IP address. It know what your your router’s current public IP address is because you run an updater script either on your router, your local server, or a device within your network which regularly updates the DDNS service with your router’s public IP address.

If you pay your ISP extra for a static public IP address then a DDNS service is not needed, but Port Forwarding is still needed,
However, unless you have a static public IP address already then you’d probably be better using the money that your ISP would charge you to pay for a Blynk IoT subscription :grinning:

You should also read the info about checking ifr your ISP uses a double NAT system, which would make it impossible to use these solutions, and you may have to look at something like ZeroTier instead.

TBH, the Pi Zero W isn’t a great device to use for a local server.
You’ll struggle to run the latest Java versions on it, and running a local server on an SD card isn’t a great idea. The SD card will have a limited life and they tend to fail suddenly, meaning you lose all of your Blynk setup, including accounts, widget setup, auth tokens, data etc.
A later model Pi 3 or a Pi 4 fitted with an SSD card is the minimum that I’d recommend. If your projects are critical then a UPS may also be a good idea.
You’ll also need to get into the habit of managing the local server yourself - taking backups, applying updates and purging unwanted data files on a regular basis.

Pete.

Thanks for all the information Pete. I do have the program working on the IoT (thanks to your help) - I’m basically doing this for a learning exercise.
Jeff