{"id":15090212,"url":"https://github.com/carnivuth/edgex_iot_simulation","last_synced_at":"2026-01-04T08:06:54.325Z","repository":{"id":241897593,"uuid":"808153168","full_name":"carnivuth/edgex_iot_simulation","owner":"carnivuth","description":"edgex environment simulation with snmp capable control nodes","archived":false,"fork":false,"pushed_at":"2024-06-13T18:56:17.000Z","size":82,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T11:43:07.271Z","etag":null,"topics":["ansible","edgex","edgex-snmp","telegram","telegram-bot","vagrant"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carnivuth.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-05-30T13:43:54.000Z","updated_at":"2024-06-20T07:57:13.000Z","dependencies_parsed_at":"2024-11-27T22:37:42.358Z","dependency_job_id":null,"html_url":"https://github.com/carnivuth/edgex_iot_simulation","commit_stats":{"total_commits":38,"total_committers":1,"mean_commits":38.0,"dds":0.0,"last_synced_commit":"2f2b1e8237fe00ab84b59efa3cd5e624ad00a768"},"previous_names":["carnivuth/edgex_iot_simulation"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carnivuth%2Fedgex_iot_simulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carnivuth%2Fedgex_iot_simulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carnivuth%2Fedgex_iot_simulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carnivuth%2Fedgex_iot_simulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carnivuth","download_url":"https://codeload.github.com/carnivuth/edgex_iot_simulation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244826637,"owners_count":20516797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ansible","edgex","edgex-snmp","telegram","telegram-bot","vagrant"],"created_at":"2024-09-25T09:23:29.541Z","updated_at":"2026-01-04T08:06:54.321Z","avatar_url":"https://github.com/carnivuth.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Edgex IOT simulation\n\n[edgex](https://www.edgexfoundry.org/) cluster simulation with snmp devices as linux servers\n\n## Architecture\n\nThe idea is to simulate a network environment with a node acting as a [edgex](https://www.edgexfoundry.org/) gateway pulling information (*uptime in this example*) from snmp capable IOT nodes, the uptime data stream is used by a external developed application (*monitor*) that uses the information to notify that a node has been rebooted trough telegram messages\n\n```mermaid\nflowchart TD\nsubgraph edgex_gateway\ndirection TB\nF[monitor]\nA[snmp-device]\nG[core-data]\nE[edgex runtime]\nA --send events to--\u003e G\nF --reads from--\u003e G\nend\nsubgraph iot_network\ndirection LR\nB[iot node 1]\nB\nend\nA --snmp queries--\u003e B\n```\n\n## Installation\n\n- install [vagrant](https://www.vagrantup.com/) and [virtualbox](https://www.virtualbox.org/)\n\n- create python virtual environment and install dependencies\n\n```bash\ncd edgex_iot_simulation\npython -m venv env\nsource env/bin/activate\npip install -r requirements.txt\n```\n\n- install required ansible roles\n\n```bash\nsource env/bin/activate\nansible-galaxy role install -r roles/requirements.yml\n```\n\n- start cluster\n\n```bash\nvagrant up\n```\n\n- run the `preflight.yml` playbook\n\n```bash\nansible-playbook -i inventory.yml preflight.yml -e 'telegram_token=\u003cINSERT_TOKEN\u003e' -e 'telegram_channel_id=\u003cINSERT_CHANNEL_ID\u003e'\n```\n\n- in order to test the application simply restart the IOT node\n\n```bash\nvagrant reload iot-node-1\n```\n\n- and then inspect logs on the edgex-runtime node\n\n```bash\ncd /usr/local/edgex-runtime\ndocker compose logs monitor\n```\n\n## Results\n\n![](./img/result.jpg)\n\n### Preflight\n\nin order to run the playbook telegram configuration parameter are neded to start the monitoring application\n\ntelegram_token: token of the bot given from [botfather](https://telegram.me/BotFather)\ntelegram_channel_id: channel_id where to route reboot notification from the monitor app, this can be obtained by\n\n-  sending a message to the bot\n-  connecting to the url `https://api.telegram.org/bot\u003cbot-token\u003e/getUpdates`\n\nthe API will reply with a json with the chat id information\n\n\n### Monitor\n\nMonitor application is a simple python script that fetches the data from the edgex-core microservice and send a telegram message to the configured channel id,\nit's deployed exploiting the edgex compose file\n\n```mermaid\nflowchart TD\nsubgraph monitor\nA[monitor.py]\nend\nB[edgex_core_data]\nC[(telegram_api)]\nA --pull information from--\u003eB\nA --notify trough--\u003eC\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarnivuth%2Fedgex_iot_simulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarnivuth%2Fedgex_iot_simulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarnivuth%2Fedgex_iot_simulation/lists"}