Skip to content
slazavPublic

About

Server for accessing devices and programs in experimental setup

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Device2


Overview

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 ssh tunnels 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.

System components

Available drivers:

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.

  • net -- Network devices, LXI.

  • 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

About

Server for accessing devices and programs in experimental setup

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages