Ethernet Shield 2 not working with Arduino UNO Minima

Hello,

We have an Arduino UNO Rev3 replaced with an Arduino UNO Rev4 (Minima).
The configuration has an Ethernet Shield 2. After programing the Arduino UNO Rev4 with the program that used to work on the Arduino UNO Rev3, we can't get ping replies from the new configuration.
We tried several Arduino Rev4 and several Ethernet Shields.

Thanks

do you have Ethernet.init(10); ?

Ethernet Shield 2 is compatiable with Arduino UNO Minima. Below is a screenshot from the IDE's Ethernet examples.

Hello Guys,

Thanks for taking the time to look into this issue.

Yes, the pin 10 is set in the initialization.

Also, when we program the Ethernet Shield we receive the the IP address via COM Port because we have the Arduino return the IP when running. Until that point every thing is fine.
The problem is when we disconnect the USB cable and connect the Ethernet Cable. The Arduino + Ethernet Shield doesn't respond to ping command from a PC that is connected in the same network.

Thanks

Hello,
I am having the same problem.
The program that was working on Arduino UNO Rev3 is not working on Rev4 (Minima).
Is there any difference?

Thanks

do the examples of the Ethernet library work for you? (with Ethernet.init(10); )

how do you power the board with USB disconnected?

Hello Juraj,

I'm not sure. I'll get back to you with the answer tomorrow, I don't have the equipment with me right now.

Thanks

Osiris

Hello Juraj,

I'm trying it out on "Web Server" Example.(with Ethernet.init(10); ).
And after trying it on R4, I replaced the Eathernet Sheild with R3 with the same program written on it, and it communicates properly.

Also , I tried with USB disconnected and power supplied, but no luck.

Thanks

Hello Guys,

Today I program the Web Server example on the Arduino Uno Minima (Rev4) and did not work.

I tried several times with my program and it worked once, using the power from the USB.

It looks like we have timing issues with the new Arduino Minima, Only the manufacturer can confirm this scenario.

Thanks

did you try with examples?

I have no problem with Ethernet shield on Uno R4 WiFi powered from USB

1 Like

Hello Juraj,

I tried the examples and I had the same results, not replying to ping commands from another PC.

My setup uses Arduino UNO Rev3, I wanted to upgrade it to ARDUINO UNO rev4 Minima. I can not use the Wi-Fi variant.

As I mentioned before I made it to reply once. I'm still thinking on timing issues.

Thanks

Osiris

Hello,

I could make it work all the time by powering it using the USB but connected to the computer.
Again, I'm sending ping commands via Ethernet connection but the Arduino UNO Rev4 Minima + Ethernet Shield.

It does not work if powered with and external power supply or using the same USB port but just connected to a charger.

It only works if powered from the USB and connected to the PC.

This is not practical, any ideas?

Thanks

Osiris

Hello,

I tried another Arduino UNO Rev3 and it works all the time, no matter how you power it.

Definitely there are differences between Arduino UNO Rev3 and Arduino UNO Rev4 Minima that make it not to work with the Ethernet Shield.

Please I need help from the Arduino Developers.

Thanks

Osiris

I guess Uno R4 + Ethernet shield has higher power consumption than classic Uno + Ethernet shield

Is there a line like while (!Serial) in your code? maybe that is the reason why it only works when it is connected to the computer and the serial port is open

1 Like

Hello Mario-r,

Yes, I have that line. This is the code I have:

#include<SPI.h>
#include<Ethernet.h>
#include <Adafruit_MAX31856.h>
#define DRDY_PIN 8

// Use software SPI: CS, DI, DO, CLK
//Adafruit_MAX31856 maxthermo = Adafruit_MAX31856(10, 11, 12, 13);
// use hardware SPI, just pass in the CS pin

Adafruit_MAX31856 maxthermo = Adafruit_MAX31856(9);
int index = -1;
int ethernetCS = 10;
int maxthermoCS = 9;
int SDcardCS = 4;
int pin;
int FanRelay = 2;


byte mac[] = {0xA8, 0x61, 0x0A, 0xAE, 0x98, 0x45};
IPAddress ip(192, 168, 0, 99);

EthernetServer server(80);
String readString;

