Ethernet working (show of hands, please)?

17 Nov 2010

All -

Everything else on mBed has been stupidly simple to get working, but I'm ready to claim that ethernet does not.  A handful of folks claim that they have it working.  Who else is having problems with ethernet?

I have tried for almost two weeks to get ethernet working on several mBeds.  So far I have tried wiring directly, wiring through capacitors, liberating a transformer and RJ45 jack and wiring through those, and finally the "recycle a board" method.  Unfortunately, still no joy on ethernet.  I'm watching the signals on an oscilloscope, and everything looks good enough for ethernet.  I have tried three mBeds (V5.1), two hubs, four ethernet cables (one of them a crossover), and the programs "ethspam", "ethsniff", "EthernetTester", "EthernetTesterGood", "UDPTest", "NetTool", "NetServices", and many of my own renditions of bashing those programs together.

I have read datasheets and application notes for all the parts, plus a few ethernet primers.  Several folks on the forum apparently cross the + and - signals.  Just to be sure, I am pretty sure that I tried every combination of R+/R- T+/T- that makes any sense at all.  I get bits on the oscilloscope, but no DHCP, no packets seen with WireShark, no HTTP server, no HTTP get, no UDP, no NTP, no ARP, no nothing.

As an aside, I'm pretty sure (after working with "ethspam" for a few days) that the mBed compiler has a bug.  It does not consistently use the correct number of bytes in the ethpkt structure (clobbering one of the bytes of the six character address arrays).  Removing the "__packed" directive simply moves the problem, but does not correct it.  Clearly, this could affect a lot of things, so I'm wondering if anybody else has noticed it.

I'll keep plugging away at it, but I'd like to know who else tried but has no ethernet?

Regards,

- Gary

 

 

17 Nov 2010

It has worked for me from the beginning. I'm using thr Sparkfun Magjack together with breakout board (see http://mbed.org/users/rolf/notebook/ethernet/ ), and used the cabling from http://mbed.org/users/no2chem/notebook/ethernet-testing/ . I have tested with EthernetTesterGood, and my own programs (using the HTTPClient library).

17 Nov 2010

I'd be interested to know this too!

I'm confident *lots* of people have it working (there are always lots of new "I'm tweeting from my mbed" posts on twitter from new users every week :). I know a few people have had some problems, but most seem to get worked out (wiring, misconfiguration of DNS/gateway/firewalls etc).

So it'd also be great to hear from people who had problems, then tracked them down; hopefully you can share your insights.

17 Nov 2010

I can understand your frustration. So lets try a trick or two. I was sat around one day and, prompted by another forum thread, decided to play with the Ethernet (the only interface on the Mbed I hadn't used till then) to see how easy/quick I could make it come to life. Didn't take long. However, what I did was of little practicle use in an application but "things happened". So lets try this to see if you can make some noise on teh wires at the very least (and maybe some noise for you too, like "hooray!")

Ok, I have an Mbed plugged into a break out board. I grabbed an ethernet cat5 cable off an Xbox360 that didn't need Xbox Live! (much to my son's annoyance when he got home!).

Under my desk I have a Netgear switch that connects various stuff to my wireless ADSL router. I connected the ethernet cable into that switch. My laptop, running Wireshark, connects via wireless so it's not even connected to the ethernet switch.

I then knocked up some code. The easier way for you to get this is by LLDP

Import this into your project, compile and put on the Mbed. You may need to edit LLDP/example to set the buad rate for the USB serial port if you want to see the messages.

When rebooted, teh Mbed will emit an LLDP packet once per second. Using Wireshark on my laptop I started getting LLDP packets straight away. Proves the Mbed, the BOB, ethernet cable, switch, wireless, my PC and Wireshark all in one easy go.

 

To see what I got see this forum post

Have a go and see if you can make some noise :)

17 Nov 2010 . Edited: 17 Nov 2010

