0

New Flora / Working Code Freezes
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

New Flora / Working Code Freezes

by djaubert on Tue Aug 07, 2018 8:27 pm

Hello, I just got a second Flora board because I'm making two of the same project.

It is a 2m 60led/m Neopixel strip connected to a Flora with the - to GND, + to VBATT, and data to Pin 6.

I uploaded the code (a rainbow cycle) to the second Flora and the leds run for a few seconds then start to look a little jittery then the onboard led blinks a few times and the strip leds freeze in position. After that the Arduino IDE loses connection to the port and I have to disconnect the strip from the board to be able to upload code again.

I connected the same strip to the other Flora with the same code as well as a Feather just to make sure it wasn't a strip issue and it works fine on those. These are all powered by USB connection to a computer.

What's going on with this second Flora? It's connected exactly the same as the other and running the same code but it freezes up. Could it be a hardware issue with the Flora board?

Here's the test code FYI

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_NeoPixel.h>

//Adafruit Library Setup
#define BUTTON_PIN   9    // Digital IO pin connected to the button.  This will be

#define PIXEL_PIN    6    // Digital IO pin connected to the NeoPixels.

#define PIXEL_COUNT   120   // Number of LEDs in Strip

Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, NEO_GRB + NEO_KHZ800);

// Main Setup
void setup() {
  pinMode(BUTTON_PIN, INPUT_PULLUP);
  strip.begin();
  strip.setBrightness(75);
  strip.show(); // Initialize all pixels to 'off'
  Serial.begin(9600);

}

void loop() {
  // Start Effect
  rainbow(10);
}

void rainbow(uint8_t wait) {
  uint16_t i, j;
 
  for(j=0; j<256; j++) {
    for(i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel((i+j) & 255));
    }
    strip.show();
    delay(wait);

  }
}

// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
  WheelPos = 255 - WheelPos;
  if(WheelPos < 85) {
    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  }
  if(WheelPos < 170) {
    WheelPos -= 85;
    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
  WheelPos -= 170;
  return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}

djaubert
 
Posts: 29
Joined: Fri Jun 08, 2018 11:30 am

Re: New Flora / Working Code Freezes

by adafruit_support_carter on Wed Aug 08, 2018 12:07 pm


adafruit_support_carter
 
Posts: 5885
Joined: Tue Nov 29, 2016 2:45 pm

Re: New Flora / Working Code Freezes

by djaubert on Thu Aug 09, 2018 10:54 am

adafruit_support_carter wrote:Do both boards upload and run the blink:
https://learn.adafruit.com/getting-star ... nboard-led
and NeoPixel:
https://learn.adafruit.com/getting-star ... d-neopixel
sketches OK?


I tried both the blink and NeoPixel code and they both work. I also modified the NeoPixel code to go to Pin 6 with 120 leds and that also works.

This makes it more puzzling to me why the FastLED code freezes on the new Flora but the same code, wiring, and strip works on the original Flora. Everything is the same except swapping out one Flora for the other. I checked to make sure they're the same Flora and they have the same Adafruit PID (659) . Is it just a fluke that it works on the original one or might it suggest something is wrong with the new board? Would it be worth trying to exchange the new one or are there any other tests that might reveal something?

djaubert
 
Posts: 29
Joined: Fri Jun 08, 2018 11:30 am

Re: New Flora / Working Code Freezes

by adafruit_support_carter on Thu Aug 09, 2018 11:38 am

The NeoPixel test works, so the board seems fine. Maybe it's something subtle with your hardware setup. Post a photo of your setup showing all connections.

adafruit_support_carter
 
Posts: 5885
Joined: Tue Nov 29, 2016 2:45 pm

Re: New Flora / Working Code Freezes

by djaubert on Thu Aug 09, 2018 1:04 pm

adafruit_support_carter wrote:The NeoPixel test works, so the board seems fine. Maybe it's something subtle with your hardware setup. Post a photo of your setup showing all connections.


Here's a photo of the connections below. Very straightforward and I've disconnected and reconnected this same configuration on both Floras many times. It still doesn't make sense why the same code would work on one Flora and not the other. I can't think of any other variables to test out or isolate the problem. How could it be something other than the board?

unnamed.jpg
unnamed.jpg (851.2 KiB) Viewed 91 times

djaubert
 
Posts: 29
Joined: Fri Jun 08, 2018 11:30 am

Re: New Flora / Working Code Freezes

by adafruit_support_carter on Thu Aug 09, 2018 1:24 pm

It could be a connection issues with the alligator clips. But it sounds like you've set this up multiple times and gone back and forth between the two Floras and the problem repeats. I think if it were the alligator clips, you'd have seen it happen on the other Flora also.