void setup() {
  
  pinMode(ethernetCS, OUTPUT);
  digitalWrite(ethernetCS, HIGH); //disable Ethernet Shield
  
  pinMode(DRDY_PIN, INPUT);
  pinMode(maxthermoCS, OUTPUT);
  digitalWrite(maxthermoCS, HIGH); //disable Adafruit_MAX31856 board

  pinMode(SDcardCS, OUTPUT);
  digitalWrite(SDcardCS, HIGH); //disable SD Card on the Ethernet Shield
  
  Serial.begin(115200);
  while (!Serial) delay(10);
  Serial.print("Initializing Ethernet Shield...");

  Ethernet.begin(mac, ip);
  Serial.print("Server is at ");
  Serial.println(Ethernet.localIP());
  pinMode(ethernetCS, OUTPUT);
  digitalWrite(ethernetCS, HIGH); //disable Ethernet Shield
  
  Serial.println("MAX31856 thermocouple");
  if (!maxthermo.begin()) {
  Serial.println("Could not initialize thermocouple.");
  while (1) delay(10);
  }

  maxthermo.setThermocoupleType(MAX31856_TCTYPE_K);

  
  Serial.print("Thermocouple type: ");
  switch (maxthermo.getThermocoupleType() ) {
    case MAX31856_TCTYPE_B: Serial.println("B Type"); break;
    case MAX31856_TCTYPE_E: Serial.println("E Type"); break;
    case MAX31856_TCTYPE_J: Serial.println("J Type"); break;
    case MAX31856_TCTYPE_K: Serial.println("K Type"); break;
    case MAX31856_TCTYPE_N: Serial.println("N Type"); break;
    case MAX31856_TCTYPE_R: Serial.println("R Type"); break;
    case MAX31856_TCTYPE_S: Serial.println("S Type"); break;
    case MAX31856_TCTYPE_T: Serial.println("T Type"); break;
    case MAX31856_VMODE_G8: Serial.println("Voltage x8 Gain mode"); break;
    case MAX31856_VMODE_G32: Serial.println("Voltage x8 Gain mode"); break;
    default: Serial.println("Unknown"); break;
  }
  maxthermo.setConversionMode(MAX31856_ONESHOT_NOWAIT);
  pinMode(maxthermoCS, OUTPUT);
  digitalWrite(maxthermoCS, HIGH); //disable Adafruit_MAX31856 board

  pinMode(ethernetCS, OUTPUT);
  digitalWrite(ethernetCS, LOW); //enable Ethernet Shield

  pinMode(FanRelay, OUTPUT);
  digitalWrite(FanRelay, HIGH); //Fan On
  delay(3000);
  digitalWrite(FanRelay, LOW); //Fan Off
}

void loop() {
  EthernetClient client = server.available();

  if (client) {
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        //Serial.print(c);

        if (readString.length() < 100) {
          readString += c;
        }

        if (c == '\n') {
          Serial.print(readString);
          client.println("HTTP/1.1 200 OK"); 
                    

          if (readString.indexOf("?TEMP") > 0) {
            
            digitalWrite(ethernetCS, HIGH); //disable Ethernet Shield            
            digitalWrite(maxthermoCS, LOW); //enable Adafruit_MAX31856 board
            
            maxthermo.triggerOneShot(); // Trigger the reading
            delay(500);

            if (maxthermo.conversionComplete()) {
              double Temp = maxthermo.readThermocoupleTemperature();
              if (Temp > 37) {
               digitalWrite(FanRelay, HIGH); //Fan On
              }
               
               if (Temp < 35) {
               digitalWrite(FanRelay, LOW); //Fan Off
              }

              Serial.println(Temp);
              
              digitalWrite(maxthermoCS, HIGH); //disable Adafruit_MAX31856 board  
              digitalWrite(ethernetCS, LOW); //enable Ethernet Shield             
              client.println("Temp: " + String(Temp));
            }
            else {
              Serial.println("Conversion not complete!");

              digitalWrite(maxthermoCS, HIGH); //disable Adafruit_MAX31856 board  
              digitalWrite(ethernetCS, LOW); //enable Ethernet Shield
              client.println("Conversion not complete!");
            }           

          }
          
          if (readString.indexOf("?DO") > 0) {
            index = readString.indexOf("?DO");
            String pinStr = readString.substring((index + 3), (index + 5));
            Serial.print("Digital Pin String: ");
            Serial.println(pinStr);
            pin = pinStr.toInt();
            Serial.print("Pin Number: ");
            Serial.println(pin);

            String pinVal = readString.substring((index + 5), (index + 6));
            Serial.print("Value To Write: ");
            Serial.println(pinVal);
            pinMode(pin, OUTPUT);
            if (pinVal == "0") {
              digitalWrite(pin, LOW);
            }
            else {
              digitalWrite(pin, HIGH);
            }
            client.println("Written Value: " + pinVal);
          }
          
          readString = "";
          delay(100);
          client.stop();
        }

      }

    }


  }

}

When I finish the uploading, I receive the IP via serial port but when I disconnect the USB cable and send "ping 192.168.0.99" from a PC in the same network "192.168.0.50" I don't get replies.

This setup:
Arduino UNO +Ethernet shield + the code above

it work on Arduino UNO Rev3, but not on the Arduino UNO Rev4.

Thanks

Osiris

Thanks

Osiris

you disconnect the USB cable while the sketch is running? I guess it will block it on the next Serial.print

If you disconnect the USB, you don't have an emulated COM port that the software is waiting for
while (!Serial)
Eth shield itself needs 250ms from reset to run, this sometimes causes problems if the software does not wait before initializing the Wiz5500/Wiz5100

Hello adatat_73,

I added a 500 ms delay, first line in the setup().

I still have the same problem Arduino UNO R4 + Ethernet Shield are not working.

Considering this fact, the Arduino Ethernet Shield should be remove from the Arduino UNO R4 compatible devices.

Thanks

Osiris

did you try to remove while (!Serial)?