Results 1 to 10 of 10

Thread: Help getting vixen to connect to arduino

  1. #1
    Join Date
    Dec 2017
    Location
    Plymouth UK
    Posts
    5
    Post Thanks / Like

    Default Help getting vixen to connect to arduino

    Hi all

    Total novice here with Vixen 3, all looks great but although music runs, screen show display with picture of house all works nothing happens with the relays I have, I apologise for such a large first post but from looking around the forum most posts seem to be asked to provide more info, so I may have over posted info amounts, any help I can have would be very appreciated, thanks in advance, Ian

    Total Kit used

    Vixen 3
    Arduino Mega 2560
    16 channel relay board (12 volt relays seperately powered) but all led lights do come on, and then just stay on, the sketch verifies and uploads with no code problems shown

    I found this sketch at http://kbarre123.github.io/blog/2015...rry-christmas/ as I am obviously no expert all I did was change it to a Arduino Mega 2560 and I used 16 pins from 30 to 45 then connected to 16 Relay Board

    /*
    This sketch allows the Arduino to read 16 bytes of data from Vixen and turn on
    its pins accordingly, which in turn controls a solid state relay hooked up to Xmas lights.
    */

    // Define pins on Arduino that will control the relay.
    #define CHANNEL_01 30
    #define CHANNEL_02 31
    #define CHANNEL_03 32
    #define CHANNEL_04 33
    #define CHANNEL_05 34
    #define CHANNEL_06 35
    #define CHANNEL_07 36
    #define CHANNEL_08 37
    #define CHANNEL_09 38
    #define CHANNEL_10 39
    #define CHANNEL_11 40
    #define CHANNEL_12 41
    #define CHANNEL_13 42
    #define CHANNEL_14 43
    #define CHANNEL_15 44
    #define CHANNEL_16 45

    // Define size of array to hold channels
    #define CHANNEL_COUNT 16

    // Define array to hold channels
    int channels[] =
    {
    CHANNEL_01, CHANNEL_02, CHANNEL_03, CHANNEL_04, CHANNEL_05, CHANNEL_06, CHANNEL_07, CHANNEL_08,
    CHANNEL_09, CHANNEL_10, CHANNEL_11, CHANNEL_12, CHANNEL_13, CHANNEL_14, CHANNEL_15, CHANNEL_16
    };

    // Define array to hold incoming data stream from Vixen
    int incomingByte[16];

    // Define baud rate. This figure must match that of your profile configuration in Vixen!
    #define BAUD_RATE 57600

    void setup()
    {
    // Begin serial communication
    Serial.begin(BAUD_RATE);

    // Set up each channel as an output
    for(int i = 0; i < CHANNEL_COUNT; i++)
    {
    pinMode(channels[i], OUTPUT);
    }
    }

    void loop()
    {
    if (Serial.available() >= CHANNEL_COUNT)
    {
    // Read data from Vixen, store in array
    for (int i = 0; i < CHANNEL_COUNT; i++)
    {
    incomingByte[i] = Serial.read();
    }
    // Write data from array to a pin on Arduino
    for (int i = 0; i < CHANNEL_COUNT; i++)
    {
    digitalWrite(channels[i], incomingByte[i]);
    }
    }
    }

    Now a set of screenshots
    multi screen shots 1.jpg
    multi screen shots 2.jpg
    multi screen shots 3.jpg
    multi screen shots 4.jpg
    multi screen shots 5.jpg

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

    Default Re: Help getting vixen to connect to arduino

    This sketch shows up periodically and has no chance of working. Take a look at the code found in this thread:

    http://doityourselfchristmas.com/for...input-via-XBee


    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
    Dec 2017
    Location
    Plymouth UK
    Posts
    5
    Post Thanks / Like

    Default Re: Help getting vixen to connect to arduino

    Hi Martin thanks for replying

    So I followed your link and read through the posts and came to the last final post with apparently the last final version which I copied below, I changed the numbers of the pins to match mine and started with the 8 channels as shown, and it verified no problem and uploaded to the Mega, and relays 1 to 8 all lit up, so I added a few more channels and the correct lights lit up, until I got to 16 pins defined and now all my lights are on, so it seems my shiny new laptop is definitely talking to my Arduino, so back to teh show and schedule and played and up pops the correct box and music but the lights do nothing apart from keep on shining, which (and please tell me if I am wrong) tells me the problem isn't with the sketch or wiring but somewhere in the Vixen stuff I have done, I have checked everything I can find and I am lost


    //set Pin for Sequencer channels
    #define CHAN_1_PIN_ID 2
    #define CHAN_2_PIN_ID 3
    #define CHAN_3_PIN_ID 4
    #define CHAN_4_PIN_ID 5
    #define CHAN_5_PIN_ID 6
    #define CHAN_6_PIN_ID 7
    #define CHAN_7_PIN_ID 8
    #define CHAN_8_PIN_ID 9


    //set output status
    #define CHAN_ON HIGH
    #define CHAN_OFF LOW


    //intensity value to turn on channels
    #define CHANNEL_TRIGGER_LEVEL 128

    // table translate channel index to pin id
    byte XlatIndexToPin[] =
    {
    CHAN_1_PIN_ID,
    CHAN_2_PIN_ID,
    CHAN_3_PIN_ID,
    CHAN_4_PIN_ID,
    CHAN_5_PIN_ID,
    CHAN_6_PIN_ID,
    CHAN_7_PIN_ID,
    CHAN_8_PIN_ID
    };

    byte CurrentChannelIndex = 0;

    // string to search for at the start of a frame so we can sync to the frame
    // you must add this string to the show player and have it sent at the start of every data frame.
    byte FrameHeader[] = {"FindMe"};
    byte FrameHeaderIndex = 0;

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

    // The EL channels are on pins 2 through 9 on the ATMega328
    // set up the output ports
    for(byte CurrentPort : XlatIndexToPin)
    {
    pinMode(CurrentPort, OUTPUT);
    digitalWrite(CurrentPort, CHAN_OFF);


    } // end set up the output ports


    // set up for a new frame
    FrameHeaderIndex = 0;
    CurrentChannelIndex = 0;


    } // setup

    void loop()
    {
    do // once
    {
    // is there data to process?
    if(0 == Serial.available())
    {
    // no data. Go away
    break;
    } // end no data

    // have we completed the header sync yet
    if( FrameHeaderIndex < sizeof(FrameHeader)-1)
    {
    // still searching for the header


    // is this an expected byte?
    if( Serial.read() != FrameHeader[FrameHeaderIndex++])
    {
    // not the expected value. Start searching at the beginning again
    FrameHeaderIndex = 0;
    }


    // go away and process the next byte in the next loop iterration.
    break;
    } // end look for header


    // we get to here if this byte is ment for the relay
    digitalWrite(XlatIndexToPin[CurrentChannelIndex], (Serial.read() < CHANNEL_TRIGGER_LEVEL) ? CHAN_OFF : CHAN_ON);


    // move to the next relay
    CurrentChannelIndex++;


    // have we sent all of the relay data?
    if( CurrentChannelIndex == sizeof(XlatIndexToPin))
    {
    // start searching for the next frame
    FrameHeaderIndex = 0;
    CurrentChannelIndex = 0;
    } // end move to next frame



    } while(false);


    } // loop

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

    Default Re: Help getting vixen to connect to arduino

    post a screen shot of your patching screen.


    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

  5. #5
    Join Date
    Dec 2017
    Location
    Plymouth UK
    Posts
    5
    Post Thanks / Like

    Default Re: Help getting vixen to connect to arduino

    Is this the screenshot you want to see ?
    1 Display set up.jpg
    2 Generic Serial Configuration.jpg
    in this shot I have changed it to 9600 to match the sketch

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

    Default Re: Help getting vixen to connect to arduino

    your frame header in vixen does noot match the header you posted in the code. they have to match or the arduino ignores all oof the data


    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

  7. #7
    Join Date
    Dec 2017
    Location
    Plymouth UK
    Posts
    5
    Post Thanks / Like

    Default Re: Help getting vixen to connect to arduino

    Hi Martin

    I see what you mean and I take it the 2 that have to match are byte FrameHeader[] = {"FindMe"}; with the Packet Data send a text header box ticked and enter FindMe in that box, I have done that and still it won't play, I have been through every help topic I can find and still no where closer, any further ideas gratefully received, Ian

  8. #8
    Join Date
    Dec 2014
    Location
    Southern California
    Posts
    897
    Post Thanks / Like

    Default Re: Help getting vixen to connect to arduino

    if you continue to have problems, a lot of people use the sketch by Victor_PV which can be found here - http://doityourselfchristmas.com/for...th-Random-mode
    Kevin

    2017 - Pi3 w/FPP controlling 8 ESPixelsticks driving 1250pixels and 3 Arduino MEGAS communicating with ESP-01s driving 96 channels
    2016 - 184 channels of Blinking/Flashing using 4 Arduino MEGAs and cheap home-made props.

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

    Default Re: Help getting vixen to connect to arduino

    The string is case sensitive. PM me if you want to set up a time to chat.


    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

  10. #10
    Join Date
    Dec 2017
    Location
    Plymouth UK
    Posts
    5
    Post Thanks / Like

    Default Re: Help getting vixen to connect to arduino

    Hi everyone

    I scrapped everything I have done so far, reloaded vixen 3 and worked my way through again, still not a lot happened, so I changed the header to "+>" on the arduino code and +> in Vixen header set up, and went all the way through and suddenly it all started working, no idea why but brilliant now all I have to do is create some lights and music by Monday night for grandkids coming around on Tuesday, does anyone have any displays set up for Vixen 3 for 16 relays or up to 32 relays ? and will the vixen 2 on here work in vixen 3 ? I am pretty excited and can feel a late night coming up after the boxing, thanks everyone :D

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
  •