MBED TCP SERVER + CLIENT IN JAVA

27 Dec 2012

I want to make a TCP Server with MBED, so my client application can connect to it

the code for my server is this:

/media/uploads/spidermanpc/codeserver.jpg

and my client code is:

/media/uploads/spidermanpc/codeclient.jpg

in the client i receive the first message well, but when i send a message from the client to the server, the server receive nothing, and the second message sent by the server never arrives to the client.

What im doing wrong?

please help me with this, i connect the mbed to an ethernet jack (sparkfun magjack + breadboard adapter) but i cant make a tcpserver to make a connection to my android application via sockets, my mbed is using static ip (the ip of the computer that has a public ip assigned to it).

Please help me i send you my schematic of how is the mbed connect. /media/uploads/spidermanpc/schematic.jpg I have connected the rj45 in the schematic following the explication on this link: https://mbed.org/cookbook/Ethernet-RJ45

but i see this link too. Is this connection right?, because rd+ rd- td+ td- are not the same: http://mbed.org/users/no2chem/notebook/ethernet-testing/

an what is the maximum length for the ethernet cat-5 cable?

I wait for your help. Thanks

28 Dec 2012

before doing TCP client/server, have you confirmed that ARP and layer 1, 2 functions work OK?

28 Dec 2012

hi steve, thank u for your answer. how i verify the points that you are saying (ARP, layer 1,2)?.

And please tell me is the connection for the sparkfun prt-08534 with breadboard adapter right?

/media/uploads/spidermanpc/captura.jpg

28 Dec 2012

maybe this info would help? It is plug and play for the mbed.

http://www.coolcomponents.co.uk/catalog/mbed-lpc1768-workshop-development-board-p-608.html

To verify ARP... Your program and the libraries enable the IP stack. ARP is used to tell the LAN the MAC address of the ethernet NIC, then obtain an IP address from a DHCP server (unless you are using Static IP).

If these concepts are unfamiliar to you, then you'll want to do some basic reading and looking at examples before undertaking the client/server project.

28 Dec 2012

steve, the problem is not the assignment of the IP, this works fine. The problem comes when i want to send two Strings followed. The send command only sent the first string. the other is never send

if i use the commands in this order in the mbed: -send -receive -send

only the first command works

Im using this connector: https://www.sparkfun.com/products/8534

with this adapter: https://www.sparkfun.com/products/8790

so im a little confuse with the schematics in this page: http://www.coolcomponents.co.uk/catalog/resources/mbedworkshop/mbedworkshopbobv2revb.jpg

i dont see the relationship between the pins

Greetings

28 Dec 2012

you mean, e.g., MBED pin RD- is called RX- for the RJ45 magjack?

the idea was you could just wire your board the same as the Cool Components mbed workshop breakout board does, for the ethernet port. I have two of those boards and they're well worth the small sum they cost.

You say you're mbed is succeeding in ARP and getting an IP address (via DHCP?). If so, the wiring is likely OK.

29 Dec 2012

hi steve, i connect my mbed to my ethernet connector following the indications in this link:

https://mbed.org/cookbook/Ethernet-RJ45 (in the part of the sparkfun prt-08534 connector)

So i suppose the connection is right.

The problem that i have is that the following is not working in my program, In my mbed tcp server i try this: 1) send (ok) 2) receive (not working) 3) send (not working)

what can be the problem?

Greetings