Go Down

Topic: Nano Every and ethernet shield with ENC28J60 (Read 91 times) previous topic - next topic

leonardoburchi

Hi all,
I bought the new Nano every with an ethernet shield compatible with Arduino Nano equipeed with ENC28J60 controller.

I'm trying to use UIPEthernet or EtherCard but with both libraries I'm getting back a lot of errors during compile.

Attached you can find all the error I have from the IDE using EtherCard and here the example sketch taken from ethercard samples:

Code: [Select]
// This demo does web requests via DHCP and DNS lookup.
// 2011-07-05 <jc@wippler.nl>
//
// License: GPLv2

#include <EtherCard.h>

#define REQUEST_RATE 5000 // milliseconds

// ethernet interface mac address
static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };
// remote website name
const char website[] PROGMEM = "google.com";

byte Ethernet::buffer[700];
static long timer;

// called when the client request is complete
static void my_result_cb (byte status, word off, word len) {
  Serial.print("<<< reply ");
  Serial.print(millis() - timer);
  Serial.println(" ms");
  Serial.println((const char*) Ethernet::buffer + off);
}

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

  // 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 (!ether.dhcpSetup())
    Serial.println("DHCP failed");

  ether.printIp("My IP: ", ether.myip);
  // ether.printIp("Netmask: ", ether.mymask);
  ether.printIp("GW IP: ", ether.gwip);
  ether.printIp("DNS IP: ", ether.dnsip);

  if (!ether.dnsLookup(website))
    Serial.println("DNS failed");
  ether.printIp("Server: ", ether.hisip);

  timer = - REQUEST_RATE; // start timing out right away
}

void loop () {

  ether.packetLoop(ether.packetReceive());

  if (millis() > timer + REQUEST_RATE) {
    timer = millis();
    Serial.println("\n>>> REQ");
    ether.browseUrl(PSTR("/foo/"), "bar", website, my_result_cb);
  }
}


Could you please help me to figure out how to solve it?

Thank you!!

MarcoPol31

I have the same problem even when trying to remain in "328" mode.

Seems that "nano every" is not available in covered Hardware in compiling librairies options.


pert

There was a bug that caused the Tools > Registers Emulation menu option to have no effect on the Nano Every:
https://github.com/arduino/ArduinoCore-megaavr/issues/49
That was fixed today but there has not been a new release of Arduino megaAVR Boards since then.

Go Up