{"id":20496336,"url":"https://github.com/ianmetcalf/node-ds2482","last_synced_at":"2025-04-13T18:21:10.944Z","repository":{"id":19343284,"uuid":"22582361","full_name":"ianmetcalf/node-ds2482","owner":"ianmetcalf","description":"Provides an interface for the Dallas DS2482 onewire bridge","archived":false,"fork":false,"pushed_at":"2017-02-13T03:26:02.000Z","size":30,"stargazers_count":3,"open_issues_count":1,"forks_count":4,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-27T09:04:27.207Z","etag":null,"topics":["beaglebone-black","ds2482","i2c","onewire","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"awslabs/aws-cfn-template-flip","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ianmetcalf.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}},"created_at":"2014-08-03T19:53:42.000Z","updated_at":"2023-07-17T01:10:28.000Z","dependencies_parsed_at":"2022-08-28T03:21:34.350Z","dependency_job_id":null,"html_url":"https://github.com/ianmetcalf/node-ds2482","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmetcalf%2Fnode-ds2482","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmetcalf%2Fnode-ds2482/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmetcalf%2Fnode-ds2482/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmetcalf%2Fnode-ds2482/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ianmetcalf","download_url":"https://codeload.github.com/ianmetcalf/node-ds2482/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248758988,"owners_count":21157067,"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":["beaglebone-black","ds2482","i2c","onewire","raspberry-pi"],"created_at":"2024-11-15T18:06:37.054Z","updated_at":"2025-04-13T18:21:10.924Z","avatar_url":"https://github.com/ianmetcalf.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DS2482 Onewire Bridge\n\n[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/ianmetcalf/node-ds2482?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nProvides an interface for the Dallas DS2482 onewire bridge\n\n# Install\n\n```\n$ npm install ds2482\n```\n\n# Usage\n\n```js\nconst DS2482 = require('ds2482');\n\nconst wire = new DS2482();\n\nwire.init()\n.then(() =\u003e wire.search())\n\n.then(found =\u003e {\n  console.log(found); // Returns a list of ROM addresses as hex encoded strings\n})\n\n.catch(err =\u003e {\n  console.error(err);\n});\n```\n\n# API\n\n### new DS2482([options])\nCreates an interface for a Dallas DS2482 i2c to onewire bridge chip\n\n__Options:__\n- `i2c` an instance of [i2c](https://github.com/kelly/node-i2c)\n- `address` the i2c address of the bridge chip, default: `0x18`\n- `device` the location of the i2c interface, default: `/dev/i2c-1`\n\n---\n\n### wire.init() _alias: wire.reset()_\nResets the bridge chip and any onewire devices connected to it\n\n__Returns:__ `Promise \u003cUint8\u003e` resolves with status register\n\n---\n\n### wire.configureBridge([options])\nConfigures the onewire interface for subsequent communication\n\n__Options:__\n- `activePullup` controls whether to use active or passive pullup\n- `strongPullup` enables strong pullup __only__ after next command then resets\n- `overdrive` enable overdrive speed for the bridge chip\n\n__Returns:__ `Promise \u003cUint8\u003e` resolves with configuration register\n\n---\n\n### wire.selectChannel([channel])\nSelect the onewire channel to use for subsequent commands\n\n_Note:_ Only for use with `DS2482-800`\n\n__Arguments:__\n- `channel` channel to select, defaults to 0\n\n__Returns:__ `Promise \u003cUint8\u003e` resolves with channel selection register\n\n---\n\n### wire.sendCommand(command [, rom])\nSends a command to a onewire device if specified or all onewire devices if omitted\n\n__Arguments:__\n- `command` command to send as an unsigned integer\n- `rom` optional ROM address of the device to send the command to as a 16 character hex encoded string\n\n__Returns:__ `Promise \u003cUint8\u003e` resolves with status register\n\n---\n\n### wire.search()\nSearches the bus for all onewire devices and returns a list of ROM addresses as hex encoded strings\n\n__Returns:__ `Promise \u003cString[]\u003e` resolves with list of roms\n\n```js\n[\n  \"2826274402000012\",\n  \"2889075f0200003e\",\n  \"3ae9f412000000a6\"\n]\n```\n\n---\n\n### wire.searchByFamily(family)\nSearches the bus for all onewire devices of a particular family and returns a list of ROM addresses as hex encoded strings\n\n__Arguments:__\n- `family` the family to search as either an unsigned integer or 2 character hex encoded string\n\n__Returns:__ `Promise \u003cString[]\u003e` resolves with list of roms\n\n```js\n[\n  \"2826274402000012\",\n  \"2889075f0200003e\"\n]\n```\n\n---\n\n### wire.searchROM()\nSearches the bus for the next onewire device and returns the ROM address as a hex encoded string\n\n__Returns:__ `Promise \u003cString\u003e` resolves with rom\n\n```js\n\"2826274402000012\"\n```\n\n---\n\n### wire.readROM()\nReads the ROM address of the single onewire device and returns it as a hex encoded string\n\n_NOTE:_ Will return a `CRC mismatch` error if multiple devices are on the bus\n\n__Returns:__ `Promise \u003cString\u003e` resolves with rom\n\n---\n\n### wire.matchROM(rom)\nSelects a single onewire device to send a command to\n\n__Arguments:__\n- `rom` the ROM address of the device to select as a 16 character hex encoded string\n\n__Returns:__ `Promise \u003cUint8\u003e` resolves with status register\n\n---\n\n### wire.skipROM()\nSelects all onewire devices to send a command to\n\n_NOTE:_ Can only be used for commands that don't return a response\n\n__Returns:__ `Promise \u003cUint8\u003e` resolves with status register\n\n---\n\n### wire.writeData(data)\nWrites one or more bytes to the onewire bus\n\n__Arguments:__\n- `data` a single byte, array of bytes or data buffer to be written out\n\n__Returns:__ `Promise \u003cUint8\u003e` resolves with status register\n\n---\n\n### wire.readData(size)\nReads one or more bytes from the onewire bus and returns a data buffer\n\n__Arguments:__\n- `size` number of bytes to be read in\n\n__Returns:__ `Promise \u003cBuffer\u003e` resolves with data buffer\n\n---\n\n### DS2482.checkCRC(buffer)\nChecks that the crc in the last byte matches the rest of the buffer\n\n__Arguments:__\n- `buffer` the data buffer to be checked\n\n__Returns:__ `Boolean`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianmetcalf%2Fnode-ds2482","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianmetcalf%2Fnode-ds2482","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianmetcalf%2Fnode-ds2482/lists"}