Skip to main content

kymoscope-collector

Site collector for Kymoscope. It runs on one host at the customer's site (normally the DMZ), reads industrial protocols, databases, message brokers, a folder of logger files or your own Python source, encrypts the data and publishes it as Kymoscope streams. Outbound connections only; the disk buffer holds ciphertext.

Install

pip install kymoscope-collector              # core: OPC UA, CSV files, UDP/TCP, Python sources
pip install "kymoscope-collector[files]"     # + Parquet, TDMS and MF4 files
pip install "kymoscope-collector[windows]"   # + Windows service
pip install "kymoscope-collector[sql]"       # + SQL sources

Requires Python 3.10 to 3.13 (python.org or your distribution; the Microsoft Store Python cannot host the Windows service and service install refuses it).

  • Docker: ghcr.io/javijur/kymoscope-collector (mount a folder with collector.yaml at /data). The container runs as uid 10001, so give it the folder: sudo chown -R 10001:10001 /srv/kymoscope (or use --user). It stops with a clear message when /data is not writable.
  • Linux (systemd): sudo useradd --system --no-create-home --shell /usr/sbin/nologin kymoscope, then copy the unit file to /etc/systemd/system/. It ships in the package at <site-packages>/kymoscope_collector/packaging/kymoscope-collector.service (and in the repository at packages/collector/packaging/). Uncomment ReadWritePaths= for any folder a files source writes to (ProtectSystem=strict).
  • Windows service: runs as LocalSystem by default. For a dedicated account: sc config KymoscopeCollector obj= .\kymoscope password= ..., plus the "Log on as a service" right (sc config doesn't grant it), read access to the Python installation and the venv (so not a Python installed under C:\Users), modify rights on state_dir and on every watched folder (its done and failed folders too), and read access to state_dir\pki\own\key.pem if it already exists (it is private to the account that created it and doesn't inherit: icacls ...\pki\own\key.pem /grant kymoscope:R). The service restarts itself after any failure.

