{"_id":"@alcz/webusb-cp2102","_rev":"1-a253033be7c1e2da77272e0c356c4829","name":"@alcz/webusb-cp2102","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@alcz/webusb-cp2102","version":"0.0.1","description":"Simple WebUSB CP2102 communication library","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["CP2102","WebUSB"],"author":"","license":"MIT","repository":{"type":"git","url":"git+https://github.com/calcite/WebUSB-CP2102.git"},"_id":"@alcz/webusb-cp2102@0.0.1","gitHead":"37d1209c48a30c19ecfb8123b4bb70807f30fc20","bugs":{"url":"https://github.com/calcite/WebUSB-CP2102/issues"},"homepage":"https://github.com/calcite/WebUSB-CP2102#readme","_nodeVersion":"18.20.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-iqORpme2XufCziheQIdtg11fpQPS5Hw4KoCjOwHhmygdVV88hGzQtwogPzT5xRLUvdWt72QwfBXZ01rPQqMqQA==","shasum":"9b6e57fcd529f1f033396eb9744980ddb82a415b","tarball":"https://registry.npmjs.org/@alcz/webusb-cp2102/-/webusb-cp2102-0.0.1.tgz","fileCount":7,"unpackedSize":11400,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoARGgo+5OoPTs7AhnY2kc3yvdO0aXbn2sgrGHpXreWgIgFip5XwLulxnWzUvTr9QxPjrpml8c25Azntlgj6QD9Vg="}]},"_npmUser":{"name":"dgalalcz","email":"dgal@alps.cz"},"directories":{},"maintainers":[{"name":"dgalalcz","email":"dgal@alps.cz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webusb-cp2102_0.0.1_1713774215467_0.7825336651200978"},"_hasShrinkwrap":false},"0.0.2":{"name":"@alcz/webusb-cp2102","version":"0.0.2","description":"Simple WebUSB CP2102 communication library","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["CP2102","WebUSB"],"author":"","license":"MIT","repository":{"type":"git","url":"git+https://github.com/calcite/WebUSB-CP2102.git"},"_id":"@alcz/webusb-cp2102@0.0.2","gitHead":"815b9b13e9e2dc7f54dcb50d50f8f981931b8917","bugs":{"url":"https://github.com/calcite/WebUSB-CP2102/issues"},"homepage":"https://github.com/calcite/WebUSB-CP2102#readme","_nodeVersion":"18.20.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-2kd0uUNfYUGGpJgdCaI0DtWWk5PwnOYzX5Gfn1yW1AkPXMncfw1k8p1KJOKZpDbQgZ+HtPl91vq+2o04SXdJZw==","shasum":"e68dab7900d48ec53d87de2d8bc3cf2196188004","tarball":"https://registry.npmjs.org/@alcz/webusb-cp2102/-/webusb-cp2102-0.0.2.tgz","fileCount":4,"unpackedSize":4605,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6lMi8D6KnHvsjR1HZxzcIJxFnx4XrHahQolhwpvHk8AIgarYYBl8G8WPI8HFgIfN8/5vxAI9TiwGbDXvRllV7ODo="}]},"_npmUser":{"name":"dgalalcz","email":"dgal@alps.cz"},"directories":{},"maintainers":[{"name":"dgalalcz","email":"dgal@alps.cz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webusb-cp2102_0.0.2_1713775728487_0.3749972562854218"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-22T08:23:35.279Z","0.0.1":"2024-04-22T08:23:35.610Z","modified":"2024-04-22T08:48:48.823Z","0.0.2":"2024-04-22T08:48:48.621Z"},"maintainers":[{"name":"dgalalcz","email":"dgal@alps.cz"}],"description":"Simple WebUSB CP2102 communication library","homepage":"https://github.com/calcite/WebUSB-CP2102#readme","keywords":["CP2102","WebUSB"],"repository":{"type":"git","url":"git+https://github.com/calcite/WebUSB-CP2102.git"},"bugs":{"url":"https://github.com/calcite/WebUSB-CP2102/issues"},"license":"MIT","readme":"# WebUSB CP2102\n\nSimple WebUSB CP2102 communication library.\n\nUseful for reading cp2102-equiped device data from Android devices.\n\nSupported browsers (systems) - https://caniuse.com/webusb\n\n\n### Example\n\nLive demo - https://calcite.github.io/WebUSB-CP2102/example/\n\n```javascript\nimport usbCp2102 from '@alcz/webusb-cp2102';\n\nconst esp = new usbCp2102({});\nesp.connect().then(async () => {\n  await esp.initialize();\n\n  const receive = async () => {\n    const data = await esp.read();\n    const s = String.fromCharCode.apply(null, new Uint8Array(data))\n    console.log(s);\n    receive();\n  }\n  receive();\n});\n```\n\n### Usage\n\nNo settings needed on chrome for android (tested on Pixel 4).\n\nTo run this lib on linux:\n\n##### Set udev rule\n\ne.g. create `/etc/udev/rules.d/50-chromusb.rules`\n\n`SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"10c4\", ATTRS{idProduct}==\"ea60\", GROUP=\"dialout\", MODE=\"0660\"`\n\n##### Add user to dialout\n\n`sudo usermod -a -G dialout $USER `\n\n##### Temporarily disable cp210x module\n\n`sudo modprobe -r cp210x`\n\n\n---\n\nBased on [GitHub gist](https://gist.github.com/nuta/2c70ba8855f50c536a51f0c5993c1e4c) shared by [Seiya Nuta](https://github.com/nuta).\n","readmeFilename":"README.md"}