Results 1 to 6 of 6

Thread: How to make a remote "Start" button for a Vixen/Arduino display?

  1. #1
    Join Date
    Nov 2018
    Posts
    2
    Post Thanks / Like

    Default How to make a remote "Start" button for a Vixen/Arduino display?

    Good morning!
    I'm making a singing/dancing Christmas tree and bulbs for our lighted boat parade here in Key West. When the boat is docked, I want visitors who walk down the dock to be able to press a big "Start" button and see the show. (I don't want the show cycling continuously through the night - I'd go crazy!)

    Has anyone built some sort of device that would kick off a show on demand?

    Thanks in advance for your help!

    Jeff

  2. #2
    Join Date
    Dec 2017
    Location
    Vancouver
    Posts
    3
    Post Thanks / Like

    Default Re: How to make a remote "Start" button for a Vixen/Arduino display?

    I agree about the button thing. Last year my neighbors were tolerant of the contract flashing but I think a button would be nicer.

    I'm planning on using the Vixen ReST services to trigger my light show this year - connect a device to a button then call the Vixen server to start things. I'll post here when it's done.

    Sent from my Moto G Play using Tapatalk

  3. #3
    Join Date
    Nov 2013
    Location
    North Carolina
    Posts
    1,570
    Post Thanks / Like

    Default Re: How to make a remote "Start" button for a Vixen/Arduino display?

    I would like to see what you guys come up with,keep us posted.

    (1)Falcon PI Player (Running the show)
    (1) Falcon F16V3
    (1)E682
    (1)Renard SS24
    (1)E1.31 Bridge
    (1)EDM-LCD-CS-EP
    (20)P10 Panels


    WIKI
    Become A Supporting Member

    Falcon Christmas


  4. #4
    Join Date
    Dec 2012
    Location
    Hudson MA
    Posts
    3,194
    Post Thanks / Like

    Default Re: How to make a remote "Start" button for a Vixen/Arduino display?

    There are a few designs that have been made for the FPP and this functionality is built into the 2.x version. I suggest going over to the falcon site.


    2018 - Moving and going to visit my Daughter in New Zealand. Most likely I will be dark or nearly dark, Some static stuff that is simple to put up.

  5. #5
    Join Date
    Dec 2017
    Location
    Vancouver
    Posts
    3
    Post Thanks / Like

    Default Re: How to make a remote "Start" button for a Vixen/Arduino display?

    Here's what I came up with for Vixen. This will play a single sequence, since there's no Web API for playing a show. The playSequence call also will let you play the same sequence even if its already playing, overlapping them, so I'm stopping and restarting on tap.

    My plan is to embed an NFC card into a prop accessory, and embed the NFC reader into a prop. So for example you would hold the 'cellphone' to a cutout elf's ear so he can phone santa to start the show.

    I'm using a D1 Mini Pro with a NFC Module V3 to read nfc cards.
    https://wiki.wemos.cc/products:retir...ini_pro_v1.0.0
    https://dangerousthings.com/wp-conte...anual_V3-1.pdf

    I wired it up with i2c, mashed up the script below from some examples online and.... it works!!!

    Code:
    /**************************************************************************/
    /**************************************************************************/
    /*! 
      This code will wait for a nfc card swipe, which will then send a call to
      Vixen to start a sequence. Note that this will only work for a single 
      sequence. 
    
      This is a basically a mashup of the ESP8266 BasicHttpClient example
      and the PN523 iso14443a sample.
    */
    /**************************************************************************/
    
    
    /* HTTP Resources */
    #include <Arduino.h>
    
    #include <ESP8266WiFi.h>
    #include <ESP8266WiFiMulti.h>
    
    #include <ESP8266HTTPClient.h>
    
    ESP8266WiFiMulti WiFiMulti;
    
    /* When the number after #if set as 1, it will be switch to SPI Mode*/
    #if 0
      #include <SPI.h>
      #include <PN532_SPI.h>
      #include "PN532.h"
    
      PN532_SPI pn532spi(SPI, 10);
      PN532 nfc(pn532spi);
    
    /* When the number after #elif set as 1, it will be switch to HSU Mode*/
    #elif 0
      #include <PN532_HSU.h>
      #include <PN532.h>
          
      PN532_HSU pn532hsu(Serial1);
      PN532 nfc(pn532hsu);
    
    /* When the number after #if & #elif set as 0, it will be switch to I2C Mode*/
    #else 
      #include <Wire.h>
      #include <PN532_I2C.h>
      #include <PN532.h>
      #include <NfcAdapter.h>
      
      PN532_I2C pn532i2c(Wire);
      PN532 nfc(pn532i2c);
    #endif
      
    void setup(void) {
      Serial.begin(115200);
    
      Serial.println("Configuring card reader - Start");
    
      nfc.begin();
    
      uint32_t versiondata = nfc.getFirmwareVersion();
      if (! versiondata) {
        Serial.print("Didn't find PN53x board");
        while (1); // halt
      }
      
      // Got ok data, print it out!
      Serial.print("Found chip PN5"); Serial.println((versiondata>>24) & 0xFF, HEX); 
      Serial.print("Firmware ver. "); Serial.print((versiondata>>16) & 0xFF, DEC); 
      Serial.print('.'); Serial.println((versiondata>>8) & 0xFF, DEC);
      
      nfc.setPassiveActivationRetries(0xFF);
      
      // configure board to read RFID tags
      nfc.SAMConfig();
        
      Serial.println("Configuring card reader - Complete");
      Serial.println("Connecting to network - Start");
    
    
        for(uint8_t t = 4; t > 0; t--) {
            Serial.printf("[SETUP] WAIT %d...\n", t);
            Serial.flush();
            delay(1000);
        }
    
        WiFi.mode(WIFI_STA);
        WiFiMulti.addAP("<SSID>", "<PASSWORD>");
        
      Serial.println("Connecting to network - Complete");
    }
    
    void loop(void) {
      boolean success;
      uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 };  // Buffer to store the returned UID
      uint8_t uidLength;                        // Length of the UID (4 or 7 bytes depending on ISO14443A card type)
      
      success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &uid[0], &uidLength);
      
      if (success) {
        Serial.println("Found a card!");
        Serial.print("UID Length: ");Serial.print(uidLength, DEC);Serial.println(" bytes");
        Serial.print("UID Value: ");
        for (uint8_t i=0; i < uidLength; i++) 
        {
          Serial.print(" 0x");Serial.print(uid[i], HEX); 
        }
        start_sequence();
    
        Serial.println("");
        // Wait 1 second before continuing
        delay(1000);
      }
      else
      {
        // PN532 probably timed out waiting for a card
        Serial.println("Timed out waiting for a card");
      }
    }
    
    
    void start_sequence() {
        // wait for WiFi connection
        if((WiFiMulti.run() == WL_CONNECTED)) {
    
            HTTPClient http;
    
            Serial.print("[HTTP] begin...\n");
            
            Serial.print("[HTTP] Stop running sequences...\n");
            http.begin("http://<computer:port>/api/play/stopSequence"); //HTTP
            http.addHeader("Content-Type", "application/json");
            int httpCode = http.POST("{\"Name\":\"Megamix\",\"FileName\":\"Megamix.tim\"}");
            if(httpCode != HTTP_CODE_OK) {
                    Serial.println("Could not stop sequence");
            } 
    
            Serial.print("[HTTP] Start sequence...\n");
            HTTPClient http2;
            http2.begin("http://<computer:port>/api/play/playSequence"); //HTTP
            http2.addHeader("Content-Type", "application/json");
            httpCode = http2.POST("{\"Name\":\"Megamix\",\"FileName\":\"Megamix.tim\"}");
    
            // httpCode will be negative on error
            if(httpCode > 0) {
                // HTTP header has been send and Server response header has been handled
                Serial.printf("[HTTP] GET... code: %d\n", httpCode);
    
                // file found at server
                if(httpCode == HTTP_CODE_OK) {
                    String payload = http2.getString();
                    Serial.println(payload);
                }
            } else {
                Serial.printf("[HTTP] GET... failed, error: %s\n", http2.errorToString(httpCode).c_str());
            }
    
            http.end();
        }
    }

  6. Thanks KeyWestJeff thanked for this post
    Likes KeyWestJeff liked this post
  7. #6
    Join Date
    Nov 2018
    Posts
    2
    Post Thanks / Like

    Cool Re: How to make a remote "Start" button for a Vixen/Arduino display?

    Middleto, thank you so much for taking the time to help out! You've provided the missing link from the Arduino board back to Vixen that I didn't know how to do. I'm going to start experimenting with this today. Our lighted boat parade is 12/15, so I have lots of work to do! I want to have a proof-of-concept built ASAP.

    I'll post my results after I integrate your code back into my project.

    If you ever come down to Key West, stop by and I'll buy you a shrimp dinner - I owe you. :-)

    Best regards,
    Key West Jeff

Tags for this Thread

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
  •