error "Boardinit "was not declared in this scope

I try to Get a Uno + data / Ethernet shield communicating with the app "Arduino Ethernet Kit'
I had the Sketch running without the connection involved .
I combine this sketch with an existing Sketch , step by step ( few rules with pieces of code) to get the Analog pin part and the LCD communication running.
The focus is the LCD item because I think i can bring the analog values to LCD .
First question : Is there somewhere a minimum of code available to get the LCD in this sketch running ?
Second : Do I need to establish the ethernet connection in the sketch with extra code because the shield should already carry out that part !
Third: What is the intention of : void setup(void) in this ?

/*
// Test Decimalen en temp wegschrijven 
  Nu Verschil in hele graden meten voor het wegschrijven
  ** Pinnummers nu 8, 9 en 10 *************************
  Verder d1 Led en A0 tem36 aansluiten
  
*/
#include <SPI.h>
#include <Ethernet.h>
#include <Servo.h>
//#include <EthernetBonjour.h>//to resolve host names via MDNS (Multicast DNS)
#define lcd_size 3 //this will define number of LCD on the phone app
int refresh_time = 15; //the data will be updated on the app every 5 seconds.
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDA, 0x02 };
IPAddress ip(192, 168, 1, 1); //Uncomment for fixed IP or leave for DHCP
EthernetServer httpServer(80);
EthernetClient client;

char mode_action[54];
int mode_val[54];
Servo myServo[53];

String mode_feedback;
String lcd[lcd_size];
String api, channel, notification, user_id;

String httpOk = "HTTP/1.1 200 OK\r\n Content-Type: text/plain \r\n\r\n";



// SimpleDHT - Version: Latest 
#include <SimpleDHT.h>
// DHT_sensor_library-1.3.0 - Version: Latest 
#include <DHT.h>
#include <DHT_U.h>
// SD - Version: Latest 
#include <SD.h>
/*
  SD card read/write
 This example shows how to read and write data to and from an SD card file
 The circuit:
 * SD card attached to SPI bus as follows:
 ** MOSI - pin 11
 ** MISO - pin 12
 ** CLK - pin 13
 ** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)
*/
#include <SPI.h>
#include <SD.h>

const int chipSelect = 4;
// The first sensor nr 7

int dataPinSensor = 7;

SimpleDHT22 dht22;

float temperature =0;
float humidity = 0;
float LastTemp = 0;
float NewTestTemp = 0;

File myFile;
// Led and senst intnsor part
const int sensorPin = A1;


void setup() {
//  void setup(void){
    
//   }

//  while (!Serial) {
//    ;// wait for serial port to connect. Needed for Leonardo only
//  }
  Serial.begin(9600);
  Serial.println(F("Please wait for IP... "));
  //Ethernet.begin(mac, ip);// Uncomment for fixed IP
  Ethernet.begin(mac); // Comment for fixed IP
  httpServer.begin();
  //  EthernetBonjour.begin("ethernet");//Insted of IP you can use hostname http://ethernet.local to connect in the app.-->> for iOS only
  //  EthernetBonjour.addServiceRecord("ethernet", 80, MDNSServiceTCP);
  Serial.println(Ethernet.localIP());
  boardInit();
  
  
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  Serial.println("Initializing SD card...");

  if (!SD.begin(4)) {
    Serial.println("initialization failed!");
    while (1);
  }
  Serial.println("initialization done.");
  
  pinMode(1,OUTPUT);
  
}


