ChipChop Arduino Library

This is a small C++ library written for the Arduino framework that handles all the communication with ChipChop automatically and should get you going in a jiffy.

The library is built as a simple C++ Class and exposes some useful little utilities that you can call from your main sketch or any other class.

NOTE
This library has been tested and extensively abused ONLY on various ESP8266 & ESP32 boards and partially on UNO R4 WiFi board.

For other Arduino like controllers, this library should give you a good starting point but you may have to do some creative modifications of the code. If you do so, please share and I will publish your modified libraries here or links to your code repository pages.


The download contains simple examples but if that is not enough than submit a question in the forum.

Library Structure
The zip file contains 2 folders and installation instructions file:

ChipChop_Arduino - x.xx
     ChipChop
     WebSockets2_Generic-modified
        Installation Instructions.txt

    ChipChop/src/

  • ChipChopManager.h & ChipChopManager.cpp files

    These are the actual library files and contain everything needed to:

    • Connect, authenticate and maintain the communication channel with ChipChop
    • Correctly JSON format and send heartbeats
    • Correctly JSON format and send trigger events
    • Parse received JSON commands and return the values to your callback
    • Keep track of the real time clock
    • Return current time & date
    • Return any error messages to an error callback

  • ChipChop/examples/

  • all-functions.ino
    Contains all examples and API calls to the ChipChopManager Class including initial settings, declaration of callbacks, what you can do in the setup() and various options that you can use in the main loop().
  • smart-led.ino
    Simple example of controlling an led light through ChipChop by receiving/parsing commands and also sending a regular device status heartbeat.
  • smart-button.ino
    Simple example of a push button that sends "trigger events" that can be used to trigger custom Smart Actions to create automated interaction between your devices.


  • WebSockets2_Generic-modified (optional)

  • Contains a modified cut-down version of the Arduino WebSockets2_generic library vs 1.13.2

    This is the only true dependency and I have included a part of this library as some PlatformIO users have reported compiling issues so that it can be included in the project manually rather than linked as a dependency. Arduino IDE doesn't seem to be affected as the creator seem to be more focused on the Arduino IDE.
    Please note that the included code is a cut-down version with support only for ESP8266/ESP32 & UNO R4 WiFi and only for a WebSocket Client not a Server.
    If you need to use a different type of device you can get the full library at the link above and modify it to work with your device. Technically if you use this library you shouldn't have to modify anything in the ChipChopManager.cpp code as the interface is the same just different hardware support.
    If you are already using WebSockets in your project but with a different library then you may have to do some re-wiring in the ChipChopManager code and if you get stuck shout for help!

You will find installation instructions for both PlatformIO and Arduino IDE in the included "Installation Instructions.txt" file and to save you time I would recommend that you watch the short installation tutorial here

ChipChop Arduino Library
Current version 1.40
Download Code



Previous Versions: