As mentioned previously my daughter helped me assemble the Edison and Arduino breakout board.
Installation
I followed the Getting Started with the Edison guide for Win32. The drivers download page suggested that the drivers were only for 64bit Windows but installed just fine, as did the FTDI drivers. However when I ran the setup the Intel Edison Setup application it seemed to remove those drivers and replace with some others. Once the new drivers were installed I picked the option to download and install the latest firmware.
We named the board "Eddie", enabled SSH and connected up to the Wifi. Once the board finished and rebooted I checked I could ping
Eddie.Local
I also checked we could connect with SSH and login as root, using Putty. Once in I double checked the version.
root@Eddie:~# cat /etc/version 201606061707
I checked for newer software from the repositories with:
opkg update opkg upgrade
It upgraded mraa and upm which connect up the hardware so that's probably a good thing.
Prerequisites
Node and MQTT are the main components I needed installed, I checked node using
node --version
That came back as v4.4.3, that's not the latest so looking at how to upgrade that might be a good idea.
I also checked mosquito was installed using
opkg info mosquito
Given that mosquito is installed, I'll swap to that rather than Mosca which I've been using for testing.
Quick test with MRAA
I mashed together a few articles to get myself a blinking LED on D7 on the grove shield
#!/usr/bin/env node var mraa = require('mraa'); console.log('MRAA Version: ' + mraa.getVersion()); var led = new mraa.Gpio(7); led.dir(mraa.DIR_OUT); var ledState = true; setInterval(function () { led.write(ledState?1:0); ledState = !ledState; }, 1000);
Then I put together an example for using the input and an interrupt.
#!/usr/bin/env node var mraa = require('mraa'); console.log('MRAA Version: ' + mraa.getVersion()); var button = new mraa.Gpio(5); var led = new mraa.Gpio(7); var ledState = true; button.dir(mraa.DIR_IN); led.dir(mraa.DIR_OUT); button.isr(mraa.EDGE_RISING, function () { led.write(ledState?1:0); ledState = !ledState; }); setInterval(function () {} , 1000); //Do nothing, stops the apps exiting process.on('SIGINT', function () { console.log("Shutting down SIGINT (Ctrl-C)"); button.isrExit(); led.write(0); process.exit(); });
Reference
https://wiki.openwrt.org/doc/techref/opkg
https://github.com/intel-iot-devkit/mraa/tree/master/examples/javascript
https://software.intel.com/en-us/node/562029#Digital_outputs
https://gist.github.com/george-hawkins/632bad44aa47d528a0eb#file-node-js-mraa-isr-md
Previous Posts
[Upcycle It] Interactive Race Car Driver - Plan of action
[Upcycle It] Interactive Race Car Driver - Software
Top Comments