This is my client-server system for accessing devices and programs in an experimental lab.
There is a server which works with "devices". They can be physical devices connected in various ways, or programs with special interface. Each device has a unique name, which is listed in the server configuration file. Server knows how to open a device, send it a message and receive answer. Clients can connect to the server using HTTP protocol and send messages to devices.
This architecture has many advantages comparing to direct connections between clients and devices:
-
Clients know nothing about device connection details, they use only device name to access it. All low-level connection parameters (e.g. serial port configuration) are managed by the server.
-
Multiple clients can access a single device without collisions. All needed lockings are done by the server.
-
A device opens on demand, when the first client start using it, and close when all users disconnect.
-
Clients can monitor all messages for any device.
-
Remote access to devices can be easily implemented by either making a tunnel for HTTP connections (there is no authentification in the server, use
sshtunnels for this), or by attaching the remote client program to the local server as a device.
I want to mention E.Sergeicheva and D.Zmeev who worked with this system in Helsinki and Lancaster. They helped and motivated me a lot.
-
device_d -- server program.
-
device_c -- command-line client program.
-
device_ping -- a tool for connecting to a device bypassing the server
Some drivers are very general, they just send messages and receive answers without any knowledge of specific devices. They work for most SCPI-capable machinery connected via serial port, GPIB, LXI, VXI11, usbtmc, for command-line programs connected via SPP protocol.
Other drivers keep information about connection details for specific
devices. For example, I have a bunch of serial_* drivers for various
leak detectors which require non-trivial serial port configuration.
Some drivers keep even deeper information about device. They may
introduce high-level text commands to replace binary communication (see
i2c_* drivers), set correct delays etc.
The general idea is to keep the communication as low-level as possible here. I have a higher-level library device-role for knowlege about devices. But exact balance is not clear.
-
[test] -- A dummy driver for tests. Repeats incoming messages. No parameters.
-
spp -- Communicating with programs via "Simple Pipe protocol"
-
usbtmc -- Using usbtmc kernel module (Agilent/Keysight USB devices, etc.)
-
serial -- RS232 connections with full control of the serial port. Base for
serial_*drivers.-
serial_asm340 -- Pfeiffer Adixen ASM340 leak detector.
-
serial_l300 -- Phoenix/Leybold L300i leak detector.
-
serial_vs_ld -- Agilent VS leak detector.
-
serial_tenma_ps -- Korad/Velleman/Tenma power supplies.
-
serial_et -- EastTester devices (e.g. E4502 LCR-meter).
-
serial_hm310t -- Hanmatec HM310T power supply.
-
serial_jds6600 -- Junctek JDS6600 signal generator.
-
serial_simple -- Serial driver with reasonable default settings. Works with old Agilent/HP and Keithley devices.
-
-
net -- Network devices, LXI.
- net_gpib_prologix -- Prologix gpib2eth converter.
-
gpib -- GPIB devices via linux-gpib library.
-
vxi -- VXI-11 network devices.
-
i2c -- Communication with linux i2c bus via text commands. Base for
i2c_*drivers-
i2c_bmp280 -- BMP280 pressure/temperature sensor via i2c
-
i2c_ssd1306 -- SSD1306 display controller (128x64, 128x32 OLED displays) via i2c
-
V.Zavjalov, 2020-2026, vl.zavjalov at gmail dot com