Imp-IO
Imp-io is a Firmata-compatibility IO class for writing node programs that interact with Electric Imp devices. Imp-io was built at Bocoup
Getting Started
To communicate with an Electric Imp using Johnny-Five w/ Imp-IO, you will need to upload the special Tyrion agent and device firmware through Electric Imp's IDE. We recommend you review Electric Imp's Getting Started before continuing.
Tyrion Setup
- Follow Electric Imp's Getting Started instructions to set up a wifi connection to your Electric Imp device.
- Once your Imp is setup, open the IDE (familiarize yourself here) and click Create New Model, give it a name and assign it to your device.
- Paste the contents of
agent.nut
into the Agent pane anddevice.nut
into the Device pane: - 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.
- Click Build and Run to finish preparing your Electric Imp.
Imp-IO Setup
In the Electric Imp IDE, locate and copy the agent id, located in agent url Look for the agent id located in the agent url:
Store 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:
export IMP_AGENT_ID="your agent id"
Then add the following to your dot-rc file of choice:
source ~/.imprc
Blink an Led
The "Hello World" of microcontroller programming:
var Imp = ;var board = agent: processenvIMP_AGENT_ID; board;
Johnny-Five IO Plugin
Imp-IO can be used as an IO Plugin for Johnny-Five:
var five = ;var Imp = ; var board = io: agent: processenvIMP_AGENT_ID ; board;
License
See LICENSE file.