Help please!

Hello together!

In a sketch I got from a friend I have the following error message:

EtherCard.h: error: expected class-name beore ´{´ token class EtherCard : public Ethernet {

I know it has something to do with the library I am using but how could I fix the problem. It is the ethercard-master library and I tried downloads from several sources allready but it is always the same message.

Thanks for your help and lots of greetings

Stefan

Attach your code.

Hi Larry thanks for trying to help me I, since it is a very long code I attached it to this message or did you mean from the library?

Greetings Stefan

PHCtoUDP.ino (26.1 KB)

When I compile your code, I get:

sketch_oct02a:49: error: variable or field 'homePage' declared void
sketch_oct02a:49: error: 'BufferFiller' was not declared in this scope
sketch_oct02a:49: error: 'buf' was not declared in this scope
sketch_oct02a:25: error: 'Ethernet' has not been declared
sketch_oct02a:41: error: 'BufferFiller' does not name a type
sketch_oct02a.ino: In function 'void setup()':
sketch_oct02a:406: error: 'ether' was not declared in this scope
sketch_oct02a:406: error: 'Ethernet' has not been declared
sketch_oct02a.ino: In function 'void loop()':
sketch_oct02a:822: error: 'ether' was not declared in this scope
sketch_oct02a:873: error: 'freeMemory' was not declared in this scope
sketch_oct02a.ino: In function 'void EthernetSendUDP(uint8_t)':
sketch_oct02a:894: error: 'ether' was not declared in this scope
sketch_oct02a.ino: At global scope:
sketch_oct02a:920: error: variable or field 'homePage' declared void
sketch_oct02a:920: error: 'BufferFiller' was not declared in this scope
sketch_oct02a:920: error: 'buf' was not declared in this scope

Now, I don't have the EtherCard library installed. Partly because I don't have an ENCxxxxx-chipped ethernet card, and partly because you didn't provide a link to the library.

Ok thank you shall I post the library I am using?
And I also have the same messages when I try to compile except the ones that connect to the ENC...
I need to say that I didn´t write the code I got it from a user who has the same Automationsystem than I do. Sine he already helped me a lot I want to give him a little pause and also it is better for my understanding if I (at least try) too figure it out "myself".
I attached the library to the message

Greetings Stefan

ethercard-master.zip (98.1 KB)

After installing the library, I now get these errors:

sketch_oct02a.ino: In function 'void loop()':
sketch_oct02a:873: error: 'freeMemory' was not declared in this scope
sketch_oct02a.ino: In function 'void homePage(BufferFiller&)':
sketch_oct02a:935: error: 'freeMemory' was not declared in this scope

Theese are exactly the same messages I get. You have any idea what I can do?

You have any idea what I can do?

Several things.

  1. Contact the original author and ask where the hell the function is.
  2. Remove the code that tries to call the function.
  3. Create an empty function with that name that does nothing.
  4. Create a function that does something, based on:
    Arduino Playground - HomePage

Ok Paul I thank you very much I´ll get in contact with the autor of the sketch I guess he got it running on his system. Do you mean the funcntion "freeMemory"? Sorry if I ask stupid questions but I´m trying to learn and its hard for a beginner. I come from step7 and this is totally different. S7 is drawing compared to arduino.

Greetings Stefan

Do you mean the funcntion "freeMemory"?

Yes. That function IS defined in the link I provided. Just copy the function from the link and paste it in your sketch. At the bottom is fine.