Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: New, Need direction

  1. #1
    Join Date
    Jan 2020
    Location
    Olympia, Washington
    Posts
    11
    Post Thanks / Like

    Default New, Need direction

    I am new to this, need advice. I have built my own light controller using an Arduino I have been having issue trying to get Vixen 3 to work at no avail (constantly getting Not Responding). I thought on giving xlights a try but not finding a Arduino code for xlights (I have an Arduino Mega 2560 r3.) My controller is a 24 channel. I am a simple person just trying to do a simple light show. I also want complete control on how the show goes on (I will take any advice). (followed direction on YouTube by a gentlemen goes by the name cheapskate for my controller design if that helps).

  2. #2
    Join Date
    Dec 2012
    Location
    Newtown CT
    Posts
    4,859
    Post Thanks / Like

    Default Re: New, Need direction

    Please post your sketch so we can review it. Also send a picture of the controller configuration in Vixen.

    FYI: Vixen and xLights have no concept of Arduino. You have serial based controllers, USB based controllers, E1.31 based controllers, DDP controllers, fpp Controllers etc.

    Arduino is a development environment that can be used to create some of the above controller types.


    2020 Full sized show reworked for the new location. Only adding (famous last words) 13 RBLs that I finally got converted to using pixels
    2019 - Just moved into a new home (yet another change of plans). Will be dim but not dark. Too much to do at the new place to leave time for a show. Dim show (3000 pixels) had regular visits most nights.
    https://www.youtube.com/channel/UCyX...ttrsZNARkUce0Q

  3. #3
    Join Date
    Jan 2020
    Location
    Olympia, Washington
    Posts
    11
    Post Thanks / Like

    Default Re: New, Need direction

    Arduino Drawing.jpgrough schetch of light controller.jpg
    Attached Images Attached Images

  4. #4
    Join Date
    Jan 2020
    Location
    Olympia, Washington
    Posts
    11
    Post Thanks / Like

    Default Re: New, Need direction

    #define MEGA_VIXEN
    //#define UNO_VIXEN

    #ifdef MEGA_VIXEN
    #define MAX_CHANNELS 24
    int channels[MAX_CHANNELS] = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,46,47,48, 49,50,51,52,53};
    #endif

    #ifdef UNO_VIXEN
    #define MAX_CHANNELS 18
    int channels[MAX_CHANNELS] = {2,3,4,5,6,7,8,9,10,11,12,13,A0,A1,A2,A3,A4,A5};
    #endif

    int incomingByte[MAX_CHANNELS];

    void setup()
    {
    int i;

    Serial.begin(9600); // set up Serial at 9600 bps

    for ( i = 0; i < MAX_CHANNELS; i ++ ) pinMode(channels[i], OUTPUT);
    }

    void loop()
    {
    int i;

    if (Serial.available() >= MAX_CHANNELS)
    {
    for (i=0; i < MAX_CHANNELS; i ++) incomingByte[i] = Serial.read();
    }

    for (i = 0; i < MAX_CHANNELS; i ++ ) analogWrite(channels[i], incomingByte[i]);
    }

  5. #5
    Join Date
    Dec 2016
    Location
    Hicksville, New York
    Posts
    226
    Post Thanks / Like

    Default Re: New, Need direction

    Quote Originally Posted by JasonMcDonough View Post
    #define MEGA_VIXEN
    //#define UNO_VIXEN

    #ifdef MEGA_VIXEN
    #define MAX_CHANNELS 24
    int channels[MAX_CHANNELS] = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,46,47,48, 49,50,51,52,53};
    #endif

    #ifdef UNO_VIXEN
    #define MAX_CHANNELS 18
    int channels[MAX_CHANNELS] = {2,3,4,5,6,7,8,9,10,11,12,13,A0,A1,A2,A3,A4,A5};
    #endif

    int incomingByte[MAX_CHANNELS];

    void setup()
    {
    int i;

    Serial.begin(9600); // set up Serial at 9600 bps

    for ( i = 0; i < MAX_CHANNELS; i ++ ) pinMode(channels[i], OUTPUT);
    }

    void loop()
    {
    int i;

    if (Serial.available() >= MAX_CHANNELS)
    {
    for (i=0; i < MAX_CHANNELS; i ++) incomingByte[i] = Serial.read();
    }

    for (i = 0; i < MAX_CHANNELS; i ++ ) analogWrite(channels[i], incomingByte[i]);
    }
    I would delete the UNO stuff just to be safe. Your code looks like mine so I don't think that's the problem.
    Code:
    #define MEGA_VIXEN
    
    #ifdef MEGA_VIXEN
      #define MAX_CHANNELS 24
      int channels[MAX_CHANNELS] = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,46,47,48,49,50,51,52,53};
    #endif
    
    
    int incomingByte[MAX_CHANNELS];
    
    void setup()
    {
      int i;
      
      Serial.begin(9600); // set up Serial at 9600 bps
    
      for ( i = 0; i < MAX_CHANNELS; i ++ )  pinMode(channels[i], OUTPUT);
    }
    
    void loop()
    {
      int i;
      
      if (Serial.available() >= MAX_CHANNELS)
      {
        for (i=0; i < MAX_CHANNELS; i ++)      incomingByte[i] = Serial.read();
      }
    
      for (i = 0; i < MAX_CHANNELS; i ++ )    analogWrite(channels[i], incomingByte[i]);
    }
    Now check your COM port settings in the device manager double click your Arduino port and go to settings:
    Make sure your bits per second is 9600
    data bits 8
    parity none
    stop bits 1
    flow control none

    Click advanced and I'd change the COM port to a low number.
    Make sure to save all that or click ok.

    I would definitely use Vixen 3, I do not recommend using xLights for AC lighting. Trust me it's confusing. I tried lol! xLights seems to be more centered around pixels.


    So, in Vixen 3 to add your Arduino Mega,
    click setup display, on the right click add generic serial. Add a name
    set outputs to 24

    Now click your Arduino or whatever you named it and click the cog on the bottom.
    Set your COM Port to the Arduino's
    set your baud rate to 9600
    parity none
    data bits 8
    stop bits 1

    Leave the header and footer empty and unchecked. You don't have those.

    Then on the left, select your 24 items, and then on the right select your 24 outputs.
    Click Patch.

    Select all your elements again, set configure to color handling, click the cog
    Set to they are a single color, and do not change color at all. Then if you want to change the color you can.

    I was in your shoes as well. Days of troubleshooting! Don't worry you'll get there.
    Crazy Light Addict.

  6. #6
    Join Date
    Jan 2020
    Location
    Olympia, Washington
    Posts
    11
    Post Thanks / Like

    Default Re: New, Need direction

    Now when I go to Configure this comes up.

    Capture.JPG

  7. #7
    Join Date
    Dec 2016
    Location
    Hicksville, New York
    Posts
    226
    Post Thanks / Like

    Default Re: New, Need direction

    Quote Originally Posted by JasonMcDonough View Post
    Now when I go to Configure this comes up.

    Capture.JPG
    Have you tried reinstalling Vixen 3 to the latest version?
    Crazy Light Addict.

  8. #8
    Join Date
    May 2007
    Posts
    5,465
    Post Thanks / Like

    Default Re: New, Need direction

    I moved the thread, this seems like a better place for it.
    Phil

  9. #9
    Join Date
    Jan 2020
    Location
    Olympia, Washington
    Posts
    11
    Post Thanks / Like

    Default Re: New, Need direction

    Yes, It will operate for a little bit then go "Not Responding"

  10. #10
    Join Date
    Oct 2014
    Location
    Sauk City, WI USA
    Posts
    1,772
    Post Thanks / Like

    Default Re: New, Need direction

    Are you saying the Arduino does work but quits after a bit or you can't make a connection with Vixen.

    I may have missed it but you are using Win10?
    You must have your controller plugged in and powered before Vixen starts (it is picky that way). You have to NOT be connected to it in the Arduino IDE or the serial monitor. Vixen won't share an open port.

    The sketch you are using is bad. I wish all the places this code is published for interfacing with lights would go away. You really need some sync code. How does the Arduino know where channel 1 is?
    The Omron SSR specified on your hand drawn layout is a zero crossing relay. It will only respond to on or off. So do not use analogwrite (which you shouldn't be using with AC lights anyway - it is really for DC loads). Use digitalWrite.
    At 24 channels, the read of the data is fine but you should really be reading one byte at a time until you have all the channel data and not waiting until the buffer fills. This is "sloppy code" as the various arduino boards have a relatively small receive buffer and as you move down the road, you might want to read more than what fits in the buffer.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •