Skip to content
TCP Ping-pong between Mbed OS device and node.js
C++ JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

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'.

You can’t perform that action at this time.