{"id":38103157,"url":"https://github.com/oktopusp/agent-sim","last_synced_at":"2026-01-16T21:22:41.562Z","repository":{"id":210402388,"uuid":"726468708","full_name":"OktopUSP/agent-sim","owner":"OktopUSP","description":"Simulates TR-369 agent device","archived":false,"fork":false,"pushed_at":"2025-02-05T13:02:30.000Z","size":52,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T13:25:40.910Z","etag":null,"topics":["agent","iot","obuspa","simulator","tr-369","usp"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OktopUSP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-02T13:47:09.000Z","updated_at":"2025-01-06T15:34:26.000Z","dependencies_parsed_at":"2023-12-02T15:22:56.207Z","dependency_job_id":"d048a5a9-2ab8-4395-b520-6621c6738eba","html_url":"https://github.com/OktopUSP/agent-sim","commit_stats":null,"previous_names":["oktopusp/agent-sim"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OktopUSP/agent-sim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OktopUSP%2Fagent-sim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OktopUSP%2Fagent-sim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OktopUSP%2Fagent-sim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OktopUSP%2Fagent-sim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OktopUSP","download_url":"https://codeload.github.com/OktopUSP/agent-sim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OktopUSP%2Fagent-sim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28482810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","iot","obuspa","simulator","tr-369","usp"],"created_at":"2026-01-16T21:22:40.992Z","updated_at":"2026-01-16T21:22:41.555Z","avatar_url":"https://github.com/OktopUSP.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/OktopUSP/agent-sim/assets/83298718/c9a6347d-4576-4ae1-a1ba-7a0c28883855\"/\u003e\n\u003c/p\u003e\n\n# Introduction\nThis repository aims to promote the development of an agent TR-369 simulator to be used as an example of the protocol behavior in a embedded device. Our project is made based on [obuspa](https://github.com/BroadbandForum/obuspa).\n\n## Features\n- Load tests\n- Controller development without specific hardware\n- Simulate real-world operations\n- Try TR-369 without buying devices\n- Exploit controller vulnerabilities\n\n### Usage\nThis simulator works by loading the Obusba project inside a docker container. There are several possible configurations you can customize.\n\n**Requisites to run:**\n- Docker\n- GO\n\nBefore running the simulator make sure you download all go modules:\n\n```shell\nagent@sim:/home/apps/agent-sim$ go mod download\nagent@sim:/home/apps/GitHub/agent-sim$ go mod tidy\n```\n\nIt’s possible to configure flags either through the command line or by using the **.env** file in the project root folder. Below are the details for each available configuration flag:\n\n**Options**\n \n| CMD Argument    | ENV              | Default     | Description                                |\n|-----------------|------------------|-------------|--------------------------------------------|\n| `-sim_number`   | `SIM_NUM`        | `1`         | Number of simulated devices                |\n| `-num_to_start_ids` | `NUM_TO_START_IDS` | `0`   | From where to start your IDs               |\n| `-protocol`     | `MTP`            | `\"\"`        | MTP to use (mqtt, stomp, websockets)       |\n| `-mqtt_addr`    | `MQTT_ADDR`      | `localhost` | Address of the mqtt broker                 |\n| `-mqtt_port`    | `MQTT_PORT`      | `1883`      | Port of the mqtt broker                    |\n| `-mqtt_user`    | `MQTT_USER`      | `\"\"`        | Mqtt user                                  |\n| `-mqtt_passwd`  | `MQTT_PASSWD`    | `\"\"`        | Mqtt password                              |\n| `-mqtt_ssl`     | `MQTT_SSL`       | `false`     | Mqtt with tls/ssl                          |\n| `-ws_addr`      | `WS_ADDR`        | `localhost` | Address of the websockets server           |\n| `-ws_port`      | `WS_PORT`        | `8080`      | Port of the websockets server              |\n| `-ws_route`     | `WS_ROUTE`       | `/ws/agent` | Route of the websockets server             |\n| `-ws_ssl`       | `WS_SSL`         | `false`     | Websockets with tls/ssl                    |\n| `-path`         | `PATH`           | `\"\"`        | Folder path to save configurations         |\n| `-imgpath`      | `DOCKERFILE_PATH`| `\"\"`        | Path to Dockerfile                         |\n| `-prefix`       | `PREFIX`         | `oktopus`   | Prefix of device id                        |\n\nThe application processes flags in the following order of priority:\n```txt\n1º - Flag through command line.\n2º - Env variables.\n3º - Default flag value.\n```\n\n**Command Line Examples**\n\nRunning a simulated MQTT client:\n```shell\ngo run cmd/main.go -path=/home/apps/agent-sim/configs/ -protocol=mqtt  -mqtt_addr=192.168.10.159 -mqtt_port=1883\n```\n\nIf the command succeeds, a Docker container will be built and run:\n\n```shell\n2025/09/09 15:54:19 Loaded variables from '.env'\n2025/09/09 15:54:19 main.go:50: Starting Oktopus TR-369 Agent Simulator Version: 0.0.1\n{\"stream\":\"Step 1/21 : FROM ubuntu AS build-env\"}\n{\"stream\":\"\\n\"}\n{\"stream\":\" ---\\u003e 802541663949\\n\"}\n{\"stream\":\"Step 2/21 : RUN apt update \\u0026\\u0026 apt -y install         build-essential         libssl-dev         libcurl4-openssl-dev        libsqlite3-dev         libz-dev         autoconf         automake         libtool         libmosquitto-dev         pkg-config         git         cmake         make     \\u0026\\u0026 apt clean\"}\n{\"aux\":{\"ID\":\"sha256:0d679f9e9582039599dafbca24a3a153415ae22244fe5ad0fe99aecf53fb3f1f\"}}\n{\"stream\":\"Successfully built 0d679f9e9582\\n\"}\n{\"stream\":\"Successfully tagged obuspa:latest\\n\"}\n2025/09/09 15:54:20 mqtt.go:29: Create new agent(s) with mqtt protocol\n2025/09/09 15:54:20 mqtt.go:30: Mqtt client config: {Addr:192.168.10.159 Port:1883 User: Pass: Ssl:false}\n2025/09/09 15:54:20 mqtt.go:47: Device: oktopus-0\n2025/09/09 15:54:20 container.go:125: Container oktopus-0-mqtt started\n```\n\nContainer **oktopus-0-mqtt** was created and will simulate a mqtt client connecting to host 192.168.10.159 on port 1883. \n\nRunning 100 simulated mqtt clients:\n```shell\ngo run cmd/main.go -sim_number=100 -path=/home/apps/agent-sim/configs/ -protocol=mqtt  -mqtt_addr=192.168.10.159 -mqtt_port=1883\n```\n100 docker containers will be created in this case. You can check them by using **docker ps** command:\n```shell\ndocker ps\nCONTAINER ID   IMAGE                           COMMAND                  CREATED          STATUS          PORTS                                                                                            NAMES\n0a845c29eea7   obuspa:latest                   \"obuspa -p -v 4 -r /…\"   19 seconds ago   Up 13 seconds                                                                                                    oktopus-70-mqtt\nac41a997c6b3   obuspa:latest                   \"obuspa -p -v 4 -r /…\"   19 seconds ago   Up 11 seconds                                                                                                    oktopus-82-mqtt\n999d5c888e49   obuspa:latest                   \"obuspa -p -v 4 -r /…\"   19 seconds ago   Up 13 seconds                                                                                                    oktopus-19-mqtt\ne81bf0d80e67   obuspa:latest                   \"obuspa -p -v 4 -r /…\"   19 seconds ago   Up 14 seconds                                                                                                    oktopus-7-mqtt\n3e3230a7a2b4   obuspa:latest                   \"obuspa -p -v 4 -r /…\"   19 seconds ago   Up 14 seconds                                                                                                    oktopus-9-mqtt\n416621cc1af3   obuspa:latest                   \"obuspa -p -v 4 -r /…\"   19 seconds ago   Up 11 seconds                                                                                                    oktopus-81-mqtt\nef6127c163ae   obuspa:latest                   \"obuspa -p -v 4 -r /…\"   19 seconds ago   Up 10 seconds                                                                                                    oktopus-11-mqtt\n6cae0db74dd6   obuspa:latest                   \"obuspa -p -v 4 -r /…\"   19 seconds ago   Up 13 seconds                                                                                                    oktopus-62-mqtt\n451f8b65332a   obuspa:latest                   \"obuspa -p -v 4 -r /…\"   19 seconds ago   Up 10 seconds                                                                                                    oktopus-66-mqtt\n55b11d721707   obuspa:latest                   \"obuspa -p -v 4 -r /…\"   19 seconds ago   Up 9 seconds                                                                                                     oktopus-67-mqtt\n088fda26ed68   obuspa:latest                   \"obuspa -p -v 4 -r /…\"   19 seconds ago   Up 16 seconds                                                                                                    oktopus-87-mqtt\n61f93f6dfd13   obuspa:latest                   \"obuspa -p -v 4 -r /…\"   19 seconds ago   Up 11 seconds                                                                                                    oktopus-80-mqtt\n67288fc7e2d8   obuspa:latest                   \"obuspa -p -v 4 -r /…\"   19 seconds ago   Up 14 seconds                                                                                                    oktopus-64-mqtt\n```\n\nTo stop and remove all containers type **ctrl+c**:\n```shell\n^C2025/09/09 16:04:50 mqtt.go:160: Deleted docker mqtt container: 1c93a54521dac6f1d811cd506e65d15b6b7870a0363d32516db74ff163484583\n2025/09/09 16:04:50 mqtt.go:160: Deleted docker mqtt container: 5c936835a39ffc5be37d861041e808c52b9cfe1cb182198c404a0b6e2da576e4\n2025/09/09 16:04:50 mqtt.go:160: Deleted docker mqtt container: 7c0844585f3b4e9cfa387c334ebd0cbedfb9ba55e30573030dff8ea885232515\n2025/09/09 16:04:50 main.go:121: (⌐■_■) Agent simulator is out!\n```\n\n**ENV files examples**\n\nYou can also set flags using the **.env** file. For example: \n\nRunning 100 simulated mqtt clients:\n\nSet necessary flags inside the .env file:\n```txt\nSIM_NUM=\"100\"\nNUM_TO_START_IDS=\"\"\nMTP=\"mqtt\"\nPREFIX=\"\"\nMQTT_USER=\"mqttuser\"\nMQTT_PASSWd=\"mqttpass\"\nMQTT_PORT=\"1883\"\nMQTT_ADDR=\"192.168.10.159\"\nWS_ROUTE=\"\"\nWS_ADDR=\"\"\nPATH=\"/home/apps/agent-sim/configs/\"\nDOCKERFILE_PATH=\"./Dockerfile\"\nMTP=\"mqtt\" #options = mqtt, websockets or stomp\n```\n\nAfter flags are set in the .env file you can run the simulator using the bellow command:\n\n```shell\ngo run cmd/main.go \n```\n\n**Controller View**\n\nAfter running the agent simulator you can view them at the Devices page from the Oktopus controller:\n\n![alt text](/img/devices.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktopusp%2Fagent-sim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foktopusp%2Fagent-sim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktopusp%2Fagent-sim/lists"}