Atmega4808 + Enc28j60 Ethernet compile Error

Hello I know the atmega4808 is still kind of new to arduino. but I ran into a little compiling error.

It says there is a incompatable with the 4808 for the enc 28j60 library. below I'm attaching the example code and error of which came up. I'm unsure what to do or how to fix this. Can someone please help me?

// Present a "Will be back soon web page", as stand-in webserver.
// 2011-01-30 <jc@wippler.nl>
//
// License: GPLv2

#include <EtherCard.h>

#define STATIC 1  // set to 1 to disable DHCP (adjust myip/gwip values below)

#if STATIC
// ethernet interface ip address
static byte myip[] = {192,168,1,100};
// gateway ip address
static byte gwip[] = { 192,168,1,1 };
#endif

// ethernet mac address - must be unique on your network
static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };

byte Ethernet::buffer[500]; // tcp/ip send and receive buffer

const char page[] PROGMEM =
"HTTP/1.0 503 Service Unavailable\r\n"
"Content-Type: text/html\r\n"
"Retry-After: 600\r\n"
"\r\n"
"<html>"
  "<head><title>"
    "Service Temporarily Unavailable"
  "</title></head>"
  "<body>"
    "<h3>This service is currently unavailable</h3>"
    "<p><em>"
      "The main server is currently off-line.<br />"
      "Please try again later."
    "</em></p>"
  "</body>"
"</html>"
;

void setup(){
  Serial.begin(57600);
  Serial.println("\n[backSoon]");

  // Change 'SS' to your Slave Select pin, if you arn't using the default pin
  if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0)
    Serial.println( "Failed to access Ethernet controller");
#if STATIC
  ether.staticSetup(myip, gwip);
#else
  if (!ether.dhcpSetup())
    Serial.println("DHCP failed");
#endif

  ether.printIp("IP:  ", ether.myip);
  ether.printIp("GW:  ", ether.gwip);
  ether.printIp("DNS: ", ether.dnsip);

}

void loop(){
  // wait for an incoming TCP packet, but ignore its contents
  if (ether.packetLoop(ether.packetReceive())) {
    memcpy_P(ether.tcpOffset(), page, sizeof page);
    ether.httpServerReply(sizeof page - 1);
  }
}

Error

WARNING: library EtherCard claims to run on avr architecture(s) and may be incompatible with your current board which runs on megaavr architecture(s).
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp: In static member function 'static void ENC28J60::initSPI()':
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:245:5: error: 'SPCR' was not declared in this scope
     SPCR = bit(SPE) | bit(MSTR); // 8 MHz @ 16
     ^~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:245:5: note: suggested alternative: 'SCL'
     SPCR = bit(SPE) | bit(MSTR); // 8 MHz @ 16
     ^~~~
     SCL
In file included from C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/ArduinoAPI.h:52:0,
                 from C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/Arduino.h:23,
                 from C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:12:
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:245:16: error: 'SPE' was not declared in this scope
     SPCR = bit(SPE) | bit(MSTR); // 8 MHz @ 16
                ^
C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/Common.h:77:25: note: in definition of macro 'bit'
 #define bit(b) (1UL << (b))
                         ^
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:245:16: note: suggested alternative: 'PE'
     SPCR = bit(SPE) | bit(MSTR); // 8 MHz @ 16
                ^
C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/Common.h:77:25: note: in definition of macro 'bit'
 #define bit(b) (1UL << (b))
                         ^
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:245:27: error: 'MSTR' was not declared in this scope
     SPCR = bit(SPE) | bit(MSTR); // 8 MHz @ 16
                           ^
C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/Common.h:77:25: note: in definition of macro 'bit'
 #define bit(b) (1UL << (b))
                         ^
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:245:27: note: suggested alternative: 'PSTR'
     SPCR = bit(SPE) | bit(MSTR); // 8 MHz @ 16
                           ^
C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/Common.h:77:25: note: in definition of macro 'bit'
 #define bit(b) (1UL << (b))
                         ^
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:246:12: error: 'SPSR' was not declared in this scope
     bitSet(SPSR, SPI2X);
            ^
C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/Common.h:72:30: note: in definition of macro 'bitSet'
 #define bitSet(value, bit) ((value) |= (1UL << (bit)))
                              ^~~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:246:12: note: suggested alternative: 'SS'
     bitSet(SPSR, SPI2X);
            ^
C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/Common.h:72:30: note: in definition of macro 'bitSet'
 #define bitSet(value, bit) ((value) |= (1UL << (bit)))
                              ^~~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:246:18: error: 'SPI2X' was not declared in this scope
     bitSet(SPSR, SPI2X);
                  ^