void loop() { 

int sensorVal = analogRead(sensorPin);
delay(5);

// convert ADC reading to voltage 
float voltage = (sensorVal / 1024.0)* 5.0 ;
Serial.print  ("Volts: ");
Serial.print(voltage);
Serial.print("degrees C :  ");
float temperature = ( voltage - .5 )*100;
Serial.println( temperature);

digitalWrite(1, LOW);
delay(1000);

Serial.println(" In loop");
byte data[40] = {0};
int err = SimpleDHTErrSuccess;
Serial.println("----------------------------------");

 for(int dataPinSensor = 7; dataPinSensor < 10; dataPinSensor++) {
  Serial.print("Test Forloop sensornr  "); 
  Serial.print(dataPinSensor);
  Serial.print(" Reading ");
  
  if ((err = dht22.read2(dataPinSensor, &temperature, &humidity, data)) != SimpleDHTErrSuccess) {
      Serial.print("Communication error with Sensor , err="); Serial.println(err);delay(1000);
      return;
  }
 
   // converting Celsius to Fahrenheit
  byte f = temperature * 1.8 + 32;  
  Serial.println(" OK:");
  Serial.print((float)temperature,2); Serial.print(" *C, "); 
  Serial.print( "  ");
  Serial.print((int)humidity); Serial.println(" H humidity");
  Serial.println("-----------------------------------");


digitalWrite(1, HIGH);

delay (10000);
digitalWrite(1, LOW);

//  Test if there is a change in Outside temp on sensor nr first
//  Only then write to file

delay(6000);
  Serial.println("=======================");
  delay(10000);
  
Serial.println("Test if difference ");
  Serial.print(dataPinSensor);
  Serial.print("LastTemp ");
  Serial.print((float) LastTemp,2);
  Serial.print(" NewTestTemp ");
  Serial.println((float) NewTestTemp,2);

if (dataPinSensor == 7){
    NewTestTemp = temperature ;
    }

Serial.println("Enter disk loop if difference with Last");

// (LastTemp != NewTestTemp){ ****   if you want more digits
if (int (LastTemp != NewTestTemp)){

    // there is at least 1 degr difference write to file
    Serial.println("********In loop Difference");
    Serial.print("LastTemp ");
    Serial.print((float) LastTemp,2);
    Serial.print(" NewTestTemp ");
    Serial.println((float) NewTestTemp,2);
    delay(1000);
  
    Serial.println("open test.txt");
  
    myFile = SD.open("test.txt", FILE_WRITE);
    delay(10000);
    Serial.println("************ Writing to disk");
    delay(10000);

    // if the file opened okay, write to it:
    //  if (myFile) {
    myFile.print(dataPinSensor);
    myFile.print(";");
    myFile.print(temperature,2);
    myFile.print(";");
    myFile.print(humidity, 0);

  {  // Modify de last dataPinSensor to the larger one.
    if (dataPinSensor == 9){
        myFile.println(";");
        Serial.println(dataPinSensor);
        Serial.println("  *** Succes ****");
        digitalWrite(1, HIGH);
        }
        else {
        myFile.print(";");
        delay(10);
        Serial.println(dataPinSensor);
        }
myFile.close();
}

}
}
if (dataPinSensor == 7){
LastTemp = NewTestTemp;
}
delay(10000);
delay(6000);
digitalWrite(1, LOW);

//  lcd[0] = "Test 1 LCD";// you can send any data to your mobile phone.
//  lcd[1] = "Test 2 LCD";// you can send any data to your mobile phone.
//  lcd[2] = analogRead(1);//  send analog value of A1

  //  EthernetBonjour.run();
}

I get a message that the nr of characters  is too much.  i,ll post the 2nd sketch in a reply!

Third: What is the intention of : void setup(void) in this ?

There is no intention, that line is a comment.

2nd existing sketch of the Arduino library.

#include <SPI.h>
#include <Ethernet.h>
#include <Servo.h>
//#include <EthernetBonjour.h>//to resolve host names via MDNS (Multicast DNS)


#define lcd_size 3 //this will define number of LCD on the phone app
int refresh_time = 15; //the data will be updated on the app every 5 seconds.


byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDA, 0x02 };
IPAddress ip(192, 168, 1, 1); //Uncomment for fixed IP or leave for DHCP
EthernetServer httpServer(80);
EthernetClient client;

char mode_action[54];
int mode_val[54];
Servo myServo[53];

String mode_feedback;
String lcd[lcd_size];
String api, channel, notification, user_id;

String httpOk = "HTTP/1.1 200 OK\r\n Content-Type: text/plain \r\n\r\n";

void setup(void)
{
  while (!Serial) {
    ;// wait for serial port to connect. Needed for Leonardo only
  }
  Serial.begin(9600);
  Serial.println(F("Please wait for IP... "));
  //Ethernet.begin(mac, ip);// Uncomment for fixed IP
  Ethernet.begin(mac); // Comment for fixed IP
  httpServer.begin();
  //  EthernetBonjour.begin("ethernet");//Insted of IP you can use hostname http://ethernet.local to connect in the app.-->> for iOS only
  //  EthernetBonjour.addServiceRecord("ethernet", 80, MDNSServiceTCP);
  Serial.println(Ethernet.localIP());
  boardInit();
}

