My Digital Garden

JPNAS.NET / Digital Garden

🌳 EvergreenLast updated:

Communication with the Machines

Exploring the layers of interaction between humans and devices, from GUIs and terminals through protocols and serial lines to low-level assembly and quantum computing, with hands-on examples.

Open in the interactive Digital Garden

Disclaimer: Should you decide to act upon any information on this website, you do so at your own risk. Commands typed into a terminal act immediately and often without asking, so read each one before you run it.

What You Need (for the practical part)
Any computer with a terminal: Windows (PowerShell), macOS (Terminal) or Linux
A plain text editor and a little curiosity
Optional: a USB-to-serial adapter and a microcontroller or a Nextion display for the serial example
Optional: a Linux machine for the assembly example, which can be an old computer (see Reviving an Old Computer)

Jump to the Examples

By "communicating with machines," we refer to a person's ability to alter a machine's state through their actions, ensuring it operates according to their intentions.

Example: You want to send and receive emails. For most people, this simply means setting up an account, typing characters into a web form, and clicking submit.

Communication is usually defined as the transmission of information. While the broader use of the term machine communication can be debated, it fits the purpose here. The degree and depth of communication required to set up something as simple as an email depends entirely on how much control you desire over the underlying process. If you value data sovereignty and full ownership, your communication with machines will be far more involved than that of a casual user.

A useful picture is a ladder. At the top you click a button and everything below is hidden from you. Each step down shows more of what really happens, gives you more control and demands more knowledge. You do not have to climb to the bottom, but knowing that the steps exist makes the machine less mysterious.

The same task, "send an e-mail", on different steps of the ladder (simplified):

LevelWhat you doWhat you need to know
Graphical interfaceClick "New message", type, click "Send" in a mail application or a web pageAlmost nothing
TerminalType a command that sends a message, for example with a command-line mail clientThe command and its options
ScriptWrite a few lines that send a message every morning on their ownA scripting language, a mail server and its login
Network protocolTalk to a mail server directly in the language it understands (SMTP)How the protocol works, what the server expects
Assembly and machine codeInstructions that the processor executes one by one, which a program above you has already turned into packetsThe processor's instruction set
Logic gates and signalsVoltages in a chip and radio waves in the airElectronics and physics

Interfaces: GUI vs. Terminal

People interact with machines at various levels. The most familiar layer is the Graphical User Interface (GUI). While GUIs provide intuitive visuals, they consume hardware resources and introduce additional security risks due to their underlying software complexity. In open-source environments, desktop environments like GNOME and KDE lead the way, while operating systems from Microsoft and Apple have evolved significantly over the decades. From early platforms like the Commodore 64 running GEOS to modern smart devices, interface design and privacy features have reached a highly mature standard. Modern data protection regulations have also played a major role in shaping device management software. The graphical interface itself is older than most people think: the Xerox Alto had windows and a mouse in 1973, long before the mass market. The longer story of operating systems is in Reviving an Old Computer.

A less visual but highly efficient alternative is the command-line interface or terminal. As outlined by GeeksforGeeks, the command line is where you input instructions, whereas the shell acts as the command-line interpreter.

GUI or terminal? (my own judgement, not a rule):

GUITerminal
LearningYou discover things by looking and clickingYou must know or look up the command, but it stays valid for decades
RepeatingEvery repetition is manualA command becomes a script and runs by itself
Remote useNeeds a lot of bandwidth and a displayWorks over a slow connection with SSH, even on a device with no screen
ResourcesNeeds memory, a graphics stack and many librariesRuns on the smallest machines
MistakesDialogs and an undo button protect youThe machine does exactly what you typed, including a destructive command

Common shells are Bash (the default on most Linux systems), zsh (macOS) and PowerShell (Windows). Learning ten commands, such as listing files, moving around folders, copying, searching text and reading a manual page, is the best investment for someone who wants more control.

From Bits and Qubits to Low-Level Logic

From a networking and hardware perspective, communication boils down to fundamental units. Digital systems process information in bits—a single bit (0 or 1) can represent a basic binary state, like a light switch being ON or OFF. At the hardware level, these binary states are manipulated using logic gates.

