Cowpoke

Cowpoke · An Ohmstead product

Cowpoke is an industrial protocol simulator and client in one Docker container. You create services, and each one speaks one protocol: as a simulated device for your HMI, SCADA or gateway to talk to, or as a client to a real one. Modbus TCP, OPC UA, EtherNet/IP, Siemens S7, MQTT with Sparkplug B, IO-Link and HTTP APIs. A historian, alarms, dashboards and a passive traffic monitor come with it. Free to self-host under the AGPL-3.0.

Cowpoke on Docker Hub Source on GitHub

Get the container

The image is ohmsteadhq/cowpoke on Docker Hub, built for linux/amd64 andlinux/arm64. It is about 70 MB, distroless, and runs as a non-root user with a healthcheck.

docker pull ohmsteadhq/cowpoke
docker run -d --name cowpoke -p 8080:8080 -p 5020:5020 -p 4840:4840 \
  -e COWPOKE_ADMIN_PASSWORD='pick-a-long-one' -v cowpoke-data:/data ohmsteadhq/cowpoke

Open http://localhost:8080 and sign in as admin. If you don't setCOWPOKE_ADMIN_PASSWORD, Cowpoke makes one up once and prints it in the log (docker logs cowpoke).

TagWhat you get
latestThe newest release.
0.1.0, 0.1One release, or the newest patch of a minor version. Use these to stay on a version you tested.
edgeThe newest commit on the master branch. Not a release.

All four tags are on Docker Hub, each for both architectures.

With Docker Compose, save this as docker-compose.yml, set COWPOKE_ADMIN_PASSWORD and run docker compose up -d:

services:
  cowpoke:
    image: ohmsteadhq/cowpoke:latest
    restart: unless-stopped
    environment:
      # Only used the first time, when there are no users yet.
      COWPOKE_ADMIN_PASSWORD: ${COWPOKE_ADMIN_PASSWORD:?set COWPOKE_ADMIN_PASSWORD}
    volumes:
      - cowpoke-data:/data
    ports:
      - "8080:8080"   # web UI and API
      - "5020:5020"   # a Modbus TCP simulator on port 5020
      - "4840:4840"   # an OPC UA simulator on port 4840

volumes:
  cowpoke-data:

The repo's own docker-compose.yml builds the image from source and adds an edge agent. To build it yourself:

git clone https://github.com/ohmsteadhq/cowpoke && cd cowpoke
docker build -t cowpoke .

What you can do with it

Define a service

A service is an id, a name, a protocol, a mode (server for a simulated device, client to talk to a real one), its settings and its tags. Build one in the web UI, which checks it as you type and has aTest button that runs it for a few seconds without saving. Or send it over the REST API, or write it as YAML. All three edit the same definition. This one simulates a tank level on a Modbus PLC and records its history:

services:
  - id: pump-station
    name: Pump station PLC
    kind: modbus
    mode: server
    settings: { port: 5020 }
    tags:
      - name: tank_level
        datatype: float32
        register: 0
        simulate: { kind: walk, min: 20, max: 80, step: 0.5 }
        history: { mode: deadband, deadband: 0.5, retention_days: 30 }

Simulated tags can follow a sine, triangle, ramp, square wave, random value, random walk, counter, toggle or a sequence of values. Set them from a test while it runs, too. The repo has acommented template for each protocol and mode, andtwo larger examples.

Ports, data and settings

Ports. The web UI and API are on 8080. Each simulated device listens on the port its settings name, so publish those too: -p 5020:5020 for a Modbus simulator on 5020. On Linux with many services,--network host is simpler.

Data. Everything Cowpoke keeps is in /data: the service configuration, users, OPC UA certificates, boards, alarms and history. Mount a volume there (-v cowpoke-data:/data) and keep it private, because alarm hooks store SMTP and MQTT passwords in it as plain text.

HTTPS. The web UI has none of its own. Off a trusted network, put it behind a reverse proxy that terminates TLS.

VariableDefault in the imageWhat it sets
COWPOKE_ADMIN_PASSWORDrandom, printed once in the logPassword for the first admin user. Only used when there are no users yet.
COWPOKE_DATA/dataConfig, users, certificates and history.
COWPOKE_CONFIG/data/cowpoke.yamlThe service configuration file.
COWPOKE_BIND0.0.0.0:8080Web UI and API address.
COWPOKE_LOGinfoLog filter, for example debug.
COWPOKE_SOURCE_URLnoneWhere this copy's source is, shown under Settings > About. For anyone running a modified Cowpoke for others.

The image has no shell, so docker exec … sh won't work. Live capture for the traffic monitor needs root and the capture capabilities: --user 0 --cap-add NET_RAW --cap-add NET_ADMIN --network host. Replaying a pcap file needs none of that.

