ESP32 Bit Pirate home
  • Network
  • Intermediate
  • 5 min
  • TCP

Recipe · Intermediate · Network

How to test a raw TCP service

The Wi-Fi and Ethernet wikis document telnet <host> [port] and nc <host> <port> for interactive TCP debugging.

Terminal shell showing a command prompt.
Use raw TCP tools for simple text protocols, gateways and quick service checks.
Step 1

Commands

After connecting to Wi-Fi or Ethernet, open a raw TCP or Telnet session.

Result

What it means

A connected session proves that routing and the TCP port work. Protocol errors after that are application-level, not basic network reachability.

Troubleshooting

  • Wrong host or stale DHCP address.
  • Service listens on a different port.
  • Firewall blocks the connection even if ping works.
  • The service expects TLS or binary framing, so plain text appears unreadable.

Next steps

  • Use http get for HTTP/HTTPS endpoints.
  • Use nmap on authorized hosts to check ports.
  • Use Ethernet mode when Wi-Fi instability makes debugging unclear.

raw TCP and Telnet FAQ

When is nc better than http get?

Use nc when the service is not HTTP or when you want to type raw protocol text directly. Use http get for normal HTTP or HTTPS endpoint checks.

When should I use telnet?

Use telnet for services that expect an interactive text session or classic Telnet behavior. For a plain TCP socket with no Telnet negotiation, nc is usually simpler.

What does a successful raw TCP connection prove?

It proves that the host and port are reachable and that a TCP session can be opened from Bit Pirate. Application protocol interpretation is a separate step.

Go deeper