C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/Common.h:72:49: note: in definition of macro 'bitSet'
 #define bitSet(value, bit) ((value) |= (1UL << (bit)))
                                                 ^~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:246:18: note: suggested alternative: 'SPI_t'
     bitSet(SPSR, SPI2X);
                  ^
C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/Common.h:72:49: note: in definition of macro 'bitSet'
 #define bitSet(value, bit) ((value) |= (1UL << (bit)))
                                                 ^~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp: In function 'void xferSPI(byte)':
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:260:5: error: 'SPDR' was not declared in this scope
     SPDR = data;
     ^~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:260:5: note: suggested alternative: 'SDA'
     SPDR = data;
     ^~~~
     SDA
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:261:14: error: 'SPSR' was not declared in this scope
     while (!(SPSR&(1<<SPIF)))
              ^~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:261:14: note: suggested alternative: 'SS'
     while (!(SPSR&(1<<SPIF)))
              ^~~~
              SS
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:261:23: error: 'SPIF' was not declared in this scope
     while (!(SPSR&(1<<SPIF)))
                       ^~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:261:23: note: suggested alternative: 'SPI0'
     while (!(SPSR&(1<<SPIF)))
                       ^~~~
                       SPI0
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp: In function 'byte readOp(byte, byte)':
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:271:19: error: 'SPDR' was not declared in this scope
     byte result = SPDR;
                   ^~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:271:19: note: suggested alternative: 'SDA'
     byte result = SPDR;
                   ^~~~
                   SDA
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp: In function 'void readBuf(uint16_t, byte*)':
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:290:9: error: 'SPDR' was not declared in this scope
         SPDR = 0x00;
         ^~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:290:9: note: suggested alternative: 'SDA'
         SPDR = 0x00;
         ^~~~
         SDA
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:292:22: error: 'SPSR' was not declared in this scope
             while (!(SPSR & (1<<SPIF)))
                      ^~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:292:22: note: suggested alternative: 'SS'
             while (!(SPSR & (1<<SPIF)))
                      ^~~~
                      SS
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:292:33: error: 'SPIF' was not declared in this scope
             while (!(SPSR & (1<<SPIF)))
                                 ^~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:292:33: note: suggested alternative: 'SPI0'
             while (!(SPSR & (1<<SPIF)))
                                 ^~~~
                                 SPI0
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:298:18: error: 'SPSR' was not declared in this scope
         while (!(SPSR & (1<<SPIF)))
                  ^~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:298:18: note: suggested alternative: 'SS'
         while (!(SPSR & (1<<SPIF)))
                  ^~~~
                  SS
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:298:29: error: 'SPIF' was not declared in this scope
         while (!(SPSR & (1<<SPIF)))
                             ^~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:298:29: note: suggested alternative: 'SPI0'
         while (!(SPSR & (1<<SPIF)))
                             ^~~~
                             SPI0
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp: In function 'void writeBuf(uint16_t, const byte*)':
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:310:9: error: 'SPDR' was not declared in this scope
         SPDR = *data++;
         ^~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:310:9: note: suggested alternative: 'SDA'
         SPDR = *data++;
         ^~~~
         SDA
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:313:19: error: 'SPSR' was not declared in this scope
          while (!(SPSR & (1<<SPIF)))
                   ^~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:313:19: note: suggested alternative: 'SS'
          while (!(SPSR & (1<<SPIF)))
                   ^~~~
                   SS
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:313:30: error: 'SPIF' was not declared in this scope
          while (!(SPSR & (1<<SPIF)))
                              ^~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:313:30: note: suggested alternative: 'SPI0'
          while (!(SPSR & (1<<SPIF)))
                              ^~~~
                              SPI0
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:317:18: error: 'SPSR' was not declared in this scope
         while (!(SPSR & (1<<SPIF)))
                  ^~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:317:18: note: suggested alternative: 'SS'
         while (!(SPSR & (1<<SPIF)))
                  ^~~~
                  SS
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:317:29: error: 'SPIF' was not declared in this scope
         while (!(SPSR & (1<<SPIF)))
                             ^~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:317:29: note: suggested alternative: 'SPI0'
         while (!(SPSR & (1<<SPIF)))
                             ^~~~
                             SPI0
In file included from C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/ArduinoAPI.h:52:0,
                 from C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/Arduino.h:23,
                 from C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:12:
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp: In static member function 'static byte ENC28J60::initialize(uint16_t, const byte*, byte)':
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:371:17: error: 'SPCR' was not declared in this scope
     if (bitRead(SPCR, SPE) == 0)
                 ^