void loop(void)
{

  lcd[0] = "Test 1 LCD";// you can send any data to your mobile phone.
  lcd[1] = "Test 2 LCD";// you can send any data to your mobile phone.
  lcd[2] = analogRead(1);//  send analog value of A1

  //  EthernetBonjour.run();

  EthernetClient client = httpServer.available();
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        process(client);
        delay(100);
        client.flush();
        client.stop();
      }
    }
  }
  update_input();
}

void process(EthernetClient client) {
  String getString = client.readStringUntil('/');
  String arduinoString = client.readStringUntil('/');
  String command = client.readStringUntil('/');

  if (command == "terminal") {
    terminalCommand(client);
  }

  if (command == "digital") {
    digitalCommand(client);
  }

  if (command == "analog") {
    analogCommand(client);
  }

  if (command == "servo") {
    servo(client);
  }

  if (command == "mode") {
    modeCommand(client);
  }

  if (command == "allonoff") {
    allonoff(client);
  }

  if (command == "refresh") {
    refresh(client);
  }

  if (command == "allstatus") {
    allstatus(client);
  }

}



void terminalCommand(EthernetClient client) {//Here you recieve data form app terminal
  String data = client.readStringUntil('/');
  Serial.println(data);
  client.print(httpOk);
}

void refresh(EthernetClient client) {
  int value;
  value = client.parseInt();
  refresh_time = value;
  client.print(httpOk);
}

void digitalCommand(EthernetClient client) {
  int pin, value;
  pin = client.parseInt();
  if (client.read() == '/') {
    value = client.parseInt();
    digitalWrite(pin, value);
    mode_val[pin] = value;
    client.print(httpOk);
  }
}

void analogCommand(EthernetClient client) {
  int pin, value;
  pin = client.parseInt();
  if (client.read() == '/') {
    value = client.parseInt();
    analogWrite(pin, value);
    mode_val[pin] = value;
    client.print(httpOk);
  }
}

void servo(EthernetClient client) {
  int pin, value;
  pin = client.parseInt();
  if (client.read() == '/') {
    value = client.parseInt();
    myServo[pin].write(value);
    mode_val[pin] = value;
    client.print(httpOk);
  }
}

void modeCommand(EthernetClient client) {
  int pin = client.parseInt();
  String mode = client.readStringUntil(' ');
  myServo[pin].detach();
  client.print(httpOk);

  if (mode == "/input") {
    pinMode(pin, INPUT);
    mode_action[pin] = 'i';
    mode_val[pin] = 0;
    digitalWrite(pin, LOW);
    client.print(F("D"));
    client.print(pin);
    client.print(F(" set as INPUT!"));
  }

  if (mode == "/output") {
    pinMode(pin, OUTPUT);
    mode_action[pin] = 'o';
    mode_val[pin] = 0;
    digitalWrite(pin, LOW);
    client.print(F("D"));
    client.print(pin);
    client.print(F(" set as OUTPUT!"));
  }

  if (mode == "/pwm") {
    pinMode(pin, OUTPUT);
    mode_action[pin] = 'p';
    mode_val[pin] = 0;
    digitalWrite(pin, LOW);
    client.print(F("D"));
    client.print(pin);
    client.print(F(" set as PWM!"));
  }

  if (mode == "/servo") {
    digitalWrite(pin, LOW);
    myServo[pin].attach(pin);
    mode_action[pin] = 's';
    mode_val[pin] = 0;
    client.print(F("D"));
    client.print(pin);
    client.print(F(" set as SERVO!"));
  }
}

void allonoff(EthernetClient client) {
  int value = client.parseInt();
  client.print(httpOk);

#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  for (byte i = 0; i <= 53; i++) {
    if (mode_action[i] == 'o') {
      digitalWrite(i, value);
      mode_val[i] = value;
    }
  }
#endif

#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)
  for (byte i = 0; i <= 13; i++) {
    if (mode_action[i] == 'o') {
      digitalWrite(i, value);
      mode_val[i] = value;
    }
  }