We used the Sparkfun Magjack breakout board here in a class and twenty students all got it working on ten different computer setups. Only pain was soldering the magjack connector and header pins to the breakout board. Each magjack company has different pinouts so watch out for that! Four wire setup below is based on the magjacks they shipped us from Sparkfun a few weeks ago:

 

mbed

adapter

TD+

P1

TD-

P2

RD+

P7

RD-

P8

 

 

 

 

P.S. The biggest problem was getting the computer support people to enable DHCP support on our network for the new boards. Had to get them all of the NIC address info and wait awhile. Try this code first just to see any packets out there

17 Nov 2010

btw, my Mbeds moved on since I did that quick hack. So, I just followed my own instructions from the start to check the code compiles etc etc. And straight away Wireshark was reading the Mbed LLDP anthem. So I know that it works for me. My switch is "auto-sensing" so getting RX/TX the wrong way round doesn't matter for me, it'll switch itself, so that's something I didn't have to worry about. Hopefully, you'll get something soon.

17 Nov 2010

Check the ethernet link status as reported by the firmware. For example, EthernetTestGood drives pin 30 with this signal.

If the link isn't up, it's a physical link issue. Your mbed isn't hearing the network hub and vice versa. If you are using a recycled board connector, there are really only five wires to juggle (+TX, -TX, +RX, -RX, and +3.3volts to the center tap of the TX data transformer.)

With a recycled connector, you may not have a pinout document. But with a scope, you should be able to verify the wiring.

For example, you could write a short program to toggle one of the DigitalOut pins on the mbed as fast as it will go, then hook that pin through a limiting resistor (1K, perhaps) to pin 3 of the RJ45. Hook pin 6 of the RJ45 to ground. Now look for the pins on the back of the jack that show that signal -- those correspond to the RX data channel.

If you repeat this driving pin 1 with pin 2 grounded, and you will find the TX data channel (be sure to find the center tap as well by looking for half-amplitude).

Good luck.

17 Nov 2010

Andy -

Thanks for the reply.  No joy on the LLDP code.  I can see the frame on the oscilloscope, but not on wireshark.

I'm going to try this other 10/100 card I just found in a box.  I'll be right back...

Regards,

- Gary

 

17 Nov 2010

Gary,

The LLDP uses an Ethernet network broadcast address to it should spread straight across your network. Like I said, my PC running Wireshark is on wireless and still gets the packets.

So, it really does sound like a hardware issue, if Wireshark cannot see the packets then they are just not getting to the hub/switch.

When you say you can scope the packets, I assume you are scoping the pin on the Mbed? If so, then it's a case of scping along the trail of connections to the hub. Start by scoping the pins on the ethernet connector that plugs into the hub. If they are not there, start working back to teh Mbed pins until it appears. Then you'll know where it's breaking down.

17 Nov 2010

Hexley -

Pin 30 comes high using EthernetTesterGood.  Also, the Link light comes on on the hub.  I have datasheets for all of the parts I have used so far.

Using ethsniff I get many bogus packets reported:

Reading 634 bytes
Destination: FF:FF:FF:FF:FF:FF
     Source: FF:FF:FF:FF:FF:FF
Reading 633 bytes
Destination: FF:FF:57:55:15:00
     Source: 00:00:00:00:00:00
Reading 634 bytes
Destination: FF:FF:FF:FF:FF:FF
     Source: FF:FF:FF:FF:FF:FF
Reading 634 bytes
Destination: FF:FF:FF:FF:FF:FF
     Source: FF:FF:FF:FF:FF:FF
Reading 764 bytes
Destination: FF:FF:FF:FF:3F:00
     Source: 00:FC:FF:3F:00:00
Reading 764 bytes
Destination: FF:FF:FF:FF:FF:FF
     Source: FF:FF:FF:FF:FF:FF
Reading 633 bytes
Destination: FF:FF:57:55:15:00
     Source: 00:00:00:00:00:00
Reading 634 bytes
Destination: FF:FF:FF:FF:FF:FF
     Source: FF:FF:FF:FF:FF:FF

The EthSniff code that generated the previous data:

#include "mbed.h"

Serial pc(USBTX, USBRX);

