TechCrunch Disrupt Hackathon 2015

Had a great time at TechCrunch Disrupt 2015, tons and tons of talented people, amazing projects and, increasingly, awesome hardware to hack on.

Goodbye IDF 2015

IDF this year was a massive amount of work but well worth the effort.

Intel IDF 2015 Setup

Spent the last two weeks building (in C++, Arduino, Node.js and Python) these lasercut Intel Edison slap boxes to show off how to build an IBM Bluemix MQTT game. Martin Kronberg did amazing work putting this all together and creating the designs. Finally we got it all setup and running here at IDF, a few highlights.

Intel Edison Slap Box game

Dancing spiders

Resin.io releases official Intel Edison support

Publish to IBM Bluemix via Mosquitto from Intel Edison

Here is how to publish to IBM Bluemix via ‘mosquitto_pub’ (comes already installed on Intel Edison).


$ mosquitto_pub -h 'your_org.messaging.internetofthings.ibmcloud.com' 
-i 'd:your_org:your_type:your_mac' -m '{"d":{"Volts":5}}' 
-t 'iot-2/evt/status/fmt/json' -q 1 -p 1883 
-u 'use-token-auth' -P 'YOUR_TOKEN_HERE'

These are the required inputs, replace the variable bits with your own authentication info:
-i client_id aka d:[YOUR_ORG]:[YOUR_TYPE]:[YOUR_MAC]
-h host [YOUR_ORG].messaging.internetofthings.ibmcloud.com
-t topic iot-2/evt/status/fmt/json
-q quality 1
-m value e.g. ‘{“d”:{“Volts”:5}}’
-p port 1883
-u username use-token-auth
-P password ‘YOUR_TOKEN’

Publish to IBM Bluemix from Arduino using Intel Edison

Here is how to publish data to IBM Bluemix from your Intel Edison or other Wi-Fi enabled Arduino device. Making this work first requires that you import and add the PubSub library for Arduino (generally by copying the .h and .cpp (and examples) folder into your Arduino Libraries folder and restarting your environment. This was written using this guide from IBM (there is more comprehensive source linked way down at the very bottom as a .ino file).

Get the file here on Gist.

Simple REST calls with Arduino over WiFi

Just ported RestClient for Arduino to use WiFi instead of Ethernet. I specifically did this to make it easier for developers to use Intel Edison’s WiFi while doing REST API calls.

I haven’t yet tested an integration but I believe aJSON or equivalent will be really useful for doing anything beyond very basic REST calls here. All I wanted was a way to make some basic REST calls with Edison over WiFi.

While I am short on time, if I get more time I might consider producing a version which support both WiFi and ethernet.

Installation

  • In a terminal, browse to the directory in your OS where your Arduino IDE keeps it’s libraries (probably “/Documents/Arduino/libraries”)
  • Run “git clone https://github.com/rexstjohn/arduino-restclient.git RestClient” to download the WiFi RestClient into your libraries
  • Restart your Arduino IDE
  • Use “File -> Examples -> RestClient -> simple_GET” to test it
/* RestClient simple GET request
 *
 * by Rex St John
 */

#include 
#include 
#include "RestClient.h"

char ssid[] = "YOUR_SSID";            //  your network SSID (name)
char pass[] = "YOUR_WIFI_PW";         // your network password
char host[] = "jsonplaceholder.typicode.com";      // target for your REST queries
int status = WL_IDLE_STATUS;         // the Wifi radio's status

// Create your WiFi RestClient, pass in the ssid and password.
RestClient client = RestClient(host, ssid, pass);

String response;
void setup() {

  // Initiate Serial Connection
  Serial.begin(9600);
  Serial.println("Starting REST client over Wi-Fi");
  if(client.connect() == WL_CONNECTED){
    response = "";
    int statusCode = client.get("/posts/1", &response);
    Serial.print("Status code from server: ");
    Serial.println(statusCode);
    Serial.print("Response body from server: ");
    Serial.println(response);
    delay(1000);
  }
}

void loop(){
  // 
}

LA Roadshow

Wonderful hackathon and workshops in Santa Monica, LA.

Node.js for the Internet of Things at O’Reilly Solid

Had the opportunity to give a workshop on the topic of Intel Edison, Node.js and the Internet of Things at O’Reilly Solid earlier today. Also had a great time attending Sandeep Mistry’s Bluetooth LE + Arduino workshop later in the day.