{"id":13521407,"url":"https://github.com/rwaldron/imp-io","last_synced_at":"2025-04-23T01:57:27.979Z","repository":{"id":23306154,"uuid":"26665690","full_name":"rwaldron/imp-io","owner":"rwaldron","description":"Electric Imp IO Plugin for Johnny-Five","archived":false,"fork":false,"pushed_at":"2018-06-02T06:24:31.000Z","size":335,"stargazers_count":12,"open_issues_count":1,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-23T01:57:22.119Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/rwaldron.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-15T01:53:07.000Z","updated_at":"2020-02-11T11:36:09.000Z","dependencies_parsed_at":"2022-08-25T22:30:27.209Z","dependency_job_id":null,"html_url":"https://github.com/rwaldron/imp-io","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwaldron%2Fimp-io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwaldron%2Fimp-io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwaldron%2Fimp-io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwaldron%2Fimp-io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rwaldron","download_url":"https://codeload.github.com/rwaldron/imp-io/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250354303,"owners_count":21416751,"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":[],"created_at":"2024-08-01T06:00:34.014Z","updated_at":"2025-04-23T01:57:27.944Z","avatar_url":"https://github.com/rwaldron.png","language":"JavaScript","funding_links":[],"categories":["Libraries and Plugins"],"sub_categories":["IO Compatibility Plugins"],"readme":"# Imp-IO\n\n[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/rwaldron/imp-io?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n[![Build Status](https://travis-ci.org/rwaldron/imp-io.png?branch=master)](https://travis-ci.org/rwaldron/imp-io)\n\nImp-io is a Firmata-compatibility IO class for writing node programs that interact with [Electric Imp devices](http://www.electricimp.com/docs/). Imp-io was built at [Bocoup](http://bocoup.com/)\n\n### Getting Started\n\nTo communicate with an Electric Imp using Johnny-Five w/ Imp-IO, you will need to upload the special\n[Tyrion](https://github.com/rwaldron/tyrion) **[agent](https://github.com/rwaldron/tyrion/blob/master/agent.nut)** and **[device](https://github.com/rwaldron/tyrion/blob/master/device.nut)** firmware through Electric Imp's [IDE](https://ide.electricimp.com/login). We recommend you review [Electric Imp's Getting Started](http://www.electricimp.com/docs/gettingstarted/) before continuing.\n\n#### Tyrion Setup\n\n1. Follow Electric Imp's [Getting Started](https://electricimp.com/docs/gettingstarted/) instructions to set up a wifi connection to your Electric Imp device. \n2. Once your Imp is setup, open the [IDE](https://ide.electricimp.com/ide) (familiarize yourself [here](https://electricimp.com/docs/gettingstarted/ide/)) and click **Create New Model**, give it a name and assign it to your device.\n3. Paste the contents of [`agent.nut`](https://raw.githubusercontent.com/rwaldron/tyrion/master/agent.nut) into the **Agent** pane and [`device.nut`](https://raw.githubusercontent.com/rwaldron/tyrion/master/device.nut) into the **Device** pane: \n![Imp Setup](https://raw.githubusercontent.com/rwaldron/tyrion/master/imp-setup.png)\n4. Expand the **Active Model** in the column on the left by click on the rightward arrow. The model will appear below, click on the model.\n4. Click **Build and Run** to finish preparing your Electric Imp.\n\n\n#### Imp-IO Setup\n\nIn the Electric Imp IDE, locate and copy the **agent id**, located in **agent url** Look for the agent id located in the agent url: \n\n![Imp Setup](https://raw.githubusercontent.com/rwaldron/imp-io/master/tyrion-install.png)\n\n\nStore your agent ID in a dot file so it can be accessed as a property of `process.env`. Create a file in your home directory called `.imprc` that contains:\n\n```sh\nexport IMP_AGENT_ID=\"your agent id\"\n```\n\nThen add the following to your dot-rc file of choice:\n\n```sh\nsource ~/.imprc\n```\n\n\n### Blink an Led\n\n\nThe \"Hello World\" of microcontroller programming:\n\n```js\nvar Imp = require(\"imp-io\");\nvar board = new Imp({\n  agent: process.env.IMP_AGENT_ID\n});\n\nboard.on(\"ready\", function() {\n  console.log(\"CONNECTED\");\n  this.pinMode(9, this.MODES.OUTPUT);\n\n  var byte = 0;\n\n  // This will \"blink\" the on board led\n  setInterval(function() {\n    this.digitalWrite(9, (byte ^= 1));\n  }.bind(this), 1000);\n});\n```\n\n### Johnny-Five IO Plugin\n\nImp-IO can be used as an [IO Plugin](https://github.com/rwaldron/johnny-five/wiki/IO-Plugins) for [Johnny-Five](https://github.com/rwaldron/johnny-five):\n\n```js\nvar five = require(\"johnny-five\");\nvar Imp = require(\"imp-io\");\n\nvar board = new five.Board({\n  io: new Imp({\n    agent: process.env.IMP_AGENT_ID\n  })\n});\n\nboard.on(\"ready\", function() {\n  var led = new five.Led(9);\n  led.blink();\n});\n```\n\n## License\nSee LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwaldron%2Fimp-io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frwaldron%2Fimp-io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwaldron%2Fimp-io/lists"}