Before installing (for the customer's IT)

  • Application control (WDAC, AppLocker, Smart App Control): the service host pythonservice.exe from pywin32 is not code-signed (python.exe is). If unsigned binaries are blocked, allow it by path or hash, use Docker or WSL, or wait for the signed installer.
  • Outbound TCP 443 to Kymoscope, directly or through an HTTP proxy (below; Basic, NTLM or Kerberos; TLS inspection works once its root certificate is in the Windows certificate store). Nothing inbound.
  • Python 3.10 to 3.13, installed for all users if the service runs under a dedicated account. Not the Microsoft Store Python.

Updating

pip can't replace files while the service runs (WinError 32), so stop it first:

kymoscope-collector service stop --config C:\ProgramData\Kymoscope\collector.yaml
pip install -U "kymoscope-collector[windows]"
kymoscope-collector service start --config C:\ProgramData\Kymoscope\collector.yaml

Docker: docker pull ghcr.io/javijur/kymoscope-collector, then remove and recreate the container with the same options. systemd: systemctl stop kymoscope-collector, pip install -U kymoscope-collector in the unit's environment, systemctl start kymoscope-collector. The buffer and certificates in state_dir survive the update.

Proxy

proxy: env:KYMOSCOPE_PROXY      # http://host:port or http://user:password@host:port (percent-encode @ : \)
no_proxy: [historian.customer.local]
proxy_auth: basic               # basic (default) | negotiate | ntlm
tls_trust: system               # system (default) | bundled
ca_bundle: corp-root.pem        # optional, a PEM trusted on top

Both the HTTPS calls and the relay WebSocket tunnel through it (HTTP CONNECT); OPC UA never does. A Windows service doesn't see a user's Windows proxy settings, so set it here. The log never shows the credentials.

  • proxy_auth: negotiate: Kerberos with NTLM fallback, as the account the collector runs as (SSPI on Windows; no password anywhere). A service as LocalSystem authenticates as the computer account DOMAIN\HOST$.
  • proxy_auth: ntlm: a named account in the URL, http://DOMAIN%5Cuser:password@host:port (keep it in file:).
  • With either, a local forwarder on 127.0.0.1 authenticates each tunnel. It carries HTTPS only: plain http:// through it gets 501 and a log line (use no_proxy or https). Only the collector itself can use it (a random key per start); another program on the host gets 407.
  • collector.log traces every tunnel (destination, schemes the proxy offers, the one chosen, each step's answer, the time; never a token or password). log: {libraries: debug} adds pyspnego's and websocket-client's own lines.
  • tls_trust: system trusts the operating system's certificate store, where IT installs a TLS-inspecting proxy's root; bundled trusts only certifi (before 0.8.2). ca_bundle adds a PEM on top (Docker, Linux).

Code-signed installers are coming.

Quick start (no server needed)

kymoscope-collector simulate                                   # demo OPC UA server on port 4840
kymoscope-collector browse --url opc.tcp://localhost:4840 --out tags.csv
kymoscope-collector run --config collector.yaml

A minimal collector.yaml:

api_key: env:KYMOSCOPE_API_KEY
streams:
  - name: Demo
    mode: live                # live (watched as it comes) | record (also kept in the cloud)
    sources:
      - name: Demo
        type: opcua
        url: opc.tcp://localhost:4840
        security: None
        allow_insecure: true  # demo server only
        tags: tags.csv

Streams

A stream is what your plan counts (streams live at once), so the collector groups sources into streams: one collector is usually one stream with every source's channels. Each stream says its mode; there is no default.

streams:
  - name: Customer A
    mode: record                 # live | record (the cloud keeps what it sends, within your storage)
    stream_password: file:stream-password.txt   # optional: who may watch (default: the API key's secret)
    visibility: private          # private | open (anyone, no password, not end-to-end encrypted)
    live: {rate_hz: 20}          # optional: live messages a second (default 20, capped by the plan)
    sources:
      - {name: PLC1, type: opcua, url: opc.tcp://10.0.0.11:4840, tags: plc1.csv}
      - {name: PLC2, type: opcua, url: opc.tcp://10.0.0.12:4840, tags: plc2.csv}
  • In a stream of more than one source every channel is named Source/Channel (PLC1/Temperature, and PLC1/Temperature.status), so equal tag names never collide; a stream of one source keeps its names.

  • Each source goes in messages of its own, so a 1 kHz source and a 1 Hz one never inflate each other.

  • At start the collector declares each stream to Kymoscope: its mode and, per source, the samples a second it reads and its channels (the adapter's poll interval, publishing_ms for OPC UA, or a faster tag's sampling_ms). A source that hands on whatever arrives (files, MQTT, Kafka, UDP, webhooks, a Python adapter) is declared at 1 Hz: set hz: on it to say its real rate. Kymoscope admits the stream against your plan and the log shows what is left, e.g. stream 'Customer A': Kymoscope: 'Customer A' admitted (record, ...). Left: .... A source whose tags change declares its stream again.

  • Password, visibility and mode belong to the stream: sources that need another one go in another stream. The stream's mode (live | record) is not an OPC UA source's own mode (SignAndEncrypt | Sign, its message security): both can appear, at their own level.

  • Since 1.0 a top-level sources: is refused (put them in a stream), and so are record, stream_password, visibility and live on a source (they moved to its stream).

  • Upgrading an older collector.yaml by hand (the MCP's write_config migrates it for you; pip alone doesn't): move each source into a stream named after it, so it keeps its stream and buffer, and give the stream its mode (record: always was mode: record; manual or none: live or record, your choice):

    # before 1.0
    sources:
      - {name: PLC1, type: opcua, url: opc.tcp://10.0.0.11:4840, record: always}
    
    # 1.0
    streams:
      - name: PLC1
        mode: record
        sources:
          - {name: PLC1, type: opcua, url: opc.tcp://10.0.0.11:4840}
    

Notes:

  • Unknown keys in collector.yaml are an error that lists the valid ones; a password with security: None is allowed but logged as a warning.
  • Editing tags.csv reconnects the source, so its tags have a short gap.
  • One OPC UA source handles about 2,000 tags reporting at distinct millisecond times per second. Split larger tag lists into several type: opcua sources with different tags files.
  • The enumeration labels are not sent. Blocks wait in a memory queue bounded by buffer.memory_mb (default 256) while a stream cannot register; the oldest are dropped and counted in <source>.queue_dropped.
  • The private key state_dir/pki/own/key.pem is created owner-only (0600; on Windows user, SYSTEM and Administrators).

Other commands: cert (show or renew the collector's certificate), service install|remove|start|stop (Windows), endpoints --url opc.tcp://host:4840 (the security an OPC UA server offers, as JSON, with the strongest), diagnose --url opc.tcp://host:4840 [--config collector.yaml] (why an OPC UA server gives no tags: what it shows this login, the likely cause and the next step, in plain English), discover --config collector.yaml --source NAME --out tags.csv (the tags a configured source offers) and backfill --config collector.yaml --source NAME --from 2026-10-01T00:00:00Z --to 2026-10-02T00:00:00Z (a time range of a source's history sent into its stream, marked historical, for sources that keep history; a backfill into a stream of several sources isn't supported yet: if you need one, put the source in a separate stream with a different name).

Recording

mode: live keeps nothing. mode: record records files on this machine, cut every split_every, and uploads them to Kymoscope (within your storage) or to the project's own storage; they stay end-to-end encrypted. Files wait on disk (up to buffer_max_mb) while Kymoscope or the storage can't be reached. With a trigger: only start → stop is recorded, each run a file of its own; live goes on while the trigger is off. The start line of each record stream says where its files go, e.g. Recording files: every 1h → Kymoscope (buffer 2 GB).

The standard recording keys, per stream (buffer_max_mb also top-level, for every stream):

key what default
split_every how often a recording is cut into a new file: 1m, 5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h or 24h from the declared rate (~150 MB files)
buffer_max_mb local space for files not stored yet (past it the oldest go) 2048 (the old buffer: max_mb still works)
storage the project's own storage, when it has one: folder: <path> or s3: {endpoint, region, bucket, prefix, access_key_id, secret_access_key} none
retention_days own storage only: how many days Kymoscope lists each file (it never deletes files there; use the storage's own lifecycle rule or a scheduled task to free space) listed until deleted
streams:
  - name: Customer A DCS
    mode: record                 # files recorded here and uploaded
    split_every: 1h
    sources:
      - {name: Customer A DCS, type: opcua, url: opc.tcp://dcs-gw:4840, tags: tags.csv,
         mark_tag: MarkButton}   # optional: each rise of this channel marks the stream
  - name: Customer A test rig
    mode: record
    trigger:                     # only start to stop is recorded; or all: / any: a list of conditions
      start: Speed > 5
      stop: Speed < 1
      start_after: 5s            # optional: the start must hold this long
      stop_after: 2min           # optional: the stop must hold this long
    sources:
      - {name: Rig, type: udp, layout: rig_layout.yaml, hz: 1000}
  - name: Customer A lab bench
    mode: live                   # nothing stored
    sources:
      - {name: Bench, type: modbus, host: 192.168.1.20, map: registers.csv}

Conditions are channel op number (>, >=, <, <=, ==, !=). Durations: 500ms, 30s, 2min, 1.5h or a plain number of seconds. The live stream always carries every value; the trigger only decides what is stored.

Times (split_every cuts, clock rules such as cycles: at: [06:00]) follow the machine's time zone; in Docker set TZ (for example -e TZ=Europe/Madrid; default UTC).

Marks: every stream has a numeric channel mark, 0 from its start and 1 for one sample when the stream is marked (MARK in the app, or a rise of a source's mark_tag). cycles: rules (and the alerts: on them) run on any stream they name in their source:, live or record, from its live values.

Removed in 2.0: the Historian (day files and the history command) and sinks. A collector.yaml that still has history:, recording:, segments: or sinks: does not start, and the error says what to use instead: mode: record (and split_every) on the stream for history:/recording:, cycles: for segments:. The folder state_dir/history is no longer used and can be deleted.

Source types

Each source of a stream has a type. Install the extra for the types you use; extras combine (pip install "kymoscope-collector[mqtt,sql]").

type Reads pip extra
opcua OPC UA servers (with history backfill) core
opcda OPC DA (Classic) servers, Windows only opcda (+ windows)
mqtt MQTT brokers, Unified Namespace, Sparkplug B mqtt
modbus Modbus TCP / RTU, SunSpec inverters modbus
can CAN / CAN FD buses decoded with a DBC can
logix Rockwell ControlLogix, CompactLogix, Micro800 logix
s7 Siemens S7-300/400/1200/1500 s7
ads Beckhoff TwinCAT PLCs by symbol name ads
bacnet BACnet/IP building automation bacnet
serial RS-232/RS-485 or serial-server instruments, line by line serial
scpi SCPI/VISA instruments (LAN, GPIB, USB) scpi
udp Binary struct packets or JSON/CSV lines over UDP or TCP core
kafka Kafka topics: JSON, raw numbers, Sparkplug B kafka
mtconnect CNC machines through an MTConnect agent mtconnect
influx InfluxDB 2.x (Flux) or 1.x (InfluxQL) influx
sql Databases; AVEVA Historian, IP.21 and Timescale presets (validate on your system) sql
rest REST APIs; Canary and Proficy presets (validate on your system) rest
webhook Receives pushed JSON webhook
files CSV (core), Parquet, TDMS, MF4; battery cyclers (Neware, BioLogic, Arbin, Maccor, Basytec, Digatron) and HDF5 files for non-CSV; cyclers, hdf5
python Your own adapter class core

Anything else (IEC 60870-5-104, IEC 61850, DNP3, Mitsubishi MC, Omron FINS...): expose it as OPC UA or MQTT with a gateway (Kepware, Ignition Edge, Matrikon, Node-RED, Telegraf...). discover and backfill (above) work with any source type that supports them.

Documentation

  • Install, collector.yaml reference, certificates, security, health, troubleshooting, and "Which source do I use?": https://kymoscope.com/docs/collector
  • Per source: /docs/collector-opcda, -opcua-history, -mqtt, -can, -modbus, -logix, -s7, -ads, -bacnet, -serial, -udp, -sql, -rest, -kafka, -mtconnect, -influx, -cyclers, and /docs/collector-gateways for protocols the collector does not read natively.

Metadata

Release files for kymoscope-collector 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kymoscope-collector 2.0.0
File Size Uploaded Provenance Actions
kymoscope_collector-2.0.0.tar.gz 417.9 kB With provenance Details for kymoscope_collector-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kymoscope-collector 2.0.0
File Interpreter ABI Platform Actions
kymoscope_collector-2.0.0-py3-none-any.whl Python 3 none any Details for kymoscope_collector-2.0.0-py3-none-any.whl

Total release size: 698.2 kB

Release files / kymoscope_collector-2.0.0.tar.gz

Download URL kymoscope_collector-2.0.0.tar.gz
Size 417.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e3e3556097052d94433f2a105b8fa5684c5e0b1046ff5c13c6020e4dd1cd817f
BLAKE2b-256 checksum
How to use checksums
1543e8f86b53b31ca814b26c75bdeb427572df425a78fae78a04380a6a97d16f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / kymoscope_collector-2.0.0-py3-none-any.whl

Download URL kymoscope_collector-2.0.0-py3-none-any.whl
Size 280.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
845b96bb1852fb585802acf732964a5ce39c53484e18f467c72f70b8be59287d
BLAKE2b-256 checksum
How to use checksums
98c196a2f978e865638e308c39076a5f054f1184152b8f0e107ee0e7cfca1612
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for kymoscope-collector 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kymoscope_collector-2.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page