{"id":15561218,"url":"https://github.com/lepiaf/serialport","last_synced_at":"2025-04-14T10:04:15.509Z","repository":{"id":55868929,"uuid":"72467135","full_name":"lepiaf/serialport","owner":"lepiaf","description":"PHP Serial Port","archived":false,"fork":false,"pushed_at":"2020-12-10T12:06:11.000Z","size":28,"stargazers_count":53,"open_issues_count":3,"forks_count":14,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-22T10:03:27.124Z","etag":null,"topics":["arduino","php","php-serial","serial-ports","serialport"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/lepiaf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-31T18:41:17.000Z","updated_at":"2024-09-23T05:40:44.000Z","dependencies_parsed_at":"2022-08-15T08:10:31.957Z","dependency_job_id":null,"html_url":"https://github.com/lepiaf/serialport","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepiaf%2Fserialport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepiaf%2Fserialport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepiaf%2Fserialport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lepiaf%2Fserialport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lepiaf","download_url":"https://codeload.github.com/lepiaf/serialport/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222515738,"owners_count":16996249,"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":["arduino","php","php-serial","serial-ports","serialport"],"created_at":"2024-10-02T16:06:25.510Z","updated_at":"2024-11-01T03:04:50.137Z","avatar_url":"https://github.com/lepiaf.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SerialPort\n\nConnect to serial port with PHP\n\nInspired by [PHP-Serial](https://github.com/Xowap/PHP-Serial), I simplify it and include composer.json to install via composer.\n\nActually, it works on linux. This library is suitable for working with Arduino. \n\n## Install via composer\n\n```\ncomposer require \"lepiaf/serialport\"\n```\n\n## How to use\n\nYou can check a full example in [example](example) folder. It contains a basic Arduino sketch and php file to read it.\n\nInstantiate a new SerialPort object with a parser and configure tty.\n\n```php\n\u003c?php\n\nuse lepiaf\\SerialPort\\SerialPort;\nuse lepiaf\\SerialPort\\Parser\\SeparatorParser;\nuse lepiaf\\SerialPort\\Configure\\TTYConfigure;\n\n$serialPort = new SerialPort(new SeparatorParser(), new TTYConfigure());\n\n$serialPort-\u003eopen(\"/dev/ttyACM0\");\nwhile ($data = $serialPort-\u003eread()) {\n    echo $data.\"\\n\";\n\n    if ($data === \"OK\") {\n        $serialPort-\u003ewrite(\"1\\n\");\n        $serialPort-\u003eclose();\n    }\n}\n```\n\nFor mac os, you must use `TTYMacConfigure`. It will use `stty -f` instead of `stty -F`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flepiaf%2Fserialport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flepiaf%2Fserialport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flepiaf%2Fserialport/lists"}