DATADEMON TUNNEL / PREVIEW
Choose a task.Follow the steps.
Install the agent and sign in with ddemon login for personal use. Open a guide below. Replace example paths, email addresses and UPPERCASE placeholders with your own values.
Show someone your local web app
Website, API or WebSocket server
Before you start Your app is running on this computer. This example uses port 3000.
Share it with your reviewer
ddemon share http http://localhost:3000 --recipient reviewer@example.comSend the generated URL
The reviewer signs in with that email to open your app over the internet. HTTP and WebSocket connections are included.
When you are done Press Ctrl-C in the sharing terminal. Keep your app and command running while sharing; the link expires after one hour by default.
Choose a different audience
Without an audience option, only you can open it. A secret link allows anyone holding the complete link to open it without signing in. Secret-link sharing is Preview and cannot be created with the macOS Apple Silicon v0.2.9 package:
ddemon share http http://localhost:3000 --secret
Use --public only when the app should be publicly accessible. Keep your app's own authentication enabled:
ddemon share http http://localhost:3000 --public
For a persistent app or custom domain, see ddemon help publish.
Test real hardware from cloud CI
Serial + GPIO · your hardware
Run your device test in a cloud job: talk to the board over serial, trigger a configured GPIO line, and check the board's response.
Before you start Connect your serial board, controller or instrument to an approved source, and configure a Linux GPIO bank if your test uses pins. Use suitable wiring and updated agents. Cloud CI also needs CI hardware access enabled at the edge and a verified Linux x86-64 job image. Manual GitHub Actions runs passed on a Pi 1B and Uno; check compatibility and fixture safety for your own hardware. The tested direct-wire fixture needs supervision because its inactive state on power loss is unverified. Hardware and CI-runner production qualification remain pending.
Publish the two bench resources
Choose the serial asset from the gateway's approved inventory. The GPIO shortcut selects its sole approved bank; with multiple banks, use the exact asset selector.
ddemon discover --device SOURCE_DEVICEddemon publish SERIAL_ASSET --from SOURCE_DEVICE --name lab-uartddemon publish gpio --from SOURCE_DEVICE --name lab-gpioCreate a separate CI key for each resource
On a personal account, use the primary device; on a business account, use an owner or admin. Store each shown-once value in your CI secret store.
ddemon keys create lab-uart --name ci-serialddemon keys create lab-gpio --name ci-gpioRun Python in your CI job
Install your device test, its dependencies and the agent in the job image. Supply
DATADEMON_SERIAL_KEYandDATADEMON_GPIO_KEYfrom your CI secret store. Save your test astests/check_device.py.python tests/check_device.pyPython runs in the CI job and calls DataDemon CLI commands to open serial access and control GPIO. The gateway exposes the configured hardware; your Python test supplies the device protocol and pass/fail assertions.
Copy a working Python example
Pulse a line. Read the board's response. This example uses the Uno HIL1 demo firmware at 115200 baud, 8N1. It arms input
D2, pulses the approvedenableGPIO line for 100 ms, then requires a matching serialEVENT. Use a suitable, approved circuit with an inactive rest state.Use Python 3.11 or newer and install
pyserialin your job image:python -m pip install pyserialCopy the complete script into
tests/check_device.py. MatchGPIO_LINE,UNO_PINandBAUD_RATEto your fixture. For another board, replace theARM,EVENTandDISARMchecks with its actual serial protocol."""Save as tests/check_device.py. Requires Python 3.11+, pyserial and ddemon.""" import json import os from pathlib import Path import secrets import select import signal import subprocess import sys import tempfile import time import serial # Match your approved GPIO bank and the Uno HIL1 demo firmware. GPIO_LINE = "enable" UNO_PIN = "D2" BAUD_RATE = 115200 PULSE_MS = 100 def check_device(): serial_env = cli_environment("DATADEMON_SERIAL_KEY") gpio_env = cli_environment("DATADEMON_GPIO_KEY") with tempfile.TemporaryDirectory(prefix="hardware-ci-") as directory: link = Path(directory).resolve() / "board.serial" access = subprocess.Popen( ["ddemon", "access", "--foreground", "--fail-closed", "--link", str(link), "--session-timeout", "180", "--json"], env=serial_env, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, start_new_session=True, ) ready = False try: wait_ready(access, link) ready = True with serial.Serial(str(link), BAUD_RATE, timeout=0.1, write_timeout=1) as port: gpio(gpio_env, "read") # Require the inactive rest state. run_id = secrets.token_hex(8) armed = f"ARMED {run_id}".encode() expect(port, access, armed, seconds=8, send=f"ARM {run_id} pin={UNO_PIN}\n".encode(), ignore=(b"READY HIL1",)) gpio(gpio_env, "pulse", str(PULSE_MS)) # Send once. expect(port, access, f"EVENT {run_id} pin={UNO_PIN} seq=1".encode(), ignore=(armed,)) gpio(gpio_env, "read") # Confirm the line is back at rest. port.write(b"DISARM\n") expect(port, access, b"DISARMED") finally: stop_serial(access, link, ready) print("PASS: GPIO pulse produced the expected serial response") # Helpers: separate keys, bounded waits, checked results and owned cleanup. def cli_environment(key_name): key = os.environ[key_name].strip() if not key: raise RuntimeError("Both resource keys are required") env = {name: value for name, value in os.environ.items() if name not in {"DATADEMON_SERIAL_KEY", "DATADEMON_GPIO_KEY", "DATADEMON_CI_KEY"}} env["DATADEMON_CI_KEY"] = key return env def gpio(env, operation, *arguments): process = subprocess.Popen( ["ddemon", "gpio", operation, GPIO_LINE, *arguments, "--json"], env=env, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, start_new_session=True, ) try: output, _ = process.communicate(timeout=45) except BaseException: # A packaged CLI may include a launcher and a child runtime. Retire # the owned group on timeout/cancellation without repeating its pulse. try: os.killpg(process.pid, signal.SIGTERM) except ProcessLookupError: pass try: process.communicate(timeout=5) except subprocess.TimeoutExpired: try: os.killpg(process.pid, signal.SIGKILL) except ProcessLookupError: pass process.communicate(timeout=2) finally: # A launcher can exit before an unresponsive child. Retire any # remaining member of this owned group even after the launcher ends. try: os.killpg(process.pid, signal.SIGKILL) except ProcessLookupError: pass raise if process.returncode: raise RuntimeError("GPIO access failed; the pulse will not be retried") data = json.loads(output) if (data.get("operation") != operation or data.get("line") != GPIO_LINE or data.get("state") != "inactive" or data.get("lease_closed") is not True or data.get("restoration_verified") is not True or (operation == "pulse" and data.get("duration_ms") != PULSE_MS)): raise RuntimeError("GPIO result or lease release was not confirmed") def wait_ready(access, link): deadline = time.monotonic() + 35 line = bytearray() while time.monotonic() < deadline: if not select.select([access.stdout], [], [], 0.1)[0]: continue byte = os.read(access.stdout.fileno(), 1) if not byte or len(line) >= 8192: raise RuntimeError("Serial access ended before readiness") line.extend(byte) if byte != b"\n": continue event = json.loads(line) line.clear() if event.get("event") == "ready": if event.get("data", {}).get("endpoint") != str(link): raise RuntimeError("Serial endpoint does not match") return if event.get("event") in {"error", "changed", "stopped"}: raise RuntimeError("Serial access failed before readiness") raise RuntimeError("Serial readiness timed out") def expect(port, access, expected, seconds=10, send=None, ignore=()): deadline, next_send = time.monotonic() + seconds, 0 line = bytearray() while time.monotonic() < deadline: if access.poll() is not None: raise RuntimeError("Serial access ended during the test") if send is not None and time.monotonic() >= next_send: port.write(send) # ARM is safe to repeat while the Uno resets. next_send = time.monotonic() + 0.5 line.extend(port.read_until(b"\n", size=256)) if len(line) > 256: raise RuntimeError("Serial response is too long") if not line.endswith(b"\n"): continue received = bytes(line).rstrip(b"\r\n") line.clear() if received == expected: return if received not in ignore: raise RuntimeError("Unexpected serial response") raise RuntimeError("Expected serial response did not arrive") def stop_serial(access, link, ready): if access.poll() is None: try: os.killpg(access.pid, signal.SIGINT) except ProcessLookupError: pass try: output, _ = access.communicate(timeout=30) except subprocess.TimeoutExpired: try: os.killpg(access.pid, signal.SIGKILL) except ProcessLookupError: pass access.communicate(timeout=2) raise RuntimeError("Serial cleanup timed out") from None if ready: events = [json.loads(line) for line in output.splitlines() if line] stopped = [event for event in events if event.get("event") == "stopped"] if (access.returncode not in {0, 130} or len(stopped) != 1 or stopped[0].get("data", {}).get("reason") != "interrupted" or any(event.get("event") in {"error", "changed", "ready"} for event in events) or link.exists() or link.is_symlink()): raise RuntimeError("Serial release was not confirmed") def interrupted(_signum, _frame): raise KeyboardInterrupt if __name__ == "__main__": signal.signal(signal.SIGTERM, interrupted) try: check_device() except RuntimeError as error: print(f"FAIL: {error}", file=sys.stderr) sys.exit(1) except (Exception, KeyboardInterrupt): print("FAIL: hardware access, test or cleanup failed", file=sys.stderr) sys.exit(1)Run the command above with both CI keys supplied. Success prints
PASS: GPIO pulse produced the expected serial response. Missing or incorrect replies, failed access and unconfirmed cleanup return a nonzero exit code. The pulse is sent once and is never retried.CLI commands your Python test calls
Start serial access as a subprocess. Pass only the serial key as
DATADEMON_CI_KEYfor that subprocess; remove both test key variables from its environment. ReplaceSERIAL_LINKwith a vacant path in a private temporary directory.ddemon access --foreground --fail-closed --link SERIAL_LINK --jsonWait for the JSON
readyevent, then openSERIAL_LINKin Python, for example withpyserial. Keep the serial subprocess running while the test calls GPIO commands. Pass only the GPIO key asDATADEMON_CI_KEYto each GPIO subprocess, again removing both test key variables.ddemon gpio pulse GPIO_LINE 100 --jsonChoose
GPIO_LINEfrom the bank's line list and use a suitable, approved circuit. This requests a 100 ms pulse. Keys select resources automatically; GPIO access covers the whole configured bank. Serial and GPIO use separate leases, without an atomic reservation.
Result and cleanup Your Python test must close the port, stop and wait for the serial subprocess, and confirm release on success, failure or cancellation. Each GPIO operation releases its own lease. Busy, offline, failed access or failed cleanup must fail the job. Keep keys in trusted runtime steps, out of images and logs. Use the full key ID from ddemon keys list with ddemon keys revoke KEY_ID to retire access.
Try serial or GPIO from a paired computer first
Choose a vacant SERIAL_LINK path in a private temporary directory. Keep this command running; after its JSON ready event, your separate Python test can open that local port.
ddemon access lab-uart --foreground --fail-closed --link SERIAL_LINK --json
Close the port and press Ctrl-C in the access terminal when finished. Inspect the bank's line names and sampled states before choosing a line:
ddemon gpio lines --resource lab-gpio
For temporary browser serial access, run ddemon share serial on the attached computer. To receive a temporary share as a local port, run the printed ddemon serial connect SHARE_URL command. Windows receiving needs a Pico Serial Hub or approved virtual-COM pair.
Reach a private service
Remote Desktop or one TCP endpoint
Before you start Both computers are paired to your account. For this example, Remote Desktop is already enabled on the source and you have its normal login credentials.
Enable background operation once
ddemon background enablePublish the desktop privately
ddemon publish rdp --name desktopConnect from your other computer
ddemon access desktopUse the generated local endpoint and .rdp file with your installed client. Opening the client requires your confirmation or an explicit option. DataDemon does not enable Remote Desktop or handle its credentials.
When you are done These named services run in the background after the command exits. ddemon access desktop --stop stops your local endpoint; ddemon unpublish desktop removes the source route.
Use a web app or another TCP service instead
For a private web app, publish its origin and then access its name from a paired computer:
ddemon publish http://localhost:3000 --name my-app
ddemon access my-app
For another TCP service, publish one fixed tcp://HOST:PORT origin. Direct stock-client TCP/RDP access needs an enabled edge port pool and explicit network admission.
Send or receive files
Browser downloads and Linux uploads
Before you start Install the agent and sign in on the computer holding the files. The file chooser is Preview and requires a compatible installed agent. If your agent does not offer it, use the terminal alternative below.
Open the file sharing window
ddemon share files --uiChoose a file or folder, the audience and expiry, then create the link. Keep the agent terminal open and this device online.
Send the generated URL
Copy and send the link yourself. If you chose a specific person, they sign in with that email and download in their browser.
When you are done Press Ctrl-C to close access. The link expires after one hour by default.
Use a file path in the terminal
Replace the path and recipient email with your own. The recipient signs in with that email.
ddemon share files ./report.pdf --recipient reviewer@example.com
Receive browser uploads on Linux
Choose an existing Linux folder on a supported local filesystem. The recipient can upload new files through the printed URL.
ddemon receive ./incoming --recipient reviewer@example.com
Keep the terminal open; press Ctrl-C to stop. Saved files remain. Public and background receiving are unavailable.
Use an SFTP client instead
Requires an enabled edge SFTP pool. Replace the example network with your recipient's public IPv4 address and /32.
ddemon share sftp ./shared --recipient reviewer@example.com --allowed-cidr 203.0.113.44/32
The recipient signs in and uses the printed SFTP instructions. Ctrl-C closes access.
Print somewhere else
One selected printer · Preview
Before you start The printer is installed and works locally. Physical printer and native-client qualification remain limited.
Find your printer's ID
ddemon printersShare browser printing with one person
ddemon share printer --printer PRINTER_ID --recipient reviewer@example.com --no-ippSend the generated URL
The recipient signs in and submits their document to that queue. DataDemon uses the installed printer and driver.
When you are done Press Ctrl-C to close access. The link also expires automatically. Closing a share does not recall a document already sent to the printer.
Use native printing
Omit --no-ipp to include authenticated native IPPS setup. This needs compatible, qualified printer capabilities. Keep the native setup URI and files private.
Use resources on another computer
Publish an approved app from your laptop
Before you start The source is paired to your account, has HTTP supervision locally enabled, and is running the app. Only the primary device can approve or revoke paired devices.
Choose the source and its app
ddemon devicesddemon discover --device SOURCE_DEVICEThis reads the source's approved inventory. Choose
HTTP_ASSETfrom that result.Publish it privately
ddemon publish HTTP_ASSET --from SOURCE_DEVICE --name lab-appOpen the app
ddemon access lab-app
When you are done The source keeps serving after your laptop disconnects. Run ddemon unpublish lab-app from a paired computer to remove the route.
Pair the source first
Start enrollment on the new computer, then approve its printed code on your signed-in primary device:
ddemon enroll
ddemon devices approve CODE
Pairing alone does not enable resource supervision. On the source, use ddemon help setup to review the locally approved resource categories.