convert Ethernet shield code to wifi ESP8266 board

hi
I’v installed application RCduino from app store to controlling rc car over Eathernet
so I decided to replace arduino Eathernet with Nodemcu wifi
I need help to convert this code to use it with nodemcu

//*********************************************************************

// This is the Arduino source code.

// You need the Arduino connected to an Ethernet Shield.

// The data format is: abcdWWWXXXYYYZZZ

// Where: a, b, c, d are the state of switchs

// WWW, XXX, YYY, ZZZ are the angle (0 to 180)

// to control the servos attached to arduino ports.

// You can select and copy this code.

//*********************************************************************

#include <SPI.h>

#include <Ethernet.h>

#include <Servo.h>

#include <stdlib.h>

#define ch1 2 // Channel 1 - Switch

#define ch2 3 // Channel 2 - Switch

#define ch3 4 // Channel 3 - Switch

#define ch4 5 // Channel 4 - Switch

#define ch5 6 // Channel 5 - Servo (throttle)

#define ch6 7 // Channel 6 - Servo (rudder)

#define ch7 8 // Channel 7 - Servo (aileron)

#define ch8 9 // Channel 8 - Servo (elevator)

byte mac = {0x00, 0xAA, 0xBB, 0xCC, 0xDA, 0x02}; // <<< Your Ethernet Shield mac address

IPAddress ip(192,168,1,101); // <<< Enter your Ethernet Shield IP address here!

EthernetServer server(80);

char c;

char command[16];

boolean incoming = 0;

Servo throttle;

Servo rudder;

Servo aileron;

Servo elevator;

// Setup:

void setup(){

// Switchs:

pinMode(ch1, OUTPUT);

pinMode(ch2, OUTPUT);

pinMode(ch3, OUTPUT);

pinMode(ch4, OUTPUT);

// Servos:

throttle.attach (ch5);

rudder.attach (ch6);

aileron.attach (ch7);

elevator.attach (ch8);

// Initial position:

throttle.write (90);

rudder.write (90);

aileron.write (90);

elevator.write (90);

// Start connection

Ethernet.begin(mac, ip);

server.begin();

// Serial.begin(9600); // For debug

}

// Main loop:

void loop(){

EthernetClient client = server.available();

// Wait for the connection:

if (client) {

while (client.connected()) {

if (client.available()) {

c = client.read();

if (c == ‘$’) incoming = 1;

if (incoming == 1){

// Get the commands:

for (int x=0 ; x<16 ; x++){

c = client.read();

command = c;

//Serial.print(c);// For debug

}

// The first 4 chars are to control the switchs

if (command [0] == ‘0’) digitalWrite(ch1, LOW);

if (command [0] == ‘1’) digitalWrite(ch1, HIGH);

if (command [1] == ‘0’) digitalWrite(ch2, LOW);

if (command [1] == ‘1’) digitalWrite(ch2, HIGH);

if (command [2] == ‘0’) digitalWrite(ch3, LOW);

if (command [2] == ‘1’) digitalWrite(ch3, HIGH);

if (command [3] == ‘0’) digitalWrite(ch4, LOW);

if (command [3] == ‘1’) digitalWrite(ch4, HIGH);

// Servos:

char s1[4] = {command[4], command[5], command[6], ‘\0’};

char s2[4] = {command[7], command[8], command[9], ‘\0’};

char s3[4] = {command[10], command[11], command[12], ‘\0’};

char s4[4] = {command[13], command[14], command[15], ‘\0’};

// Convert char to int:

int s1i = atol (s1);

int s2i = atol (s2);

int s3i = atoi (s3);

int s4i = atoi (s4);

// Set servo position:

throttle.write (s1i);

rudder.write (s2i);

aileron.write (s3i);

elevator.write (s4i);

incoming = 0;

}

}

}

}

delay(1);

client.stop();

}

I need help to convert this code to use it with nodemcu

What help? There are several libraries for working with the ESP8266. Some make it simple. Others do not. Which library are you using?