C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/Common.h:71:32: note: in definition of macro 'bitRead'
 #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
                                ^~~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:371:17: note: suggested alternative: 'SCL'
     if (bitRead(SPCR, SPE) == 0)
                 ^
C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/Common.h:71:32: note: in definition of macro 'bitRead'
 #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
                                ^~~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:371:23: error: 'SPE' was not declared in this scope
     if (bitRead(SPCR, SPE) == 0)
                       ^
C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/Common.h:71:43: note: in definition of macro 'bitRead'
 #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
                                           ^~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:371:23: note: suggested alternative: 'PE'
     if (bitRead(SPCR, SPE) == 0)
                       ^
C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/Common.h:71:43: note: in definition of macro 'bitRead'
 #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
                                           ^~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp: In static member function 'static uint8_t ENC28J60::doBIST(byte)':
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:662:17: error: 'SPCR' was not declared in this scope
     if (bitRead(SPCR, SPE) == 0)
                 ^
C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/Common.h:71:32: note: in definition of macro 'bitRead'
 #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
                                ^~~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:662:17: note: suggested alternative: 'SCL'
     if (bitRead(SPCR, SPE) == 0)
                 ^
C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/Common.h:71:32: note: in definition of macro 'bitRead'
 #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
                                ^~~~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:662:23: error: 'SPE' was not declared in this scope
     if (bitRead(SPCR, SPE) == 0)
                       ^
C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/Common.h:71:43: note: in definition of macro 'bitRead'
 #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
                                           ^~~
C:\Users\jJc\Documents\Arduino\libraries\EtherCard\src\enc28j60.cpp:662:23: note: suggested alternative: 'PE'
     if (bitRead(SPCR, SPE) == 0)
                       ^
C:\Users\jJc\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.0.8\cores\coreX-corefiles/api/Common.h:71:43: note: in definition of macro 'bitRead'
 #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
                                           ^~~
exit status 1
Error compiling for board ATmega4808.

Joseph

That is not little, it needs a rewrite to work. Just use an ATMEGA328! It will save all the issues you are having.

I recommend my EthernetENC library which has the standard Arduino Ethernet API and compiles on 4809

I do not have any 328. But I currently only have these 4808.

Joseph

Hey Juraj do you have a link? Currently I’m not at my desk. Or do you have a link for your whole libraries please?

Joseph

in Library Manager

I downloaded your library and there is no Example ones that I can find and test. Do I need to change something on mine to go to your library? I did change it to the 4809 from the 4808 in the board selection.

Joseph

https://github.com/jandrassy/EthernetENC/wiki/Examples

hello, I did change out what it is needed and I get new error message. I'll post the original code and the new code with the library change.

Original code

// Present a "Will be back soon web page", as stand-in webserver.
// 2011-01-30 <jc@wippler.nl>
//
// License: GPLv2

#include <EtherCard.h>

#define STATIC 0  // set to 1 to disable DHCP (adjust myip/gwip values below)

#if STATIC
// ethernet interface ip address
static byte myip[] = { 192,168,1,200 };
// gateway ip address
static byte gwip[] = { 192,168,1,1 };
#endif

// ethernet mac address - must be unique on your network
static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };

byte Ethernet::buffer[500]; // tcp/ip send and receive buffer

const char page[] PROGMEM =
"HTTP/1.0 503 Service Unavailable\r\n"
"Content-Type: text/html\r\n"
"Retry-After: 600\r\n"
"\r\n"
"<html>"
  "<head><title>"
    "Service Temporarily Unavailable"
  "</title></head>"
  "<body>"
    "<h3>This service is currently unavailable</h3>"
    "<p><em>"
      "The main server is currently off-line.<br />"
      "Please try again later."
    "</em></p>"
  "</body>"
"</html>"
;

void setup(){
  Serial.begin(57600);
  Serial.println("\n[backSoon]");

  // Change 'SS' to your Slave Select pin, if you arn't using the default pin
  if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0)
    Serial.println( "Failed to access Ethernet controller");
#if STATIC
  ether.staticSetup(myip, gwip);
#else
  if (!ether.dhcpSetup())
    Serial.println("DHCP failed");
#endif

  ether.printIp("IP:  ", ether.myip);
  ether.printIp("GW:  ", ether.gwip);
  ether.printIp("DNS: ", ether.dnsip);
}

void loop(){
  // wait for an incoming TCP packet, but ignore its contents
  if (ether.packetLoop(ether.packetReceive())) {
    memcpy_P(ether.tcpOffset(), page, sizeof page);
    ether.httpServerReply(sizeof page - 1);
  }
}

New sketch

// Present a "Will be back soon web page", as stand-in webserver.
// 2011-01-30 <jc@wippler.nl>
//
// License: GPLv2

