Skip to content

Instantly share code, notes, and snippets.

@MobileRez
Created September 4, 2016 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MobileRez/5809912a001ec7d264ddef988bb338bf to your computer and use it in GitHub Desktop.
Save MobileRez/5809912a001ec7d264ddef988bb338bf to your computer and use it in GitHub Desktop.
// The Spark preprocessor is very poor at obeying the C standard and C/C++ interaction
// We simply need to disable it.
#pragma SPARK_NO_PREPROCESSOR
// This #include statement was automatically added by the Particle IDE.
#include "azure_c_shared_utility/platform.h"
#include "azure_iothub_client/iothub_client_ll.h"
#include "azure_iothub_client/iothub_message.h"
#include "azure_c_shared_utility/crt_abstractions.h"
#include "azure_iothub_client/iothubtransportmqtt.h"
#include "neopixel/neopixel.h"
SYSTEM_MODE(AUTOMATIC);
// IMPORTANT: Set pixel COUNT, PIN and TYPE
#define PIXEL_PIN D2
#define PIXEL_COUNT 288
#define PIXEL_TYPE WS2812B
Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);
int ledState = 0;
/* Important global variables for Azure IoT Hub */
unsigned char certx[] = {
0x30, 0x82, 0x03, 0x77, 0x30, 0x82, 0x02, 0x5f, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x04, 0x02, 0x00, 0x00, 0xb9, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x5a, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x49, 0x45, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x09, 0x42, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x6f, 0x72, 0x65, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x0a, 0x43, 0x79, 0x62, 0x65, 0x72, 0x54, 0x72, 0x75, 0x73, 0x74, 0x31, 0x22, 0x30, 0x20, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x19, 0x42, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x43, 0x79, 0x62, 0x65, 0x72, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x30, 0x30, 0x35, 0x31, 0x32, 0x31, 0x38, 0x34, 0x36, 0x30, 0x30, 0x5a, 0x17, 0x0d, 0x32, 0x35, 0x30, 0x35, 0x31, 0x32, 0x32, 0x33, 0x35, 0x39, 0x30, 0x30, 0x5a, 0x30, 0x5a, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x49, 0x45, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x09, 0x42, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x6f, 0x72, 0x65, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x0a, 0x43, 0x79, 0x62, 0x65, 0x72, 0x54, 0x72, 0x75, 0x73, 0x74, 0x31, 0x22, 0x30, 0x20, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x19, 0x42, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x43, 0x79, 0x62, 0x65, 0x72, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x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03, 0xae, 0x5e, 0x84, 0x3e, 0x5f, 0xff, 0x15, 0xed, 0x69, 0xbc, 0xf9, 0x39, 0x36, 0x72, 0x75, 0xcf, 0x77, 0x52, 0x4d, 0xf3, 0xc9, 0x90, 0x2c, 0xb9, 0x3d, 0xe5, 0xc9, 0x23, 0x53, 0x3f, 0x1f, 0x24, 0x98, 0x21, 0x5c, 0x07, 0x99, 0x29, 0xbd, 0xc6, 0x3a, 0xec, 0xe7, 0x6e, 0x86, 0x3a, 0x6b, 0x97, 0x74, 0x63, 0x33, 0xbd, 0x68, 0x18, 0x31, 0xf0, 0x78, 0x8d, 0x76, 0xbf, 0xfc, 0x9e, 0x8e, 0x5d, 0x2a, 0x86, 0xa7, 0x4d, 0x90, 0xdc, 0x27, 0x1a, 0x39, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x45, 0x30, 0x43, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xe5, 0x9d, 0x59, 0x30, 0x82, 0x47, 0x58, 0xcc, 0xac, 0xfa, 0x08, 0x54, 0x36, 0x86, 0x7b, 0x3a, 0xb5, 0x04, 0x4d, 0xf0, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x03, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x85, 0x0c, 0x5d, 0x8e, 0xe4, 0x6f, 0x51, 0x68, 0x42, 0x05, 0xa0, 0xdd, 0xbb, 0x4f, 0x27, 0x25, 0x84, 0x03, 0xbd, 0xf7, 0x64, 0x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0x94, 0x7a, 0xd0, 0x33, 0x3d, 0xa7, 0x65, 0x0f, 0xf5, 0xfc, 0x8e, 0x9e, 0x62, 0xcf, 0x47, 0x44, 0x2c, 0x01, 0x5d, 0xbb, 0x1d, 0xb5, 0x32, 0xd2, 0x47, 0xd2, 0x38, 0x2e, 0xd0, 0xfe, 0x81, 0xdc, 0x32, 0x6a, 0x1e, 0xb5, 0xee, 0x3c, 0xd5, 0xfc, 0xe7, 0x81, 0x1d, 0x19, 0xc3, 0x24, 0x42, 0xea, 0x63, 0x39, 0xa9,
0x30, 0x82, 0x05, 0xe1, 0x30, 0x82, 0x04, 0xc9, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x04, 0x07, 0x27, 0xaa, 0x47, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x5a, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x49, 0x45, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x09, 0x42, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x6f, 0x72, 0x65, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x0a, 0x43, 0x79, 0x62, 0x65, 0x72, 0x54, 0x72, 0x75, 0x73, 0x74, 0x31, 0x22, 0x30, 0x20, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x19, 0x42, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x43, 0x79, 0x62, 0x65, 0x72, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x34, 0x30, 0x35, 0x30, 0x37, 0x31, 0x37, 0x30, 0x34, 0x30, 0x39, 0x5a, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x35, 0x30, 0x37, 0x31, 0x37, 0x30, 0x33, 0x33, 0x30, 0x5a, 0x30, 0x81, 0x8b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52, 0x65, 0x64, 0x6d, 0x6f, 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x15, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x0c, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x49, 0x54, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x15, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x49, 0x54, 0x20, 0x53, 0x53, 0x4c, 0x20, 0x53, 0x48, 0x41, 0x32, 0x30, 0x82, 0x02, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x02, 0x0f, 0x00, 0x30, 0x82, 0x02, 0x0a, 0x02, 0x82, 0x02, 0x01, 0x00, 0xd1, 0xe8, 0x37, 0xa7, 0x76, 0x8a,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 0xff, 0x39, 0xd8, 0x26, 0xc8, 0x12, 0x9d, 0x1c, 0x9a, 0xaa, 0xa9, 0xc0, 0x16, 0x8e, 0x86, 0xed, 0x67, 0x52, 0x96, 0x00, 0x7f, 0x0d, 0x92, 0x3d, 0x3d, 0xd9, 0x70, 0x36, 0xe5, 0xea, 0x42, 0x6f, 0x1f, 0xae, 0x95, 0xe5, 0x5b, 0x5d, 0xf8, 0xd0, 0x3a, 0xc7, 0xd4, 0xde, 0x77, 0x86, 0xd0, 0xfc, 0x9e, 0x4e, 0xe2, 0xe2, 0xb8, 0xa9, 0x68, 0x37, 0x09, 0xc4, 0x39, 0xe3, 0x85, 0xb8, 0x89, 0xf3, 0x1f, 0x6e, 0xb7, 0x6d, 0x1f, 0x4a, 0x2f, 0x18, 0x09, 0x6f, 0xde, 0x4a, 0x01, 0x8f, 0x14, 0xc9, 0xb7, 0xa6, 0xee, 0xa7, 0x63, 0x9f, 0x33, 0xa4, 0x54, 0x7c, 0x42, 0x83, 0x68, 0xb8, 0xa5, 0xdf, 0xbf, 0xec, 0xb9, 0x1a, 0x5d, 0x13, 0x3b, 0xd9, 0xad, 0x68, 0xfd, 0x20, 0x0a, 0x55, 0x91, 0x21, 0x64, 0xf9, 0xd7, 0x13, 0x01, 0xa0, 0x08, 0x5d, 0x59, 0x89, 0x1b, 0x44, 0xaf, 0xa4, 0xac, 0xc7, 0x05, 0x10, 0xfa, 0x41, 0x4a, 0xa8, 0xfb, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x82, 0x01, 0x7b, 0x30, 0x82, 0x01, 0x77, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x00, 0x30, 0x60, 0x06, 0x03, 0x55, 0x1d, 0x20, 0x04, 0x59, 0x30, 0x57, 0x30, 0x48, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xb1, 0x3e, 0x01, 0x00, 0x30, 0x3b, 0x30, 0x39, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01, 0x16, 0x2d, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63, 0x79, 0x62, 0x65, 0x72, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6f, 0x6d, 0x6e, 0x69, 0x72, 0x6f, 0x6f, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x63, 0x66, 0x6d, 0x30, 0x0b, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x2a, 0x01, 0x30, 0x42, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x36, 0x30, 0x34, 0x30, 0x32, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x26, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6f, 0x63, 0x73, 0x70, 0x2e, 0x6f, 0x6d, 0x6e, 0x69, 0x72, 0x6f, 0x6f, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x6f, 0x72, 0x65, 0x72, 0x6f, 0x6f, 0x74, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, 0x86, 0x30, 0x27, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x20, 0x30, 0x1e, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x09, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xe5, 0x9d, 0x59, 0x30, 0x82, 0x47, 0x58, 0xcc, 0xac, 0xfa, 0x08, 0x54, 0x36, 0x86, 0x7b, 0x3a, 0xb5, 0x04, 0x4d, 0xf0, 0x30, 0x42, 0x06, 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x3b, 0x30, 0x39, 0x30, 0x37, 0xa0, 0x35, 0xa0, 0x33, 0x86, 0x31, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63, 0x64, 0x70, 0x31, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2d, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x52, 0x4c, 0x2f, 0x4f, 0x6d, 0x6e, 0x69, 0x72, 0x6f, 0x6f, 0x74, 0x32, 0x30, 0x32, 0x35, 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x51, 0xaf, 0x24, 0x26, 0x9c, 0xf4, 0x68, 0x22, 0x57, 0x80, 0x26, 0x2b, 0x3b, 0x46, 0x62, 0x15, 0x7b, 0x1e, 0xcc, 0xa5, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x69, 0x62, 0xf6, 0x84, 0x91, 0x00, 0xc4, 0x6f, 0x82, 0x7b, 0x24, 0xe1, 0x42, 0xa2, 0xa5, 0x8b, 0x82, 0x5c, 0xa7, 0xc5, 0x44, 0xcb, 0xe7, 0x52, 0x76, 0x63, 0xd3, 0x76, 0x9e, 0x78, 0xe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0x10, 0xea, 0xea, 0xb5, 0x74, 0x17, 0x3c, 0x4e, 0xdd, 0x7e, 0x91, 0x0a, 0xa8, 0x0b, 0x78, 0x07, 0xa7, 0x31, 0x44, 0x08, 0x31, 0xab, 0x18, 0x84, 0x0f, 0x12, 0x9c, 0xe7, 0xde, 0x84, 0x2c, 0xe9, 0x6d, 0x93, 0x45, 0xbf, 0xa8, 0xc1, 0x3f, 0x34, 0xdc,
0x30, 0x82, 0x06, 0x72, 0x30, 0x82, 0x04, 0x5a, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x13, 0x5a, 0x00, 0x01, 0xb6, 0xb3, 0x5b, 0xcf, 0xbb, 0xc1, 0x79, 0x5d, 0x10, 0x5b, 0x00, 0x01, 0x00, 0x01, 0xb6, 0xb3, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x81, 0x8b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52, 0x65, 0x64, 0x6d, 0x6f, 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x15, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x0c, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x49, 0x54, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x15, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x49, 0x54, 0x20, 0x53, 0x53, 0x4c, 0x20, 0x53, 0x48, 0x41, 0x32, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x35, 0x30, 0x38, 0x32, 0x37, 0x30, 0x33, 0x31, 0x38, 0x30, 0x34, 0x5a, 0x17, 0x0d, 0x31, 0x37, 0x30, 0x38, 0x32, 0x36, 0x30, 0x33, 0x31, 0x38, 0x30, 0x34, 0x5a, 0x30, 0x1e, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x13, 0x2a, 0x2e, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x2d, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0x9d, 0x70, 0xbf, 0xa8, 0x15, 0x1d, 0x96, 0x77, 0xc8, 0x9b, 0x92, 0xb7, 0x1d, 0x8b, 0xb4, 0xa3, 0xf3, 0x1b, 0xe6, 0xd3, 0x4d, 0x72, 0xca, 0xf4, 0xc7, 0x2e, 0x03, 0xa3, 0x43, 0xee, 0xc2, 0xad, 0x96, 0xd6, 0xdc, 0xf4, 0x64, 0x7b, 0xc8, 0x21, 0x2f, 0x55, 0x38, 0x03, 0x61, 0x90, 0xd0, 0x9b, 0x57, 0x23, 0xa7, 0x72, 0x73, 0xfa, 0x76, 0xf9, 0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0x3e, 0x2d, 0x7e, 0x7f, 0x01, 0x8b, 0x49, 0x09, 0x2a, 0x64, 0xb9, 0xde, 0x64, 0x2d, 0xfb, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x82, 0x02, 0x39, 0x30, 0x82, 0x02, 0x35, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x04, 0xb0, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x2a, 0x96, 0x1e, 0x84, 0x14, 0x8d, 0x03, 0x9d, 0xce, 0xc6, 0x2b, 0xe7, 0x68, 0xb0, 0xb3, 0xdf, 0xe7, 0x85, 0x50, 0x9d, 0x30, 0x5d, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x56, 0x30, 0x54, 0x82, 0x13, 0x2a, 0x2e, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x2d, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x82, 0x1a, 0x2a, 0x2e, 0x61, 0x6d, 0x71, 0x70, 0x77, 0x73, 0x2e, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x2d, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x82, 0x21, 0x2a, 0x2e, 0x73, 0x75, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2d, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x2d, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x51, 0xaf, 0x24, 0x26, 0x9c, 0xf4, 0x68, 0x22, 0x57, 0x80, 0x26, 0x2b, 0x3b, 0x46, 0x62, 0x15, 0x7b, 0x1e, 0xcc, 0xa5, 0x30, 0x7d, 0x06, 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x76, 0x30, 0x74, 0x30, 0x72, 0xa0, 0x70, 0xa0, 0x6e, 0x86, 0x36, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6d, 0x73, 0x63, 0x72, 0x6c, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x6d, 0x73, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x63, 0x72, 0x6c, 0x2f, 0x6d, 0x73, 0x69, 0x74, 0x77, 0x77, 0x77, 0x32, 0x2e, 0x63, 0x72, 0x6c, 0x86, 0x34, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63, 0x72, 0x6c, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x6d, 0x73, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x63, 0x72, 0x6c, 0x2f, 0x6d, 0x73, 0x69, 0x74, 0x77, 0x77, 0x77, 0x32, 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x70, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x64, 0x30, 0x62, 0x30, 0x3c, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x30, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x6d, 0x73, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x6d, 0x73, 0x69, 0x74, 0x77, 0x77, 0x77, 0x32, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x22, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x16, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6f, 0x63, 0x73, 0x70, 0x2e, 0x6d, 0x73, 0x6f, 0x63, 0x73, 0x70, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x4e, 0x06, 0x03, 0x55, 0x1d, 0x20, 0x04, 0x47, 0x30, 0x45, 0x30, 0x43, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x2a, 0x01, 0x30, 0x36, 0x30, 0x34, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01, 0x16, 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x6d, 0x73, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x63, 0x70, 0x73, 0x00, 0x30, 0x27, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x15, 0x0a, 0x04, 0x1a, 0x30, 0x18, 0x30, 0x0a, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 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e, 0x71, 0xbe, 0x26, 0x04, 0x6d, 0x0c, 0x32, 0x4e, 0xc7, 0x01, 0x05, 0x3d, 0x9b, 0xf8, 0x32, 0x6b, 0x1a, 0xad, 0x87, 0xac, 0xa0, 0x0c, 0xb2, 0xb9, 0xf3, 0x0a, 0x23, 0x49, 0x5d, 0x22, 0xe1, 0x18, 0x94, 0xd3, 0x5a, 0x99, 0x90, 0x7c, 0xea, 0x21, 0x6b, 0xf9, 0x16, 0x18, 0x4c, 0x8d, 0xb1, 0x70, 0xc8, 0xa1, 0x1c, 0xe9, 0x4d, 0xf9, 0x3e, 0xce, 0xe4, 0x3f, 0xfd, 0x4e, 0x7d, 0xd1, 0xa6, 0xd7, 0x73, 0x8d, 0x69, 0x8a, 0x83, 0x97, 0x8e, 0x11, 0xc8, 0x5b, 0x0b, 0x14, 0x58, 0xa2, 0x0d, 0x8c, 0x59, 0x14, 0x34, 0xac, 0x28, 0xcd, 0x16, 0x0f, 0x16, 0xe5, 0xf5, 0x42, 0xc0, 0x95, 0x57, 0x37, 0x59, 0x1f, 0x39, 0x90, 0x40, 0x4a, 0xe8, 0x8f, 0xa9, 0x49, 0x08, 0xfe, 0xef, 0xf6, 0x79, 0xcf, 0x6c, 0xd3, 0xcf, 0xda, 0x8e, 0x15, 0x68, 0x01, 0xd7, 0x94, 0x9e, 0x81, 0x36, 0xe3, 0x49, 0x1e, 0xee, 0x93, 0xd9, 0x84, 0x56, 0x78, 0xfd, 0x28, 0x39, 0x46, 0xb4, 0x6f, 0x16, 0xd6, 0x8a, 0xf4, 0x10, 0x6a, 0xeb, 0x10, 0x33, 0xf6, 0x08, 0xcb, 0x29, 0xd2, 0x81, 0x23, 0x55, 0x32, 0x5b, 0x64, 0x0c, 0x44, 0x69, 0x9d, 0xdc, 0x54, 0x22, 0xaf, 0x6b, 0x9b, 0x10, 0x53, 0x11, 0x4c, 0x8f, 0x01, 0xb7, 0xda
};
static const char* connectionString = "[device connection string]";
static int callbackCounter;
DEFINE_ENUM_STRINGS(IOTHUB_CLIENT_CONFIRMATION_RESULT, IOTHUB_CLIENT_CONFIRMATION_RESULT_VALUES);
typedef struct EVENT_INSTANCE_TAG
{
IOTHUB_MESSAGE_HANDLE messageHandle;
int messageTrackingId; // For tracking the messages within the user callback.
} EVENT_INSTANCE;
static IOTHUBMESSAGE_DISPOSITION_RESULT ReceiveMessageCallback(IOTHUB_MESSAGE_HANDLE message, void* userContextCallback)
{
int* counter = (int*)userContextCallback;
const unsigned char* buffer = NULL;
size_t size = 0;
IOTHUBMESSAGE_CONTENT_TYPE contentType = IoTHubMessage_GetContentType(message);
if (contentType == IOTHUBMESSAGE_BYTEARRAY)
{
if (IoTHubMessage_GetByteArray(message, &buffer, &size) == IOTHUB_MESSAGE_OK)
{
Serial.printf("Received Message [%d] with BINARY Data: <<<%.*s>>> & Size=%d\r\n", *counter, (int)size, buffer, (int)size);
}
else
{
//Serial.printf("Failed getting the BINARY body of the message received.\r\n");
}
}
else if (contentType == IOTHUBMESSAGE_STRING)
{
if ((buffer = (const unsigned char*)IoTHubMessage_GetString(message)) != NULL && (size = strlen((const char*)buffer)) > 0)
{
//Serial.printf("Received Message [%d] with STRING Data: <<<%.*s>>> & Size=%d\r\n", *counter, (int)size, buffer, (int)size);
}
else
{
//Serial.printf("Failed getting the STRING body of the message received.\r\n");
}
}
else
{
//Serial.printf("Failed getting the body of the message received (type %i).\r\n", contentType);
}
// Retrieve properties from the message
MAP_HANDLE mapProperties = IoTHubMessage_Properties(message);
if (mapProperties != NULL)
{
const char*const* keys;
const char*const* values;
size_t propertyCount = 0;
if (Map_GetInternals(mapProperties, &keys, &values, &propertyCount) == MAP_OK)
{
if (propertyCount > 0)
{
size_t index;
//Serial.printf("Message Properties:\r\n");
for (index = 0; index < propertyCount; index++)
{
//Serial.printf("\tKey: %s Value: %s\r\n", keys[index], values[index]);
}
//Serial.printf("\r\n");
}
}
}
/* Some device specific action code goes here... */
(*counter)++;
return IOTHUBMESSAGE_ACCEPTED;
}
static void SendConfirmationCallback(IOTHUB_CLIENT_CONFIRMATION_RESULT result, void* userContextCallback)
{
EVENT_INSTANCE* eventInstance = (EVENT_INSTANCE*)userContextCallback;
Serial.printf("Confirmation[%d] received for message tracking id = %d with result = %s\r\n", callbackCounter, eventInstance->messageTrackingId, ENUM_TO_STRING(IOTHUB_CLIENT_CONFIRMATION_RESULT, result));
/* Some device specific action code goes here... */
callbackCounter++;
IoTHubMessage_Destroy(eventInstance->messageHandle);
}
static char msgText[1024];
static char propText[1024];
#define MESSAGE_COUNT 5
static IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle;
static EVENT_INSTANCE messages[MESSAGE_COUNT];
void setup()
{
strip.begin();
strip.show(); // Initialize all pixels to 'off'
Particle.function("ledcolor", ledColor);
/* Azure IoT Hub Setup Content */
srand((unsigned int)get_time(NULL));
//double avgWindSpeed = 10.0;
callbackCounter = 0;
int receiveContext = 0;
if (platform_init() != 0)
{
//Serial.printf("Failed to initialize the platform.\r\n");
}
else
{
if ((iotHubClientHandle = IoTHubClient_LL_CreateFromConnectionString(connectionString, MQTT_Protocol)) == NULL)
{
//Serial.printf("ERROR: iotHubClientHandle is NULL!\r\n");
}
else
{
uint32_t* cert_data = (uint32_t*)malloc(4 + sizeof(certx));
*cert_data = sizeof(certx);
memcpy(cert_data + 1, certx, sizeof(certx));
#ifdef MBED_BUILD_TIMESTAMP
// For mbed add the certificate information
if (IoTHubClient_LL_SetOption(iotHubClientHandle, "TrustedCerts", certificates) != IOTHUB_CLIENT_OK)
{
//Serial.printf("failure to set option \"TrustedCerts\"\r\n");
}
#endif // MBED_BUILD_TIMESTAMP
// For mbed add the certificate information
if (IoTHubClient_LL_SetOption(iotHubClientHandle, "TrustedCerts", cert_data) != IOTHUB_CLIENT_OK)
{
//Serial.printf("failure to set option \"TrustedCerts\"\r\n");
}
/* Setting Message call back, so we can receive Commands. */
if (IoTHubClient_LL_SetMessageCallback(iotHubClientHandle, ReceiveMessageCallback, &receiveContext) != IOTHUB_CLIENT_OK)
{
//Serial.printf("ERROR: IoTHubClient_LL_SetMessageCallback..........FAILED!\r\n");
}
else
{
//Serial.printf("IoTHubClient_LL_SetMessageCallback...successful.\r\n");
/* Now that we are ready to receive commands, let's send some messages */
}
}
}
}
void loop()
{
}
int ledColor(String command)
{
if(command == "white")
{
whiteStrip(20);
return 1;
}
else if(command == "pink")
{
pinkStrip(20);
return 1;
}
else if(command == "red")
{
redStrip(20);
return 1;
}
else if(command == "orange")
{
orangeStrip(20);
return 1;
}
else if(command == "yellow")
{
yellowStrip(20);
return 1;
}
else if(command == "green")
{
greenStrip(20);
return 1;
}
else if(command == "cyan")
{
cyanStrip(20);
return 1;
}
else if(command == "blue")
{
blueStrip(20);
return 1;
}
else if(command == "purple")
{
purpleStrip(20);
return 1;
}
else if(command == "magenta")
{
magentaStrip(20);
return 1;
}
else if(command == "off")
{
off(20);
return 1;
}
else if (command == "eeryforest"){
eeryForest(20);
return 1;
}
else if (command == "alter"){
alter(20);
return 1;
}
else return -1;
}
void stripSetPixelColor(unsigned char red, unsigned char green, unsigned char blue)
{
uint16_t i;
for (int i = 0 ; i < strip.numPixels() ; i += 1 )
{
strip.setPixelColor(i, strip.Color(red,green,blue));
}
strip.show();
/* send the data to iotHub */
sprintf(json, "{"red":%d, "green":%d, "blue":%d}", (int)red, (int)green, (int)blue);
IotHubClient_SendAsync(handle, json, ...);
}
/*************************************************************
Mood or Time of Day lighing Pattern Functions
*************************************************************/
void eeryForest(uint8_t wait)
{
// [0] [1] [2] [3]
// w r w g
for (int i = 0 ; i < strip.numPixels() ; i += 8 )
{
strip.setPixelColor(i, strip.Color(155,0,155)); //155,48,255 or 255,0,255
strip.setPixelColor(i+1, strip.Color(114,0,130));
strip.setPixelColor(i+2, strip.Color(76,0,105));
strip.setPixelColor(i+3, strip.Color(38,0,80));
strip.setPixelColor(i+4, strip.Color(0,0,55)); //0,255,255 or 0,0,255
strip.setPixelColor(i+5, strip.Color(38,0,80));
strip.setPixelColor(i+6, strip.Color(76,0,105));
strip.setPixelColor(i+7, strip.Color(114,0,130));
}
strip.show();
delay(wait);
}
void moodTest(uint8_t wait)
{
// [0] [1] [2] [3]
// w r w g
for (int i = 0 ; i < strip.numPixels() ; i += 15 )
{
strip.setPixelColor(i, strip.Color(49,37,129));
strip.setPixelColor(i+1, strip.Color(49,37,129));
strip.setPixelColor(i+2, strip.Color(49,37,129));
strip.setPixelColor(i+3, strip.Color(73,37,129));
strip.setPixelColor(i+4, strip.Color(73,37,129));
strip.setPixelColor(i+5, strip.Color(73,37,129));
strip.setPixelColor(i+6, strip.Color(91,37,129));
strip.setPixelColor(i+7, strip.Color(91,37,129));
strip.setPixelColor(i+8, strip.Color(91,37,129));
strip.setPixelColor(i+9, strip.Color(105,37,129));
strip.setPixelColor(i+10, strip.Color(105,37,129));
strip.setPixelColor(i+11, strip.Color(105,37,129));
strip.setPixelColor(i+12, strip.Color(119,37,129));
strip.setPixelColor(i+13, strip.Color(119,37,129));
strip.setPixelColor(i+14, strip.Color(119,37,129));
}
strip.show();
delay(wait);
}
void alter(uint8_t wait)
{
uint16_t i;
for(i = 0; i < strip.numPixels() / 4 ; i++)
{
strip.setPixelColor(i, strip.Color(0,255,0));
}
for(i = strip.numPixels() / 4 + 1; i < strip.numPixels() / 2; i++)
{
strip.setPixelColor(i, strip.Color(255,58,0));
}
for(i = strip.numPixels() / 2 + 1; i < strip.numPixels() * 3 / 4; i++ )
{
strip.setPixelColor(i, strip.Color(255,0,0));
}
for(i = strip.numPixels() * 3 / 4 + 1 ; i < strip.numPixels(); i++)
{
strip.setPixelColor(i, strip.Color(0,0,255));
}
strip.show();
delay(wait);
}
void compColors(uint8_t wait)
{
// [0] [1] [2] [3]
// w r w g
for (int i = 0 ; i < strip.numPixels() ; i += 8 )
{
strip.setPixelColor(i, strip.Color(255,0,0));
strip.setPixelColor(i+1, strip.Color(255,0,0));
strip.setPixelColor(i+2, strip.Color(255,0,0));
strip.setPixelColor(i+3, strip.Color(255,0,0));
strip.setPixelColor(i+4, strip.Color(0,0,255));
strip.setPixelColor(i+5, strip.Color(0,0,255));
strip.setPixelColor(i+6, strip.Color(0,0,255));
strip.setPixelColor(i+7, strip.Color(0,0,255));
}
strip.show();
delay(wait);
}
//Solid colors
void redStrip(uint8_t wait)
{
//uint16_t i;
//for (int i = 0 ; i < strip.numPixels() ; i += 1 )
//{
// strip.setPixelColor(i, strip.Color(255,0,0));
//}
//strip.show();
stripSetPixelColor(255, 0, 0);
delay(wait);
}
void orangeStrip(uint8_t wait)
{
uint16_t i;
for (int i = 0 ; i < strip.numPixels() ; i += 1 )
{
strip.setPixelColor(i, strip.Color(255,58,0));
}
strip.show();
delay(wait);
}
void yellowStrip(uint8_t wait)
{
uint16_t i;
for (int i = 0 ; i < strip.numPixels() ; i += 1 )
{
strip.setPixelColor(i, strip.Color(255,255,0));
}
strip.show();
delay(wait);
}
void greenStrip(uint8_t wait)
{
uint16_t i;
for (int i = 0 ; i < strip.numPixels() ; i += 1 )
{
strip.setPixelColor(i, strip.Color(0,255,0));
}
strip.show();
delay(wait);
}
void cyanStrip(uint8_t wait)
{
uint16_t i;
for (int i = 0 ; i < strip.numPixels() ; i += 1 )
{
strip.setPixelColor(i, strip.Color(0,255,255));
}
strip.show();
delay(wait);
}
void blueStrip(uint8_t wait)
{
uint16_t i;
for (int i = 0 ; i < strip.numPixels() ; i += 1 )
{
strip.setPixelColor(i, strip.Color(0,0,255));
}
strip.show();
delay(wait);
}
void purpleStrip(uint8_t wait)
{
uint16_t i;
for (int i = 0 ; i < strip.numPixels() ; i += 1 )
{
strip.setPixelColor(i, strip.Color(255,0,255));
}
strip.show();
delay(wait);
}
void magentaStrip(uint8_t wait)
{
uint16_t i;
for (int i = 0 ; i < strip.numPixels() ; i += 1 )
{
strip.setPixelColor(i, strip.Color(155,48,255));
}
strip.show();
delay(wait);
}
void pinkStrip(uint8_t wait)
{
uint16_t i;
for (int i = 0 ; i < strip.numPixels() ; i += 1 )
{
strip.setPixelColor(i, strip.Color(255,182,203));
}
strip.show();
delay(wait);
}
void whiteStrip(uint8_t wait)
{
uint16_t i;
for (int i = 0 ; i < strip.numPixels() ; i += 1 )
{
strip.setPixelColor(i, strip.Color(255,255,255));
}
strip.show();
delay(wait);
}
void off(uint8_t wait)
{
uint16_t i;
for (int i = 0 ; i < strip.numPixels() ; i += 1 )
{
strip.setPixelColor(i, strip.Color(0,0,0));
}
strip.show();
delay(wait);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment