Please replace your screenshots with the serial monitor text, formatted with triple backticks in the same way as your code.
I’d also suggest that you read this…
And I would of course suggest that you throw your Uno, Mega and ESP-01 in the bin and use a proper IoT device and maybe a port expander such as this…
Pete.