Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 39

Thread: Project to use a pixelstick type device as a FPP remote.

  1. #11
    Join Date
    Nov 2010
    Location
    Livermore, CA
    Posts
    2,126
    Post Thanks / Like

    Default Re: Project to use a pixelstick type device as a FPP remote.

    That is awesome
    Happy to Show support;
    Xlights/Nutcracker and The Falcon Team

  2. #12
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,353
    Post Thanks / Like

    Default Re: Project to use a pixelstick type device as a FPP remote.

    Hi, well so far so good (still early days). It appears that its not that difficult to read back the SPIFFS file (Serial Peripheral Interface Flash File System external ram connected via the SPI interface).

    SPIFFS_!.jpg

    The top line is the 28 byte header with the number of channels, frames per second and number of frames in the sequence. The block underneath is the first portion the data, I messed up and opened the file in notepad and it converted all the 00s to 20 HEX which is a space (silly me should have used notepad++ but wasnt paying attention).

    The nice stuff so far:
    It appears to have stored the data in SPIFFS.
    We can read the data back, Im not sure what the speed is like or whether it needs block reads and a buffer.
    It appears that opening the file sets the read position to the start of the file.
    It appears that each read increments the read position pointer (very cool that save us doing it).

    If all goes well you should be able to rename an .FSEQ file and upload it to the ESP8266 via the Arduino IDE file uploader. Then at power up the ESP will read the .FSEQ header and configure its self to the number of channels, frames / second and the length of the sequence. Then just loop round the sequence outputting to the pixels. No Wi-Fi or interface needed it just plays the sequence at power up.

    Thats it for tonight as its getting late this side of the pond I continue tomorrow afternoon.

  3. #13
    Join Date
    Jan 2017
    Posts
    49
    Post Thanks / Like

    Default Re: Project to use a pixelstick type device as a FPP remote.

    I tried something similar about 2 months ago with the idea to upload a simple sequence to the ESP so it could run autonomously, i.e. power-on an sequence starts.

    I gave up when I realized the FSEQ size would become an issue, I'm glad you are having more success and I'm watching closely as your work may help me implement my original idea!

  4. #14
    Join Date
    Nov 2010
    Location
    Livermore, CA
    Posts
    2,126
    Post Thanks / Like

    Default Re: Project to use a pixelstick type device as a FPP remote.

    That is awesome and good news, thank you sir. (because you are kicking butt, I'm going to withhold any comments relating to your use of windows ) hahaha.. BTW where are you located?

    -Tory
    Happy to Show support;
    Xlights/Nutcracker and The Falcon Team

  5. #15
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,353
    Post Thanks / Like

    Default Re: Project to use a pixelstick type device as a FPP remote.

    Quote Originally Posted by Livermore-Dad View Post
    That is awesome and good news, thank you sir. (because you are kicking butt, I'm going to withhold any comments relating to your use of windows ) hahaha.. BTW where are you located?

    -Tory
    Hi, LOL. I’m England born and bred, about 18 miles from Nottingham.

    If you have 5 minutes can you whip up another .FSEQ for testing please (as you have it all setup). A single pixel chase in white is better for me as:
    1. It doesn’t use much power easier for me on the bench with my 5V 144 per meter WS2812s (great for testing as they don’t take up much space but nearly impossible to power inject so you can’t have too many on at a time).
    2. White shows up if the data alignment is out, as any pixel that is lit but not white is wrong.

    The chase can loop as many times as you want – as a thought I could do with something different at the end of the sequence so it’s easy to tell it’s getting to the end. A change of direction or speed will do anything that gives a visual indication that we are at the end of the file not stuck in a loop somewhere in the middle.

    Also I’m not sure how to set this but the last .FSEQ had data for 512 channels (padded out with 62 Zeros at the end). I’m guessing you had an E1.31 output set for this universe and it was at the default 512 channels. I don’t mind if its 450 (ideal as it saves file space) or 510 so long as the number of channels is divisible by 3 or it’s going to get messy later.

    Can you make that less that 1.5MB please I'm having some problems reading more than 1.5M in one block.
    Last edited by Barnabybear; 11-18-2017 at 01:48 PM.

  6. #16
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,353
    Post Thanks / Like

    Default Re: Project to use a pixelstick type device as a FPP remote.

    Hi, a quick progress update:

    Code:
    // posted for progress infomation - this is not finished code and will only print data values over serial - it does not light pixels.
    
    #include <ESP8266WiFi.h>
    #include <FS.h>
    
    int n;  // variable for loop.
    int nn;  // variable for loop.
    File FSEQ_Data;
    long int Data_Offset;  // start of data in .FSEQ file (length of headder) (read from file).
    long int Number_Channels;  //  total number of channels in .FSEQ file (read from file).
    long int Step_Lenght;  // number of frames in .FSEQ file (read from file).
    int Frame_Time;  // FPS of of frames in .FSEQ file (read from file).
    bool Debug = 1; // minimum debug.
    bool FSEQ_Headder_Debug = 1; // debug .FSEQ headder.
    
    void setup() {
      WiFi.mode(WIFI_OFF);  // disable wifi.
      SPIFFS.begin();  // start an instance of SPIFFS.
      Serial.begin(115200);  // debug print - comment out during normal use.
      FESQ_Headder_Read();  // call function.
    }
    
    void loop() {
      FSEQ_Data = SPIFFS.open("/tree-4min.fseq", "r");  //open file in read only mode.
      FSEQ_Data.seek(Data_Offset, SeekSet); // set read pionter to correct byte.
      for  (nn = 0; nn < Step_Lenght ; nn++) {  // loop number of steps in sequence (fps*time).
      for  (n = 0; n < Number_Channels ; n++) {  // loop number of channels times.
    
        byte Data = FSEQ_Data.read();  // read one byte of data from .FSEQ file.
        Serial.print(Data, HEX);  // print byte as hex value.
        Serial.print(" ");
      }
        delay(Frame_Time);  // delay (1 sec / fps) - not final code.
      }
    }
    
    //*************** void FESQ_Headder_Read ***************//
    void FESQ_Headder_Read() {
      Serial.print("Opened "); // debug print.
      FSEQ_Data =  SPIFFS.open("/tree-4min.fseq", "r");
      if (FSEQ_Data) { // check file open.
        //-----------------------------------------
        FSEQ_Data.seek(4, SeekSet); // set read pionter to correct byte.
        Data_Offset = (FSEQ_Data.read()); // read LSB.
        Data_Offset = Data_Offset + (FSEQ_Data.read() * 256); // read MSB & add to LSB.
        while (FSEQ_Headder_Debug) { // debug print.
          Serial.println(); // debug print.
          Serial.print("Data Offset: "); // debug print.
          Serial.print(Data_Offset); // debug print.
          Serial.print(" "); // debug print.
          break;
        }
        //-----------------------------------------
        FSEQ_Data.seek(10, SeekSet); // set read pionter to correct byte.
        Number_Channels = (FSEQ_Data.read()); // read LSB.
        Number_Channels = Number_Channels + (FSEQ_Data.read() * 256); // read MSB & add to LSB.
        while (FSEQ_Headder_Debug) { // debug print.
          Serial.println(); // debug print.
          Serial.print("Channels: "); // debug print.
          Serial.print(Number_Channels); // debug print.
          Serial.print(" "); // debug print.
          break;
        }
        //-----------------------------------------
        FSEQ_Data.seek(14, SeekSet); // set read pionter to correct byte.
        Step_Lenght = (FSEQ_Data.read()); // read LSB.
        Step_Lenght = Step_Lenght + (FSEQ_Data.read() * 256); // read MSB & add to LSB.
        while (FSEQ_Headder_Debug) { // debug print.
          Serial.println(); // debug print.
          Serial.print("Step Length: "); // debug print.
          Serial.print(Step_Lenght); // debug print.
          Serial.print(" "); // debug print.
          break;
        }
        //-----------------------------------------
        FSEQ_Data.seek(18, SeekSet); // set read pionter to correct byte.
        Frame_Time = (FSEQ_Data.read()); // Read FPS.
        while (FSEQ_Headder_Debug) { // debug print.
          Serial.println(); // debug print.
          Serial.print("Frame Timing: "); // debug print.
          Serial.print(Frame_Time, DEC); // debug print.
          Serial.print(" "); // debug print.
          break;
        }
        //-----------------------------------------
        while (Debug) { // debug print.
          Serial.println(); // debug print.
          Serial.print("FSEQ_Data read"); // debug print.
          Serial.println(" and variables set."); // debug print.
          delay(10);
          break;
        }
      }
      // if the file isn't open, pop up an error:
      else {
        while (Debug) { // debug print.
          Serial.print("error opening "); // debug print.
          Serial.println("FSEQ_Data"); // debug print.
          break;
        }
      }
      return;
    }

    It's all a bit disjointed as I'm pasting in bits of code from the previous project and some of the comments may not be bang on. Anyway it works up to 1.5MB of data and then for some reason it reads very slowly after that, I think that has something to do with OTA updates. The next job is to replace the print statements with writes to the pixels.

  7. #17
    Join Date
    Nov 2010
    Location
    Livermore, CA
    Posts
    2,126
    Post Thanks / Like

    Default Re: Project to use a pixelstick type device as a FPP remote.

    Yep on it!! A lovely England, been there a few times. I lived in Germany for 3 years in my youth.

    Putting something together right now
    Happy to Show support;
    Xlights/Nutcracker and The Falcon Team

  8. #18
    Join Date
    Nov 2010
    Location
    Livermore, CA
    Posts
    2,126
    Post Thanks / Like

    Default Re: Project to use a pixelstick type device as a FPP remote.

    Here is what you wanted small white chase and the last 10 seconds it switches directions. Also set to 450 channels instead of 512

    https://www.dropbox.com/s/510igrnuyd...nce-chase.fseq this is like 540KB, so you should be in good shape loading it.

    Thanks!
    Happy to Show support;
    Xlights/Nutcracker and The Falcon Team

  9. #19
    Join Date
    Nov 2010
    Location
    Livermore, CA
    Posts
    2,126
    Post Thanks / Like

    Default Re: Project to use a pixelstick type device as a FPP remote.

    Good morning BTW ))
    Happy to Show support;
    Xlights/Nutcracker and The Falcon Team

  10. #20
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,353
    Post Thanks / Like

    Default Re: Project to use a pixelstick type device as a FPP remote.

    Quote Originally Posted by Livermore-Dad View Post
    Here is what you wanted small white chase and the last 10 seconds it switches directions. Also set to 450 channels instead of 512

    https://www.dropbox.com/s/510igrnuyd...nce-chase.fseq this is like 540KB, so you should be in good shape loading it.

    Thanks!
    Hi, thanks thats brilliant and works a treat (says 452 channels, 1200 steps, 50mS timing). I'll look at why it says 452 channels but it has reduced the file size.
    I'll add the pixel control later and post back.

Page 2 of 4 FirstFirst 1234 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
  •