//#include <EtherCard.h>
#include <EthernetENC.h>
#define STATIC 0  // set to 1 to disable DHCP (adjust myip/gwip values below)

#if STATIC
// ethernet interface ip address
static byte myip[] = { 192,168,1,200 };
// gateway ip address
static byte gwip[] = { 192,168,1,1 };
#endif

// ethernet mac address - must be unique on your network
static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };

byte Ethernet::buffer[500]; // tcp/ip send and receive buffer

const char page[] PROGMEM =
"HTTP/1.0 503 Service Unavailable\r\n"
"Content-Type: text/html\r\n"
"Retry-After: 600\r\n"
"\r\n"
"<html>"
  "<head><title>"
    "Service Temporarily Unavailable"
  "</title></head>"
  "<body>"
    "<h3>This service is currently unavailable</h3>"
    "<p><em>"
      "The main server is currently off-line.<br />"
      "Please try again later."
    "</em></p>"
  "</body>"
"</html>"
;

void setup(){
  Serial.begin(57600);
  Serial.println("\n[backSoon]");

  // Change 'SS' to your Slave Select pin, if you arn't using the default pin
  if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0)
    Serial.println( "Failed to access Ethernet controller");
#if STATIC
  ether.staticSetup(myip, gwip);
#else
  if (!ether.dhcpSetup())
    Serial.println("DHCP failed");
#endif

  ether.printIp("IP:  ", ether.myip);
  ether.printIp("GW:  ", ether.gwip);
  ether.printIp("DNS: ", ether.dnsip);
}

void loop(){
  // wait for an incoming TCP packet, but ignore its contents
  if (ether.packetLoop(ether.packetReceive())) {
    memcpy_P(ether.tcpOffset(), page, sizeof page);
    ether.httpServerReply(sizeof page - 1);
  }
}

New error message


backSoon:20:6: error: 'Ethernet' is not a class, namespace, or enumeration
 byte Ethernet::buffer[500]; // tcp/ip send and receive buffer
      ^~~~~~~~
C:\Users\jJc\AppData\Local\Temp\arduino_modified_sketch_83649\backSoon.ino: In function 'void setup()':
backSoon:46:7: error: 'ether' was not declared in this scope
   if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0)
       ^~~~~
C:\Users\jJc\AppData\Local\Temp\arduino_modified_sketch_83649\backSoon.ino:46:7: note: suggested alternative: 'getchar'
   if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0)
       ^~~~~
       getchar
backSoon:46:26: error: 'Ethernet' is not a class, namespace, or enumeration
   if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0)
                          ^~~~~~~~
backSoon:51:8: error: 'ether' was not declared in this scope
   if (!ether.dhcpSetup())
        ^~~~~
C:\Users\jJc\AppData\Local\Temp\arduino_modified_sketch_83649\backSoon.ino:51:8: note: suggested alternative: 'getchar'
   if (!ether.dhcpSetup())
        ^~~~~
        getchar
backSoon:55:3: error: 'ether' was not declared in this scope
   ether.printIp("IP:  ", ether.myip);
   ^~~~~
C:\Users\jJc\AppData\Local\Temp\arduino_modified_sketch_83649\backSoon.ino:55:3: note: suggested alternative: 'getchar'
   ether.printIp("IP:  ", ether.myip);
   ^~~~~
   getchar
C:\Users\jJc\AppData\Local\Temp\arduino_modified_sketch_83649\backSoon.ino: In function 'void loop()':
backSoon:62:7: error: 'ether' was not declared in this scope
   if (ether.packetLoop(ether.packetReceive())) {
       ^~~~~
C:\Users\jJc\AppData\Local\Temp\arduino_modified_sketch_83649\backSoon.ino:62:7: note: suggested alternative: 'getchar'
   if (ether.packetLoop(ether.packetReceive())) {
       ^~~~~
       getchar
exit status 1
'Ethernet' is not a class, namespace, or enumeration

Joseph

I'm not sure what would be the next step. I'm just running a simple web server and it looks like From that page #8 says to only change #include <EtherCard.h> to #include <EthernetENC.h>. Is there any other thing I needed to change?

Joseph

Hi,

Don't you have a UNO or Nano?

Tom... :grinning: :+1: :coffee: :australia:

Hello Tom, No not at the moment I lend it to a friend of mine my uno board about 200 miles away. I don't think I will get it back anytime soon lol

Joseph

I think i read the website a little wrong. It looks like I'm suppose to use the ethernet example not the etherCard example. Let me try that.

Joseph

the ethercard library has a not standard API. the EthernetENC library has the same API as the Arduino Ethernet library.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.