It seems that your setup is still not right. From the log that you posted, I can see that your OpenPLC host is not communicating with your ESP8266 at all. The last ESP8266 message you see is "waiting for a new client...", but no one ever connects. If you're using the nodemcu board as your ESP8266 device, the internal LED is connected to GPIO2, which is OpenPLC input %IX3.0. This means that whenever you press a button connected to that input the LED will toggle, because it is physically wired to do so, and not because OpenPLC program is running properly.
You need to make sure that both ESP8266 and your Raspberry Pi are on the same network. Then you need to verify that the ESP8266 has actually connected to the OpenPLC host. You may want to open the serial monitor on the Arduino IDE at 115200 baud to check the logs from your ESP8266 device as well. Maybe you put the Raspberry Pi IP wrong, or maybe is something else. When the ESP8266 connects, you should see a message like "ESP8266: Client accepted! Creating thread for the new client ID: x" on the OpenPLC logs. If you don't see that message, it means that your ESP8266 board is not connected.
The 502 port is used for Modbus TCP communications. The ESP8266 does not talk Modbus. It is supposed to use port 7567 to talk directly to OpenPLC's ESP driver and send/receive IO information. If you try to use port 502 to communicate with your OpenPLC host, the ESP board will try to connect to the Modbus server and it won't work. After you finish your setup and have verified that it is working, you can use Modbus/TCP software to communicate with your OpenPLC host and query data. Don't use Modbus software to communicate directly with your ESP board because it won't work.