exit status 1 Error

Hey!
I want to send Data from my Arduino ESP32 to a PHP script, in order to proceed the data there. The data equals 4 pushbuttons, and gives the values 1-4 (4buttons).

Everything is on localhost.

I tried the following code:

#include <SPI.h>
#include <Ethernet.h>

int controllerid=69;

int redButton = 35;
int blueButton= 33;
int yellowButton=32;
int greenButton =34; //Pin vom Button

int buttonStateRED=0;
int buttonStateBLUE=0;
int buttonStateYELLOW=0;
int buttonStateGREEN=0;

int buttonid = 0;

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

char server[] = "localhost";    

// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192,168,0,177);

// Initialize the Ethernet client library
// with the IP address and port of the server 
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;

void setup() {
 // Open serial communications and wait for port to open:
  Serial.begin(9600);

  Serial.begin(115200);
  pinMode(greenButton, INPUT);
  pinMode(redButton, INPUT);
  pinMode(yellowButton, INPUT);
  pinMode(blueButton, INPUT);


  // start the Ethernet connection:
  if (Ethernet.begin(mac) == 0) {
    Serial.println("SERIAL: Failed to configure Ethernet using DHCP");
  }

  // give the Ethernet shield a second to initialize:
  delay(1000);

  Serial.println("SERIAL: connecting...");

  // if you get a connection, report back via serial:
  if (client.connect(server, 80)) {

     client.print("GET /request.php");
     client.println(" HTTP/1.1");
     client.println("Host: localhost");
     client.println("User-Agent: Arduino");
     client.println("Accept: text/html");
     client.println("Connection: close");
     client.println();

  } 
  else {
    // if you didn't get a connection to the server:
    Serial.println("SERIAL: connection failed");
  }
}

void loop()
{
  buttonStateRED=digitalRead(redButton);
  buttonStateBLUE=digitalRead(blueButton);
  buttonStateYELLOW=digitalRead(yellowButton);
  buttonStateGREEN=digitalRead(greenButton);

  if(buttonStateRED == HIGH)
  {
    buttonid=1;   
  }
  else if(buttonStateBLUE == HIGH)
  {
    buttonid=2;
  }
  else if(buttonStateYELLOW == HIGH)
  {
    buttonid=3;
  }
  else if(buttonStateGREEN == HIGH)
  {
    buttonid=4;
  }

  
  // if there are incoming bytes available, print them
  if (client.available()) {
    char c = client.read();
    Serial.print(c);
  }

  // if the server's disconnected, stop the client:
  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();

    // do nothing forevermore:
    while(true);
  }
}

but I get the Error:
exit status 1
Error compiling for board ESP32 Dev Module.

Please help me.

Full Error Log:
Arduino: 1.8.7 (Windows 10), Board: “ESP32 Dev Module, Disabled, Default, QIO, 80MHz, 4MB (32Mb), 115200, None”

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.cpp: In static member function ‘static uint16_t W5100Class::write(uint16_t, const uint8_t*, uint16_t)’:

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.cpp:315:22: error: no matching function for call to ‘SPIClass::transfer(uint8_t [8], int)’

SPI.transfer(cmd, 4);

^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.h:18:0,

from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.cpp:13:

C:\Users\manda\Documents\Arduino\hardware\espressif\esp32\libraries\SPI\src/SPI.h:69:13: note: candidate: uint8_t SPIClass::transfer(uint8_t)

uint8_t transfer(uint8_t data);

^

C:\Users\manda\Documents\Arduino\hardware\espressif\esp32\libraries\SPI\src/SPI.h:69:13: note: candidate expects 1 argument, 2 provided

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.cpp:369:29: error: no matching function for call to ‘SPIClass::transfer(uint8_t [8], int)’

SPI.transfer(cmd, len + 3);

^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.h:18:0,

from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.cpp:13:

C:\Users\manda\Documents\Arduino\hardware\espressif\esp32\libraries\SPI\src/SPI.h:69:13: note: candidate: uint8_t SPIClass::transfer(uint8_t)

