Skip to content

WIZnet-MbedEthernet/mbed-os-example-tcp-ping-pong

 
 

Repository files navigation

Mbed OS - TCP ping-pong with node.js

Looking for UDP? See mbed-udp-ping-pong.

Tested on ODIN-W2 EVK, but should work on every Mbed OS 5 device that implements the Network Sockets API.

Get both devices on the same WiFi network, or host the server on a publicly available hostname.

Setting up the server

  1. Install a recent version of node.js.

  2. Open a terminal.

  3. Navigate to the server-in-node directory.

  4. Run:

    $ node server.js
    
  5. Note down the IP address of the WiFi interface.

Setting up the client

  1. Open mbed_app.json and set your connectivity method and WiFi credentials.
  2. Open main.cpp and set the IP (or hostname) of the server.
  3. Compile and flash on the device.

What it does

The Mbed device will set up a TCP socket to the server, and will send 'ping' the server. The server will respond with 'pong'.

About

TDP Ping-pong between Mbed OS device and node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 57.6%
  • JavaScript 42.4%