Can a button change a variable in a function()

thanks, i assume that the update won t work, if it s called in the same run with configuring wifi through wifimanager… probably a minor inconvenience anyway but it seems a secondary webserver defined as in the above doesn t work if we had another webserver (the wifimanager built in one) started

Are your virtualWrite’s for each virtual pin working ok i.e. is it just the ventLogic() function that is failing?

I have several virtualWrite’s in one of my sketches and they all work fine except one.

btw, i think i remember it s a no-no to send too many updates to blynk without a blynk.run happening in between or similar

@tzapulica WiFiManager can be called within the same sketch as the WebUpdater but they don’t work well together. As you will know your original intention was for WiFiManager to be used in setup but it functions ok outside setup. So in our sketch as long as we take care of which facility we want to use at a given moment in time, WebUpdater or WiFiManager, they are ok. Generally your WiFiManager is just needed during start up but we do test it after start up by disconnecting the secondary router of Wemos are connected to and then rescanning when we turn the router back on.

Not sure what your reference to too many Blynk updates means within the context of this thread>

it was related to this.

maybe @Pavlo could let us know what the best practices are for multiple blynk writes in a row

yeah, the two webservers don t work well together, there s some bug somewhere in webserver startup/cleanup, but as you say, since wifimanager is usually only needed at deploy time, it s not such a big deal anyway.

if you do need to make it work for whatever reason, for now i was able to make it work like so WiFiManager auto connect and start a http web server · GitHub

@tzapulica I have the same virtualWrite’s in my sketches. I thought Blynk were fine with 10 to 20 updates per second so 3 virtualWrites should be fine, no?

I am pieman64 on github so we touched on your webserver at gist yesterday.

you can see above where i got in trouble for having blynk.run after every blynk write!!!

1 Like

cool :stuck_out_tongue:

sorry for spreading disinformation about writes :stuck_out_tongue:

i lost track of what you can and can t do on the device end, and what you should do…

thansk!

the buttons are now being heard by the controller, but sticking on the setCancel IF

i need to get my head around my logic again…