Simulink Wifi External Mode with Wifi Integrated Mega Board

Hi,

I am working on a self-made drone where I can control everything.

The project is running fine. I ran into the problem of running the drone in external mode without the USB cable connected. The obvious solution seems to be a Arduino mega with the ESP8266 integrated.

Currently I am using this board:

The regular mega runs fine in USB external mode. I just downgraded the BaudRate to
codertarget.arduinobase.registry.setBaudRate(gcs,230400).

I am struggling with the set up of the WiFi external mode. With the jumper setting the Hardware Settings.

If anyone went trough all of the please help!

Thank you so much!

What are the proper steps to take to get things running. Is there an explanation somewhere on the web?