#endif

}

void allstatus(EthernetClient client) {
  //Sending all data in JSON format
  client.println(F("HTTP/1.1 200 OK"));
  client.println(F("content-type:application/json"));
  client.println(F("Connection: close"));
  client.println();
  client.println(F("{"));

  client.print(F("\"m\":["));//m for Pin Mode
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  for (byte i = 0; i <= 53; i++) {
    client.print(F("\""));
    client.print(mode_action[i]);
    client.print(F("\""));
    if (i != 53)client.print(F(","));
  }
#endif
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)
  for (byte i = 0; i <= 13; i++) {
    client.print(F("\""));
    client.print(mode_action[i]);
    client.print(F("\""));
    if (i != 13)client.print(F(","));
  }
#endif
  client.println(F("],"));

  client.print(F("\"v\":["));// v for Mode value
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  for (byte i = 0; i <= 53; i++) {
    client.print(mode_val[i]);
    if (i != 53)client.print(F(","));
  }
#endif
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)
  for (byte i = 0; i <= 13; i++) {
    client.print(mode_val[i]);
    if (i != 13)client.print(F(","));
  }
#endif
  client.println(F("],"));

  client.print(F("\"a\":["));// a For Analog
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  for (byte i = 0; i <= 15; i++) {
    client.print(analogRead(i));
    if (i != 15)client.print(",");

  }
#endif
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)
  for (byte i = 0; i <= 5; i++) {
    client.print(analogRead(i));
    if (i != 5)client.print(",");
  }
#endif
  client.println("],");


  client.print("\"l\":[");// l for LCD
  for (byte i = 0; i <= lcd_size - 1; i++) {
    client.print("\"");
    client.print(lcd[i]);
    client.print("\"");
    if (i != lcd_size - 1)client.print(",");
  }
  client.println("],");

  client.print("\"f\":\"");// f for Feedback.
  client.print(mode_feedback);
  client.println("\",");
  client.print("\"t\":\"");//t for refresh Time .
  client.print(refresh_time);
  client.println("\"");
  client.println(F("}"));
  //  client.stop();
}

void update_input() {
  for (byte i = 0; i < sizeof(mode_action); i++) {
    if (mode_action[i] == 'i') {
      mode_val[i] = digitalRead(i);
    }
  }
}

void boardInit() {
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)//Mega
  for (byte i = 0; i <= 53; i++) {
    if (i == 0 || i == 1 || i == 10 || i == 50 || i == 51 || i == 52 || i == 53) {
      mode_action[i] = 'x';
      mode_val[i] = 0;
    }
    else {
      mode_action[i] = 'o';
      mode_val[i] = 0;
      pinMode(i, OUTPUT);
    }
  }

#endif

#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)//Leo or Uno
  for (byte i = 0; i <= 13; i++) {
    if (i == 0 || i == 1  || i == 10 || i == 11 || i == 12 || i == 13 ) {
      mode_action[i] = 'x';
      mode_val[i] = 0;
    }
    else {
      mode_action[i] = 'o';
      mode_val[i] = 0;
      pinMode(i, OUTPUT);
    }
  }
#endif


}

CtrlAltElite:
There is no intention, that line is a comment.

Tnx

I commented it in my tryal and error way of trying to get this running .

I am not going to try to sew your code back together. Use the Reply icon, NOT the Quick Reply field, and use the Additional Options link to attach your code.

Tnx PaulS,

I,ll try to work the other way around and clean the sketch from Statco first.
Cleaning in this case first make it fit for Uno first by removing other types of boards.

I can imagine that you quit for now. I think it is messy too!

Tnx anyhow to give it a try.

Pls just 1 more question:

When just powering up a Uno with Ethernet shield and connected to a router it will have an Ip address.
I think.

where / how can i read that ip address, Tablet , PC , not reading it on the Arduino!

where / how can i read that ip address

Typically, the router has an IP address that you can put in a browser. That will cause the router, acting as a server, to respond with some information. That may take many forms, but some kind of page should be shown, from which you can learn what devices the router has served address to, and what those addresses are.

If you are using DHCP, you need to ask your DHCP server that question.

The UNO reports 192.18.178.248 ,
Looking in the picture , could i reserve and fix above nr for the UNO ?

Let me give it a try !