DigitalOut myled(LED1);

Ethernet eth;

int main() {
    char buf[0x600];

    pc.baud(230400);
    while(1) {
         device_poll(); 
        int size = eth.receive();
        if(size > 0) {
            myled = 1;
            printf ("Reading %d bytes\r\n", size);
            eth.read(buf, size);
            printf("Destination: %02X:%02X:%02X:%02X:%02X:%02X\r\n",
                    buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
            printf("     Source: %02X:%02X:%02X:%02X:%02X:%02X\r\n",
                    buf[6], buf[7], buf[8], buf[9], buf[10], buf[11]);
        }

//        wait(1);
        myled = 0;
    }
}


Regards,

- Gary

 

17 Nov 2010

Andy -

The whole problem is that the hardware link doesn't appear broken; I can trace the signal all the way to the hub (I have the cover off of it, too).  Clearly, it is a hardware problem, but no matter what I do to the hardware, I get the same results.  The good news is that it will probably end up being something really stupid...

Regards,

- Gary

 

17 Nov 2010

Have you tried playing with set_link() to manually set the link speed/duplex? e.g. FullDuplex10 (10 Mbit, full duplex), FullDuplex100 etc. Maybe it is the hub not playing in some configurations.

17 Nov 2010

Simon -

Good idea.  Unfortunately, the library doesn't say what values of mode to use for each of the modes...

- Gary

17 Nov 2010

I checked Ethernet.h, and indeed "eth.set_link(AutoNegotiate)" should work.

The compiler says different: "Identifier "AutoNegotiate" is undefined (E20)" in file "/main.cpp".

- Gary

 

17 Nov 2010

Gary -

A few network questions:

1. Is the mbed plugged into a hub or a switch?

2. What speed does your hub/switch show when the mbed is plugged in?

3. Do other devices work when plugged into the same spot? If so, are they showing the same speed?

4. Can you give us an idea of your network layout -- particularly, how many intermediate hubs there might be between your DHCP server and the mbed?

17 Nov 2010

Aaaaarrrrrghh.  It's eth.AutoNegotiate.

17 Nov 2010

Hexley -

I have a Netgear Hub (EN106TP) and a Linksys switch (EZXS55W).  Neither work properly. I have my laptop and the mBed plugged into the switch right now, and the laptop is what I'm using to post this.  Beyond the switch is our large network switch to the DHCP server.  It is important to note that I have tried static addresses as well as DHCP.  The laptop can't see the mBed doing anything, and the mBed sees garbage.

I have also swapped the cables, and the laptop works on either of the two that I'm using right now.

Regards,

- Gary

 

17 Nov 2010

Well, now... 

eth.set_link(eth.HalfDuplex10) settled down the ethsniff program, and more importantly, it tends to agree with WireShark!  Stand by for more testing...

- Gary

 

17 Nov 2010

Hi Gary,

If you take a look at the Ethernet set_link() method, it lists the different settings:

AutoNegotiate      Auto negotiate speed and duplex
HalfDuplex10       10 Mbit, half duplex
FullDuplex10       10 Mbit, full duplex
HalfDuplex100      100 Mbit, half duplex
FullDuplex100      100 Mbit, full duplex

So for example, for setting an ethernet object of "eth" to 10MBit Full Duplex, you'd do:

eth.set_link(Ethernet::FullDuplex10);

Simon

17 Nov 2010

An update -

I have seen some strange things in the last hour...  but I do seem to have a working sniffer/spammer.  No DHCP or web page, but I'm happy for what I have so far.  I did notice that set_link was added to the library within the last two weeks. 

And the presumed compiler bug was indeed just me misplacing one character in the array.  I'll quit creating a piece of code to prove it...

Thanks for the help so far!

Regards,

- Gary

 

18 Nov 2010

All -

After more investigation, I have determined that my hardware does indeed work.  Unfortunately, it only works if I set the link to HalfDuplex10 (AutoNegotiate does not work).  Since the popular libraries seem to instantiate their own ethernet object, setting the link before setting up the library does no good.  For example, the following code does not work:

#include "mbed.h"
#include "lwip/opt.h"
#include "lwip/stats.h"
#include "lwip/sys.h"
#include "lwip/pbuf.h"
#include "lwip/udp.h"
#include "lwip/tcp.h"
#include "lwip/dns.h"
#include "lwip/dhcp.h"
#include "lwip/init.h"
#include "lwip/netif.h"
#include "netif/etharp.h"
#include "netif/loopif.h"
#include "device.h"

Ethernet ethernet;

int main() {
    ethernet.set_link(Ethernet::HalfDuplex10);

    printf("Configuring device for DHCP...\r\n");
    /* Start Network with DHCP */
    IP4_ADDR(&netmask, 255,255,255,255);
    IP4_ADDR(&gateway, 0,0,0,0);
    IP4_ADDR(&ipaddr,  0,0,0,0);

    /* Initialise after configuration */
    lwip_init();
    netif->hwaddr_len = ETHARP_HWADDR_LEN;
    device_address((char *)netif->hwaddr);
    netif = netif_add(netif, &ipaddr, &netmask, &gateway, NULL, device_init, ip_input);
    netif->hostname = hostname;
    netif_set_default(netif);
    wait(5);
    dhcp_start(netif); // <-- Use DHCP

       .
       .
       .
}

It doesn't work because lwip creates its own ethernet connection, and apparently the hardware forgets that it was already negotiated.  Line 111 of lwip/device.cpp (http://mbed.org/projects/cookbook/svn/EMAC/lwip/trunk/Core/device.cpp?rev=658) says it all:

86 err_t device_init(struct netif *netif) { 
87   LWIP_ASSERT("netif != NULL", (netif != NULL)); 
88    
89   NETIF_INIT_SNMP(netif, snmp_ifType_ethernet_csmacd, 0x2EA); 
90    
91   /* maximum transfer unit */ 
92   netif->mtu = 0x2EA; 
93    
94   /* device capabilities */ 
95   /* don't set NETIF_FLAG_ETHARP if this device is not an ethernet one */ 
96   netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP; 
97  
98   netif->state = NULL; 
99   gnetif = netif; 
100  
101   netif->name[0] = IFNAME0; 
102   netif->name[1] = IFNAME1; 
103  
104   /* We directly use etharp_output() here to save a function call. 
105    * You can instead declare your own function an call etharp_output() 
106    * from it if you have to do some checks before sending (e.g. if link 
107    * is available...) */ 
108   netif->output          = etharp_output; 
109   netif->linkoutput      = device_output; 
110  
111   eth = new Ethernet(); 
112  
113   return ERR_OK; 
114 } 
 

I have a hard time believing that I'm the only guy with this problem...

Regards,

- Gary

 

18 Nov 2010

It works flawlessly here, which is curious since I did the wort possible wiring ever on a protoboard. Auto negotiation goes fine, and I can see on the switch that it goes 100mpbs full-duplex, which I assumed would not be possible due to long cables and bad wiring.

18 Nov 2010

All -

After reading the lwip code I figured out that I can diddle with the set_link call if I extern the Ethernet pointer and make the call after starting the interface:

    extern Ethernet *eth;                    // lwIP uses "eth" as its instantiation
        .
        .
        .
    dhcp_start(netif);                       // <-- Use DHCP
    eth->set_link(Ethernet::HalfDuplex10);   // Set the interface to Half Duplex, 10 MBit

That will do the job for me, but I'm still curious why my hardware doesn't auto negotiate.

A big thanks to all who helped; especially Simon, who pointed out the set_link() call.

Regards,

- Gary

 

19 Nov 2010

Hi,  I have also  also had bad experience getting Ethernet going but the reference by Simon to the 10/100 MB setup made me check my hub,  which was an old junker 10MB only. I have now connected to another hub with 100MB support and all is working - fantastic.  Many thanks to all who have helped.

Regards

Steve

19 Nov 2010

Weird, autonegotion actually *stopped* work in here.

11 Jan 2011

Can anybody please help me. I find the details of the Ethernet set up very confusing, so I too am having trouble getting my link to mbed to work. I have the mbed plugged into a 'Cool Components Workshop Board (version 2)', plugged into my PC (XP SP3) via a 'crossover' cable. I did no better with a 'straight' cable either. I have tried several of the test programs, with no success.

Windows report on this link is:

Local Area Connection 3
This connection has limited or no connectivity. You might not be able to
access the Internet or some network resources. This problem occurred
because the network did not assign a network address to the computer.

Details:

Property          Value
Physical Address: D8-5D-4C-81-F5-A2
IP Address:       169.254.112.239
Subnet Mask:      255.255.0.0
Default Gateway: 
DNS Server: 
WINS Server: 

Attempting to find a solution on the Internet I came across this, which looks pretty relevant:

Quote:

Bottom line: if you're getting a 169.254.x.x IP address then something about your network setup isn't working, and you probably want to investigate what and why.

Using this program (I have removed blank lines to save space):

#include "mbed.h"
#include "EthernetNetIf.h"
#include "HTTPClient.h"
 EthernetNetIf eth;  // Original from mbed site
/* EthernetNetIf eth(  // alternative I tried -- no success
  IpAddr(192,168,0,120), //IP Address
  IpAddr(255,255,255,0), //Network Mask
  IpAddr(192,168,1,254) , //Gateway
  IpAddr(192,168,1,254)  //DNS
); */

HTTPClient http;
int main() {
  printf("Setting up...\n\r");
  EthernetErr ethErr = eth.setup();
  if(ethErr)
  {
    printf("Error %d in setup.\n\r", ethErr);
    return -1;
  }
  printf("Setup OK\n\r");
  HTTPText txt;
  HTTPResult r = http.get("http://mbed.org/media/uploads/donatien/hello.txt", &txt);
  if(r==HTTP_OK)
  {
    printf("Result :\"%s\"\n\r", txt.gets()); 
  }
  else
  {
    printf("Error %d\n", r);
  }
  while(1)
  {
  }
  return 0;
}

Using the program as above I get the following where I have left justified the lines as there is no 'carriage return' in the output and it wraps round at the right margin:

Tera Term output:

Setting up...
[..\fwk\if\eth\EthernetNetIf.cpp:setup@86] HW Addr is : 00:02:f7:f0:40:e5.
[..\fwk\if\eth\EthernetNetIf.cpp:setup@99] DHCP Started, waiting for IP...
[..\fwk\if\eth\EthernetNetIf.cpp:setup@131]
Timeout.
Error -65534 in setup.

(no lights on RJ45 socket, LEDs flashing alternately 1&4 and 2&3

If I comment out the first " EthernetNetIf eth;" line and 'uncomment' the next and the table, I get:

Tera Term output:

Setting up... 
[..\fwk\if\eth\EthernetNetIf.cpp:setup@86] HW Addr is : 00:02:f7:f0:40:e5.
[..\fwk\if\eth\EthernetNetIf.cpp:setup@142] Connected, IP : 192.168.0.120                             
Setup OK
Error 3

(No lights on RJ45 socket, nor leds on mbed )

11 Jan 2011

Let me start by apologizing for quoting the full message. It is too relevant.

Harry Weston wrote:

Can anybody please help me. I find the details of the Ethernet set up very confusing, so I too am having trouble getting my link to mbed to work. I have the mbed plugged into a 'Cool Components Workshop Board (version 2)', plugged into my PC (XP SP3) via a 'crossover' cable. I did no better with a 'straight' cable either. I have tried several of the test programs, with no success.

Windows report on this link is:

Local Area Connection 3
This connection has limited or no connectivity. You might not be able to
access the Internet or some network resources. This problem occurred
because the network did not assign a network address to the computer.

Details:

Property          Value
Physical Address: D8-5D-4C-81-F5-A2
IP Address:       169.254.112.239
Subnet Mask:      255.255.0.0
Default Gateway: 
DNS Server: 
WINS Server: 

Attempting to find a solution on the Internet I came across this, which looks pretty relevant:

Quote:

Bottom line: if you're getting a 169.254.x.x IP address then something about your network setup isn't working, and you probably want to investigate what and why.

This is normal: your laptop normally receives its ip-address from a dhcp server. when connected to the MBED there is none, so it configures only the autoconf (169.254) address.

Harry Weston wrote:

Using this program (I have removed blank lines to save space):

#include "mbed.h"
#include "EthernetNetIf.h"
#include "HTTPClient.h"
 EthernetNetIf eth;  // Original from mbed site
/* EthernetNetIf eth(  // alternative I tried -- no success
  IpAddr(192,168,0,120), //IP Address
  IpAddr(255,255,255,0), //Network Mask
  IpAddr(192,168,1,254) , //Gateway
  IpAddr(192,168,1,254)  //DNS
); */

HTTPClient http;
int main() {
  printf("Setting up...\n\r");
  EthernetErr ethErr = eth.setup();
  if(ethErr)
  {
    printf("Error %d in setup.\n\r", ethErr);
    return -1;
  }
  printf("Setup OK\n\r");
  HTTPText txt;
  HTTPResult r = http.get("http://mbed.org/media/uploads/donatien/hello.txt", &txt);
  if(r==HTTP_OK)
  {
    printf("Result :\"%s\"\n\r", txt.gets()); 
  }
  else
  {
    printf("Error %d\n", r);
  }
  while(1)
  {
  }
  return 0;
}

Using the program as above I get the following where I have left justified the lines as there is no 'carriage return' in the output and it wraps round at the right margin:

Tera Term output:

Setting up...
[..\fwk\if\eth\EthernetNetIf.cpp:setup@86] HW Addr is : 00:02:f7:f0:40:e5.
[..\fwk\if\eth\EthernetNetIf.cpp:setup@99] DHCP Started, waiting for IP...
[..\fwk\if\eth\EthernetNetIf.cpp:setup@131]
Timeout.
Error -65534 in setup.

(no lights on RJ45 socket, LEDs flashing alternately 1&4 and 2&3

If I comment out the first " EthernetNetIf eth;" line and 'uncomment' the next and the table, I get:

Tera Term output:

Setting up... 
[..\fwk\if\eth\EthernetNetIf.cpp:setup@86] HW Addr is : 00:02:f7:f0:40:e5.
[..\fwk\if\eth\EthernetNetIf.cpp:setup@142] Connected, IP : 192.168.0.120                             
Setup OK
Error 3

(No lights on RJ45 socket, nor leds on mbed )

Both quite normal. In the first case you again have no dhcp server, so the MBED does not get an ip-address. That is what the error -65534 indicates. Try connecting your MBED to your normal internet link (assuming your modem does dhcp), and it will get an address AND it can access the page it tries to fetch from the MBED website.

And about the leds: that is normal: the stack probably does not support the leds (I did not check though). My leds (on the same baseboard) do not turn on either. There is no way to specify the pin numbers.... Oh, and by the way: for me the http client works great.

13 Jan 2011 . Edited: 13 Jan 2011

Hello Louis Lagendijk L

Many thanks for your reply, and apologies for not replying sooner - things got a bit hectic for a while.

It is very useful to have your replies include with the relevant parts of my query, and, since you have repeated it completely, to save space I will edit my original post so that there is only the copy in your reply.

You have nicely explained the effects I see, and I feel I am beginning to understand what is going on a bit better now, but it is a complex subject and it leaves me with yet more questions:

You say; "This is normal: your laptop normally receives its ip-address from a dhcp server. when connected to the MBED there is none, so it configures only the autoconf (169.254) address." Now, does the laptop have just one ip-address that it is referred to by all  connections? Does it expect mbed to supply an ip-address for both itself and the laptop? And what about all the other things like 'Network Mask' , 'Gateway' and 'DNS'. And which bit of equipment does what in setting up the link?

You also say "Try connecting your MBED to your normal internet link (assuming your modem does dhcp), and it will get an address AND it can access the page it tries to fetch from the MBED website". Well my real need at the moment is to get the time from the PC into mbed programs, it just seemed a nice bonus to be able to access the Internet too. If I did as you say and got an address, would I be able to use it in other circumstances, or does it apply only for that session while connect to my Internet router?

And by the way I did see an amber LED lit up on the RJ45 socket at some time in my blunderings.

Surely there is some way that we can get the mbed to supply the required data when it is connected. Is it my PC that is lacking something?

I hope that this does not sound ungrateful for the trouble you have already taken in answering my query. It is just that I am very confused by the descriptions I find of the LAN system, most of them assume that one has a fair knowledge of what it is about, and what all the jargon means, and that one is dealing with a much more complex set up than just an mbed connected to a PC. Now I am in touch, I hope, with someone who can clarify it a bit. If you know of a good, simple, account on the Internet, that would be a very good place for me to start.

So, very many thanks again, and very best wishes, Harry

13 Jan 2011

Hmm, quoting does not work this time for me, so I just copied your questions:


You say; "This is normal: your laptop normally receives its ip-address from a dhcp server. when connected to the MBED there is none, so it configures only the autoconf (169.254) address." Now, does the laptop have just one ip-address that it is referred to by all connections? Does it expect mbed to supply an ip-address for both itself and the laptop? And what about all the other things like 'Network Mask' , 'Gateway' and 'DNS'. And which bit of equipment does what in setting up the link?


Normally all computers are connected in a network. In most networks there will be a DHCP server that provides all computers with an own IP-address, the netmask and gateway address. Think of it as all computers connected to the same wire. One of these computers (e.g. your cable or adsl modem) serves as dhcp server. This dhcp server will provide each computer with an own IP-address etc. In reality each device is connected to a device called hub or switch. But that device just simulates the single wire idea. If your internet modem has more than one ethernet connector it internally already contains a switch. If so, connect both your laptop and the mbed to a connector on the modem and your all set.


You also say "Try connecting your MBED to your normal internet link (assuming your modem does dhcp), and it will get an address AND it can access the page it tries to fetch from the MBED website". Well my real need at the moment is to get the time from the PC into mbed programs, it just seemed a nice bonus to be able to access the Internet too. If I did as you say and got an address, would I be able to use it in other circumstances, or does it apply only for that session while connect to my Internet router?


It is the address provided by your modem. If you would connect your laptop too (as described above) it would get another address. The addresses provided by modems are normally in the 192.168.x.y range (or 172.16.something or 10.something). These addresses are local to your network and can be used whenever you wish. The easiest way to deal with addresses is normally to use dhcp to allocate an address. Otherwise (for connecting to your laptop only) you could of course give both devices a fixed ip-address in the same range and with the same netmask (gateway is not needed as there is no connection to the outside world). Using a switch or 2 ethernet connections on your modem is easier, as both devices would get an own address using dhcp.


And by the way I did see an amber LED lit up on the RJ45 socket at some time in my blunderings.


I need to check the code to see if this was an accident or is really possible (would be nice). -- Surely there is some way that we can get the mbed to supply the required data when it is connected. Is it my PC that is lacking something?


Not really, unless you make your MBED act as a DHCP server there is no way it can do anything for the laptop. I don't think that a dhcp server exists yet for the mbed. Just buy a cheap 100mbnit switch if your modem does not have two ethernet connectors or set fixed addresses on both the laptop and the mbed. And even then the http-client will not work as it needs to go out to the internet to get the "hello world" that it shows in the end.

Your best bet is to connect both mbed and laptop to your modem, it is so much easier.....

good luck, Louis

13 Jan 2011 . Edited: 13 Jan 2011

Hello Louis again. Many thanks for your reply, it explains a lot more. I will try your suggestions out and see what happens. I'll post the results here.Thanks again for your time and trouble in giving these answers, and best wishes, Harry

By the way, it looks as though there is no chance of editing my original post to make it shorter, so I will have to leave it as it is..