Arduino uno with Nodemcu(as wifi shield)

Battery backup

Blynk.config() and “runs until server connects” code that manages your relays.

Yes now am using an UPS !! :slightly_smiling_face:

I have used Blynk.syncAll …So see the previous state on the server. So this will wait till the nodemcu boots(it takes around 10sec) till then the relays are high.

As you can see from the other espouses, it’s often down to pin choices, and appropriate use of pindef and digitalWrite commands as early as possible in the code execution.
Pull up/down resistors will prevent booting or connection to Wi-Fi if used on the wrong pins.
I don’t think I’ve come across a library that doesn’t have an ESP version, or simple hack available to make it work on non AVR devices in the past couple of years. In fact, it’s often the other way around with some functionality only being available on ESPs. Things like OTA (invaluable in many home automation situations) will only work with ESP stand-alone devices.

I do a lot of real world home automation and although I started with Arduino devices I now don’t have a single Arduino device in my setups. All are either Wemos D1 Mini or Sonoff style devices - all of which use stand-alone ESP processors.

Pete.

3 Likes

Yes, but I was referring to your comment about the server taking extra time if it also rebooted… You don’t have to let the NodeMCU sit there twiddling its clock until the server connects. You can have code that sets your relays to a prefered default or “server down” state along with other running logic while waiting for the server to connect and synchronize to the last settings.

1 Like

I found this on the Blynk Docs

Blynk.config(auth, server, port);

This is to manage the token, ssid and pass right !
Then how

Blynk.config()

will let the nodemcu work until the connection is back ?

Is there any sample bit of code that i can see and understand the flow ?

Why don’t you just define your digital outputs and set them LOW in void setup, before doing your Blynk connection?

Pete.

No, as the name suggests it configures the connection.

Look at Connection Management in the docs to allow your sketch to run whilst the server is down.

1 Like

Already did that… Even then for a short pulse of time (the time taken by the nodemcu to boot and get into the normal operating mode) there will be a spike. That is the booting process of esp’s … Cant do anything on the software part. What ever we do needs to be on the hardwae side. We need to create some kind of buffer and keep the spikes away from the relay…

It’s very difficult to help with this, because most of the time I think we’re talking at cross purposes.

You’ve said in previous posts that the server takes around 1 minute to boot and the NodeMCU takes around 10 seconds. In reality, the NodeMCU will take almost no time at all, but it will normally take 5-6 seconds before you have a connection established with your Blynk server - assuming that the server hasn’t also rebooted.
@Gunner said that you could work around these delays by manually setting your relays at the desired state before your Blynk connection and you seemed to be exploring the various connection methods in your following posts hence my comments about setting the pin states before attempting your Blynk connection.

You’re now back to talking about very short spikes, as opposed to 10 second or 1 minute delays - which makes it difficult to keep a sensible conversation going.
There will be a solution to these spikes - choosing the correct pins, or using physical pull down resistors is where I’d start looking.

Because of the problems with keeping you focused on one issue I’m going to step back from this conversation.

Pete.

I know where mentioned 10 sec. I just said it will wait for the server to come online and sync when connection is back.

i guess you are getting confused. From the time this conversation started i am talking about nodemcu giving spikes during the reboot, so am using uno and nodemcu as wifi to prevent that…
and When costas asked Which pin are used i said the pin numbers and scenario happening.

I guess if you go through the conversation you can understand on what am saying ! May be i am bad in my English but i have tried to explain as close as possible.

Try this yourself -
Plug your relay modules to your esp do the coding put delays put what ever you feel will work. Once done just press the reset button(stimulating reboot) on the esp and observe the relay.
I am not worried about the server reboot (can be managed by UPS) , not worried about nodemcu getting stuck before it regains the connection (Can be managed by calling the function outside the loop and setup.)
Only problem is the short spike on the reboot. Need a way to buffer that out.

Clearly there is confusion, but we will have to agree to differ about the source of the confusion.

Anyway, I’m out of here - good luck with the project.

Pete.