[BUG] Some weird problems, Arduino (SainSmart) crashes (1 Viewer)

Dragy

Portal Pro
April 27, 2009
778
333
31
Home Country
Netherlands Netherlands
I am busy with a new setup for my new TV, but I run into some problems. This is the setup:

- SainSmart UNO R3

- AtmoDuino firmware with FastLed 3.0.3
- Serial port on 115200
- 64 leds
- AtmoWin 1.0.0.8
- AtmoLight 1.14

What goes wrong:
I have the idea that serial data lets the Arduino crash, because this problem only occurs with the AtmoDuino code. Sometimes it reboots, the other time it just doesn't respond. I can reproduce this every time when playing with the static color or software adjustment sliders. To let it run again, I have to press the reset button on the Arduino. It runs fine when not changing mode or doing this, so no problems occur when not touching AtmoWin and just let it run whatever it does.

Also, AtmoLight can't connect to AtmoWinA.exe, because it lets AtmoWin crash.

So there are 2 problems:
- The Arduino crashes when playing with color sliders and sometimes when changes mode
- AtmoWin crashes when AtmoLight starts

Also, when I do this: AtmoWinA.exe /register, it gives an error: RegisterTypeLib failed. Code:0x8002801c

Someone knows what's going on?

This is the error AtmoLight produces in MP:
Code:
[2014-12-18 12:38:19,035] [Error  ] [AtmoLight Initialise] [ERROR] - AtmoLight: AtmoWinHandler - Error with GetAtmoRemoteControl!
[2014-12-18 12:38:19,056] [Error  ] [AtmoLight Initialise] [ERROR] - AtmoLight: AtmoWinHandler - Exception: Ongeldige klassereeks (Uitzondering van HRESULT: 0x800401F3 (CO_E_CLASSSTRING))
[2014-12-18 12:38:20,177] [Error  ] [AtmoLight Reinitialise] [ERROR] - AtmoLight: AtmoWinHandler - Error with GetAtmoRemoteControl!
[2014-12-18 12:38:20,177] [Error  ] [AtmoLight Reinitialise] [ERROR] - AtmoLight: AtmoWinHandler - Exception: Ongeldige klassereeks (Uitzondering van HRESULT: 0x800401F3 (CO_E_CLASSSTRING))
[2014-12-18 12:38:20,281] [Error  ] [AtmoLight Reinitialise] [ERROR] - AtmoLight: AtmoWinHandler - Reinitialising failed.

Code:
#include <FastLED.h>

// Set the number of leds in the strip.
#define NUM_LEDS 64
#define DATA_PIN 12

CRGB leds[NUM_LEDS];

void setup(){
  Serial.begin(115200);

  //sanity check delay - allows reprogramming if accidently blowing power w/leds
  delay(2000);
  FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);

  setupLEDs();
  loopLeds();
  clearLeds();
}

int readByte(){
  while (Serial.available() == 0){ /* wait for data */ }
  return Serial.read();
}

void loopLeds(){
for(int j = 0; j < 3; j++) {
  for(int i = 0 ; i < NUM_LEDS; i++ ) {
  memset(leds, 0, NUM_LEDS * 3);
  switch(j) {
  case 0: leds[i].r = 255; break;
  case 1: leds[i].g = 255; break;
  case 2: leds[i].b = 255; break;
  }
  FastLED.show();
  delay(5);
  }
  }
}


void clearLeds(){
  for(int dot = 0; dot < NUM_LEDS; dot++){
  leds[dot] = CRGB::Black;
  };
  FastLED.show();
}

// shows colored LEDs for 500ms then blanks out ready to go
void setupLEDs()
{
  memset(leds,150, sizeof(leds));
  FastLED.show();
  delay(500);
  memset(leds,0, sizeof(leds));
  FastLED.show();
}

void loop() {
  if(readByte() == 0xFF){
  if(readByte() == 0x00){
  if(readByte() == 0x00){
  int channels = readByte();
  for(int dot = 0; dot < channels; dot++){
  leds[dot].r = readByte();
  leds[dot].g = readByte();
  leds[dot].b = readByte();
  }
  FastLED.show();
  }
  }
  }
}
 
Last edited:

Lightning303

MP Donator
  • Premium Supporter
  • September 12, 2009
    798
    577
    Home Country
    Germany Germany
    Hey,
    not sure about the Arduino part atm, but the AtmoLight error has something to do with AtmoWin not being registered.
    Have you tried starting cmd as administrator and then register AtmoWin? Also you say AtmoWin crashes when AtmoLight wants to connect? What is the setup you are using? Is AtmoWin already running when you start MP, or is it closed and AtmoLight tries to start it?
     

    Dragy

    Portal Pro
    April 27, 2009
    778
    333
    31
    Home Country
    Netherlands Netherlands
    Ah the AtmoLight problem is solved, indeed by executing /register as administrator (problem 2).

    What more do you want to know about my setup?
     

    Lightning303

    MP Donator
  • Premium Supporter
  • September 12, 2009
    798
    577
    Home Country
    Germany Germany
    Is AtmoWin still crashing when AtmoLight wants to connect to it?
    If so, i want to know if AtmoWin is running before you start MP or not. If you set AtmoLight to start AtmoWin for you or not.
    Or did the register as admin also solve the AtmoWin crashing part of the problem?
     

    Dragy

    Portal Pro
    April 27, 2009
    778
    333
    31
    Home Country
    Netherlands Netherlands
    No, that is fixed by registering AtmoWin. By the way, I never had to do that before on an other system.
     

    Lightning303

    MP Donator
  • Premium Supporter
  • September 12, 2009
    798
    577
    Home Country
    Germany Germany
    Yeah, some systems dont need it, i have no clue why... AtmoWin is a black box for me :p.

    So the arduino problem, i dont seen anything wrong with the scetch :/. So if you just enable liveview in atmowin, after a while it just stops working?
     

    Dragy

    Portal Pro
    April 27, 2009
    778
    333
    31
    Home Country
    Netherlands Netherlands
    No, it only stops working when:
    - switching modes (sometimes)
    - changing software color adjustment (playing with the slider, even touching it slightly)
    - changing static color, high change of failure, but less than with the software color adjustment sliders
    - closing AtmoWin

    I really don't get the hang of when it fails, or what even could be the cause.

    I tried FastLED2 instead of 3, but that makes no difference. Also tried AtmoDuino v1 and v2, both the same.
     

    HomeY

    Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    I see some differences with my Arduino sketch. No clue if it's gonna help, but try the attached one (i've already set #Leds + DATA channel). ;)
    I've got an Arduino Leonardo + WS2812B, and this sketch is working fine for me.
     

    Attachments

    • Atmoduino_Dragy.zip
      781 bytes

    Dragy

    Portal Pro
    April 27, 2009
    778
    333
    31
    Home Country
    Netherlands Netherlands
    Thanks, but actually there is no really difference. Also, to be sure, I tried your sketch of course. Result: No difference.

    I really begin to think there is something wrong with the Arduino..
     

    Lightning303

    MP Donator
  • Premium Supporter
  • September 12, 2009
    798
    577
    Home Country
    Germany Germany
    Well, you could try the ghetto debugging route i always go in these cases. Add a normal led to one pin and change its state within the code to see if something is actually happening. As an easy first test for example you could add code into the loop that toggles the led every second (use millis() instead of delay() so the rest of the code can still run). If you see the Arduino crash and the led is still blinking, you know the arduino actually did not crash, but rather is not getting any more infos or the wrong infos. If it crashes and its not blinking we know there is actually something wrong with the scetch/arduino. And so on. :)
     

    Users who are viewing this thread

    Top Bottom