Both Local and Online Server for one project (multiple devices)

Hello

I have Blynk and two Wemos happily tracking my solar controller and fridge temp and controls in my motorhome.

At the moment it’s using my mobile internet in the van, but this means I lose control if I go into a no signal zone.

I intend on setting up Raspberry Pi and having a local server, but ideally I’d like to keep the ability to check on the system when I’m not around the van.

Is it possible to have the Wemos talking with the local (Pi) and online servers at the same time?

I don’t think my mobile network allows portforwarding, but I can chase that some more if there’s no other way.

Many thanks

Not really… and even if possible with WiFi provisioning and code, then each server is totally independent from all others, so your Hardware, data and control wouldn’t be synchronized.

That is probably your only way, but you might have to have your mobile provider act as just the internet supply to a separate router/AP with the port forwarding setup, as well as look into NoIP DNS providers.

Thanks. It’s useful to not waste time on something that isn’t possible.

Could you point me in the direction of some examples/write up about setting up blynk with port forwarding that would be relevant in my situation?

Thank you!

Not at the same time but the WeMos can be coded to switch seamlessly between local and cloud servers.

The app switch is not yet seamless and you have to manually make the adjustment. You can run multiple instances of Blynk on a single Smartphone though. One could be logged into the cloud server and the other into a local server.

So I could ping and if there’s no connection it flips over to the local server?

Exactly or if you don’t want to add the ping library then Blynk.connected() would do.

Great - I’m going to have a stab at altering my code to try this, would you mind having a look once I have?
I’m still a beginner and getting my head around C++, any advice would be appreciated.

Thank you!

Yes we’ll take a look at the code for any obvious errors etc.

Great, thank you :slight_smile:

Ah, nothings really impossible… you could throw a ball across the room and hit the target or set up a whole Rube Goldberg Machine to do the same thing… all depends on time and skill :wink:

Port forwarding is a networking function of your router, not Blynk specific and not exactly the same across various makes and models, but generally very easy to find on Google, once you know the make and model of your router.

The port you would want to forward to your Local Servers IP would be 8443.

Remember you would need the same accounts on each server with the same project, and would have to manually update any changes from one to the other. And if your device depends on any synchronization of pins, that will be incorrect after a server switch. Not to mention that you need to switch both the Device and your App each time to the relevant server.

1 Like