uint8_t transfer(uint8_t data);

^

C:\Users\manda\Documents\Arduino\hardware\espressif\esp32\libraries\SPI\src/SPI.h:69:13: note: candidate expects 1 argument, 2 provided

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.cpp:371:23: error: no matching function for call to ‘SPIClass::transfer(uint8_t [8], int)’

SPI.transfer(cmd, 3);

^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.h:18:0,

from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.cpp:13:

C:\Users\manda\Documents\Arduino\hardware\espressif\esp32\libraries\SPI\src/SPI.h:69:13: note: candidate: uint8_t SPIClass::transfer(uint8_t)

uint8_t transfer(uint8_t data);

^

C:\Users\manda\Documents\Arduino\hardware\espressif\esp32\libraries\SPI\src/SPI.h:69:13: note: candidate expects 1 argument, 2 provided

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.cpp: In static member function ‘static uint16_t W5100Class::read(uint16_t, uint8_t*, uint16_t)’:

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.cpp:416:22: error: no matching function for call to ‘SPIClass::transfer(uint8_t [4], int)’

SPI.transfer(cmd, 4);

^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.h:18:0,

from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.cpp:13:

C:\Users\manda\Documents\Arduino\hardware\espressif\esp32\libraries\SPI\src/SPI.h:69:13: note: candidate: uint8_t SPIClass::transfer(uint8_t)

uint8_t transfer(uint8_t data);

^

C:\Users\manda\Documents\Arduino\hardware\espressif\esp32\libraries\SPI\src/SPI.h:69:13: note: candidate expects 1 argument, 2 provided

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.cpp:418:24: error: no matching function for call to ‘SPIClass::transfer(uint8_t*&, uint16_t&)’

SPI.transfer(buf, len);

^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.h:18:0,

from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.cpp:13:

C:\Users\manda\Documents\Arduino\hardware\espressif\esp32\libraries\SPI\src/SPI.h:69:13: note: candidate: uint8_t SPIClass::transfer(uint8_t)

uint8_t transfer(uint8_t data);

^

C:\Users\manda\Documents\Arduino\hardware\espressif\esp32\libraries\SPI\src/SPI.h:69:13: note: candidate expects 1 argument, 2 provided

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.cpp:460:22: error: no matching function for call to ‘SPIClass::transfer(uint8_t [4], int)’

SPI.transfer(cmd, 3);

^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.h:18:0,

from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.cpp:13:

C:\Users\manda\Documents\Arduino\hardware\espressif\esp32\libraries\SPI\src/SPI.h:69:13: note: candidate: uint8_t SPIClass::transfer(uint8_t)

uint8_t transfer(uint8_t data);

^

C:\Users\manda\Documents\Arduino\hardware\espressif\esp32\libraries\SPI\src/SPI.h:69:13: note: candidate expects 1 argument, 2 provided

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.cpp:462:24: error: no matching function for call to ‘SPIClass::transfer(uint8_t*&, uint16_t&)’

SPI.transfer(buf, len);

^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.h:18:0,

from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.cpp:13:

C:\Users\manda\Documents\Arduino\hardware\espressif\esp32\libraries\SPI\src/SPI.h:69:13: note: candidate: uint8_t SPIClass::transfer(uint8_t)

uint8_t transfer(uint8_t data);

^

C:\Users\manda\Documents\Arduino\hardware\espressif\esp32\libraries\SPI\src/SPI.h:69:13: note: candidate expects 1 argument, 2 provided

exit status 1
Error compiling for board ESP32 Dev Module.

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

I don’t understand your code. Why are you using SPI if you want to communicate wirelessly? Your errors come from the SPI instructions which are called somewhere that I can’t see in your code (SPI.transfer has only one argument, not two).

You declare the Serial link twice:

  Serial.begin(9600);

  Serial.begin(115200);

Just keep the last one and verify that your serial console is set to 115200.

Finally, I don’t see any instructions that would send the value of buttonid to your http server