{"id":26790079,"url":"https://github.com/maxboro/emulated-uart-connection","last_synced_at":"2026-05-19T04:10:16.316Z","repository":{"id":275205567,"uuid":"925393251","full_name":"maxboro/emulated-uart-connection","owner":"maxboro","description":"Device connection and data transmission via UART - simple example","archived":false,"fork":false,"pushed_at":"2025-03-29T10:50:23.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T11:32:10.808Z","etag":null,"topics":["c-language","python","uart-communication","uart-receiver","uart-transmitter"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxboro.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":"2025-01-31T19:45:07.000Z","updated_at":"2025-03-29T10:50:24.000Z","dependencies_parsed_at":"2025-01-31T21:24:08.745Z","dependency_job_id":"739b70d6-36e0-4085-8f86-8999fb9e2cc8","html_url":"https://github.com/maxboro/emulated-uart-connection","commit_stats":null,"previous_names":["maxboro/emulated-uart-connection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maxboro/emulated-uart-connection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxboro%2Femulated-uart-connection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxboro%2Femulated-uart-connection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxboro%2Femulated-uart-connection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxboro%2Femulated-uart-connection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxboro","download_url":"https://codeload.github.com/maxboro/emulated-uart-connection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxboro%2Femulated-uart-connection/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267116493,"owners_count":24038624,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["c-language","python","uart-communication","uart-receiver","uart-transmitter"],"created_at":"2025-03-29T14:17:44.171Z","updated_at":"2026-05-19T04:10:11.291Z","avatar_url":"https://github.com/maxboro.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\nDevice connection and data transmission via UART – a simple example. \nUART is emulated using socat. \n\nFor Linux-based systems.\n\n# How to run\n\n### Create connection\nTo start connection run:\n```bash\nbash ./scripts/create_connection.sh\n```\nwhen connection no longer needed: Ctrl+C\n\n## Communication simulation\n### Python version\nStart transmission:\n```bash\n python ./transmission/python/transmitter.py --rate-hz=10\n```\n\nStart receiver in another terminal:\n```bash\n python ./transmission/python/receiver.py\n```\n\n### C version (currently just a minimal example)\nCompile code:\n```bash\n cd ./transmission/c/\n gcc transmitter.c -o transmitter\n gcc receiver.c -o receiver\n```\nor compile code with address sanitizer:\n```bash\n cd ./transmission/c/\n gcc -fsanitize=address -g transmitter.c -o transmitter\n gcc -fsanitize=address -g receiver.c -o receiver\n```\nStart receiver:\n```bash\n ./receiver\n```\nStart transmitter in another terminal:\n```bash\n ./transmitter\n```\n\n# Example\n### Python version\nTransmitter terminal:\n```terminal\nTransmission started at 10 Hz rate\nDevices: {'PTY_T': '/dev/pts/6', 'PTY_R': '/dev/pts/7'}\nPayload size: 20 bytes\nHeader size: 2 bytes\nTransmitter device: /dev/pts/6\n{'n': 0, 'ts': 1738408736.2018816, 'val1': 79.66531579271519, 'val2': 8002.739455114154}\n{'n': 1, 'ts': 1738408736.3031824, 'val1': 1142.7951800440528, 'val2': 9014.455197574267}\n{'n': 2, 'ts': 1738408736.4045305, 'val1': 3146.0788074662705, 'val2': 2369.597081576965}\n...\n{'n': 94, 'ts': 1738408745.6603653, 'val1': 8316.69147879593, 'val2': 7361.872599472276}\n{'n': 95, 'ts': 1738408745.7607894, 'val1': 5397.2207306205155, 'val2': 4051.730185618906}\n{'n': 96, 'ts': 1738408745.8615575, 'val1': 1450.975641802117, 'val2': 9434.488074294803}\n^CTransmitter is interrupted\nN sent: 97. Session duration: 9.7s\nActual rate: 10.0 Hz\nTransmitter serial is closed\n```\nReceiver terminal:\n```terminal\nDevices: {'PTY_T': '/dev/pts/6', 'PTY_R': '/dev/pts/7'}\nPayload size: 20 bytes\nHeader size: 2 bytes\nReceiver device: /dev/pts/7\n{'n': 45, 'ts': 1738408740.7292933, 'val1': 6136.21044921875, 'val2': 9628.3828125}\n{'n': 46, 'ts': 1738408740.8297496, 'val1': 7620.64599609375, 'val2': 3515.54443359375}\n...\n{'n': 88, 'ts': 1738408745.0570807, 'val1': 7096.373046875, 'val2': 4274.52197265625}\n{'n': 89, 'ts': 1738408745.1576502, 'val1': 6489.908203125, 'val2': 6629.0810546875}\n^CReceiver is interrupted\nFirst package received: 45, last: 89\nN received: 45, n sent 45.\nSuccess rate: 100.0%\nReceiver serial is closed\n```\n### C version\nTransmitter terminal:\n```terminal\nConnection params:\n/dev/pts/4\n/dev/pts/5\nmain PTY_T: /dev/pts/4\nmain PTY_R: /dev/pts/5\nMsg '0 1738761153.432000 1804289.375000 846930.875000' is sent.\nMsg '1 1738761154.433000 1681692.750000 1714636.875000' is sent.\nMsg '2 1738761155.433000 1957747.875000 424238.343750' is sent.\nMsg '3 1738761156.434000 719885.375000 1649760.500000' is sent.\nMsg '4 1738761157.434000 596516.687500 1189641.500000' is sent.\nMsg '5 1738761158.435000 1025202.375000 1350490.000000' is sent.\nMsg '6 1738761159.436000 783368.687500 1102520.125000' is sent.\nMsg '7 1738761160.437000 2044897.750000 1967514.000000' is sent.\nMsg '8 1738761161.438000 1365180.500000 1540383.500000' is sent.\nMsg '9 1738761162.438000 304089.187500 1303455.750000' is sent.\nEnd of transmission signal is sent.\n```\nReceiver terminal:\n```terminal\nConnection params:\n/dev/pts/4\n/dev/pts/5\nmain PTY_T: /dev/pts/4\nmain PTY_R: /dev/pts/5\nReceived: 0 1738761153.432000 1804289.375000 846930.875000\nVal sum: 2651220.250000\nReceived: 1 1738761154.433000 1681692.750000 1714636.875000\nVal sum: 3396329.500000\nReceived: 2 1738761155.433000 1957747.875000 424238.343750\nVal sum: 2381986.250000\nReceived: 3 1738761156.434000 719885.375000 1649760.500000\nVal sum: 2369646.000000\nReceived: 4 1738761157.434000 596516.687500 1189641.500000\nVal sum: 1786158.250000\nReceived: 5 1738761158.435000 1025202.375000 1350490.000000\nVal sum: 2375692.500000\nReceived: 6 1738761159.436000 783368.687500 1102520.125000\nVal sum: 1885888.750000\nReceived: 7 1738761160.437000 2044897.750000 1967514.000000\nVal sum: 4012411.750000\nReceived: 8 1738761161.438000 1365180.500000 1540383.500000\nVal sum: 2905564.000000\nReceived: 9 1738761162.438000 304089.187500 1303455.750000\nVal sum: 1607545.000000\nReceived end of transmission signal\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxboro%2Femulated-uart-connection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxboro%2Femulated-uart-connection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxboro%2Femulated-uart-connection/lists"}