Problem with the code

IoT_hobbyist:
There are two issues in your code

Those issues aren't even issues "yet", since for a number of reasons OP's code as posted doesn't compile.

It needs a complete revamp, which is what I would have helped with yesterday had OP replied to my questions. I had a sketch with a decent structure mapped out in my head awaiting further info....