In recent years, quantum computing has emerged from pure theory into an active technological frontier, replacing traditional binary bits with quantum bits, or qubits. Operating on quantum mechanical principles, quantum computers represent a fundamental shift in computing architecture. A qubit can be in a combination of 0 and 1 until it is measured, and a program is a sequence of gates applied to qubits. Today you communicate with such a machine through a cloud service and a software library, not through a keyboard attached to it. A list of toolkits is in the quantum computing section of Network Door Opener.

In classical computing, groups of bits form bytes and binary code. To make this code human-readable, character encodings such as UTF-8 are used. Older, simpler codes such as ASCII give every letter a number, and UTF-8 (RFC 3629) extends the idea to all the world's writing systems while staying compatible with ASCII. The letter A is the number 65, which is the byte 01000001, and the same bits could just as well be a colour, a sound sample or a part of a program. What they mean depends only on who reads them and how.

Units you will meet:

UnitMeaning
BitOne binary digit, 0 or 1
Byte8 bits, 256 possible values (0 to 255, or 00 to FF in hexadecimal)
Baud / bit rateHow fast a serial line sends symbols or bits, for example 9600 baud on many simple displays and sensors
Packet / frameA block of bytes with an address and a header that travels through a network (see Computer Networks)

Input Devices, Abstraction, and System Architecture

Modern computing encompasses diverse input mechanisms, including voice commands and other specialized input devices like smart wearables. Regardless of the input form, hardware converts these signals into binary data, processes them, and outputs the result as text, sound, visuals, or movement on output devices.

Input and output devices also decide who can use a machine at all. Screen readers such as NVDA, keyboard-only operation, voice control and switch devices make the same machine usable for people who cannot use a mouse or a screen, and the Web Content Accessibility Guidelines describe how to build interfaces that work for them. Notice that the terminal, being plain text, is often the most accessible interface of all. A voice assistant, on the other hand, usually sends the recording to a cloud service, so it is worth asking where your words are processed.

Users do not need to think strictly in terms of Boolean logic. While end-users interact through GUIs, developers write code using high-level programming languages (like C++, Python, or Rust). Even direct hardware interaction via an instruction set architecture is managed through intermediate tools like Assembly languages and assemblers. A compiler translates the whole program into machine code before it runs, an interpreter reads and executes it line by line, and an assembler turns human-readable processor instructions into the bytes the processor understands.

Terms like Kernel, Program, and Application represent different layers of software semantics and system abstractions. Underlying all software is computer architecture, which defines the foundational communication rules. Open standards and open architectures—such as those backed by the RISC-V ecosystem—demonstrate how global tech communities collaborate to shape the future of machine interaction. The chips in the small devices of Microcontroller Communication show the variety: the ESP8285 uses an Xtensa core, some newer chips from the same family use RISC-V, and the Arduino boards use ARM or AVR cores. Each has its own instruction set, and compilers hide that difference from you.

How Machines Talk to Each Other

Machines also need to communicate with other machines, and the same ladder applies. Close to the hardware there are short serial links between chips, higher up there are networks and protocols, and at the top there are programming interfaces (APIs) that let one program ask another to do something without knowing how it works inside.

Common ways machines exchange data (my own selection, not a complete list):

LinkTypical useNotes
UART (serial)Displays, GPS modules, a console on a microcontrollerTwo data wires plus ground, both ends must agree on the speed (baud rate)
I²C and SPISensors, memory, small displays on the same boardShort distances; I²C uses two wires and addresses, SPI uses more wires and is faster
USBKeyboards, drives, programming boardsA standard that carries data and power
Ethernet, Wi-Fi + TCP/IPAnything on a networkThe foundation of everything below; see Computer Networks
HTTP and RESTWeb pages, web APIs, many smart devicesRequest and response: the client asks, the server answers
MQTTSensors, switches and door controllersPublish and subscribe through a broker; light on small devices. A working example is in Network Door Opener

