{"id":29770558,"url":"https://github.com/xanthium-enterprises/linux-serialport-programming-using-c-termios-api","last_synced_at":"2025-09-17T16:19:11.841Z","repository":{"id":299594977,"uuid":"1002412779","full_name":"xanthium-enterprises/linux-serialport-programming-using-c-termios-api","owner":"xanthium-enterprises","description":"Learn to program the serial port of a Linux Computer like Ubuntu,Fedora,Arch using C language and termios API for communicating with a single board computer like Arduino (ATmega328P) or Raspberry Pi Pico.","archived":false,"fork":false,"pushed_at":"2025-06-17T13:14:19.000Z","size":928,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-27T06:09:10.807Z","etag":null,"topics":["arduino-linux-serialport","arduino-serial","atmega328p","c-language","c-programming","c-programming-language","linux","linux-serialport","msp430g2553","raspberry-pi","raspberry-pi-pico","serial-communication","serial-port-communication","serialport","termios","termios-structure","tty","ttys0","ttyusb"],"latest_commit_sha":null,"homepage":"https://www.xanthium.in/native-serial-port-communication-arduino-micro-linux-unix-bsd-system-c-lang-terminos-api","language":"C","has_issues":true,"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/xanthium-enterprises.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":"2025-06-15T12:26:55.000Z","updated_at":"2025-06-23T14:29:25.000Z","dependencies_parsed_at":"2025-06-17T10:53:32.777Z","dependency_job_id":null,"html_url":"https://github.com/xanthium-enterprises/linux-serialport-programming-using-c-termios-api","commit_stats":null,"previous_names":["xanthium-enterprises/linux-serialport-programming-using-c-termios-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xanthium-enterprises/linux-serialport-programming-using-c-termios-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xanthium-enterprises%2Flinux-serialport-programming-using-c-termios-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xanthium-enterprises%2Flinux-serialport-programming-using-c-termios-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xanthium-enterprises%2Flinux-serialport-programming-using-c-termios-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xanthium-enterprises%2Flinux-serialport-programming-using-c-termios-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xanthium-enterprises","download_url":"https://codeload.github.com/xanthium-enterprises/linux-serialport-programming-using-c-termios-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xanthium-enterprises%2Flinux-serialport-programming-using-c-termios-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275623399,"owners_count":25498335,"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-09-17T02:00:09.119Z","response_time":84,"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":["arduino-linux-serialport","arduino-serial","atmega328p","c-language","c-programming","c-programming-language","linux","linux-serialport","msp430g2553","raspberry-pi","raspberry-pi-pico","serial-communication","serial-port-communication","serialport","termios","termios-structure","tty","ttys0","ttyusb"],"created_at":"2025-07-27T05:40:31.463Z","updated_at":"2025-09-17T16:19:11.818Z","avatar_url":"https://github.com/xanthium-enterprises.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linux Serial Port Programming Tutorial using C Language and termios API\n\n- In this repo ,You will find code for programming the serial port of your Linux distribution(Ubuntu,Fedora,Arch,Linux Mint) using C language.\n- We will also Learn to perform Bi-Directional Serial Communication between a Linux PC and an Arduino UNO\n- Here we will be using the native API's provided by the Linux System like the\n  - **termios** structure.\n  - **read()** system call\n  - **write()** system call\n-  to configure the serial port of our linux system.\n-  Code is written in **Pure C** language and compiled using **GCC**.\n\n ![Screenshot of serial port programming in linux using C](docs/arduino-ubuntu-serial-communication.jpg)\n\n\n## Online Tutorial\nA detailed writeup of the Linux serial Port Programming tutorial can be found using the below link \n- [Linux Serial Port Programming tutorial for the Absolute Beginner](https://www.xanthium.in/native-serial-port-communication-arduino-micro-linux-unix-bsd-system-c-lang-terminos-api)\n- \n![reading data from serialport using read() system call on linux](docs/arduino-linux-pc-serial-communication-c-language.jpg)\n\n![writing data to serialport using write() system call on linux](docs/write-to-linux-serial-port-in-c.jpg)\n  \n\n\n## Hardware Connections\n ![hardware connections for serial communication between arduino uno board and arch linux laptop using C/C++](docs/linux-arduino-serial-port-communication-in-c.jpg)\n \n \n The above image shows how to connect the Arduino board with the Linux PC for Serial Communication.\n\n ![connecting microcontroller to linux serial port using c language](docs/linux-arduino-serialport-comm.jpg)\n \n\n The above image shows how to interface bare microcontrollers like 8051,ATmega328P,MSP430 with linux serial port using a [USB to Serial Converter](https://www.xanthium.in/USB-to-Serial-RS232-RS485-Converter).\n\n## Compiling the Code.\n\nThe Code can be compiled using GCC on any modern Linux Systems.\n\n`gcc serial_port_code.c -o serial_port_code`\n\nCode tested on \n\n- `OS       :Fedora Linux 42 (Workstation Edition) x86_64`\n- `Kernel   :Linux 6.14.9-300.fc42.x86_64`\n- `Compiler :gcc (GCC) 15.1.1 20250521 (Red Hat 15.1.1-2)`\n\n- `OS       : Ubuntu 24.04.2 LTS x86_64`\n- `Kernel   : 6.11.0-26-generic` \n- `Compiler :gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0`\n\n## Screen shots\n![reading data from linux serial port using C](docs/arduino-ubuntu-serial-communication.jpg)\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxanthium-enterprises%2Flinux-serialport-programming-using-c-termios-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxanthium-enterprises%2Flinux-serialport-programming-using-c-termios-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxanthium-enterprises%2Flinux-serialport-programming-using-c-termios-api/lists"}