1

Topic: Need Help, Timeout Wifi Connections at Esp8266 and mobile app

// The code works for 5 sec. , after that the wifi connections interrupts
// I work with an rgb led strip, who should activated the led strip in colour red, when i push the button on the app.

//Maybe the line " void ledleiste(uint32_t color) { " works not cause, i havnt marked the color as an remotexy


//////////////////////////////////////////////
//        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 "MagnWallR"
#define REMOTEXY_WIFI_PASSWORD "Bodensee9"
#define REMOTEXY_SERVER_PORT 6377


// RemoteXY configurate 
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =   // 27 bytes
  { 255,1,0,0,0,20,0,16,179,1,2,0,41,12,14,7,2,26,1,31,
  79,78,0,79,70,70,0 };
 
// this structure defines all the variables and events of your control interface
struct {

    // input variables
  uint8_t switch_1; // =1 if switch ON and =0 if OFF

  uint8_t r;
  uint8_t g;
  uint8_t b;
  uint8_t i;


 
} RemoteXY;
#pragma pack(pop)

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

#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel strip(10, 12, NEO_GRB + NEO_KHZ800);


void setup()
{
  RemoteXY_Init ();
  strip.begin(); 

 
 
  // TODO you setup code
 
}

void loop()
{
  RemoteXY_Handler ();

if(RemoteXY.switch_1==1){

  RemoteXY.r =150;
  RemoteXY.g =0;
  RemoteXY.b =0;

  ledleiste(strip.Color(RemoteXY.r ,RemoteXY.g, RemoteXY.b));
  strip.show();

}else{
  RemoteXY.r =0;
  RemoteXY.g =0;
  RemoteXY.b =0;

  ledleiste(strip.Color(RemoteXY.r ,RemoteXY.g, RemoteXY.b));
  strip.show();

}
 
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay()

}

void ledleiste(uint32_t color) {
 
  for(RemoteXY.i=0; RemoteXY.i<strip.numPixels(); RemoteXY.i++)
    strip.setPixelColor(RemoteXY.i, color);                     
       
  }

2

Re: Need Help, Timeout Wifi Connections at Esp8266 and mobile app

Don't change the variables in the RemoteXY struct. Copy it from the editor as is and do not change it.