FAIL: UDP Communications between a PC and an Arduino Nano

It was my intent to cover Arduino Nano UDP communications as the last segment in the various combinations of communicating between Arduino’s and PC’s or Raspberry Pi’s.

Unfortunately, after spending way more time than I should have, I had to give this idea up.

There is some sort of bug in the UDP code of the UIPEthernet library (at least thru version 1.0.9). It will start off running just fine, but after it receives 50 or so UDP packets something corrupts within it. From my perspective, udp.parsepacket simply never returns with a packet, even though packets are being sent.

I did some precursor debugging of the UIPEthernet library. The problem was not obvious and the code is complicated enough I didn’t give myself a better than 50/50 chance of ever figuring out the issue, so I quit.

I then turned to the ethercard library which I have successfully used in the past. While I have known this library to work, as I relearned its operation, I realized I would have to make a big overhaul to my own program as its operation is quite a bit different than the standard Arduino ethernet library or the UIPEthernet library.

I decided it wasn’t worth the time to make such changes. But I know if I need to use UDP on a nano in the future, I will use the ethercard library again and write the code in a manner that will work with that library.


This entry was posted in c-arduino and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.