Arduino UNO WiFi Rev2 and Arduino Ethernet Shield Rev2

Hello everyone,

Please I need help. I am using two board Arduino. On the first stage, I use Arduino Uno Wifi Rev2 and on the top of it, I plugged the Arduino Ethernet Shield Rev2. The MAC address of Arduino Wifi Rev2 is : 0xA8, 0x61, 0x0A, 0xAF, 0x16, 0xC1.
In order to operate the Ethernet communication, I upload the application below inside the kit Arduino Wifi Rev2 by using Usb connection cable.


#include <ModbusIP.h>
#include <Modbus.h>
#include <Ethernet.h>
#include <SPI.h>
#include <ArduinoRS485.h>

int tanklevel;
int tanklevel_old;

const int tanklevel_ir = 100;

//Modbus IP Object
ModbusIP mb;

void setup() {
Serial.begin(9600);

// The media access control (ethernet hardware) address for the shield
byte mac[] = { 0xA8, 0x61, 0x0A, 0xAF, 0x16, 0xC1 };
// The IP address for the shield
byte ip[] = { 192, 168, 1, 124 };

//Config Modbus IP
mb.config(mac, ip);

mb.addIreg(tanklevel_ir);

tanklevel = 12;
tanklevel_old = 12;

mb.Ireg (tanklevel_ir, tanklevel);

DisplayCurrentValues();

}

void loop() {

mb.task();

// send updated values
CheckForDataChange();

}

void CheckForDataChange() {

boolean data_has_changed = false;

if (tanklevel_old != tanklevel) {
data_has_changed = true;
tanklevel_old = tanklevel;
}

if (data_has_changed == true) {
DisplayCurrentValues();
}

}

void DisplayCurrentValues() {

String tmpstr;

tmpstr = "Tank Level: " + String(tanklevel) + " ft";
Serial.println(tmpstr);

}


Please can someone help me.

Aristide Yannic.

The issue is that I am not able to communicate withe the Ethernet Shield board. When I try a ping 192.168.1.124 there is no respond. My laptop is configure to 192.168.1.127, mask: 255.255.255.0 Gateway 192.168.1.1.

Please help me.

add Ethernet.nit(10); before Ethernet.begin

Thank you Juraj,
your post help a lot to understand the pin 10 used by Ethernet.
However, I've tried this as you mentioned:
Ethernet.init(10);
Ethernet.begin(mac, ip);
But the issue remain. I am not able to ping the Arduino Tcp board.
image

Do you have any solution please?
Thanks

Hello everyone,

It's seems there is compatibility problem while combining the Arduino Uno WiFi Rev2 and Arduino Ethernet Shield Rev2. The picture below coming from the Arduino Uno WiFi Rev2, Website shows the compatibility cards.

However, on the website page of Ethernet Shield Rev2, there is compatibility between Uno WiFi Rev2 and Ethernet Shield Rev2. That's bring some confusing way...

Please confirm my analyze and let me know if I am wrong or not.

The project that I driving at this moment require to use a TCP communication shield and IOT board.

Please, I need your help. Please feel free to send to me an email.
Aristide

try the examples of the Ethernet library. don't forget Ethernet.init(10)

Hello everyone,
Thanks Juraj. The problem has been fixed. I'm now able to ping my Ethernet shield rev2.
Thank you.

what did you do to actually fix the problem?

@tlock0331 this ^^^ ?

Hi,
first I used the recomandation of @Juraj, to put Ethernet.init(10).
An the, I installed all the Arduino Ethernet libraries.

Thank you.