Cowpoke
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/cowpokedocker 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/cowpokeOpen 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).
| Tag | What you get |
|---|---|
latest | The newest release. |
0.1.0, 0.1 | One release, or the newest patch of a minor version. Use these to stay on a version you tested. |
edge | The 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
- Test before the hardware arrives. A Modbus TCP or OPC UA simulator for your HMI, SCADA or gateway to poll.
- Stand in for a PLC. A simulated Logix or S7 PLC that answers tag reads by name and DB reads by address.
- Test an MQTT or Sparkplug host. A built-in broker, or a Sparkplug B edge node, publishing your tags.
- Read real devices. A client for each protocol, with history, alarms and boards on what it reads.
- Watch the wire. A passive monitor on a SPAN port: who talks to which PLC, writes, program downloads, run/stop, response times, retransmissions.
- Run automation code in CI. A fresh Cowpoke for each test, driven from Python.
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.
| Variable | Default in the image | What it sets |
|---|---|---|
COWPOKE_ADMIN_PASSWORD | random, printed once in the log | Password for the first admin user. Only used when there are no users yet. |
COWPOKE_DATA | /data | Config, users, certificates and history. |
COWPOKE_CONFIG | /data/cowpoke.yaml | The service configuration file. |
COWPOKE_BIND | 0.0.0.0:8080 | Web UI and API address. |
COWPOKE_LOG | info | Log filter, for example debug. |
COWPOKE_SOURCE_URL | none | Where 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:/dataWith 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
| Protocol | Simulator | Client |
|---|---|---|
| Modbus TCP | Holding and input registers, coils, discrete inputs; several unit ids on one port | Polls a device or gateway, several unit ids per service; writes coils and holding registers |
| OPC UA | Your tags as variables; None to Aes256Sha256RsaPss; anonymous and user logins; a trust list | Reads and writes a server's nodes with the same policies and logins |
| EtherNet/IP | A Logix controller: Read Tag and Write Tag by name, ListIdentity | Reads and writes ControlLogix and CompactLogix tags by symbolic name |
| Siemens S7 | An S7 PLC answering S7comm reads and writes on DBs, M, I and Q | Reads and writes S7-300/400/1200/1500 by address (DB1.DBD0, MW10) |
| MQTT | A built-in broker that publishes every tag; optionally a Sparkplug B edge node | Subscribes to topics, reads JSON or text; reads Sparkplug B nodes and devices |
| IO-Link | An ifm IoT Core master: process data in and out, device info | Reads sensors through a real ifm IoT Core master by IODD bit offset |
| API request | A mock HTTP API: routes, canned bodies, delays, status codes | Calls an endpoint on a timer and picks values out of the JSON |
| Traffic monitor | None: it only listens | Watches 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
- Historian. Any numeric tag, on change past a deadband or on an interval, with its own retention. Compressed by day, with hourly rollups for long trends.
- Alarms and hooks. High, low, equals, bad quality, stale and rate-of-change alarms with severities and acknowledgement. Hooks send a webhook, an email or an MQTT message, or write a tag.
- Boards. Dashboards built in the UI: trends, values, gauges, lamps with a switch, and alarm lists.
- Traffic monitor. Passive. Decodes Modbus, EtherNet/IP and CIP, S7comm, unencrypted OPC UA and MQTT, and measures response times and retransmissions per talker.
- Insights. A baseline per tag, then suggestions with evidence: a client polling far too fast, a reading pinned at 32767, drift, chattering alarms, writes at odd hours.
- Accounts. Admin edits services, users and certificates. Operator writes values and starts or stops services. Viewer reads everything.
- REST API and Python. Everything the UI does, over REST, server-sent events and a WebSocket. A small Python client and a pytest fixture start a throwaway Cowpoke per test.
- YAML config. Every service is a YAML definition. The UI's YAML tab, the API and one file in the data folder all edit the same thing.
- Edge agents. The same binary at the plant dials out to a central Cowpoke, so the plant needs no inbound firewall rules. It keeps running and recording while the link is down.
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:
- Connection. A simulator that isn't running. A client on a different port than its device listens on. A client speaking one protocol to a port where another is served.
- Logins. A username or password that doesn't match the one the device requires. Secrets are compared, never shown.
- Modbus. Word order, unit id, register table, register, datatype, string length, scale and offset.
- OPC UA. A security policy the server doesn't offer, an anonymous client on a server that requires a login, and node ids.
- Siemens S7. The S7 address and datatype of each tag.
- EtherNet/IP. The Logix tag name each tag reads.
- MQTT and Sparkplug B. The topic a tag subscribes to, the Sparkplug group, edge node and device ids, and metric names.
- API request. A URL path the mock API doesn't serve, and JSON pointers.
- IO-Link. Port, process data in or out, bit offset and bit length.
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.