Upgrade

Pull the new image and start the container again on the same data volume. Your services, users and history stay in the volume.

docker pull ohmsteadhq/cowpoke
docker rm -f cowpoke
# then the same docker run as before, with the same -v cowpoke-data:/data

With Compose: docker compose pull, then docker compose up -d. To stay on a version you tested, use a version tag such as ohmsteadhq/cowpoke:0.1.0 in place of latest.

Every protocol, both ways

ProtocolSimulatorClient
Modbus TCPHolding and input registers, coils, discrete inputs; several unit ids on one portPolls a device or gateway, several unit ids per service; writes coils and holding registers
OPC UAYour tags as variables; None to Aes256Sha256RsaPss; anonymous and user logins; a trust listReads and writes a server's nodes with the same policies and logins
EtherNet/IPA Logix controller: Read Tag and Write Tag by name, ListIdentityReads and writes ControlLogix and CompactLogix tags by symbolic name
Siemens S7An S7 PLC answering S7comm reads and writes on DBs, M, I and QReads and writes S7-300/400/1200/1500 by address (DB1.DBD0, MW10)
MQTTA built-in broker that publishes every tag; optionally a Sparkplug B edge nodeSubscribes to topics, reads JSON or text; reads Sparkplug B nodes and devices
IO-LinkAn ifm IoT Core master: process data in and out, device infoReads sensors through a real ifm IoT Core master by IODD bit offset
API requestA mock HTTP API: routes, canned bodies, delays, status codesCalls an endpoint on a timer and picks values out of the JSON
Traffic monitorNone: it only listensWatches a SPAN port or a pcap file: who talks to which device, writes, downloads, run/stop

Every service runs on its own. Cowpoke is not a bridge that copies values from one protocol to another.

Built in

Foreman: ask why a client reads wrong

Foreman diagnoses communication misconfigurations. You name the services and say what you noticed. Cowpoke gathers each service's status, settings, tag map and live values, runs its rule checks, and asks a small language model to name the misconfigured service, the cause and the fix. It only reads; nothing is changed.

The rule checks compare each client with the simulator of the same protocol, field by field. They need no model:

The model then answers with one cause: an address offset, word order, unit id, scaling, register table, datatype, string length, bit offset, tag name, node id, security policy, credentials, topic, Sparkplug ids, metric name, JSON pointer, URL path, wrong port or host, protocol mismatch, device offline, something else, or nothing wrong.

curl -X POST localhost:8080/api/foreman/diagnose \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"services": ["tank-plc", "scada"], "symptom": "The SCADA shows a tank level of zero"}'

The reply holds the diagnosis (service, cause, explanation, fix), the rule findings behind it, the engine used and the seconds it took. Send "dry_run": true to get the evidence and the rule findings without asking a model. Foreman is an API route today, with no page in the web UI.

Where the model runs. The image on Docker Hub has no model engine built in. Point it at a model server with COWPOKE_FOREMAN_URL: any OpenAI-compatible chat endpoint, such as llama.cpp's server. For Ollama, also set COWPOKE_FOREMAN_API=ollama, and name the model with COWPOKE_FOREMAN_MODEL_NAME. A build from source with --features foreman loads a GGUF file itself, from the path inCOWPOKE_FOREMAN_MODEL.

What it does not cover. The rule checks need a reference to compare a client with, and today that is a simulator of the same protocol in the same Cowpoke. A client reading a real device has no such reference yet. The traffic monitor is not part of a diagnosis. In the repo's benchmark, stock qwen3:4b through Ollama, given the rule findings, passed 11 of 12 scenarios on the first hand-staged set and 5, 6 and 9 of 12 on three later sets of faults staged to be harder. Twelve scenarios is a small test: treat an answer as a lead to check, not a verdict.

Bring your Ohmstead I/O

Draw the panel in Ohmstead, then test its I/O in Cowpoke without retyping a tag. Ohmstead lists every wired channel of a PLC or I/O module as an I/O point, named by the field device on it (LT-101). In Cowpoke's service builder, Import from Ohmstead fetches those points with a project id and an access token, or takes the pasted export, and turns them into tags with addresses, datatypes, descriptions and units. Importing again keeps each tag's address, history and simulation.

Free to self-host

Cowpoke is open source under the GNU AGPL-3.0: run it anywhere, as many services as you like, at no cost. If you run a modified Cowpoke as a service for others, offer them its source. Ohmstead sells hosting for teams that would rather not run it themselves; talk to an engineer about it.

Not built yet: Modbus RTU over serial, OPC UA subscriptions (the client polls), built-in HTTPS (put a reverse proxy in front), S7comm-plus on optimized blocks, and IO-Link masters other than ifm IoT Core. The source has the full list.

Pick your protocol

Docs and source

Run it on your own network.