1

Topic: Compatibility with WS2812FX

Hello,

My name is Jérémie, I'm new here and I just discovered RemoteXY, it's really great and make possible a mobile APP for microcontroller ! Amazing !

In my project, I use standalone a ESP01 and I want to make led effects.
I'm trying to use this nice librairy WS2812FX : https://github.com/kitesurfer1404/WS2812FX

It works well but when I add this instruction to start it in tne loop "ws2812fx.service();" I have connection issue from the mobile phone with RemoteXY, It cannot connect anymore, there must be some conflict ? I use the ESP01 as an access point.

Can someone please have a look ?

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__ESP8266WIFI_LIB_POINT
#include <ESP8266WiFi.h>

#include <RemoteXY.h>

// RemoteXY connection settings 
#define REMOTEXY_WIFI_SSID "RemoteXY"
#define REMOTEXY_WIFI_PASSWORD "12345678"
#define REMOTEXY_SERVER_PORT 6377


// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,5,0,0,0,64,0,10,0,1,
  1,1,12,18,42,8,2,16,88,0,
  2,0,12,33,42,8,2,26,31,31,
  79,78,0,79,70,70,0,6,0,13,
  49,41,41,2,16,129,0,6,5,55,
  6,15,76,69,68,32,67,111,110,116,
  114,111,108,32,67,101,110,116,101,114,
  0 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t button_1; // =1 if button pressed, else =0 
  uint8_t switch_1; // =1 if switch ON and =0 if OFF 
  uint8_t rgb_1_r; // =0..255 Red color value 
  uint8_t rgb_1_g; // =0..255 Green color value 
  uint8_t rgb_1_b; // =0..255 Blue color value 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////

#include <WS2812FX.h>
#define LED_PIN 2                       // 0 = GPIO0, 2=GPIO2
#define LED_COUNT 150
#define DEFAULT_COLOR 0xFF5900
#define DEFAULT_BRIGHTNESS 128
#define DEFAULT_SPEED 1000
#define DEFAULT_MODE FX_MODE_RAINBOW_CYCLE 

String modes = "";
uint8_t myModes[] = {}; // *** optionally create a custom list of effect/mode numbers
boolean auto_cycle = false;

WS2812FX ws2812fx = WS2812FX(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);


void setup() 
{
  RemoteXY_Init (); 
  
  ws2812fx.init();
  ws2812fx.setMode(DEFAULT_MODE);
  ws2812fx.setColor(DEFAULT_COLOR);
  ws2812fx.setSpeed(DEFAULT_SPEED);
  ws2812fx.setBrightness(DEFAULT_BRIGHTNESS);
  ws2812fx.start();
  
  // TODO you setup code
  
}

void loop() 
{ 
  RemoteXY_Handler ();
  
  ws2812fx.service();
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay() 
}

2

Re: Compatibility with WS2812FX

It works for me. Additionally, I use the NeoPixelBus library and control the LEDs via DMA

NeoPixelBus<NeoGrbFeature, NeoEsp8266Dma800KbpsMethod> strip(LED_COUNT);

3

Re: Compatibility with WS2812FX

jereminoz wrote:

#define DEFAULT_SPEED 1000

Try adjusting this value lower?

I suspect that it is building up enough of a delay between loop() functions that the RemoteXY link is timing out.

"And voila, which is French for.......'and then I found out.'" - Ready Player One