What is ChipChop

To help you understand what you have in front of you and how you can use it to make some pretty cool IoT things I'm going to quickly give you some fundamental info

ChipChop is an IoT Device Cloud platform that I have initially developped for my personal use, overdone it a little bit and realised that what I have created is too big and wasteful for just one person to use...so I've decided to share it.

Everything here is self funded and as I am not a rich guy until ChipChop can get some sponsorship the usage limits are there to keep things free and accessible to everyone.


Technology

In simplest terms ChipChop is a cluster of interconnected Node.js (and some other) servers that each fulfil a certain role. It's built completely from ground up and if you exclude Node itself it doesn't run on top of any other platform, library or major dependency.

Everything that you can find here is built from scratch, the platform itself, a full OAuth 2.0 server, full in-memory database with it's own editor software, Development Console software, Web App, main website, forum, custom templating engine for Node.js, the C++ Arduino Library and countless other things that are somewhere inside doing some clever things.

ChipChop is also fast, very fast, clever things happen here in microseconds (a millisecond is an eternity) and if you are not careful shit also happens quickly too

How does it work

There are some fundamental working concepts that if you grasp right now you may not even have to read any further, just download an example project, log into the Development Console, experiment a bit and you may figure it out on your own.

The following is a simple step-by-step overview how things work. If you intend to use the ChipChop Arduino Library then things are even simpler as a lot of the hard work is automatically handled for you.

Step 1
In the ChipChop Development Console you first describe the Arduino device that you will build (or you already have). Just the components you want to interact with, the device name and you give it a unique ID.

Step 2
In the Dev Console in the "My Account" section you grab the security credentials - your user UUID and Security Authorisation Code and also your allocated Endpoint Server URI

Step 3
You build your device and you program the following behavior:

  1. You initiate a WebSocket connection to your allocated endpoint server and send your credentials as a query string
    for example: ws://api.chipchop.io/wsdev/?uuid=your_user_uuid&device_id=your_device_id

    After this point all communication will use JSON as a data exchange format

  2. You receive a handshake request from the server with a challenge code that you need to MD5 hash with the Authorisation Code you've grabbed from the Dev Console i.e. MD5( challenge_code + your_authorisation_code)

  3. You send the handshake response message to the server with the hashed code, uuid and device_id

  4. You get a confirmation that everything is ok and your WebSocket connection will stay permanently open

  5. On regular intervals, not faster then 10 seconds you send a heartbeat as a JSON payload with the status of all components as you have described them in Step 1

  6. If something happens that needs acting straight away (i.e. motion sensor gets triggered or a button is pressed) you send a "triggerevent" message. It's a shorter version of the heartbeat and can contain a status of only one component.
    You can send trigger events no faster than 500 milliseconds apart and a maximum of 10 events per minute.
    Important: Do NOT use triggerevent instead of a heartbeat as they provide different functionality

  7. In your device code you need to process JSON messages from the server so if you send a remote command your device needs to act on it. The commands can target either an exact component or the entire device.

Step 4
In the Dev Console use the Alexa Connect section to link your ChipChop account with your Alexa account.
Once linked, use the Link Devices section to connect and disconnect devices from Alexa. From that point on, you will have a real-time bi-directional channel created between your devices and Alexa.

Step 5
In the Dev Console you create Actions which will get executed when certain components change their status either through a heartbeat or a triggerevent.

Actions can send "commands" to other devices and also to Alexa that can also trigger Alexa routines and control other devices that are not made by you (plugs, lights, switches and stuff that you've bought in a shop and connected to Alexa)

Aaand...BOOM, that's how it's done!...now, you are the proud owner of a real-time <=> multi-device <=> multi-directional channel communication!

Step 6
For day to day interaction with your little gizmos I have built a nice little mobile phone friendly ChipChop Web App. It has a nice simple interface and enbles you to easily view the status of all your devices, switch things ON/OFF, send commands and create simple Actions.
There is no need to download any apps, countless updates and all that crap.. just the web browser on your phone and off you go!

This was just a brief explanation how things work, there is of course a lot more.
Download the example Arduino projects, have a play with the Dev Console and ask for help if you get stuck.


Now...Bugger off and go build something cool