11 years, 5 months ago.

direct ethernet connection between 2 MBEDs

I am trying to directly transmit data between MBEDs by connecting the TX+ & TX- of MBED1 to the RX+ & RX- of MBED2 and vice versa. This is done without the use of any switch etc. This is the code on the transmitter device:

#include "mbed.h"

DigitalOut myled(LED2);
Ethernet eth;

int main() {
    while(1) {
        eth.write("1",1);
        while(eth.send()!=1);
        myled = 1;
        wait(1);
        eth.write("0",1);
        while(eth.send()!=1);
        myled = 0;
        wait(1);
    }
}

and this is the code on the receiver:

#include "mbed.h"

DigitalOut b0(LED1);

Ethernet eth;

int main() {
    
    while(1) {
        int size = eth.receive();
        if(size > 0) {
            b0 = 1;
        }
    }
}

The transmitter LED glows as expects however the receiver LED does not turn on at all. So I have a few fundamental questions: 1) Is what I'm trying to do even possible using ethernet? 2) We know certainly that the Ethernet is transmitted since the LED on the Transmitter glows, but it doesnt seem to be received at all. So how do we make the ethernet device listen to the ethernet line?

posted by Marius Heil 12 Apr 2013

I am interested in this too.

Any approaches?

posted by Marius Heil 15 Apr 2013
Be the first to answer this question.