Ethernet shield issues + sending OSCs

Hi guys,

I’m a newbie in using the Arduino Ethernet Shield v2 (Arduino product code A000024) and I’m experiencing some strange behaviousr on a critical work with strict deadline :confused:.

The project involve some Arduino (both UNOs and MEGA2560s) sending sensor data via OSC to a couple of destination PCs for later processing.

To do that I’m using what it seemed to me to be a quite simple to use Arduino OSC library, the CNMAT one.

I’ve noticed this facts:

  • Fact 1, which I think is not dependant on the Ethernet shield itself but on the firmware I’ve written and on the library I’m using. The firmware (find one of them attached) is stucked, or running terribly slowly, when the destination PC is not connected on the LAN. Why? This sounds strange to me because I’ve always used OSC in my work (especially on software written for and running on PC) whitout problems in similar situations;

Is there a way to prevent my code from remaining stucked if something like this occurs?
Maybe is out there another OSC library for Arduino which works better?

  • Fact 2, which I think is related to some hardware malfunction. I’ve found my code getting stucked even with a correct setup of the LAN. The code stop working, stop sending OSC messages, Ethernet shield is no more reachable with the ping. This persists also after loading again the code, or manually resetting the Arduino board. Initially I thought it was my fault but I’ve found that, substituting the shield with another one, the problem magically disappeared. On one of the problematic shield I’ve also experienced many continuos shutdown and startup of the Arduino every 5 seconds;

Are these ethernet shield known to be defective or having some issues?
The strange thing is that I’ve experienced this problem on 3 out of 8 of them: this is super critical!

Have you experienced something similar?
Do you know of similar problems occured before?

Let me know as soon as you can and thank you so much for your help and support.
bests
na

test.zip (4.18 KB)

The firmware (find one of them attached) is stucked, or running terribly slowly, when the destination PC is not connected on the LAN. Why?

What exactly does that mean? How do you know? In the code you posted UDP is used so the receiving device is not checked, it may be listening or simply omited.

Maybe is out there another OSC library for Arduino which works better?

I don't think the OSC library is responsible for that.

which I think is related to some hardware malfunction. I've found my code getting stucked even with a correct setup of the LAN. The code stop working, stop sending OSC messages, Ethernet shield is no more reachable with the ping. This persists also after loading again the code, or manually resetting the Arduino board.

Did you buy an original Arduino Ethernet Shield? I never heard of an non-clone board behaving like this.

The strange thing is that I've experienced this problem on 3 out of 8 of them: this is super critical!

Where did you buy them? Post a link to the store!

Did you use them on an UNO or on a Mega2560? How did you power the setup? Where the boards original Arduino hardware?

Hi pylon and thank you for you quick feedback, so lets examine it point by point:

What exactly does that mean? How do you know?

When I work in the preliminary phase of the prototypes I always use the serial monitor to print internal statements in a continuous way to see what is going on the loop.

It happend to me that, if the OSC server PC is not connected on the LAN, the code is stucked in the sense that also the continuous serial printing stops and I don’t see any new line beeing printed or, some other time, those line are printed with an extremely big time and irregular interval between them.

If I comment out the OSC part, the firmware behaves normally without any problems.

This happens also if the LAN cable is disconnected from the Arduino Ethernet shield at the startup of the Arduino.

In the code you posted UDP is used so the receiving device is not checked, it may be listening or simply omited.

Is there a library function I can use to check if the destination device is online? Sorry :-[ , I didn’t realize it.
Can you post maybe a code example of the “proper way” to do the check?

Did you buy an original Arduino Ethernet Shield? I never heard of an non-clone board behaving like this.

Yes, I’ve always used original Arduino hardware. I’m a great fan of the platform and I’ve developed firmware on that for many years.

Where did you buy them? Post a link to the store!

I’ve bought them from the same store I’ve always used in all these years withou any problems. Talking about Digikey (product link) and Rs Components (product link)

Did you use them on an UNO or on a Mega2560?

I’m using those shields both on Arduino UNO and Arduino MEGA2560.

How did you power the setup?

I’m powering the Arduinos using a Mean-Well RD-85-A which is a Dual Output Switching Power Supply.
I’m connecting its second channel (12V out) to the Vin pin of the Arduinos.

Where the boards original Arduino hardware?

Also the Arduino boards are original Arduino ones that I bought from the same supplier mentioned above.
Thank you for your support
let me know

It happend to me that, if the OSC server PC is not connected on the LAN, the code is stucked in the sense that also the continuous serial printing stops and I don't see any new line beeing printed or, some other time, those line are printed with an extremely big time and irregular interval between them.

The only way the Ethernet Shield may detect that is if it waits for the ARP request to be answered. It shouldn't happen (given my assumptions of the inernal working of the WizNet chip are correct) if you disconnect the PC after you ran the sketch for a while (so the ARP cache is filled with the PC's MAC address/IP translation).

Is there a library function I can use to check if the destination device is online? Sorry :-[ , I didn't realize it.
Can you post maybe a code example of the "proper way" to do the check?

You can use a network ping library (attention, there is a library named Ping that handles ultrasonic distance devices). This will tell you if the device is online but ti has to do an ARP request too, so if that really slows your sektch down, that won't help much.

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