Debug Serial Comms
Linux Format|May 2019

Sean Conway walks you through the process of troubleshooting communication problems between a PC application and a serial device.

Debug Serial Comms

The itch for an article on troubleshooting USBto-serial connections needed to be scratched, after working on a request for assistance from a local model railroad group (see LXF239). This tutorial will provide the knowledge to troubleshoot communication (comms) issues from an app on a PC to a serial device, using a USB-to-serial cable/interface.

In the diagram shown below, there is a PC running an application that requires a serial interface. The PC is connected to the serial device, shown on the far right side of the drawing, using a USB-to-serial cable/ interface. The drawing contains a few additional details that will be introduced as our discussion expands.

Hardware in the PC supported serial comms; at one point during the evolution of the PC, a minimum of two DB9 ports (the 9-pin COM port) was considered standard. The red highlighted text in the diagram are some examples of COM port communication needs. But all things come to an end, and the ubiquitous USB port soon replaced COM ports. To consolidate all the different serial device comms requirements, a USB-toserial cable/adaptor came into play. Unfortunately, this generic serial comms doesn’t always work, and it can be frustrating trying to isolate the root cause of serial communication failure.

After connecting the USB-to-serial cable to the host PC, the first step is to determine if the OS recognises the USB-to-serial adaptor. In Linux, the dmesg command reveals information regarding hardware detection, driver assignments and communication port allocation. It is important to take note of what COM port (COM1, 2, 4 or so on) is used – this will be needed to support our efforts, as well as set up the application.

Denne historien er fra May 2019-utgaven av Linux Format.

Start din 7-dagers gratis prøveperiode på Magzter GOLD for å få tilgang til tusenvis av utvalgte premiumhistorier og 9000+ magasiner og aviser.

Denne historien er fra May 2019-utgaven av Linux Format.

Start din 7-dagers gratis prøveperiode på Magzter GOLD for å få tilgang til tusenvis av utvalgte premiumhistorier og 9000+ magasiner og aviser.

FLERE HISTORIER FRA LINUX FORMATSe alt
Create your first WebSocket service
Linux Format

Create your first WebSocket service

Mihalis Tsoukalos explains how to use the Go programming language to work with the WebSocket protocol.

time-read
9 mins  |
April 2023
Fantastic Mr Firefox
Linux Format

Fantastic Mr Firefox

Nick Peers takes a trip down memory lane to reveal the story behind the rise - and slight fall - of Mozilla's popular web browser.

time-read
9 mins  |
April 2023
Set up your terminal and email like it's 1983
Linux Format

Set up your terminal and email like it's 1983

Jump in the hot terminal time machine with Mats Tage Axelsson who emails from the command line using the latest technology.

time-read
8 mins  |
April 2023
Universal layer text effects with GIMP
Linux Format

Universal layer text effects with GIMP

Posters use them, films and presentations are hard to imagine without them: text effects. Attract attention with Karsten Günther and GIMP.

time-read
8 mins  |
April 2023
Jump to a federated social network
Linux Format

Jump to a federated social network

Nick Peers reveals how you can get up and running with this free, decentralised and non-profit alternative to Twitter.

time-read
9 mins  |
April 2023
Free our SOFTWARE!
Linux Format

Free our SOFTWARE!

Taking anything for granted is dangerous, so Jonni Bidwell and Mike Saunders revisit how the free software movement got started to help free us from proprietary tyranny!

time-read
4 mins  |
April 2023
Master RPI.GPIO
Linux Format

Master RPI.GPIO

Les Pounder goes back to the early days of the Raspberry Pi - and his career with this classic library! -

time-read
5 mins  |
April 2023
Waveshare Zero to Pi3
Linux Format

Waveshare Zero to Pi3

Transform your Pi Zero into a Pi 3, they promised Les Pounder, but it's more like adding on go-faster stripes.

time-read
2 mins  |
April 2023
The Best OPEN SOURCE Software Ever!
Linux Format

The Best OPEN SOURCE Software Ever!

In an attempt to trigger controversy, Michael Reed and Neil Mohr unequivocally state these are the greatest free software apps ever. Probably. We’re just trying to be helpful.

time-read
10+ mins  |
April 2023
Linux-Mandrake 7
Linux Format

Linux-Mandrake 7

Simplicity and a wide range of applications make this a great distribution for all Linux users.

time-read
2 mins  |
April 2023