Lost newb 2560 built in wifi

Hello everyone. Start out saying I am not a programmer do not understand much on codes computer language or how to compile sketches but I am good at directions.

My project is Xmas lights controlled by a 2560 mega controlling sainsmart relay boards. I was successful in uploading the code(not mine) to the mega and working as intended while I am connected USB to my computer. My problem is being outside Xmas lighting a connection physically from arduino and computer not really feasible so i need to go WIFI.

I have bought a 2560 with built in wifi and researched enough to be able to flash it using this link http://arduino.esp8266.com/stable/package_esp8266com_index.json

Now after flashing this is where I am lost. How do I program the esp to assign an IP address so I can connect to 2560 using wifi not a cable? I can not seem to find anything on that. I have watched a lot videos and read a lot instructables but they all stop after the flash.

I have thought about maybe going simpliar and doing usb port over internet adapters and keeping the com port portion of the light program simple but again gets confusing on how to set that up and what equipment/programs are needed. My light program easiest and simplest way to connect to arduino is a comport with cable so I think maybe utilizing com port but doing a wifi connect to a hub where 2560 is may work.

any help and guidance is appreciated

I have bought a 2560 with built in wifi

Please post a link to the device that you have

https://www.amazon.com/gp/product/B07MR3V6WP/ref=ppx_yo_dt_b_asin_title_o08_s00?ie=UTF8&psc=1

What functionality of your system relies on communication with a PC over USB?

wildbill:
What functionality of your system relies on communication with a PC over USB?

After some searching inspired by your question I do not believe using WiFi to connect is even an option as far as an Arduino goes. There doesn’t seem to be a way to tell my program to look for/ control Arduino over WiFi just seems to be “com port” serial connections. So I guess I am just going to look at USB extender cables