<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — Esp32 fails to connect to wifi]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1833&amp;type=atom" />
	<updated>2024-08-05T15:05:35Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=1833</id>
		<entry>
			<title type="html"><![CDATA[Esp32 fails to connect to wifi]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=5627#p5627" />
			<content type="html"><![CDATA[<p>I have written this code for controling few leds. If the loop function is empty, my board connects to my wifi no problem. But somehow it doesn&#039;t with my code.</p><div class="codebox"><pre><code>/*
   -- New project --
   
   This source code of graphical user interface 
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 3.1.13 or later version 
   download by link [url]http://remotexy.com/en/library/[/url]
   To connect using RemoteXY mobile app by link [url]http://remotexy.com/en/download/[/url]                   
     - for ANDROID 4.13.13 or later version;
     - for iOS 1.10.3 or later version;
    
   This source code is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.    
*/

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

// you can enable debug logging to Serial at 115200
//#define REMOTEXY__DEBUGLOG    

// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__WIFI_CLOUD

#include &lt;WiFi.h&gt;

// RemoteXY connection settings 
#define REMOTEXY_WIFI_SSID &quot;Interneras&quot;
#define REMOTEXY_WIFI_PASSWORD &quot;urbm2927&quot;
#define REMOTEXY_CLOUD_SERVER &quot;cloud.remotexy.com&quot;
#define REMOTEXY_CLOUD_PORT 6376
#define REMOTEXY_CLOUD_TOKEN &quot;XXXXXXXX&quot;

#include &lt;RemoteXY.h&gt;

// RemoteXY GUI configuration  
#pragma pack(push, 1)  
uint8_t RemoteXY_CONF[] =   // 30 bytes
  { 255,1,0,0,0,23,0,17,0,0,0,24,1,106,200,1,1,1,0,1,
  42,84,24,24,0,94,24,58,68,0 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t button_01; // =1 if button pressed, else =0

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

} RemoteXY;   
#pragma pack(pop)
 
/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////

#include &lt;FastLED.h&gt;

#define NUM_LEDS 59
#define DATA_PIN 3

CRGB leds[NUM_LEDS];
const byte signalas = 2;




void setup() 
{
  RemoteXY_Init (); 
  
     FastLED.addLeds&lt;WS2812B, DATA_PIN, RGB&gt;(leds, NUM_LEDS);  // GRB ordering is typical
     pinMode(signalas, INPUT);
     
  // TODO you setup code

  
}

void loop() 
{ 
  RemoteXY_Handler ();

  if(digitalRead(signalas)==HIGH){

    for(int a = 0; a&lt;=99; a++){
      leds[a] = CRGB(255,255,255);
    }
    FastLED.show();
  }
  else if(RemoteXY.button_01 == 1){

    for(int p=0; p&lt;=99; p++){
      leds[p]=(0,0,0);
    }
    FastLED.show();
    
    leds[30] = CRGB(255,255,255);
    leds[50] = CRGB(255,255,255);
    leds[70] = CRGB(255,255,255);
    leds[90] = CRGB(255,255,255);
    FastLED.show();
    RemoteXY_delay(15);

    leds[11] = CRGB(255,255,255);
    leds[9]  = CRGB(255,255,255);
    leds[31] = CRGB(255,255,255);
    leds[29] = CRGB(255,255,255);
    leds[51] = CRGB(255,255,255);
    leds[49] = CRGB(255,255,255);
    leds[71] = CRGB(255,255,255);
    leds[69] = CRGB(255,255,255);
    FastLED.show();
    RemoteXY_delay(15);

    leds[12] = CRGB(255,255,255);
    leds[8]  = CRGB(255,255,255);
    leds[32] = CRGB(255,255,255);
    leds[28] = CRGB(255,255,255);
    leds[52] = CRGB(255,255,255);
    leds[48] = CRGB(255,255,255);
    leds[72] = CRGB(255,255,255);
    leds[68] = CRGB(255,255,255);
    FastLED.show();
    RemoteXY_delay(15);

    leds[33] = CRGB(255,255,255);
    leds[27] = CRGB(255,255,255);
    leds[53] = CRGB(255,255,255);
    leds[47] = CRGB(255,255,255);
    FastLED.show();
    RemoteXY_delay(1000);

    leds[30] = CRGB(0,0,0);
    leds[50] = CRGB(0,0,0);
    leds[70] = CRGB(0,0,0);
    leds[90] = CRGB(0,0,0);
    leds[11] = CRGB(0,0,0);
    leds[9]  = CRGB(0,0,0);
    leds[31] = CRGB(0,0,0);
    leds[29] = CRGB(0,0,0);
    leds[51] = CRGB(0,0,0);
    leds[49] = CRGB(0,0,0);
    leds[71] = CRGB(0,0,0);
    leds[69] = CRGB(0,0,0);
    leds[12] = CRGB(0,0,0);
    leds[8]  = CRGB(0,0,0);
    leds[32] = CRGB(0,0,0);
    leds[28] = CRGB(0,0,0);
    leds[52] = CRGB(0,0,0);
    leds[48] = CRGB(0,0,0);
    leds[72] = CRGB(0,0,0);
    leds[68] = CRGB(0,0,0);
    leds[33] = CRGB(0,0,0);
    leds[27] = CRGB(0,0,0);
    leds[53] = CRGB(0,0,0);
    leds[47] = CRGB(0,0,0);
    FastLED.show();

    
  }
  else {
    for(int p=0; p&lt;=99; p++){
      leds[p]=(0,0,0);
    }
    FastLED.show();
  }
  
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay(), use instead RemoteXY_delay() 


}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[zgs.tamutis]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1671</uri>
			</author>
			<updated>2024-08-05T15:05:35Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=5627#p5627</id>
		</entry>
</feed>
