Well, I should have knocked on wood. Here's the sketch I flashed to try controlling the RBG color of an LED strip with POST commands and Particle.function():
#define FASTLED_FORCE_SOFTWARE_SPI
#include "FastLED.h"
// must use fastLED 3.1: https://github.com/FastLED/FastLED/tree/FastLED3.1
// fast led constants and initialize
#define DATA_PIN 4
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
#define NUM_LEDS 28
CRGB leds[NUM_LEDS];
int sat = 255;
int bright = 200;
int hue = 0;
void setup() {
delay(2000);
FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER > (leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
FastLED.setBrightness(200);
pinMode(1, OUTPUT); // LED on oak
Particle.function("value", setter);
}
int setter(String val)
{
hue = val.toInt();
return 1;
}
// the loop routine runs over and over again forever:
void loop() {
fill_solid(leds, NUM_LEDS, CHSV(hue, 255, 200));
digitalWrite(1, HIGH);
FastLED.show();
delay(1000);
fill_solid(leds, NUM_LEDS, CHSV(0, 0, 0));
digitalWrite(1, LOW);
FastLED.show();
delay(5000);
}
I flashed it successfully, then hooked up my strip to vcc, gnd, and p4. Nothing happened, which I thought was an issue with my code. I went back to tinker and re-upload (replacing the "hue" variable in my fill_solid() call with a static value), and was unable to upload.
Every since, my oak will not take a sketch. It uploads to particle, then times out either during the flashing or reboot step of the process. In addition, on a power cycle, it connects to my wifi and I can see it on particle but then it goes offline after just a couple of minutes never to return. So I grabbed my other oak, got it setup (SoftAP update) and also flashed a successful blink routine. Then I flashed the code above and now I'm experiencing the same with both. They connect, then disconnect after a few minutes (doing nothing) or upon flashing.
Is there anything wrong with what I did that could cause this?? As in, can a sketch binary file goof with the wireless settings at all? I don't get why it's leaving my wireless network and going offline according to particle. That said, I could see it still listed as connected in my router status page. I have no idea what's going on...