Tcp/ip communication between mbed and Android phone

Introduction

I wrote this page for test the tcp/ip communication between the mbed and an Android phone.


Required Components


Ethernet Schematic

In this example I used the SI-60002-F RJ45 connector without leds.
In the below photo I summarized the schematic:

/media/uploads/edodm85/rj45.png


How works

First you must connect the mbed and the phone to the same network.

In this test the mbed works as server with address ip 192.168.153.153 and it is connect directly to the router.

Instead the client (Android phone) have this address ip 192.168.153.100.

Now in Terminal Multi you can create the connection and start sending the messages. You can see the messages received with a usb terminal.

The goal is send a message by android and receive a feedback message (CMD Received) by the mbed.


Code

Import programTest_server_ethernet

Program for test the tcp/ip communication between mbed and Android phone


Example

You can setting the address ip and the port by the below menu

/media/uploads/edodm85/screenshot_20160720-151005_mod.png


Then you can start the connection with mbed. The black ball will turn green color when the connection is established.

/media/uploads/edodm85/screenshot_20160719-164337_mod.png /media/uploads/edodm85/screenshot_20160719-194405_mod.png


The output is (if you send a message you will receive a "CMD Received" message from mbed):

/media/uploads/edodm85/realterm_server_mod.png


Report

Please log in to post comments.