Page 4 of 4 FirstFirst ... 234
Results 31 to 39 of 39

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

  1. #31
    Join Date
    Jun 2015
    Posts
    67
    Post Thanks / Like

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

    Quote Originally Posted by Barnabybear View Post
    Hi pakeonoahu. A nice find, other than that is it working for you?
    Hi Barnabybear,
    It works fine with 50ms rate on a 16x16 matrix, 15% brightness. Thanks for the great work on this. I was trying to add a switch to toggle a GPIO so it will pick the next fseq file in a loop, ie: from pixel_data1, pixel_data2, pixel_data3, I ran into an issue since FESQ_Headder_Read() is called from setup routine, I wonder what's the best way to do this, I am not a programmer but I write just to get by. If you are not too busy then it would be nice to see this option can be added to your code.

    thanks again.

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

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

    Hi, that should be do-able. It was a sort of proof of concept and I’m not a coder so it is more than likely not the best way.
    Are you thinking the button has a next function the same as a music player and skips to the next file and if it gets to the last it loops back to the first?
    What board are you using?
    Does it have any buttons other than reset?

  3. #33
    Join Date
    Jun 2015
    Posts
    67
    Post Thanks / Like

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

    Quote Originally Posted by Barnabybear View Post
    Hi, that should be do-able. It was a sort of proof of concept and Iím not a coder so it is more than likely not the best way.
    Are you thinking the button has a next function the same as a music player and skips to the next file and if it gets to the last it loops back to the first?
    What board are you using?
    Does it have any buttons other than reset?
    Hi, yes, what you described is what I am looking for, I have esp-12 and esp-01, I have electronics background with designing and building project , so which ever GPIO shouldn't be a problem for me, just need to pull it down to GND to trigger it. I am thinking of ESP-12 since I can lay it flat, I am embedding a matrix on the back and some pixels in both sleeves on my daughter's jacket, it will run your code using fseq while she's out during the holiday season, where she also can cycle to different sequences as needed, then run ESPixelStick code around the house be part of my house sequences.

  4. #34
    Join Date
    Jun 2015
    Posts
    67
    Post Thanks / Like

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

    Modified the code to play more than one file, tested with three(3) and they are working. GPIO 04 connected to a momentary switch to ground, pressing the button will skipping to next sequence, loop back to the first once it passes 3. I am not a programmer, just added what I need to get this going for my project.

    Code:
    /* ------- FOR TEST ONLY - CONSIDER TO BE NON-WORKING CODE -------
      Copyright 2017 Barnabybear <diychristmas.org> Full details at end of code.
      19-Nov-2017
    */
    #include <ESP8266WiFi.h>
    #include <FS.h>
    #define FASTLED_ESP8266_RAW_PIN_ORDER
    #include <FastLED.h>
    #define DATA_PIN 2
    
    int n;  // variable for loop.
    int nn;  // variable for loop.
    int nnn;  // variable for loop.
    int Count = 1;
    int SWITCH = 4;
    String namefront = "/pixel_data";
    String nameend = ".fseq";
    String filename = namefront + Count + nameend;
    
    byte Data;  // variable for data.
    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).
    unsigned long Time_Start;
    unsigned long Time_Now;
    bool Debug = 1; // minimum debug.
    bool FSEQ_Headder_Debug = 1; // debug .FSEQ headder.
    
    CRGB leds[288];
    
    void setup() {
      WiFi.mode(WIFI_OFF);  // disable wifi.
      pinMode(SWITCH, INPUT_PULLUP);
      SPIFFS.begin();  // start an instance of SPIFFS.
      FESQ_Headder_Read();  // call function.
      FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, Number_Channels / 3);
      Time_Start = millis();
    }
    
    void loop() {
    
      FSEQ_Data = SPIFFS.open(filename.c_str(), "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).
        if (digitalRead(SWITCH) == LOW) {
          Count = Count + 1;
          if (Count == 4) {
            Count = 1;
          }
          filename = namefront + Count + nameend;
          FESQ_Headder_Read();
          delay(500);
          break;
        }
        for  (n = 0; n < (Number_Channels / 3) ; n++) {  // loop number of channels times.
          leds[n].r = FSEQ_Data.read();  // read one byte of data from .FSEQ file.
          leds[n].g = FSEQ_Data.read();  // read one byte of data from .FSEQ file.
          leds[n].b = FSEQ_Data.read();  // read one byte of data from .FSEQ file.
        }
    
        for (nnn = 0 ; nnn < (Number_Channels % (Number_Channels / 3)); nnn++) {
          Data = FSEQ_Data.read();
        }
        while (millis() - Time_Start < Frame_Time) {
          delay(1);
        }
        Time_Start = millis();
        FastLED.show();
      }
    }
    
    //*************** void FESQ_Headder_Read ***************//
    void FESQ_Headder_Read() {
    
      FSEQ_Data =  SPIFFS.open(filename.c_str(), "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.
        //-----------------------------------------
        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.
        //-----------------------------------------
        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.
        //-----------------------------------------
        FSEQ_Data.seek(18, SeekSet); // set read pionter to correct byte.
        Frame_Time = (FSEQ_Data.read()); // Read FPS.
      }
      return;
    }
    
    /*
      Permission is hereby granted, free of charge, to any person obtaining a copy of this software
      and associated documentation files (the "Software"), to deal in the Software without restriction,
      including without limitation the rights to use, copy, modify, merge, publish, distribute,
      sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
      furnished to do so, subject to the following conditions:
    
      The above copyright notice and this permission notice shall be included in all copies or
      substantial portions of the Software.
    
      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
      INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
      PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
      FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
      ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
      IN THE SOFTWARE.
    */

  5. #35
    Join Date
    Jun 2015
    Posts
    67
    Post Thanks / Like

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

    Okay, found issue with ESP-01, I was using only ESP-12 for testing, I finally decided to load the code(the original) on an ESP-01 (4Mb), it didn't work at all, I then tried anther brand new ESP-01, still no output, both ESP-01 then tested with ESPixelstick and ESPEasy, no problem at all. I think that explains why others tired and didn't work. Isn't ESP-12 and ESP-01 uses same SoC and has less GPIO? Some how there are differences that it doesn't work with it.

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

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

    Quote Originally Posted by pakeonoahu View Post
    Okay, found issue with ESP-01, I was using only ESP-12 for testing, I finally decided to load the code(the original) on an ESP-01 (4Mb), it didn't work at all, I then tried anther brand new ESP-01, still no output, both ESP-01 then tested with ESPixelstick and ESPEasy, no problem at all. I think that explains why others tired and didn't work. Isn't ESP-12 and ESP-01 uses same SoC and has less GPIO? Some how there are differences that it doesn't work with it.
    Hi, great work. When you loaded up the ESP-01 was it in the ESPixelstick or stand a loan?

    I also used an ESP8266-12 to test this and I’m thinking that I’ve not finished this off properly. I’ll check but I’m sure the ESPixelstick PCB inverts the output. This means that the output of the ESP8266-01 also needs to be inverted (two inversions gets us back to normal). I’ll have a look later and if this is correct inverting should be an easy fix.

    As a quick test
    ; if you have some male/female Dupont connectors you can use the ESP8266-01 without the ESPixelstick and it should be fine. Some photos (half way down, no need to read any text).

  7. #37
    Join Date
    Jun 2015
    Posts
    67
    Post Thanks / Like

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

    Quote Originally Posted by Barnabybear View Post
    Hi, great work. When you loaded up the ESP-01 was it in the ESPixelstick or stand a loan?

    I also used an ESP8266-12 to test this and Iím thinking that Iíve not finished this off properly. Iíll check but Iím sure the ESPixelstick PCB inverts the output. This means that the output of the ESP8266-01 also needs to be inverted (two inversions gets us back to normal). Iíll have a look later and if this is correct inverting should be an easy fix.

    As a quick test
    ; if you have some male/female Dupont connectors you can use the ESP8266-01 without the ESPixelstick and it should be fine. Some photos (half way down, no need to read any text).
    Hi, I didn't use the ESPixelstick board for this at all, my connection to the pixels are Dupont connectors to the esp01, so as the ESP-12, no other circuit(except adding an 100ohm resistor when needed) is in play between the output to the pixel. I don't see how it make a difference between esp01 and esp12, but they do.

    thanks.

  8. #38
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,277
    Post Thanks / Like

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

    Hi, I’ve run the code on an ESP8266-01 (2M (FT25H16W)) with Dupont cables which sort of worked. The logic analyser showed the output as spot on timing wise but scoping showed a lower output voltage than the ESP8266-12. With no output resistor the pixels where about 75% correct with 25% noise. I suspect if you put the ESP into the ESPixelstick board which has a level converter (3.3V to 5V) it should work.

    Let me know if this doesn’t work and I’ll see what I can do.

  9. #39
    Join Date
    Jun 2015
    Posts
    67
    Post Thanks / Like

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

    Quote Originally Posted by Barnabybear View Post
    Hi, Iíve run the code on an ESP8266-01 (2M (FT25H16W)) with Dupont cables which sort of worked. The logic analyser showed the output as spot on timing wise but scoping showed a lower output voltage than the ESP8266-12. With no output resistor the pixels where about 75% correct with 25% noise. I suspect if you put the ESP into the ESPixelstick board which has a level converter (3.3V to 5V) it should work.

    Let me know if this doesnít work and Iíll see what I can do.
    Seem like it's the hardware limitation, I will just use ESP12 since ESP01 with additional hardware will make it too big in size. Thanks for looking into it, look like I didn't mess up on my end.

Page 4 of 4 FirstFirst ... 234

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
  •