VFD Pump Control via RS485 Modbus and Blynk

Okay, a few observations…

Having a process that takes up to 8 seconds to complete is probably pushing the boundaries with Blynk already. Blynk needs to be constantly communicating with the server, so that it knows if anything (such as a button press event) has changed in the app. It does this with Blynk.run and I think the standard timeout is 10 seconds. If the server hasn’t heard from the device in the past 10 seconds it will assume it’s MIA and show it as offline - missing, presumed dead.

The device then needs to re-connect to the server, which will happen automatically if you’ve written your code correctly, but it’s not very elegant. Adding. Blynk.run commands into your function (subroutine) that does the floating point maths is one way to keep the communication with the server going.

Personally, I’d recommend going for something a bit more mainstream than the Particle boards. I think (but I could be wrong) that they’re designed to work as a Wi-Fi mesh system and talk to the Particle server. A regular ESP8266 based device such as a NodeMCU or Wemos D1 Mini is what most people use, or an ESP32 device if you need lots of IO pins and are working with a lot of analogue inputs.
You might find this topic handy:

My approach is to use multiple Wemos D1 Mini devices that all talk to the central Pi device via MQTT. My home automation system currently has 17 separate devices, most of which have a single job to do - such as turning a light on or off, taking temperature readings, driving a touch screen etc.
All communication is via Wi-Fi, which means that you put the device where you want it and power it locally, rather than running a rats nest of wires back to a single controller (the Mega in your case).
A bit more light reading here if you’re interested in this concept:

I don’t run a local Blynk server, but if I did then I’d probably go for a Docker setup. My Pi acts as an MQTT and Node-Red server (Node-Red is a graphical programming tool that allows you to create rules-based workflow-type processes very easily. It also handles the communication with Blynk via a Node-Red plugin). I know very little about Raspberry Pi’s, and the whole server build was done via a script that installs everything, but I thing in future I’ll be moving towards a Docker based setup to simplify things even further.
There’s a great Docker explanation here:

Pete.