{"id":15132799,"url":"https://github.com/qbituniverse/iot-trafficlights","last_synced_at":"2026-01-20T23:32:34.611Z","repository":{"id":255580099,"uuid":"852050900","full_name":"qbituniverse/iot-trafficlights","owner":"qbituniverse","description":"IoT Traffic Lights module built with C# Core running in Docker on Raspberry Pi.","archived":false,"fork":false,"pushed_at":"2024-10-09T13:55:14.000Z","size":1416,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T14:22:27.059Z","etag":null,"topics":["docker","iot","netcore","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qbituniverse.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,"zenodo":null}},"created_at":"2024-09-04T06:22:44.000Z","updated_at":"2024-10-09T13:55:18.000Z","dependencies_parsed_at":"2025-04-12T14:32:51.903Z","dependency_job_id":null,"html_url":"https://github.com/qbituniverse/iot-trafficlights","commit_stats":null,"previous_names":["qbituniverse/iot-trafficlights"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/qbituniverse/iot-trafficlights","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbituniverse%2Fiot-trafficlights","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbituniverse%2Fiot-trafficlights/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbituniverse%2Fiot-trafficlights/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbituniverse%2Fiot-trafficlights/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qbituniverse","download_url":"https://codeload.github.com/qbituniverse/iot-trafficlights/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbituniverse%2Fiot-trafficlights/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28618802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T22:24:05.405Z","status":"ssl_error","status_checked_at":"2026-01-20T22:20:31.342Z","response_time":117,"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":["docker","iot","netcore","raspberry-pi"],"created_at":"2024-09-26T04:40:26.869Z","updated_at":"2026-01-20T23:32:34.596Z","avatar_url":"https://github.com/qbituniverse.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IoT Traffic Lights\n\nTraffic Lights solution to control traffic lights, setup on the Raspberry Pi GPIO board.\n\n## Application Design\n\n![IoT Traffic Lights Application](/.docs/IoT.TrafficLights.Application.png)\n\n## Raspberry Pi Breadboard Wiring\n\nMaster source for the breadboard wiring can be found in the [IoT.TrafficLights.Breadboard.fzz](/.docs/IoT.TrafficLights.Breadboard.fzz) file. The file also allows to simulate the solution in the [Fritzing](https://fritzing.org/) application.\n\n![IoT Traffic Lights Breadboard](/.docs/IoT.TrafficLights.Breadboard.png)\n\n## Hardware Specification\n\n|Component|Description|\n|-----|-----|\n|Raspberry Pi|Raspberry Pi 4 Model B Rev 1.5, 4GB RAM\u003cbr /\u003eLinux 6.1.0-rpi4-rpi-v8\u003cbr /\u003eDebian GNU/Linux 12 (bookworm)\u003cbr /\u003earm64 architecture|\n|Breadboard and wiring|1x 830 hole breadboard and 10x standard wires|\n|LEDs|2x Green LEDs\u003cbr /\u003e2x Red LEDs\u003cbr /\u003e1x Amber LED|\n|Resistors|5x 330 Ohm|\n|Motion Sensor|1x HC-SR501 type motion sensor|\n\n## Projects\n\n|Name|Description|\n|-----|-----|\n|[IoT.TrafficLights.Domain](/.docs/IoT.TrafficLights.Domain.md)|Domain project containing reusable models, modules and data repositories.|\n|[IoT.TrafficLights.Api](/.docs/IoT.TrafficLights.Api.md)|Api (REST) project used to control the traffic lights module and access traffic lights execution logs.|\n|[IoT.TrafficLights.Web](/.docs/IoT.TrafficLights.Web.md)|Web app project used to control the traffic lights module from a Razor UI HTTP web app client.|\n|[IoT.TrafficLights.Console](/.docs/IoT.TrafficLights.Console.md)|Console app used to run traffic lights module or traffic sensor module.|\n\n## Deployment\n\nThe easiest way to deploy the IoT Traffic Lights application is to run the [docker-compose.yaml](/.cicd/compose/docker-compose.yaml) Docker Compose file with the following command. This will deploy all the containers, volumes and networking on the Docker instance.\n\n```bash\ndocker compose -f docker-compose.yaml --env-file vars.env up -d\n```\n\nTo remove the IoT Traffic Lights application from Docker instance, use this command. This will remove all the containers, volumes and networking from Docker instance.\n\n```bash\ndocker compose -f docker-compose.yaml --env-file vars.env down\n```\n\nThe [vars.env](/.cicd/compose/vars.env) file provides all the environment specific configuration for the application. Use this table below as guide to configure the deployment.\n\n|Key|Values|Description|\n|-----|-----|-----|\n|ENVIRONMENT|Development, Test, Production|Defines the release environment.|\n|COMPOSE_PROJECT_NAME|dev-iot-trafficlights, test-iot-trafficlights, prod-iot-trafficlights|This is used to prefix resources and set environmental boundaries for the application components. It allows to run Dev, Test and Prod simultaneously on the same Docker instance at the same time and not clash with each other.|\n|COMPOSE_PROFILES|Mock, SQLite, MySql, MongoDb|Defines which application components are created and used as backend data storage, i.e. SQLite, or MySql or MongoDb database or Mock in-memory only hard-coded data samples.|\n|DB_DIR_SQLITE|C:\\Path\\SQLite or /home/path/sqlite|SQLite database folder location where the database artifacts are stored.|\n|DB_PORT_SQLITE|30xx, ex. 3017|Port number to access SQLite database.|\n|DB_DIR_MYSQL|C:\\Path\\MySql or /home/path/mysql|MySql database folder location where the database artifacts are stored.|\n|DB_PORT_MYSQL|33xx, ex. 3317|Port number to access MySql database.|\n|DB_DIR_MONGODB|C:\\Path\\MongoDb or /home/path/mongodb|MongoDb database folder location where the database artifacts are stored.|\n|DB_PORT_MONGODB|270xx, ex. 27017|Port number to access MongoDb database.|\n|DB_PWD|Password|Password to access the database, only applicable to MySql _root_ user.|\n|API_PORT|80xx, ex. 8011|Port to access the Api.|\n|WEB_PORT|80xx, ex. 8014|Port to access the Web app.|\n|LOGLEVEL_CONSOLE|Verbose, Debug, Information, Warning, Error, Fatal|Log levels for the console output.|\n|LOGLEVEL_DATABASE|Verbose, Debug, Information, Warning, Error, Fatal|Log levels to log in the Database.|\n|GPIO|Mock, Pi|Define if the application is wired to Raspberry Pi or just in a Mock mode.|\n|RUN|RunMock, RunTrafficSensor, RunTrafficTimer|Program to run in the Console app.|\n\n## Modules\n\n### TrafficControl\n\nUse to control the traffic and pedestrian lights pattern, turning different light modes through GPIO pins.\n\n|LED Light|GPIO Pin|\n|-----|-----|\n|Traffic Red|26|\n|Traffic Amber|19|\n|Traffic Green|13|\n|Pedestrian Red|27|\n|Pedestrian Green|17|\n\n|Type|Description|\n|-----|-----|\n|Mock|Module is controlled through mock calls, no Pi required.|\n|Pi|Module is executing GPIO commands on the Pi. Raspberry Pi is required for this.|\n|Api|Module calls through HTTP layer to the _IoT.TrafficLights.Api_.\u003cbr /\u003eRefer to _IoT.TrafficLights.Api_ configuration and ports below.\u003cbr /\u003eSample URL: _http://localhost:8011_|\n\n### TrafficSensor\n\nUse to control the motion detection sensor, turning on or off sensor mode through GPIO pins.\n\n|Sensor|GPIO Pin|\n|-----|-----|\n|Sensor On|21|\n\n|Type|Description|\n|-----|-----|\n|Mock|Module is controlled through mock calls, no Pi required.|\n|Pi|Module is executing GPIO commands on the Pi. Raspberry Pi is required for this.|\n\n## Repository\n\nBackend database details, used across all projects in the IoT TrafficLights solution.\n\n|Object|Name|Description|\n|-----|-----|-----|\n|**Database**|IotTrafficLights|Main database name for the IoT TrafficLights solution.|\n|**Tables**|ApiLogs|Store the API execution logs.|\n||WebLogs|Store the Web App execution logs.|\n||ConsoleLogs|Store the Console execution logs.|\n||TrafficLogs|Store Traffic Lights execution logs.|\n\n### Configuration\n\n|Name|Description|\n|-----|-----|\n|Mock|Defaults to *empty string (\"\")*. Hard coded in-memory, stateless, mock calls to sample data set, no data persistance.\u003cbr /\u003e Connection string is not required.|\n|SQLite|SQLite backed database that is stored on a host machine file system as _.db_ file.\u003cbr /\u003eCommunication with the database through a file system.\u003cbr /\u003eDefault SQLite deployment doesn't configure any user credentials and can be accessed without such permissions.\u003cbr\u003e_NOTE: Works on AMD and ARM architectures_.|\n|SQLite.Url|PATH_TO_DATABASE\\DATABASE_NAME.db|\n|MySql|MySql backed database that can run either in Docker container or as standalone installation on the machine.\u003cbr /\u003eCommunication with the database is on port _33xx_ over the network (IP Address) or localhost (127.0.0.1).\u003cbr /\u003eUse the default _root_ account and password of your choice that is configured during MySql database deployment.\u003cbr\u003e_NOTE: Works on AMD and ARM architectures_.|\n|MySql.Url|Server=127.0.0.1;Port=33xx;User ID=root;Password=YOUR_PASSWORD;Database=DATABASE_NAME|\n|MongoDb|MongoDb backed database that can run either in Docker container or as standalone installation on the machine.\u003cbr /\u003eCommunication with the database is on port _270xx_ over the network (IP Address) or localhost (127.0.0.1).\u003cbr /\u003eDefault MongoDb deployment doesn't configure any user credentials and can be accessed without such permissions.\u003cbr\u003e_NOTE: Works on AMD and ARM architectures (Pi 5 or higher)_.|\n|MongoDb.Url|mongodb://localhost:270xx|","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqbituniverse%2Fiot-trafficlights","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqbituniverse%2Fiot-trafficlights","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqbituniverse%2Fiot-trafficlights/lists"}