Smart Home

Hello everyone
i’m new using arduino i got stuck with coding in this project where it always showing the same error

(In file included from C:\Users\user\Documents\Arduino\libraries\etherShield/etherShield.h:25:0,

from C:\Users\user\Desktop\smart_home\smart_home.ino:16:

C:\Users\user\Documents\Arduino\libraries\etherShield/ip_arp_udp_tcp.h:32:66: error: ‘prog_char’ does not name a type

extern uint16_t fill_tcp_data_p(uint8_t *buf,uint16_t pos, const prog_char *progmem_s);

^

In file included from C:\Users\user\Desktop\smart_home\smart_home.ino:16:0:

C:\Users\user\Documents\Arduino\libraries\etherShield/etherShield.h:34:65: error: ‘prog_char’ does not name a type

uint16_t ES_fill_tcp_data_p(uint8_t *buf,uint16_t pos, const prog_char *progmem_s);

^

exit status 1
Error compiling for board Arduino/Genuino Uno.

This is my coding
(Code tags added by moderator - also removed some of the excessive blank lines)

/*
 ###############################################################
 Smart home

 ###############################################################
*/

//libraries
#include "etherShield.h"
#include "ETHER_28J60.h"
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

static uint8_t mac[6] = {0x54, 0x55, 0x58, 0x10, 0x01, 0x24};   // this just needs to be unique for your network,
// so unless you have more than one of these boards
// connected, you should be fine with this value.

static uint8_t ip[4] = {192, 168, 0, 101};                       // the IP address for your board. Check your home hub
// to find an IP address not in use and pick that
// this or 10.0.0.15 are likely formats for an address
// that will work.

static uint16_t port = 80;                                      // Use port 80 - the standard for HTTP

ETHER_28J60 ethernet;
double tempin;
double tempout;
boolean light;
boolean light2;
boolean PIR;
boolean rain;
int alarm;
boolean check;

void setup() {

 delay(200);
 ethernet.setup(mac, ip, port);

 //temperature sensor
 sensors.begin();
 sensors.setWaitForConversion(false);
 sensors.setResolution(12);
 sensors.requestTemperatures();

 // define pins
 pinMode(A0, INPUT);
 pinMode(5, OUTPUT);
 pinMode(6, OUTPUT);
 pinMode(3, INPUT);
 pinMode(4, INPUT);
 pinMode(7, INPUT);

}

void loop() {

 char* params;
 if (params = ethernet.serviceRequest()) {


   //when you type in browser http://192.168.0.101/all
   if (strcmp(params, "all") == 0) {

     sensors.requestTemperatures();
     tempin = sensors.getTempCByIndex(0);
     sensors.requestTemperatures();
     tempout = sensors.getTempCByIndex(1);


     ethernet.print("<center>");
     ethernet.print("<font color='teal'>");
     ethernet.print("<h1>Smart Home</h1>");
     ethernet.print("</font>");
     ethernet.print("
");

     ethernet.print("<h2>Temp in: ");
     ethernet.print(tempin);
     ethernet.print("</h2>");

     ethernet.print("<h2>Temp out: ");
     ethernet.print(tempout);
     ethernet.print("</h2>");

     check = true;
     ethernet.print("<h2>Alarm: ");
     ethernet.print(alarm);
     ethernet.print("</h2>");

     ethernet.print("<h2>Rain: ");
     rain = digitalRead(4);
     if (rain == true) {
       ethernet.print("NO");
     }
     if (rain == false) {
       ethernet.print("YES");
     }
     ethernet.print("</h2>");


     ethernet.print("<h2>Window: ");
     if (digitalRead(7) == HIGH) {
       ethernet.print("CLOSE");
     }
     else {
       ethernet.print("OPEN");
     }
     ethernet.print("</h2>");


     ethernet.print("Lamp: ");
     ethernet.print("<a href='light'><button>Lamp</button></a>");


     ethernet.print("
");
     ethernet.print("
");

     ethernet.print("Instruction how make your smart home: <a href='http://www.instructables.com/member/Nikus/'>link</a>");
     ethernet.print("
");
     ethernet.print("C by Nikodem Bartnik");

     ethernet.print("</center>");

}

   // TEMP IN ********************
   if (strcmp(params, "tempin") == 0) {
     sensors.requestTemperatures();
     tempin = sensors.getTempCByIndex(0) * 100;
     ethernet.print(tempin);                        // print temperature in on ethernet
   }


   // TEMP OUT *******************
   if (strcmp(params, "tempout") == 0) {
     sensors.requestTemperatures();
     tempout = sensors.getTempCByIndex(1) * 100;
     ethernet.print(tempout);                      // print temperature out on ethernet
   }


  // ALARM **********************
   if (strcmp(params, "alarm") == 0) {

     check = true;

     ethernet.print(alarm);


   }

   // RAIN ***********************
   if (strcmp(params, "rain") == 0) {
     rain = digitalRead(4);
     if (rain == true) {
       ethernet.print("NO");
     }
     if (rain == false) {
       ethernet.print("YES");
     }
   }

   // WINDOW **********************
   if (strcmp(params, "window") == 0) {
     if (digitalRead(7) == HIGH) {
       ethernet.print("close");
     }
     else {
       ethernet.print("open");
     }
   }

   //LIGHT INTERNET****************
   if (strcmp(params, "light") == 0) {
     ethernet.print("Lamp: ");
     ethernet.print(!light2);
     ethernet.print("
");
     ethernet.print("change: ");
     ethernet.print("<a href='light'><button>Lamp</button></a>");
     light2 = !light2;
     digitalWrite(6, light2);


   }

   // ETHERNET RESPOND ************
   ethernet.respond();
   delay(20);
 }

 // LIGHT ON CLAP ****************
 if (analogRead(A0) > 350) {
   light = !light;
   digitalWrite(5, light);
   delay(1000);
 }

 //MOVE SENSOR*******************
 PIR = digitalRead(3);
 if (check == true) {
   if (PIR == true) {
     alarm = 1;
     check = false;

   }
   if (PIR == false) {
     alarm = 0;
   }
 }

}

Nice job of posting code, following the directions. NOT!

It appears that you are using an out-dated copy of the etherShield library, as last as far as the version of the IDE you are using.

Do you mind if you please give me the latest version of the Ehershield library

I don't know about your compile problem, but you need a == in this if statement

void loop() {

char* params;
if (params = ethernet.serviceRequest()) {

but you need a == in this if statement

No, he/she doesn't. That assigns a value to the pointer, and then tests that the pointer in not NULL.

Do you mind if you please give me the latest version of the Ehershield library

I have no idea. I spent the extra $1 and got a W5100 based Ethernet shield. You will, too, someday.

alright anyways thanks for help