Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: I don't know how to write code and could really use a hand with wifi

  1. #11
    Join Date
    Sep 2019
    Posts
    7
    Post Thanks / Like

    Default Re: I don't know how to write code and could really use a hand with wifi

    Quote Originally Posted by MikeKrebs View Post
    How many pixels on each person? How many people? I don't think NRF is the right technology if you doing pixel outfits and sending data from Vixen.

    You should really think about ESP based devices for any significant data transfers.
    The ESPixelSticks cost around $50.00 and can handle up to 600 pixels. The NRF24L01's cost about a dollar and I only need each one to handle around 20 pixels. The ESPixelSticks use a home network so if I'm not home it doesn't work. The NRF's operate on radio thru arduinos. They could be used in a parade which is what I'm trying to do. I'm still hoping someone can help me by adding wifi to the arduino code I posted here.
    Last edited by dwzhigg; 03-30-2020 at 05:36 PM.

  2. #12
    Join Date
    Dec 2011
    Posts
    6,371
    Post Thanks / Like

    Default Re: I don't know how to write code and could really use a hand with wifi

    You can purchase a Wemos , esp-01 , nodemcu cheap and use AP mode .
    no need for router.

  3. #13
    Join Date
    Sep 2019
    Posts
    7
    Post Thanks / Like

    Default Re: I don't know how to write code and could really use a hand with wifi

    Here is an arduino code run by vixen to operate LED suits using NRF's for the wifi. The problem with it is LED's, I need pixels. If anyone can help combine these 2 codes, it would be of greatly appreciated. I will give you full credit in my Youtube videos.
    Code:
    Hello!
    
    Assembled a mock-up of controlled led suits on nrf24l01. Now it is one transmitter and two receivers (perspective 5).
    
    Due to the lack of knowledge in programming, the code from the network was taken as a basis and redone for itself.
    
    Everything works but there is a lack of synchronism. I am sure that you can speed up the work.
    
    I appeal to experts, help please optimize the code 
    
    Transmitter 
    
    001
    #include <RF24Network.h>
    002
    #include <RF24.h>
    003
    #include <SPI.h>
    004
    #define MAX_CHANNELS 28
    005
     
    006
    RF24 radio(9, 10);
    007
     
    008
    // Network uses that radio
    009
    RF24Network network(radio);
    010
    int Data[] = {4, 5, 6, 7, 8, 14, 15, 16, 17, 18};
    011
    int state;
    012
    int ch;
    013
    int chVal[MAX_CHANNELS] = {0}; 
    014
    int NODE01[MAX_CHANNELS / 2] = {0}; //массив для NODE01
    015
    int NODE02[MAX_CHANNELS / 2] = {0}; //массив для NODE02
    016
    enum states
    017
    {
    018
      IDLE,
    019
      DELIM,
    020
      READ,
    021
      DISP
    022
    };
    023
     
    024
    void setup(void)
    025
    {
    026
      Serial.begin(57600);
    027
      pinMode(8, OUTPUT);
    028
      digitalWrite(8, HIGH);
    029
      SPI.begin();
    030
      radio.begin();
    031
      network.begin(/*channel*/ 90, /*node address*/ 00);             // канал и адрес узла
    032
     
    033
     
    034
      {
    035
        state = IDLE;
    036
        ch = 0;
    037
        Serial.begin(57600);
    038
     
    039
      }
    040
      delay(1000);
    041
     
    042
    }
    043
     
    044
    void loop(void)
    045
    {
    046
     
    047
      // Pump the network regularly
    048
      network.update();                                              // нужно постоянно запускать, чтобы транслировались
    049
      if (Serial.available())
    050
      {
    051
        switch (state)
    052
        {
    053
          case IDLE:
    054
            ch = 0;
    055
            if (Serial.read() == '+')
    056
            {
    057
              state = DELIM;
    058
            }
    059
            else
    060
            {
    061
              state = IDLE;
    062
            }
    063
            break;
    064
     
    065
          case DELIM:
    066
            ch = 0;
    067
            if (Serial.read() == '>')
    068
            {
    069
              state = READ;
    070
            }
    071
            else
    072
            {
    073
              state = IDLE;
    074
            }
    075
            break;
    076
     
    077
          case READ:
    078
     
    079
            chVal[ch++] = Serial.read();
    080
            if (ch >= MAX_CHANNELS)
    081
            {
    082
              ch = 0;
    083
              state = DISP;
    084
            }
    085
            break;
    086
     
    087
          case DISP:
    088
            state = IDLE;
    089
     
    090
            //Serial.print("Sending...");
    091
            // Готовим массив для NODE 01---
    092
            for (int n01 = 0; n01 < MAX_CHANNELS / 2; n01++) {
    093
              NODE01[n01] = chVal[n01];
    094
            }
    095
            //------------------------------
    096
     
    097
            //------------------------------
    098
            // Готовим массив для NODE 02---
    099
            for (int n02 = 14; n02 < MAX_CHANNELS; n02++) {
    100
              NODE02[n02 - 14] = chVal[n02];
    101
            }
    102
            //------------------------------
    103
     
    104
            // Передача на NODE 01  ------
    105
            RF24NetworkHeader header01(/*to node*/ 01);                      // тут указываем на какое устройство отправляем данные
    106
            //bool ok = network.write(header,&NODE01,sizeof(NODE01));            // передаем, функция возвращает статус
    107
            network.write(header01, &NODE01, sizeof(NODE01));          // передаем, функция  не возвращает статус
    108
     
    109
            //----------------------------
    110
            // Передача на NODE 02  ------
    111
            RF24NetworkHeader header02(/*to node*/ 02);                      // тут указываем на какое устройство отправляем данные
    112
            //bool ok = network.write(header,&NODE02,sizeof(NODE02));            // передаем, функция возвращает статус
    113
            network.write(header02, &NODE02, sizeof(NODE02));          // передаем, функция не возвращает статус
    114
            //----------------------------
    115
            digitalWrite(8, !digitalRead(8));
    116
            // if (ok)                                                        // смотрим на статус и отписываемся в Serial
    117
            // Serial.println("ok.");
    118
            //else
    119
            //  Serial.println("failed.");
    120
     
    121
     
    122
            //  break;
    123
        }
    124
      }
    125
     
    126
    }
    Receivers
    
    01
    /// приемник с реле
    02
    #include <RF24Network.h>
    03
    #include <RF24.h>
    04
    #include <SPI.h>
    05
    #define MAX_CHANNELS 14
    06
    int ch;
    07
    int chVal[MAX_CHANNELS] = {0};
    08
    int            data[MAX_CHANNELS];
    09
    RF24 radio(7, 8);
    10
     
    11
    RF24Network network(radio);
    12
     
    13
     
    14
    #define ID 02 // ID устройства
    15
    //****************Переменные пинов светодиодов
    16
    int l1 = 1;
    17
    int l2 = 2;
    18
    int l3 = 19;
    19
    int l4 = 4;
    20
    int l5 = 5;
    21
    int l6 = 6;
    22
    int l7 = 9;
    23
    int l8 = 10;
    24
    int l9 = 14;
    25
    int l10 = 15;
    26
    int l11 = 16;
    27
    int l12 = 17;
    28
    int l13 = 18;
    29
    int l14 = 3;
    30
    //**************************
    31
    int lp[] = {l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14}; // массив пинов светодиодов
    32
     
    33
    const char inv_off = LOW ;   //LOW для макета, HIGH для костюма с транзисторами
    34
    const char inv_on = HIGH ;  // HIGH для макета, LOW для костюма с транзисторами
    35
     
    36
    void setup(void)
    37
    {
    38
      //Serial.begin(57600);
    39
     
    40
      for (int i = 0; i < 14; i++) {
    41
        pinMode(lp[i], OUTPUT);
    42
        digitalWrite(lp[i], inv_on);
    43
      }
    44
     
    45
     
    46
      SPI.begin();
    47
      radio.begin();
    48
      network.begin(/*channel*/ 90, /*node address*/ ID);
    49
      //radio.setAutoAck(false); // отключаем подтверждение приема пакетов
    50
    }
    51
     
    52
    void loop(void)
    53
    {
    54
      // Pump the network regularly
    55
      network.update();                                        // нужно постоянно запускать, чтобы транслировались
    56
      // данные между узлами
    57
     
    58
      // Is there anything ready for us?
    59
      while ( network.available() )                            // если пришли данные
    60
      {
    61
        // If so, grab it and print it out
    62
        RF24NetworkHeader header;
    63
     
    64
        network.read(header, &data, sizeof(data));             // читаем данные
    65
        //Serial.println(data);                                  // отправляем в сериал для отладки
    66
        for (ch = 0; ch < MAX_CHANNELS; ch++) {
    67
          //digitalWrite(relayPin,!digitalRead(relayPin));
    68
          //Serial.print(data[ch]);
    69
          //Serial.print("  ");
    70
          digitalWrite(lp[ch], !data[ch]);
    71
        }
    72
     
    73
        // Serial.println("  ");
    74
        // Serial.println("______________________________________");
    75
     
    76
     
    77
        //digitalWrite(l1, !data[0]);
    78
        //digitalWrite(l2, !data[1]);
    79
        //digitalWrite(l3, !data[2]);
    80
        //digitalWrite(l4, !data[3]);
    81
        //analogWrite(l5, data[4]);
    82
        //analogWrite(l6, data[5]);
    83
        //analogWrite(l7, data[6]);
    84
        //analogWrite(l8, data[7]);
    85
        //digitalWrite(l9, !data[8]);
    86
        //digitalWrite(l10, !data[9]);
    87
        //digitalWrite(l11, !data[10]);
    88
        //digitalWrite(l12, !data[11]);
    89
        //digitalWrite(l13, !data[12]);
    90
        //analogWrite(l14, data[13]);
    91
      }
    92
     
    93
     
    94
    }
     
    
    Here's how it looks on the video  https://youtu.be/Cza3q-HZ_gc
    
    Top
    Login or register to post comments
    Sat, 08/26/2017 - 14:57#1
    mobistrike
    mobistrike avatar
    Offline
    Registered: 08/19/2016
    Everything works great. Now I'm making costumes. There will be 2. I’ll show you when I’m ready. 
    
    Who cares - a complete receiver circuit. 
    
    
    
     
    
    Top
    Login or register to post comments
    Sat, 08/26/2017 - 16:57# 2
    mobistrike
    mobistrike avatar
    Offline
    Registered: 08/19/2016
    Some more videos 
    
    https://youtu.be/uV5pWElTY6g
    
    Top
    Login or register to post comments
    Sun, 08/27/2017 - 13:22# 3
    Tomasina
    Tomasina avatar
    Offline
    Registered: Mar 9, 2013
    simply replacing bold ints with const byte saves 1% memory. It doesn’t affect speed, but MK’s memory is small, especially if it is filled with special effects;)
    
    01
    /// приемник с реле
    02
    #include <SPI.h>
    03
    #define MAX_CHANNELS 14
    04
    byte ch;
    05
    byte chVal[MAX_CHANNELS] = {0};
    06
    byte data[MAX_CHANNELS];
    07
     
    08
     
    09
    #define ID 02 // ID устройства  // <<<<<< не 02, а 2, т.к. ведущий ноль переводит счисление в бинарное,
    10
    //****************Переменные пинов светодиодов
    11
    const byte l1 = 1;
    12
    const byte l2 = 2;
    13
    const byte l3 = 19;
    14
    const byte l4 = 4;
    15
    const byte l5 = 5;
    16
    const byte l6 = 6;
    17
    const byte l7 = 9;
    18
    const byte l8 = 10;
    19
    const byte l9 = 14;
    20
    const byte l10 = 15;
    21
    const byte l11 = 16;
    22
    const byte l12 = 17;
    23
    const byte l13 = 18;
    24
    const byte l14 = 3;
    25
    //**************************
    26
    const byte lp[] = {l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14}; // массив пинов светодиодов
    27
     
    28
    const boolean inv_off = LOW ;   //LOW для макета, HIGH для костюма с транзисторами
    29
    const boolean inv_on = HIGH ;  // HIGH для макета, LOW для костюма с транзисторами
    30
     
    31
    void setup(void)
    32
    {
    33
      //Serial.begin(57600);
    34
     
    35
      for (byte i = 0; i < 14; i++) {
    It was:
    
    1
    Скетч использует 1 002 байт (3%) памяти устройства. Всего доступно 32 256 байт.
    2
    Глобальные переменные используют 38 байт (1%) памяти, оставляя 2 010 байт для локальных переменных.
    It became:
    
    1
    Скетч использует 882 байт (2%) памяти устройства. Всего доступно 32 256 байт.
    2
    Глобальные переменные используют 24 байт (1%) памяти, оставляя 2 024 байт для локальных переменных.
    How long is the NRF range?
    
    Top
    Login or register to post comments
    Mon, 08/28/2017 - 08:26#4
    mobistrike
    mobistrike avatar
    Offline
    Registered: 08/19/2016
    Tomasina writes:
    simply replacing bold ints with const byte saves 1% memory. It doesn’t affect speed, but MK’s memory is small, especially if it is filled with special effects;)
    
    1
     
    How long is the NRF range?
    
    Thanks, I already did it.
    
    In terms of indirect visibility - 20 meters. Obstacle - concrete wall. I did not check further. I think more than good.
    
    Assembled Receiver Module
    
    
    
     
    
    Top
    Login or register to post comments
    Mon, 16/10/2017 - 09:05#5
    mobistrike
    mobistrike avatar
    Offline
    Registered: 08/19/2016
    First off!
    
    https://youtu.be/RV4l8zcjPNs
    
    Top
    Login or register to post comments
    Mon, 10/16/2017 - 14:23# 6
    b707
    Offline
    Registered: May 26, 2017
    mobistrike, great!
    
    It is a pity the picture with the scheme is too shrunk, the inscriptions are almost not to make out.
    
    What kind of wire goes to the center of the arduins. what is he for?
    
    Top
    Login or register to post comments
    Mon, 10/16/2017 - 14:50# 7
    sadman41
    Offline
    Registered: 10/19/2016
    b707 writes:
    What kind of wire goes to the center of the arduins. what is he for?
    
    A4 / A5
    
    Top
    Login or register to post comments
    Mon, 16/10/2017 - 16:16#eight
    mobistrike
    mobistrike avatar
    Offline
    Registered: 08/19/2016
    sadman41 writes:
    b707 writes:
    What kind of wire goes to the center of the arduins. what is he for?
    
    A4 / A5
    
    True A4 and A5. This is pro mini.
    
    Here is the diagram  https://yadi.sk/i/THQSCVjp3Nnvuj
    
    Top
    Login or register to post comments
    Mon, 10/16/2017 - 16:19#nine
    sadman41
    Offline
    Registered: 10/19/2016
    mobistrike writes:
    Here is the diagram  https://yadi.sk/i/THQSCVjp3Nnvuj
    
    1117, with this inclusion, can fry the medium.
    
    Top
    Login or register to post comments
    Mon, 16/10/2017 - 16:25#ten
    mobistrike
    mobistrike avatar
    Offline
    Registered: 08/19/2016
    sadman41 writes:
    mobistrike writes:
    Here is the diagram  https://yadi.sk/i/THQSCVjp3Nnvuj
    
    1117, with this inclusion, can fry the medium.
    
    Do not understand . This is its standard inclusion.
    
    Top
    Login or register to post comments
    Mon, 10/16/2017 - 17:02#eleven
    sadman41
    Offline
    Registered: 10/19/2016
    mobistrike writes:
    Do not understand . This is its standard inclusion.
    
    Starting with # 6 - http://arduino.ru/forum/apparatnye-voprosy/ams1117  (note that there is ceramic on the radio module).
    
    Itself fell into this trap.
    
    Top
    Login or register to post comments
    Mon, 16/10/2017 - 16:59#12
    mobistrike
    mobistrike avatar
    Offline
    Registered: 08/19/2016
    Read. Informative . True, he never stepped on this rake.
    
    And yet - NRF24 is sure to solder the capacitor like this 
    
    Top
    Login or register to post comments
    Thu, 11/11/2017 - 17:23#thirteen
    mobistrike
    mobistrike avatar
    Offline
    Registered: 08/19/2016
     
    
     
    
     
    
     
    
    Top
    Login or register to post comments
    Wed, 25/10/2017 - 11:06#fourteen
    mobistrike
    mobistrike avatar
    Offline
    Registered: 08/19/2016
    Final inspection . Everything works great!
    
    Here is  https://youtu.be/xq0bhQRGzlc
    
     
    
    PS .. Moderators, close the topic!
    
    Top
    Login or register to post comments
    Thu, 10/26/2017 - 23:09#fifteen
    valera678
    Offline
    Registered: 11/04/2016
    closed
    
    Top
    Login or register to post comments
    Thu, 10/26/2017 - 23:42#16
    Tomasina
    Tomasina avatar
    Offline
    Registered: Mar 9, 2013
    nifiga;)
    
    Top
    Login or register to post comments
    Arduino programming materials were translated from the official website of the Arduino project - http://arduino.cc
    and are licensed under a Creative Commons Attribution-ShareAlike 3.0 License .
    Email for communication: electropochta@arduino.ru

  4. #14
    Join Date
    Dec 2011
    Posts
    6,371
    Post Thanks / Like

    Default Re: I don't know how to write code and could really use a hand with wifi

    If you are determined to use Arduino , this may help you __>

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

    Default Re: I don't know how to write code and could really use a hand with wifi

    Hi, there are lots of RF guys on the forum that I'm sure will help when they get time (sorry but I'm not one). If you want to go down the WiFi route with something like the ESP8266 then there are a few projects that have done this sort of thing before.

    This one uses EL wire with ESP8266ís to supply data to the drivers. The Sequence was played on a Raspberry Pi connected to a small router powered by a battery, this was concealed in one of the coat pockets and provided a WiFi signal to the other people. Iím sure JCook would be happy to assist as would I.

    The video is from this post:

    http://doityourselfchristmas.com/for...434#post499434


  6. #16
    Join Date
    Oct 2014
    Location
    Sauk City, WI USA
    Posts
    1,283
    Post Thanks / Like

    Default Re: I don't know how to write code and could really use a hand with wifi

    Quote Originally Posted by dwzhigg View Post
    The ESPixelSticks cost around $50.00 and can handle up to 600 pixels.
    The espixelstick on amazon is $50 only to hold the listing. when in stock, they are around $25. They are complete controllers already setup to handle pixel data. But you can do even better. pm ukewarrior for a ten pack of his pixel pop jr, get a 10 pack of esp8266 from aliexpress or amazon, get a10 pack BOM from digi-key, tayda, or Mouser, get a programming device and 7-10 batteries and you have your show hardware with spares.

    As far as your ambitions go, 5 x20 pixels = 300 channels. Fits with a single universe so the dmx code linked below would be a great place to start. I would use fastled as that is what I am familiar with but many different libraries will drive 20 pixels. I dont I have any nrf devices but will look around one of these days.

    If you decide to do esp based, barnabybear pointed you to the right resource.

  7. #17
    Join Date
    Dec 2014
    Location
    Southern California
    Posts
    927
    Post Thanks / Like

    Default Re: I don't know how to write code and could really use a hand with wifi

    KWoodard posted a project using the NRF24L01's. I had modified it for my project where I had an Uno as the transmitter and 3 MEGAs receiving but never felt like it would be stable for me (due to my modifications). For pixels, I think you would be better off with a ESP8266 based project.

    http://doityourselfchristmas.com/for...light=kwoodard
    Kevin

  8. #18
    Join Date
    Sep 2019
    Posts
    7
    Post Thanks / Like

    Default Re: I don't know how to write code and could really use a hand with wifi

    Quote Originally Posted by kev View Post
    KWoodard posted a project using the NRF24L01's. I had modified it for my project where I had an Uno as the transmitter and 3 MEGAs receiving but never felt like it would be stable for me (due to my modifications). For pixels, I think you would be better off with a ESP8266 based project.

    http://doityourselfchristmas.com/for...light=kwoodard
    I took several peoples suggestion and purchased a couple ESPixelstick's. Followed the instructions and got them working just fine. My ongoing problem as I stated in one of my earlier post is that I need to have them work without my home router. I need to run vixen on my laptop and operate the ESPixelstick's anyplace. Does anyone have any suggestions on how to go about this?

  9. #19
    Join Date
    Dec 2012
    Location
    Framingham, MA
    Posts
    509
    Post Thanks / Like

    Default Re: I don't know how to write code and could really use a hand with wifi

    Not sure how I missed this.... If you wanted to go with the NRF24's and arduino's I would suggest looking at Komby's RFShowControl code:

    https://github.com/komby/RFShowControl

    FPP has the transmitter code built in, just need to wire a NRF to the Pi. You could put the Pi in bridge mode to run from Vixen or put the fseq files on the Pi.

    Several years ago, the NRF's were somewhat widely used for various wireless controllers. I have a couple of NRF based AC controllers in storage just in case I decide I need an AC prop. The stick man suite I did for my son ( https://www.youtube.com/watch?v=kjwr...&index=4&t=34s ) used a NRF. Had some custom code that when he got out of range it would flip to some sort of pattern.
    Dan Kulp

  10. #20
    Join Date
    Oct 2009
    Posts
    14
    Post Thanks / Like

    Default Re: I don't know how to write code and could really use a hand with wifi

    To use the ESPixelStick in a portable/mobile environment you need to setup an Wi-Fi access point that is battery powered. You just need to locate somewhere central to your performers (each who would have an battery powered ESPixelStick and the LEDs) and your laptop (running the sequence using Vixen)..

    I have used a Cisco E1200 router powered by a 12V battery (I used a 7Ah SLA) for an outdoor display where I didn't have power....

    wap.jpg

    In my case everything was pretty closely located so I just put the access point and battery in a plastic ammo case.....
    Last edited by packetbob; 04-19-2020 at 10:17 PM.

Page 2 of 3 FirstFirst 123 LastLast

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
  •