Known Bug: EtherTen and Ardunio 1.0 DHCP

The EtherTen combines an Uno-equivalent Arduino-compatible board and Wiznet-based Ethernet support, along with a microSD card slot and Power-over-Ethernet support. [Product page]
mjoconr
Posts:12
Joined:Sun Dec 25, 2011 12:59 am
Known Bug: EtherTen and Ardunio 1.0 DHCP

Post by mjoconr » Sun Dec 25, 2011 1:19 am

Hi Guys

Is there a bug which would cause the DHCP not to work (I think the EtherTen is locking up or going into a loop) using Ardunio GUI 1.0.

I've tested the examples which use static IP and they all work but the DHCP examples do not.

My dhcp server is getting the requests out as per the log below.
Dec 25 11:20:02 gw dnsmasq[3375]: DHCPDISCOVER(br0) 00:aa:bb:cc:de:02
Dec 25 11:20:02 gw dnsmasq[3375]: DHCPOFFER(br0) 203.xxx.xxx.56 00:aa:bb:cc:de:02
Dec 25 11:20:02 gw dnsmasq[3375]: DHCPDISCOVER(br0) 00:aa:bb:cc:de:02
Dec 25 11:20:02 gw dnsmasq[3375]: DHCPOFFER(br0) 203.xxx.xxx.56 00:aa:bb:cc:de:02

So it would seem to be an issue with the processing of the response.

Cheers
Mike

mjoconr
Posts:12
Joined:Sun Dec 25, 2011 12:59 am

Re: Known Bug: EtherTen and Arduino 1.0 DHCP

Post by mjoconr » Sun Dec 25, 2011 3:17 am

Hi

So I continued searching and it would seem as if the Arduino 1.0 GUI Ethernet library do have issues. I'm going to try to build a osx app using the GIT Head and see if they have fixed it.

Mike

LukeW
Posts:91
Joined:Tue Nov 01, 2011 10:14 am

Re: Known Bug: EtherTen and Ardunio 1.0 DHCP

Post by LukeW » Sun Dec 25, 2011 5:28 am

The EtherTen is really nothing more than the same chipset as an official Arduino Ethernet Shield integrated into an Arduino Uno, on the same board, with some minor tweaks and improvements.

It's fully compatible with the official Ethernet Shield, and I don't really think there are any bugs with it.

The bugs are really with Arduino IDE 1.0, it is notorious for breaking a few things.

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts:298
Joined:Sat Oct 15, 2011 11:31 am
Location:Melbourne, Australia
Contact:

Re: Known Bug: EtherTen and Ardunio 1.0 DHCP

Post by jonoxer » Wed Dec 28, 2011 3:42 am