The two network models are worth comparing. In request and response (HTTP) a client opens a conversation, asks a question and waits for the answer. In publish and subscribe (MQTT) a device sends a message to a named topic, and every device that subscribed to that topic receives it, so the sender and the receiver never need to know each other. That is why one phone button can open a door that sits behind a broker, and why a single temperature sensor can feed a display, a graph and an alert at the same time.

Every such link is a place where someone can listen or lie, so communication with machines needs three things: authentication (who is talking), encryption (nobody else can read it) and least privilege (a device may do only what it must). The reasoning behind that is in Security Considerations. A terminal command that can delete a disk is powerful for the same reason that a command which can unlock a door is dangerous.

Examples: Try It Yourself

Overview

1 – a conversation with the network from the terminal
2 – the same task at three different levels
3 – talking to a display over a serial line
4 – a program in assembly language

Example 1 – Ask the network a question

Open a terminal and try these. They only read information and change nothing. On Windows PowerShell the equivalent of traceroute is tracert.

ping -c 4 example.com        # is the machine reachable? (on Windows: ping -n 4 example.com)
nslookup example.com         # which address belongs to this name?
curl -I https://example.com  # fetch only the headers of a web page

The last command is a conversation in the HTTP protocol: curl sent a request and printed the status line and headers of the response. The browser does the same thing, only it then draws the page. More commands for checking a home network are in Computer Networks.

Example 2 – The same task at three levels

The task: show the word "Hello". Compare the number of things you have to understand at each level.

  • GUI: open a text editor, type the word, look at the screen.
  • Terminal: echo Hello
  • Programming language: python3 -c "print('Hello')"
  • Assembly language: about fifteen lines, see Example 4.

Each step down gives you more control over exactly what the machine does, and costs more effort and more knowledge. Professionals move between the levels depending on the problem.

Example 3 – Talk to a display over a serial line

A Nextion display, used in Microcontroller Communication, understands plain text commands that end with three bytes of 0xFF. On Linux with a USB-to-serial adapter (the port name varies, check with dmesg after plugging it in) you can send one by hand. Connect only the data lines and ground as described in the display's datasheet, and check that the adapter's voltage matches the display.

stty -F /dev/ttyUSB0 9600
printf 't0.txt="Hello"\xff\xff\xff' > /dev/ttyUSB0

The first line sets the speed of the line to 9600 baud, which must match the display. The second writes the text command followed by the three 0xFF bytes. If a text box named t0 exists on the current page, it now shows "Hello". Nothing in this exchange is more than bytes on a wire, and the display's own processor decides what they mean.

Example 4 – A program in assembly language

This small program for 64-bit Linux on an x86 processor prints "Hello" using only the operating system's two basic calls. It needs the NASM assembler and will not run on ARM, Windows or macOS without changes.

; hello.asm - 64-bit Linux, NASM syntax
global _start

section .data
msg db "Hello", 10          ; the text and a newline (10)

section .text
_start:
    mov rax, 1              ; system call number 1: write
    mov rdi, 1              ; file 1: standard output
    mov rsi, msg            ; address of the text
    mov rdx, 6              ; number of bytes
    syscall
    mov rax, 60             ; system call number 60: exit
    xor rdi, rdi            ; exit code 0
    syscall
nasm -f elf64 hello.asm -o hello.o
ld hello.o -o hello
./hello

The assembler turned each line into machine code, and the linker made a file that the kernel can start. Every high-level language ends up doing the same thing in the end: it asks the kernel to write bytes to a file called "standard output". The same program without any assembler at all, written byte by byte, and the whole path down to the logic gates are in From Source Code to Silicon.

Some resources:

A Few More Thoughts

Every layer of the ladder exists because someone wanted to make the layer below easier to use, and every layer also hides something. That is a good trade for everyday work and a risk when something goes wrong, because the problem may live on a step you cannot see. You do not have to become a programmer to benefit: knowing that a button, a command and a few bytes on a wire are three views of the same event helps you judge what a device really does, what it sends and to whom, and what is lost when you let someone else decide the details. How to be careful with all of this is the subject of Security Considerations, and how small devices put the ideas to work is shown in Microcontroller Communication and Network Door Opener.

← All notes