With the number of NeoPixels you are dealing with, it may be a power issue also. Try reducing the number of pixels and see if you still get the problem. You can do this by just changing this line:
Code: Select all | TOGGLE FULL SIZE
#define PIXEL_COUNT   120   // Number of LEDs in Strip

Set that to something like 10.

adafruit_support_carter
 
Posts: 5885
Joined: Tue Nov 29, 2016 2:45 pm

Re: New Flora / Working Code Freezes

by djaubert on Thu Aug 09, 2018 8:06 pm

adafruit_support_carter wrote:Set that to something like 10.


I tried reducing the number of pixels to 10 and it seemed to run through the code a few times without any issues. I slowly increased the number until I got to about 60 which is when the code freezes at the same spot every time - on the bpm function. I also tried on a few different data pins just to be sure and the behavior is pretty much the same.



I understand that this may be a power issue but why is it freezing at the same spot every time, and how does one typically resolve a power issue? Everything has been powered by USB connection to a computer (got the cable from adafruit: PID 592).

It still doesn't explain why one Flora works and the other doesn't - which one is behaving properly and how would a third Flora behave? What other tests are left?

djaubert
 
Posts: 29
Joined: Fri Jun 08, 2018 11:30 am

Re: New Flora / Working Code Freezes

by adafruit_support_carter on Thu Aug 09, 2018 9:19 pm

the code freezes at the same spot every time - on the bpm function

What is the bpm function? If the code stops with an error message, please post the full text of it here.

adafruit_support_carter
 
Posts: 5885
Joined: Tue Nov 29, 2016 2:45 pm

Re: New Flora / Working Code Freezes

by djaubert on Fri Aug 10, 2018 11:12 am

adafruit_support_carter wrote:
the code freezes at the same spot every time - on the bpm function

What is the bpm function? If the code stops with an error message, please post the full text of it here.


Strange turn of events.

After some more testing I was able to replicate the issue on Adafruit test code and also get the FastLED code to work. The issue seems to be code-independent.

I was testing some other rainbow cycle code I cobbled together (the code in the original post on this thread) and it started to freeze like the FastLED code so I examined all of the differences between that code and the rainbow cycle code you had me test and the only difference is your version had a brightness of 50 and my version had a brightness of 75.

So I changed the brightness of your rainbow test code up to 75 and sure enough it froze after about a minute or so - by that I mean you can see the lights start to look jittery and eventually the rainbow cycle stops in place and the lights stay on but cease to move and I then have to disconnect the strip from the board in order to be able to upload new code.

After that I changed the brightness in the FastLED code down to 50 and it worked fine.

What was strange and striking to me was that after your test code with brightness of 75 froze and I had to disconnect power from the strip, in touching the board to do so the board was hot to the touch and I noticed when touching it the leds on the strip got brighter. A couple of times when I would touch the board and only when I touched the board it would cause the onboard LED (#7 I think, not the onboard NeoPixel) to blink red while the strip leds got brighter. I couldn't replicate the onboard blinking but I did record a video of me touching the board after your code froze with the strip leds getting brighter. If that would be useful to see let me know and I can send it to you.

Sadly shortly after these tests the little Flora board stopped responding and no longer shows up in the Arduino IDE so I can only assume it's cooked. The other Flora and Feather still work fine and so does the strip and in fact most of my tests with those had always been running at brightness 100 so it still doesn't make sense to me why the new Flora would have an issue going over brightness 50 even on Adafruit test code. Shouldn't it be able to especially considering the other Flora never had an issue doing so? Did I do something wrong? I don't know what other recourse I have now other than to get another Flora and hope for different results.

djaubert
 
Posts: 29
Joined: Fri Jun 08, 2018 11:30 am

Re: New Flora / Working Code Freezes

by adafruit_support_carter on Fri Aug 10, 2018 12:27 pm

It sounds like you are dealing with a power issue. There's some good info here about powering NeoPixels and expected requirements, etc:
https://learn.adafruit.com/adafruit-neo ... -neopixels

The reason it worked on one but not the other are unknown. But these marginal power issues can be a gray area so can lead to odd behavior like that.

adafruit_support_carter
 
Posts: 5885
Joined: Tue Nov 29, 2016 2:45 pm

Re: New Flora / Working Code Freezes

by djaubert on Fri Aug 17, 2018 8:05 pm

I purchased a new Flora and everything works fine the same as the first Flora.

djaubert
 
Posts: 29
Joined: Fri Jun 08, 2018 11:30 am

Re: New Flora / Working Code Freezes

by adafruit_support_carter on Sun Aug 19, 2018 12:24 pm

Do you know which part got hot? It sounds like something did happen that could be power related. Maybe the alligator clips touched each other at some pointed and shorted things out?

adafruit_support_carter
 
Posts: 5885
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.