For what it's worth, over the last few days I've spent my time working on a new version of the light switches for my home automation system using EtherTens with DHCP (I've been building using Arduino IDE v1.0 RC2) and DHCP seems to work fine. I've put a DS18B20 temperature sensor inside each light switch so the EtherTen can steal its bus identifier and use it as a MAC address on the LAN, to save me setting a MAC address manually inside the sketch for each light switch.

It's a handy trick, and I was thinking of writing it up as a little tutorial some time.

Short answer: EtherTen + Arduino 1.0 + DHCP has been working just fine for me, so I don't think it's a problem with the board.
--
Jon

mr-russ
Posts:16
Joined:Wed Jan 18, 2012 8:46 am

Re: Known Bug: EtherTen and Ardunio 1.0 DHCP

Post by mr-russ » Wed Jan 18, 2012 9:37 am

The arduino 1.0 GUI does have problems with the ethernet module in general if you are using avr-gcc 4.5.1 and possibly other versions. Fixes have gone into git for this. I recent got an EtherTen and have had trouble with the ethernet stopping working after 30minutes to 4 hours after the board booted. After much investigation and importing the fixes to the libraries, its been running successfully for 48 hours without a hitch. I also experienced problems with 0022 on Ubuntu 11.04

I was lazy and lost all the references to this. I also do not know if it will manifest itself in the same way on your system. But there was plenty different issues found when I searched. The bugs you might be experiencing are;

http://code.google.com/p/arduino/issues/detail?id=742
http://code.google.com/p/arduino/issues/detail?id=605

As a side note, DNS bloats the sketch size a lot in 1.0. If you don't need it, removing it reduces ethernet sketch sizes considerably (3k+).

jebz
Posts:33
Joined:Sun Feb 12, 2012 10:58 pm

Re: Known Bug: EtherTen and Ardunio 1.0 DHCP

Post by jebz » Mon Feb 13, 2012 1:05 pm

jonoxer wrote: Short answer: EtherTen + Arduino 1.0 + DHCP has been working just fine for me, so I don't think it's a problem with the board.
--
Jon
I've been having some fun with a network project. DHCP was working well for a few days with the address displayed on a LCD shield. I then started investigating INI file reading and couldn't get the example to read the example ini file. A different small sketch managed to open the example ini file and send it to the serial monitor just fine.

I then returned to my main project but it wouldn't obtain a DHCP address. I tried my earlier sketch with the LCD display of the network address but still no good. I reset my home router, still no good. I put the EtherTen on a different router and it started working fine with no change. Back to the original router and still no good. Return to the 2nd router and it works. There's something not right here.

jebz
Posts:33
Joined:Sun Feb 12, 2012 10:58 pm

Re: Known Bug: EtherTen and Ardunio 1.0 DHCP

Post by jebz » Mon Feb 13, 2012 1:45 pm

jebz wrote: I then returned to my main project but it wouldn't obtain a DHCP address.
Wonderful logs. The router said it had run out of leases. There were a dozen free but that's what it said. i changed the lease duration and this appeared to flush the stuck leases.

harryman01
Posts:10
Joined:Tue May 08, 2012 11:33 am

Re: Known Bug: EtherTen and Ardunio 1.0 DHCP

Post by harryman01 » Tue May 08, 2012 11:37 am

Dear All

I wonder if could you please let me know the code to read the DS18B20 unique ID and assign it as a MAC address to the EtherTen board

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts:298
Joined:Sat Oct 15, 2011 11:31 am
Location:Melbourne, Australia
Contact:

Re: Known Bug: EtherTen and Ardunio 1.0 DHCP

Post by jonoxer » Tue May 08, 2012 11:50 am

I wonder if could you please let me know the code to read the DS18B20 unique ID and assign it as a MAC address to the EtherTen board
I intend to write that up as a tutorial, but I have a few things higher on the "to do" list at the moment so it may be a little while until I get to it. Sorry.
--
Jon

bcdaus
Posts:3
Joined:Thu May 10, 2012 12:43 am

Re: Known Bug: EtherTen and Ardunio 1.0 DHCP

Post by bcdaus » Thu May 10, 2012 12:58 am

What a cool application of the DS18S20 temp sensor. At the moment I just make up a MAC as an incrementing number with my initials as the first 3 octets. I checked the official list of MAC addresses and BC:BC:BC is not used so I won't clash with any current available gear!

Back on thread, I did find issues with the .available() when using Arduino 1.0, but rolling back to 0.22 solved the issue and also reduces the code size considerably.

Jon - would you write the DS18s20 address to eeprom then on startup check if there is a value at that eeprom location and if so load it to the MAC address ? It seems once you establish the Ethernet parameters its not easy to change them.

My thoughts on this would be :
Read address 0 in eeprom. If it is 255 (FFh or the default unprogrammed value) then
- read DS18s20 unique ID
- write it to eeprom position 1-6
- set flag in eeprom to 0 to say we have read the unique ID
- reboot the unit to force load the MAC
If adreess 0 is 0 then:
- read from the eeprom position 1-6
- set the MAC address
- init the Ethernet port

You could load the address starting at position 0, but the risk is always if the DS18s20 ID starts at FF then the code constantly runs the lookup code. For an extra byte I think its worth avoiding the risk.

Seems logical ?

Bill.

Post Reply